Generative AI with LLMs (Week 1)
Course Notes and Slides from DeepLearning.AI’s Generative AI with LLMs course.
Â
LLM Use Cases
Current LLM use cases:
- Essay Writing
- Summarization
- Translation
- Information Retrieval from within text
- Invoke APIs and Actions - LLM can figure out actions to take (e.g. API call) then return an answer
Â
Transformers
Â
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.
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
Â
Â
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
Â