Skip to content
Under the Hood
Decks
2

Chapter 2

Driving it

How to get what you actually want out of it.

4 things to try in this chapter

✦ AI presenter · 15s

A young wizard with glowing arcane runes

Transcript

People think talking to AI is like casting a spell — say the magic words, get the magic result. Close. But the real magic isn't the words. It's the context you give it. Show it exactly what you want — and it bends to your will.

A brief, not a spell

People talk about “magic words” and “secret prompts.” Forget that. The skill is much more ordinary, and much more useful: you’re writing a clear brief, the way you’d explain a task to a sharp person who can’t read your mind.

If a human would be confused by your request, the AI will be too — it’ll just hide the confusion better.

There are no magic incantations. What works is what would work on any capable stranger: say what you want, what it’s for, who it’s for, and what “good” looks like. Vague in, vague out.

  • The taskwhat exactly do you want it to do — write, list, explain, fix, compare?
  • The purposewhat’s it for? An answer for a five-year-old and an answer for an exam are not the same answer.
  • The shapehow should the result look — a paragraph, ten bullet points, a table, a single sentence?

Why does phrasing matter so much, given it’s “just predicting words”? Because your prompt sets the scene it predicts inside of. A precise, serious request makes precise, serious answers the most likely continuation. A lazy request makes a generic answer the most likely one. You’re not casting a spell — you’re choosing which neighbourhood of its training it wanders into.

Be specific, and show an example

The single biggest upgrade to any prompt: get specific. “Write something about dogs” gives you mush. “Write three funny captions for a photo of a wet dog, each under ten words” gives you something you can actually use.

Specificity isn’t about length — it’s about removing guesses. Every detail you leave out, the model fills in for you, usually with the blandest average it can find. Pin down the format, the length, the tone, the audience, and the constraints.

And if you can show one example of what you want, do. A single example of the style or layout you’re after teaches it more than a paragraph of description.

  • Weak“Help me with my essay.”
  • Strong“Here’s my essay’s opening paragraph. Suggest three ways to make the first sentence grab attention, keeping my voice. Don’t rewrite the whole thing.”
  • Show, don’t just tellpaste an example: “Match this style: [your sentence].” Examples are instructions the model can copy directly.

Giving examples has a proper name: few-shot prompting. Show it two or three worked examples of input-and-output you like, and it’ll infer the pattern and continue it — often far more reliably than any description. Zero examples is “zero-shot.” When something keeps coming out wrong, the fix is usually one good example, not ten more adjectives.

Context is everything

Here’s the rule that trips up everyone: the AI only knows what’s in front of it right now. It doesn’t know you, your homework, your earlier chat in another window, or that file on your computer — unless you put it in the conversation.

Most “the AI is useless” moments are really “I never gave it the context” moments.

Under the hood · the context window

What you put in front of it

your questionthe article you pasted“keep it short”“act as a coach”one example

The context window — its desk

your questionthe article you pasted“keep it short”“act as a coach”one example
earlier stuff ↓

nearly full

It only knows what fits here. Run out of room and the oldest bits drop off.

What you get

An answer built from exactly what's on the desk.

Nothing on the desk? It guesses — and that's when it goes wrong.

The model can only work with what fits on its desk. Give it the right things — and don't expect it to remember what fell off.

Whatever it needs to do the job well, paste it in: the actual text, the real numbers, the rubric your teacher gave you, the message you’re replying to. Don’t make it guess what it could simply read.

The model’s short-term memory is the conversation itself — what’s often called the “context window.” Things scroll out of reach in very long chats, and a fresh chat starts blank. It’s a desk, not a diary.

  • Give it the source“Summarise this article: [paste].” beats “What did that article say?” — it never saw the article.
  • Give it the rulesmarking criteria, word limits, banned words, the format your teacher wants.
  • Start fresh when you switch tasksleftover context from an unrelated chat can quietly steer the answer.

The context window has a real size limit, measured in “tokens” (chunks of words). Stuff in too much and the oldest parts fall off the edge — the model isn’t ignoring you, it genuinely can’t see them anymore. There’s also a subtler effect: models pay most attention to the very start and the very end of what you give them, and can go a bit hazy in the middle. So put your most important instruction first or last, not buried in paragraph six.

Give it a role and some fences

Tell it who to be and what the limits are. “You’re a strict physics tutor. Don’t give me the answer — ask me questions until I work it out myself.” That one line changes everything about what comes back.

A role changes how it talks, how deep it goes, and how blunt it is. Ask it to be a patient tutor and you get one kind of answer. Ask for a blunt editor and you get a completely different one. It’s not really becoming a person — it’s just leaning on a different slice of what it learned.

