Nearby lessons
20 of 30Encoding & Decoding
Concept in One Line
Encoding means converting text into numbers, and decoding means converting numbers back into readable text.
Why This Concept Is Important
- Computers understand only numbers.
- GPT works internally using numbers.
- Helps students understand how AI really processes language.
Key Points to Remember
- GPT cannot process text directly.
- Text is first converted into tokens.
- Tokens are converted into numbers (encoding).
- The model processes numbers internally.
- Output numbers are converted back to text (decoding).
Encoding Explained
What is Encoding?
Converting tokens into numbers.
Each token gets a numeric ID.
Numbers carry learned meaning.
Example:
"Hello AI"
-> Tokens -> ["Hello", " AI"]
-> Numbers -> [13225, 481]
Numbers are for machine use only.
Decoding Explained
What is Decoding?
Converting numbers back to tokens.
Tokens are converted to readable text.
Final answer is shown to the user.
Example:
[13225, 481]
-> Tokens -> ["Hello", " AI"]
-> Text -> "Hello AI"
Simple Flow
Text -> Tokens -> Numbers (Encoding) -> Model Processing -> Numbers -> Tokens -> Text (Decoding)
Interview / Exam Points
Q1: What is encoding in GPT?
Encoding is the process of converting text tokens into numbers so that the model can process them.
Q2: What is decoding in GPT?
Decoding is the process of converting numbers back into readable text.
Common Confusions to Avoid
- Encoding is not encryption.
- Numbers do not mean human words.
- Encoding is for machine understanding.
- Decoding is for human reading.
One Line to Remember
GPT thinks in numbers, humans read text.
Quick Self-Check
For Students
Encoding converts text to numbers - Yes / No?
Decoding converts numbers to text - Yes / No?
(Correct answers: Yes, Yes)