Spark
Thinking with AI

Foundations: how a prompt works and how AI “thinks”

Topic 018 min read + 20 min for the taskRevised October 10, 2026

This is the most basic topic in the guide. It gives you the mental framework every other topic builds on. There are quite a few terms here, but each one comes with a practical example instead of a textbook definition. If you have never written prompts on purpose, start here: everything after this gets easier.

The next topic is “Ethics, privacy and limits”. Read it before your first work prompt.

How a model “thinks”: briefly and without math

A language model doesn’t look up the answer in a knowledge base, and it doesn’t “understand” a question the way a person does. It continues text. The model takes everything written so far and predicts the next small piece, a token, over and over. A token is part of a word, sometimes a whole word or a symbol (see the glossary). Four practical conclusions follow from this simple mechanism, and the rest of the guide relies on them:

  • The prompt is the context. The model continues whatever you gave it in the most plausible way. The more precisely you set the context (role, audience, examples), the narrower the corridor of plausible continuations. That is why the prompt structure in the next section works, and “make it nice” gets you the most average result possible.
  • The same prompt gives different answers. The next token is picked with some randomness, not strictly the most likely one. The degree of that randomness is called temperature. You can’t adjust it in chat apps. In the API not every model has it: some current models only allow the default value. Details for specific models are in the sources for this topic. This is a property of the model, not a bug. For brainstorming, variety helps. For a repeatable result you have to dampen it with a precise prompt, examples and a fixed answer format.
  • A model can be confidently wrong. A plausible continuation and a correct answer are different things. When the model lacks the knowledge, it doesn’t stay silent. It builds text that looks true: a made-up number, a link that doesn’t exist, a wrong date. Ask about “the three-fox rule” in typography, and the model may explain it with confidence, even though no such rule exists. This is called a hallucination. The model doesn’t flag it in any way, which is why the “Ethics, privacy and limits” topic has a rule about checking facts.
  • A model’s knowledge stops at its training date. It doesn’t know anything that happened later unless web search is on (the “Content search and research” topic). For fast-changing things like tool versions, prices and news, an answer “from memory” is almost always out of date.
Four photos of the same scene from one prompt: a ceramic mug of coffee on a windowsill in morning light. The mugs, window frames and light differ in every frame.
One prompt, four different mugs. It’s the same randomness as in text: each time the model picks its own continuation. · Midjourney V8.2
Prompt
A ceramic mug of coffee on a windowsill, morning light, editorial photo --ar 4:5
The model builds text one token at a time and each time picks the next one from several likely options.

Anatomy of a good prompt

Almost any working prompt, for text or for an image, breaks down into five parts. Check yourself against this list every time, and one-line prompts will fade away on their own:

  • role: who the AI should “pretend” to be (“you are an art director”, “you are a UX editor”);
  • context: what is already known about the task, the brand, the audience;
  • task: what exactly needs to be done, ideally with one clear verb;
  • response format: a list, a table, JSON, three options, 100 words max;
  • constraints: what not to do, such as tone, length, banned words, technical limits.

This breakdown goes by many names: guides mention RTF, RACE and CO-STAR. The point is the same: remove ambiguity before you hit send. You can see how it works on a real task in the “Side project” topic, section “How to brief the agent: the five parts of a prompt”.

A before-and-after example:

  • Weak: “write the text for a button”
  • Strong: “You are a UX copywriter for a fintech product. Come up with the label for the button that confirms a money transfer. Tone: confident, no corporate jargon. Format: 3 options, 2–3 words each. Don’t use the word ‘pay’: we already have a button with that label on another screen.”
BeforeA wide shot of a cozy café: wooden tables, customers with cups, a barista at the espresso machine, shelves with plants and bags of coffee

“Make a nice picture for a coffee shop”: the model chose the subject, the framing and the format on its own.

AfterA close-up: a barista’s hands in a leather apron pour milk into a cup with a leaf pattern in the foam, a window and a brick wall nearby, warm side light

The same request, broken into role, context, task, format and constraints.

The five parts of a prompt work for images too: each part removes one decision the model would otherwise make for you. · Nano Banana Pro
Prompt
You are the art director of a small specialty coffee shop in an old brick building. Create the hero image for its website: a barista’s hands pouring latte art, close-up, warm morning side light, a muted earthy palette, horizontal 16:9, no text, no faces visible.

System prompt vs user prompt

In most chat interfaces you only write the “user prompt”, your own message. But behind the scenes almost every tool has a “system prompt”. It is a hidden instruction from the developer that sets the model’s baseline behavior (for example, “answer in a friendly way” or “never give medical diagnoses”). This matters to a designer for two reasons. First, it explains why the same question sounds different in different apps built on the same model (say, GPT inside Notion AI versus GPT in plain ChatGPT). Second, some tools (custom GPTs, Gemini Gems, Claude projects) let you write a “system” instruction yourself, once. After that it applies to every message in that chat.

Zero-shot, few-shot and examples inside the prompt

Zero-shot means you simply ask the model to do something, with no examples. Few-shot means you attach 2–3 examples of what the result should look like, and the model repeats the pattern. For a designer, few-shot is especially useful for copy and briefs. Attach 2 texts already written in the brand’s voice, and the quality goes up more than from any verbal description of tone. Here is what such a few-shot prompt looks like in practice:

