Landmark 18 stops to get here · leads to 4

Prompt Engineering

Designing a model's input (instructions, context, examples and output format) to get better results without changing the model itself.

Your route here

18 stops · basics first
  1. Natural Language Processing ✓ understood

    The field of AI that lets computers read, interpret, translate and generate human language, from spam filters and search to chatbots.

  2. Token ✓ understood

    The unit of text a language model reads and writes: a word, part of a word, or a character, drawn from the model's fixed vocabulary.

  3. Tokenization ✓ understood

    Splitting text into tokens, usually subword pieces, and mapping each to an integer ID so a language model can process it.

  4. Language Modeling ✓ understood

    Assigning probabilities to sequences of text, in practice by predicting each next token from the ones before it; the objective behind large language models.

  5. Dataset ✓ understood

    A collection of data examples used for training, validating, or testing machine learning models.

  6. Training ✓ understood

    The process of fitting a model to data by repeatedly measuring how wrong its outputs are and adjusting its parameters to reduce that error.

  7. Machine Learning ✓ understood

    Building systems that learn patterns from data instead of following hand-written rules, getting better at a task as they see more examples.

  8. Unsupervised Learning ✓ understood

    Learning from unlabeled data to discover hidden patterns, structures, or relationships without explicit target outputs.

  9. Self-Supervised Learning ✓ understood

    Training on unlabeled data by making the data supply its own answers: hide or alter part of an input and have the model predict or match it.

  10. Pre-training ✓ understood

    Training a model on a large dataset (often self-supervised) before fine-tuning on specific tasks, enabling transfer learning.

  11. Feature ✓ understood

    A single measurable property of an example, such as a house's floor area or how many links an email contains, used as an input to a model.

  12. Neural Network ✓ understood

    A model built from layers of simple units, each taking a weighted sum of its inputs and applying a nonlinearity; training adjusts the weights so the whole stack maps inputs to useful outputs.

  13. Deep Learning ✓ understood

    A subset of machine learning that uses neural networks with multiple layers (deep neural networks) to learn hierarchical representations of data.

  14. Representation Learning ✓ understood

    Letting a model learn its own internal description of the data, such as embeddings or layered visual features, instead of relying on features designed by hand.

  15. Embedding ✓ understood

    A list of numbers (a vector) that represents a word, sentence, image or other item, learned so that similar items end up close together.

  16. Attention Mechanism ✓ understood

    A technique that lets a neural network weigh every part of its input when producing each output, focusing on the parts most relevant at that step.

  17. Transformer ✓ understood

    A neural network architecture, introduced in 2017, built from stacked self-attention and feed-forward layers; the basis of nearly every modern large language model.

  18. Large Language Model ✓ understood

    A neural network, almost always a transformer, trained on vast amounts of text to predict the next token, which lets it write, answer, summarize and follow instructions.

  19. Prompt Engineering · you are here ✓ understood

Picture it

Write the promptRole, context, clear instructionsAdd examples + formatFew-shot examples, output…Run the modelEvaluate the outputTest against real and edge casesRefineTighten wording, add constraintsSame model, better input
  1. 01 Write the prompt Role, context, clear instructions
  2. 02 Add examples + format Few-shot examples, output structure
  3. 03 Run the model
  4. 04 Evaluate the output Test against real and edge cases
  5. 05 Refine Tighten wording, add constraints

↺ back to 01 · Same model, better input

Notice nothing about the model changes in this loop: each pass improves only the input, and that alone can change output quality.

Prompt engineering is the practice of shaping a model’s input to get better output. The model’s weights stay fixed; what changes is the instructions, context, examples and format you give it. For a large language model, the prompt is the only lever you have without retraining, and it turns out to be a strong one.

It works because language models are conditioned on everything in their context. The same model will answer differently when told who the audience is, shown what a good answer looks like, or asked to reason before answering.

The main techniques

  • Clear, specific instructions. State the task, the audience, the constraints and what “done” looks like. Most weak outputs trace back to an underspecified request.
  • Context. Supply the documents, data or background the model needs rather than hoping it knows. Retrieval systems like RAG automate this step.
  • Examples. Show a few input–output pairs and the model imitates the pattern. The GPT-3 paper (2020) called this few-shot prompting and showed that a large enough model could pick up new tasks this way with no gradient updates, a process the paper calls in-context learning.
  • Room to reason. Asking for intermediate steps before the answer, chain-of-thought prompting, raised accuracy on multi-step maths and logic problems in a 2022 Google study, with the gains growing as models got larger.
  • Structure. Put standing instructions in a system prompt, separate instructions from data with clear delimiters or tags, and ask for a specific output format when a program will read the result.

An engineering loop

The diagram’s point is that this is iterative and testable. Anthropic’s prompt engineering guide says to start with clear success criteria, some way to test against them empirically, and a first draft to improve. You run the prompt on real and edge-case inputs, find where it fails, change one thing, and run it again. Without that evaluation step, prompt changes are guesswork.

Where it stops

Prompting can’t add knowledge the model lacks or reliably override behaviour it was trained into. When a task needs new skills, a consistent style across millions of calls, or a smaller cheaper model, fine-tuning is often the better tool. Prompts are also brittle across models: wording tuned for one model can underperform on the next. And as models improve, less of the craft is phrasing tricks and more of it is simply giving the model the context a capable colleague would need.

Where it sits

Prompt Engineering

Explore nearby

In the research

All papers →

A paper that builds on Prompt Engineering .

Sources

  1. Brown et al., "Language Models are Few-Shot Learners" . 2020 (GPT-3)
  2. Wei et al., "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models" . 2022
  3. Anthropic, "Prompt engineering overview" . Claude Platform documentation