2. Large Language Models (LLMs) vs. AI Chat Bots
What AI Chat Bots can do :
What LLMs can do :
1
Once upon a
time, …..
Write
a story.
Write
a story.
Once upon a
time, …..
Write Stories
Write Jokes
Make conversation
…
3. Large Language Models (LLMs)
2
Large Language Models (LLMs) are machine learning models that can understand and
generate human-like text.
These models are trained on vast amounts of text data from the internet and other
sources to learn the patterns and rules of human language.
Some major LLMs are :
OpenAI's GPT series of models (e.g., GPT-3.5 and GPT-4)
Google's PaLM and Gemini models
Meta's LLaMA model
4. How do LLMs work?
The Idea?
Next Word Prediction
How to implement the Idea?
Word Embedding
Attention Mechanism
Transformer
Architecture
3
6. NEXT WORD PREDICTION
Autocomplete Context LLM
How to implement Next Word prediction?
Word Embedding
Attention Mechanism
Transformer Architecture
5
8. Attention Mechanism
• Sentence 1: The bank of the river.
• Sentence 2: Money in the bank.
8
Question :
• How to Decide Which Words Determine
Context?
How do humans derive the context?
: Neighbouring Words
10. Attention Mechanism
How to Decide Which Words Determine Context?
Answer: Similarity
The bank of the river Money in the bank
The Attention Mechanism allows the model to focus and place more “Attention” on the relevant
words, to derive the context.
11
The bank Of river
bank 0 1 0 0.1
Money in the bank
bank 0.2 0 0 1
11. Transformer Architecture
Transformer :
Concatenation of many
transformer blocks.
12
: Maps input (user query) to output(response).
: Keeps track of the context.
Neural Network
Attention
Transformer Block :
Neural Network
Attention Layer
Transformer
Block
Neural Network: Machine Learning model inspired by human brain’s neural network.
Neural Network
Attention
Neural Network
Attention
Neural Network
Attention
Transformer Block Transformer Block Transformer Block
Input :
Write a
story
Output:
Once