AI Glossary 05 - Prompting and In-Context Learning

The shortest path from a raw model to a useful answer runs through the request you send it, and an entire craft has grown around that seam. This fifth glossary lesson collects the prompting terms: the anatomy of a request, the reasoning patterns that raise answer quality, and the newer vocabulary for managing the whole context window. The site treats the practice in depth in the Prompt Engineering Guide pick and OpenAI’s tutorial on clear ChatGPT prompting; this lesson stays on the words themselves, a sentence or two each.

The prompt itself

Five terms for what a request is made of.

  • Prompt: Everything handed to the model in one request: instructions, documents, examples, partially written text it should continue. Nothing else reaches it, so anything the model is expected to use this turn has to be in here.
  • Prompt engineering: The practice of structuring that request for reliability: what to include, in what order, phrased how. It is the cheapest lever available and improves immediately, so it gets tried before anything involving training.
  • Zero-shot: Asking for the task straight out, with no worked examples included in the request. Naming the format, the audience, and the constraints inside the instruction still counts; the term only marks the absence of examples. This is the baseline every technique below gets measured against.
  • Few-shot learning: Placing a handful of solved demonstrations inside the request so the model imitates the pattern, also called in-context learning because the weights never change. Two or three well-chosen examples routinely outperform paragraphs of instruction.
  • Structured output: Constraining the reply to a fixed shape, most often JSON conforming to a schema, either by asking for it or by blocking every token that would break the format. Downstream code then stops guessing how to parse the answer.

The reasoning patterns

Four terms for asking the model to spend effort before it answers.

  • Chain-of-thought: Having the model write out its steps before committing to an answer, which measurably improves arithmetic, logic, and multi-part questions. The gain comes from spending output tokens on intermediate work; the same question answered in one leap performs worse.
  • Self-consistency: Sampling several independent reasoning paths for one question and keeping the majority answer. It costs a multiple of one solution and buys error cancellation, and the idea extends into searching over chains rather than following a single one. A higher sampling temperature helps here, because agreement between wildly different paths is stronger evidence than agreement between near-duplicates.
  • ReAct: A loop that alternates reasoning traces with tool actions, feeding each tool’s result back into the next thought. A typical cycle reads thought, action, observation, then another thought, until the model commits to an answer. It is the skeleton most agent frameworks still ship, and it turns a one-shot answer into a working session.
  • Prompt chaining: Decomposing a job into a sequence of prompts, each doing one step and handing its output to the next. Every link stays simple enough to debug, and a weak step stops smearing garbage silently through the rest.

The vocabulary of context control

Three terms from the layer above single prompts. They arrived once agents began stuffing tool results and retrieved pages into every turn, and the window turned into contested ground.

  • Context engineering: The broader discipline of deciding everything that occupies the window: instructions, retrieved documents, tool results, memory, and their budgets. The prompt is one input; the craft is managing the whole window as a scarce resource.
  • Role prompting: Assigning the model a role or persona, or marking who said what inside a transcript, so tone and defaults shift accordingly. Accuracy effects are mixed, but structured roles are what tool-calling formats are built on.
  • Prompt compression: Shortening what sits in the window, from dropping boilerplate to replacing passages with learned digests, so more of the budget carries signal. The aggressive implementations use a smaller model to decide what to cut, while prompt caching attacks the same cost from the other side by reusing whatever stayed identical.

Common confusions

Three pairs that get conflated in casual usage and in job postings alike.

  • Prompt engineering vs context engineering: Prompt engineering shapes the single request. Context engineering shapes the whole window across a session, including what gets retrieved and remembered. The second term exists because agent sessions outgrew the first.
  • In-context learning vs fine-tuning: In-context learning changes behavior for one request using examples placed inside it. Fine-tuning changes the weights for every future request. The first is free and reversible; the second is a training run, and a later lesson in this series covers its vocabulary.
  • Chain-of-thought vs prompt chaining: Chain-of-thought makes one model think in steps inside one reply. Prompt chaining makes several requests in a row, each with its own prompt. One interleaves reasoning; the other pipelines whole tasks.

Further reading

Three papers that named the patterns above:

This is lesson 05 of the AI glossary. Lesson 04 covered Training at Scale and Optimization, and prompting is the layer where all that training finally meets your actual question. Prompts are also the input a cache amortizes, which Claude Code prompt caching explained covers for a real product, and Context Engineering 101 extends this vocabulary to full agent sessions. The next lesson changes registers entirely: from words to geometry, in Embeddings and Vector Search.