Skip to main content

AI glossary Models & Architecture

What is prompt engineering?

← All glossary terms
In short

The practice of designing and testing the instructions given to a language model so that its answers are better and more consistent.

Explained

Prompt engineering is the practice of writing, structuring and testing the inputs given to a large language model (LLM) so that it produces reliable, useful outputs. It covers clear instructions, worked examples (few-shot), step-by-step reasoning (chain of thought), roles and structured output formats such as JSON. In a business setting it is less about clever wording and more about method: define what a good answer looks like, build a set of test cases and change the prompt until it passes them. It is usually the cheapest way to improve a model's behaviour before considering fine-tuning or a different model.

How it works

A prompt is everything the model reads before it answers: the instructions, the context, any examples and the user's question. Small changes in that text can change the answer, so prompt engineering treats the prompt as something to design and test, not to improvise.

The usual loop is simple: write a first version, run it against a set of real cases, look at where it fails and adjust. Most of the effort goes into the test cases, because without them there is no way to know whether a change helped.

Common techniques

  • Clear, specific instructions: the task, the audience, the format and the length.
  • Few-shot examples: a handful of input and output pairs that show the expected answer.
  • Chain of thought: asking the model to reason step by step before giving the final answer.
  • Roles and system prompts: setting who the model is and which rules it follows.
  • Structured output: asking for JSON or a fixed template that software can read.
  • Prompt chaining: splitting a complex task into several smaller prompts.

Prompt engineering vs fine-tuning and context engineering

Prompt engineering changes the instructions; fine-tuning changes the model's weights with additional training data. Prompting is faster and cheaper to iterate, so it usually comes first. Fine-tuning makes sense when the behaviour is stable, the volume is high and prompting alone has reached its limit.

Context engineering is the broader discipline of deciding what information reaches the model at each step: retrieved documents, tool results, memory and history. In agents and RAG systems, the prompt is only one piece of that context.

Frequently asked questions

What is prompt engineering in simple terms?

It is learning how to ask a language model for what you need. You write clear instructions, add examples and context, and test the result until the model answers well and consistently.

Is prompt engineering still relevant with newer models?

Yes, although it has changed. Newer models need fewer tricks, but they still depend on clear instructions, good context and a defined output format. In production, testing prompts against real cases matters more than ever.

What are the main prompt engineering techniques?

The most common are clear instructions, few-shot examples, chain-of-thought reasoning, role or system prompts, structured output and breaking a task into a chain of prompts. Which ones help depends on the task and the model.

When should I use fine-tuning instead of prompt engineering?

Start with prompting, because it is cheaper and faster to change. Consider fine-tuning when you need a stable style or format at high volume, when prompts become too long or costly, or when prompting no longer improves results.

How do you test a prompt?

Build a set of representative inputs with the expected answers or criteria, run the prompt against them and score the results. Repeat after every change, and keep the test set as the reference when you switch models.

Decision guides that use this term

Where it shows up at Thinkia

Further reading

Sources

Updated: 2026-10-21

Want to see how this applies to your organisation?

Talk to an AI Expert