Few-shot: two examples set the pattern, and the third result repeats it.
Here are two examples of how we usually caption product cards on our blog:
1. “A cozy wool throw: that feeling of home on a cold evening”
2. “A handmade ceramic mug: the small detail that changes your morning”

Write a caption in the same tone for a new card: a set of scented candles

Multi-step reasoning (chain-of-thought)

A phrase like “think step by step” or “first list the options, then pick the best one and explain why” makes the model show its intermediate reasoning instead of jumping straight to a final answer. This is especially useful in brainstorming and when you review complex designs, where you need to see the logic behind a choice and not just the conclusion.

One caveat. Modern “reasoning” models (modes like Thinking, Extended thinking or Deep Think in apps) already have step-by-step reasoning built in. The model thinks before answering on its own, and “think step by step” adds almost nothing. What helps them more is full context and a clear description of what counts as a good result. Turn reasoning mode on where the cost of a mistake is higher than the cost of waiting for an answer. On fast models without such a mode, the trick still works. And asking to “list the options first, then choose” always helps, because it shows the logic of the choice.

Structured output

You can ask the model directly to return its answer as a table, a numbered list with fixed fields, or even JSON. This is handy when the result goes next into a Notion or Airtable table, or into another tool.

Multimodality

Modern models (GPT, Gemini, Claude) accept more than text: images, PDFs, screenshots. Gemini also accepts audio and video as files. For a designer this means one thing: you no longer need to describe a design in words. Attach the design itself and ask the model to review it, improve it or build it in code.

What language to prompt in

Models’ training data usually contains more English than any other language: in Llama 3, for example, other languages made up just over 5%. If you prompt in your native language and it isn’t English, the same prompt in English will often give a better, more precise and more predictable result. This is especially noticeable in image and video generation, where English is the de facto working language of the industry. It is also cheaper: text in other languages, especially in non-Latin scripts, splits into more tokens, so it fills the context faster and costs more through the API. Russian is the measured example in the chart below. None of this means you must always write in English: briefs, copy and client conversations naturally happen in the client’s language. But if a prompt in another language disappoints you, ask the model itself to translate it into English (“translate this prompt into English, keep the meaning, adapt it to design industry terms”) and compare the results.

How many times more tokens the GPT-4 tokenizer spends on the same text than on English. English is the cheapest: in the study by Petrov et al. (NeurIPS 2023), Russian comes out about 2.5 times more expensive. Newer tokenizers narrow the gap: for GPT-4o, OpenAI shows Russian text needing 1.7 times fewer tokens than before.

What to do when the chat “forgets” the start of the conversation

Every model has a limit on how much text it can hold in a conversation at once: the context window (see the glossary). When a conversation gets very long (dozens of messages, large pasted files), the earliest messages can drop out of the model’s “memory”. Then it starts contradicting what it said at the beginning or forgets the constraints you set. The sign: the model suddenly ignores a rule it followed carefully five messages ago. The fix is simple. Don’t try to stretch one endless chat. Start a new conversation for each new subtask. In the first message, carry over only what really needs remembering: the outcome of the previous stage and the key constraints. That is more reliable, and answers come faster than in a bloated chat.

The context window: whatever doesn’t fit, the model no longer sees.

Command examples for practice

Where to pasteAny chat assistant: ChatGPT, Claude, Gemini
Here is my prompt: [paste]. Break it down into parts: role, context, task, format, constraints. Tell me which parts are missing.
Rewrite this prompt as a few-shot prompt: here are 2 examples of text in the tone I need [paste], now write a third one on the same subject.
Solve this task step by step. First list every possible approach, then pick the best one and explain why: [paste the task]
Return your answer as a table with the columns: idea, pros, cons, implementation difficulty.
Mini-task

Take one real prompt you wrote recently (your own, not one from this topic). Break it down into the five parts of the anatomy from the start of this topic: role, context, task, format, constraints. Find which parts were missing, add them, and compare the result with what you got before.

Time: 20 minutes
Done when: you have two versions of the answer, before and after, and you can name which added part of the prompt made the biggest difference

Sources

  1. Language Model Tokenizers Introduce Unfairness Between Languagesarxiv.org

    Petrov et al., NeurIPS 2023: on the FLORES-200 corpus the GPT-4 tokenizer spends 2.49 times more tokens on Russian than on English; the data behind the chart

  2. Hello GPT-4oopenai.com

    The Language tokenization section: the new tokenizer spends 1.7 times fewer tokens on Russian

  3. Migrating to Claude Opus 5.5platform.claude.com

    On Opus 5.5, temperature, top_p and top_k can only stay at their defaults, and reasoning is always on

  4. Model guidance (GPT-6 Astra)developers.openai.com

    When temperature and top_p are unavailable on new OpenAI models: only with reasoning turned on

  5. Upload & analyze files in Gemini Appssupport.google.com

    Gemini accepts audio and video as files, with length limits by plan

Found a mistake or an outdated fact? Write to hey@iskra.guide