Beginner-Friendly Topic
Take your time - it's perfectly normal to re-read this topic 2-3 times. Try the interactive code editor below to run code yourself. Use the Q&A section to check your understanding before moving on. You've got this! 🚀
How Prompts Work
Understanding how the AI processes your prompt helps you write better ones. The AI does not read your prompt the way a human does. It converts it into tokens and processes it through patterns it learned during training.
What Happens When You Submit a Prompt
- Step 1: Your prompt is converted into tokens (small text chunks the model understands)
- Step 2: The tokens are fed into the model along with any previous conversation
- Step 3: The model processes all the context through its learned patterns
- Step 4: The model generates the response one token at a time, choosing the most likely next token at each step
- Step 5: The output tokens are converted back into readable text and shown to you
What the AI Is Actually Doing
The AI is not thinking about your question the way a person does. It is applying statistical patterns from its training to predict what text should come next given your input.
This means:
- The AI does not have opinions (its output reflects patterns in training data, not genuine beliefs)
- The AI can be confidently wrong (it generates plausible-sounding text, which can be incorrect)
- The AI is very sensitive to how you phrase things (small changes to a prompt can produce very different outputs)
Deep Learning ⊂ Machine Learning ⊂ Artificial Intelligence
Key Takeaways
- Understanding how the AI processes your prompt helps you write better ones.
- Step 1: Your prompt is converted into tokens (small text chunks the model understands)
- Step 2: The tokens are fed into the model along with any previous conversation
- Step 3: The model processes all the context through its learned patterns