Lesson 03 of 13 · How models work
Prompts, context windows and settings
What is actually sent to a model on every request: a system prompt, the conversation so far and your new message, all inside a limited context window. Why long chats get slower, more expensive and forgetful, what temperature does, and the few prompting habits that make the biggest difference.
What is really sent
Models are stateless: they remember nothing between requests. Every time you press Enter, the application builds one big prompt and sends all of it:
┌─ context window (e.g. 200,000 tokens) ─────────────────────────────┐
│ System prompt "You are a support assistant for ACME. Answer only │
│ from the documents provided. Be brief." │
│ Extra context documents found by search (RAG), tool results │
│ History user: … assistant: … user: … assistant: … │
│ New message user: "And how do I reset it?" │
│ ── room left for the answer (output tokens) ── │
└────────────────────────────────────────────────────────────────────┘
- The system prompt is written by whoever built the product. It sets the role, the rules and the format. You usually cannot see it.
- The history is how "memory" works in a chat: it is simply re-sent.
- The context window is the hard limit on how many tokens fit, including the answer. Modern models range from tens of thousands to around a million tokens.
Imagine a very clever helper who forgets everything the moment they finish speaking. To keep a conversation going, you hand them a notebook with everything said so far each time you ask something. The notebook has a fixed number of pages; when it's full, you have to tear out or shorten the oldest pages.
Why long chats get worse
| Effect | Why |
|---|---|
| Slower | More input tokens to process on every turn |
| More expensive | Input tokens are billed again on every turn |
| Forgets early details | Old messages are trimmed or summarised when the window fills |
| Drifts | Important instructions get buried among many other tokens |
Practical habit: start a new conversation for a new task, and paste the key facts again instead of relying on something said 50 messages ago.
Temperature: how random the choice is
At each step the model has scores for every possible next token (lesson 2). Temperature controls how it chooses:
- Low (near 0): almost always the most likely token. Consistent, good for extraction, classification and code.
- Higher (around 1): more willing to pick less likely tokens. More varied, good for brainstorming and creative writing, but also more prone to errors.
Even at temperature 0, outputs are not always perfectly identical, so do not build systems that depend on exact wording.
Prompting habits that make a difference
"Prompt engineering" sounds mysterious, but most of the value comes from treating the model like a capable new colleague who has no background on your situation.
Weak: "Explain this error."
Better: "I'm a Linux admin. Below is the output of 'systemctl status nginx'
after a config change. Explain the most likely cause in 3 bullet
points and give the command to confirm it. If the output is not
enough to tell, say what else you need.
<paste output>"
- Context: who you are, what you are doing, what has been tried.
- The real material: the log, the document, the data, pasted in.
- The format: bullets, a table, a JSON shape, a word limit. Giving one or two examples (few-shot prompting) is the strongest way to get a format.
- Permission to say "I don't know": reduces made-up answers (lesson 4).
Recap
- Every request sends the system prompt, extra context, history and your message; the model itself remembers nothing.
- The context window limits how much fits; long chats get slower, costlier and forgetful.
- Temperature trades consistency for variety.
- Good prompts give context, the real material, the format, and permission to say "I don't know".
This site is a public version of my personal engineering knowledge hub. It intentionally excludes confidential company information and internal operational details.