Generative AI with LLMs (Week 1)

Generative AI with LLMs (Week 1)

Tags
machine-learning
python
Published
October 4, 2023
Author
Chris Chan

Generative AI with LLMs (Week 1)

Course Notes and Slides from DeepLearning.AI’s Generative AI with LLMs course.
 

LLM Use Cases

notion image
Current LLM use cases:
  1. Essay Writing
  1. Summarization
  1. Translation
  1. Information Retrieval from within text
  1. Invoke APIs and Actions - LLM can figure out actions to take (e.g. API call) then return an answer
 

Transformers

 
notion image
Key components of a transformer:
  • Inputs are a series of tokens from context window. Embedding layer translates tokens into word and positional embeddings (vectors).
  • Each encoder/decoder contains feed forward networks and self attention mechanisms that allows a model to focus on different parts of the input sequence during computation
 

Prompting and Prompt Engineering

There’s zero, one and multi shot inference. Key difference is how many example responses you give to the model in the context window.
notion image

Generative Configuration Parameters

Top K Sampling → Generate only from top k tokens
p → specify total probability
Temperature → change softmax output (increase for more randomness)

Project Life Cycle

 
notion image
 

Types of Models

Autoencoding
  • encoder only
  • masked language modeling:
    • objective = reconstruct text
  • Good for: sentiment analysis, named entity recognition
Autoregressive Model
  • decoder only
  • casual language modeling
    • objective = predict next token
  • Good for for: text generation, emergent behavior
 
Seq to Seq Models
  • encoder + decoder
  • Span corruption:
    • objective = reconstruct span (chain of words)
  • Good for: translation, text summary, question answering
Â