Nearby lessons
10 of 30What Happens When You Ask a Question?
Concept in One Line
When you ask a question, ChatGPT converts text into tokens and numbers, understands context using attention, and generates the answer word by word.
Why This Concept Is Important
- It removes confusion about how ChatGPT works.
- It helps students ask better prompts.
- It is a very common interview question.
Key Points to Remember
- Your question is called a prompt.
- GPT does not read text directly.
- Text is converted into tokens.
- Tokens are converted into numbers (embeddings).
- Transformer uses attention to understand context.
- Output is generated one word at a time.
Step-by-Step Flow
Step 1: User Question (Prompt)
- You type a question.
Example: "Explain Machine Learning simply"
Step 2: Tokenization
- Sentence is broken into small parts called tokens.
Step 3: Embeddings
- Tokens are converted into numbers.
- Numbers carry meaning and relationship.
Step 4: Transformer + Attention
- Model focuses on important words.
- Understands what the user wants.
Step 5: Word-by-Word Generation
- GPT predicts the first word.
- Then the second word.
- Continues till the answer is complete.
Step 6: Stop Signal
- Model predicts when to stop the answer.
Step 7: Output Text
- Numbers are converted back into readable text.
Simple Diagram / Flow
User Question
->
Tokens
->
Embeddings (Numbers)
->
Transformer + Attention
->
Next Word Prediction (Repeated)
->
Final Answer
Interview / Exam Points
Q1: What happens internally when you ask ChatGPT a question?
The input is tokenized, converted into embeddings, processed using transformer attention, and the answer is generated word by word.
Q2: Does ChatGPT think before answering?
No. It predicts the next word based on probability.
Common Confusions to Avoid
- ChatGPT does not understand questions like humans.
- ChatGPT does not generate answers in one step.
- ChatGPT works step by step.
- Attention helps context understanding.
One Line to Remember
ChatGPT answers by predicting the next word again and again using context and probability.
Quick Self-Check
- ChatGPT generates answer in one step -> Yes / No?
- ChatGPT uses attention to understand context -> Yes / No?
- Correct answers: No, Yes