Constraints are just as powerful, and underused. Fences tell it what not to do, which is often the whole point.

  • Role“Act as a careful editor who points out weak arguments, not typos.”
  • Limits“In under 100 words.” “Use no jargon.” “Only use the text I pasted — don’t add outside facts.”
  • Behaviour“If you’re not sure, say so.” “Ask me a question before you answer if anything is unclear.”

A role prompt doesn’t install knowledge it didn’t already have — telling it “you are a doctor” doesn’t make it a doctor. What it does is shift the style and the slice of training it leans on, which usually makes the answer more focused and consistent. Useful, but don’t mistake a convincing persona for real expertise underneath. It’ll sound like a doctor long before it’s as reliable as one.

The first answer is a draft

Stop treating the first reply as the final word. It’s a first draft. The real skill is the second, third, and fourth message — steering it closer to what you actually wanted.

People who get great results aren’t better at the opening prompt. They’re better at pushing back.

Don’t start over with a brand-new prompt when something’s nearly right. Stay in the conversation and adjust — it remembers what it just wrote, so you can edit by talking.

Be specific about what’s off, the same way you’d be specific in the first place. There’s even a dial for how much it gambles on unlikely words — it’s called temperature, and you can play with it in the lab below.

  • Redirect“Too formal. Make it sound like I’m talking to a friend.”
  • Zoom in“The second point is the strongest — expand just that, drop the rest.”
  • Challenge it“Are you sure? What’s the strongest argument against what you just said?”
  • Restart when stuckif it’s gone in circles, a clean chat with a better-built first prompt beats fighting a derailed one.

Pushing back works partly because asking it to reconsider, critique itself, or “think step by step” forces it to generate reasoning before its conclusion — and reasoning it has written out becomes context that shapes a better final answer. But watch for a trap: these models are people-pleasers. Say “are you sure?” and they’ll often cave and “correct” a perfectly good answer, just because the question sounds like you wanted a change. Push back to test the logic, not to bully it into agreeing with you.

When prompting becomes engineering

Two ideas the professionals use, in plain terms: prompts can be hijacked, and you can give a model its own little library to read from.

  • Prompt injectionan AI can’t reliably tell your instructions apart from instructions hidden in the text it’s reading. So a web page or document can carry a sneaky line like “ignore your previous instructions and…” — and the model may obey it. This is a genuine, unsolved security problem, not a party trick.
  • Building a knowledge baseinstead of hoping the model already knows your stuff, you hand it the right documents at the right moment — your notes, a manual, a set of facts — so it answers from those rather than from memory.

That second idea has a name: retrieval-augmented generation, or RAG. Roughly: you keep a pile of documents; when you ask a question, a search step grabs the few most relevant chunks and pastes them into the context window automatically; then the model answers using them. It’s how a chatbot can “know” your school’s rules or a company’s products without ever being retrained.

The catch ties back to prompt injection: once you’re auto-feeding outside documents into the context, a poisoned document can smuggle in instructions too. The wider craft — deciding what goes into the context window, in what order, and where it came from — is now called context engineering, and it’s most of the real work behind a good AI tool.

Bad → Fantastic: one request, four ways

Same goal every time. Add specifics, then real context — and run each one against the actual AI to watch the answer get better.

Bad

explain AI

No audience, no length, no angle. It'll dump a vague paragraph.

Okay

Explain how AI works.

There's a task now — but it's still guessing who you are and how deep to go.

Good

Explain how an AI chatbot works, to a sharp 13-year-old, in about 3 sentences.

Audience, depth, and length. Now it's aiming at a real target.

Fantastic

Explain how an AI chatbot predicts the next word, to a sharp 13-year-old. Use one vivid everyday analogy, keep it to 3 sentences, and end with why that's also why it sometimes makes things up. Give me two versions.

+ who it's for+ an analogy+ length + a rule+ ask for options

Audience, an analogy, a length, a required ending, and a choice of two. You've handed it everything a great teacher would want.

The secret isn't magic words. It's context.

Try it · words are the controls

Say it better, get it better

Two asks for the same thing. One is flat, one is specific. Run both and watch what the machine does with each.

A story opening

The flat ask

Write the opening line of a story about a dragon.

The vivid ask

Write the opening line of a story about an ancient, arthritic dragon who guards something worthless and knows it.

Try it · the creativity dial

Turn the temperature up

Every model has a hidden dial called temperature. Low: it plays safe and picks the likeliest words. High: it takes risks. Same question — very different answers. Drag it, then generate.

0.20

careful & predictable

✦ Try it

Lazy vs. loaded. First try asking it to “write something about dogs.” Then run this. Compare.

The prompt

Write three captions for a photo of a soaking-wet dog. Each under eight words, genuinely funny, no emoji.

Check yourself · not a test

Did it actually stick?

Try to answer in your head first — out loud is even better — then tap to check. Remembering it beats re-reading it.