Skip to main content
v2026.1714 entries · CC-BY 4.0
CASRAI

Data science & AI · Reference

What is prompt engineering?

Prompt engineering is the practice of designing and refining the inputs given to a generative AI model so that it produces more useful, accurate, or appropriately formatted outputs.

Why prompts matter

A generative model produces output by continuing or responding to the text it is given, so the prompt is the primary means of control without retraining the model. Small changes in wording, the inclusion of examples, or explicit instructions about format and role can shift the output markedly. Prompt engineering is the systematic attempt to find inputs that reliably elicit accurate, relevant, and well-structured responses. It is an empirical practice: prompts are tested and refined, because a model's behaviour cannot always be predicted from first principles.

Common techniques

Zero-shot prompting asks the model to perform a task with instructions only and no examples. Few-shot prompting includes a handful of worked examples in the prompt to demonstrate the desired pattern.

Chain-of-thought prompting asks the model to show intermediate reasoning steps, which can improve performance on multi-step problems. Other practices include specifying a role, constraining the output format, and breaking complex tasks into smaller prompts. Which technique helps depends on the model and task and is established empirically.

Reproducibility caveats

Prompt engineering has important limitations for research. Model outputs are stochastic, so the same prompt can yield different answers; models also change between versions, meaning a prompt tuned today may behave differently later. Prompts can be brittle — minor rewording can change results — and effective prompts rarely transfer cleanly between different models. For these reasons, prompts and exact model versions should be documented, and results should not be treated as stable or reproducible without verification.

Prompt engineering in research

When generative models are used as research tools, prompt engineering is part of the method and should be reported like any other protocol: the exact prompts, model, version, and settings, plus how outputs were validated. Treating prompts as disposable or undocumented undermines reproducibility. Prompt design also intersects with safety — for example, defending against prompt injection, where untrusted input attempts to override intended instructions.

Key facts

At a glance

  • Definition: designing inputs to steer a generative model
  • Zero-shot: instructions only, no examples
  • Few-shot: a few worked examples included in the prompt
  • Chain-of-thought: prompting for intermediate reasoning steps
  • Key caveat: outputs are stochastic and model-dependent
  • Reproducibility: prompts and model versions must be documented

Common questions

FAQ

What is the difference between zero-shot and few-shot prompting?+

Zero-shot prompting gives the model only instructions and no examples; few-shot prompting includes a small number of worked examples to demonstrate the desired output pattern. Few-shot can improve results on tasks where the format or behaviour is hard to specify in words alone.

What is chain-of-thought prompting?+

Chain-of-thought prompting asks the model to produce intermediate reasoning steps before its final answer. For multi-step problems this can improve accuracy, though the stated reasoning is not a guaranteed account of how the model arrived at its answer.

Is prompt engineering reproducible?+

Only with care. Model outputs are probabilistic and change between versions, and prompts can be brittle and model-specific. Documenting exact prompts, models, and settings — and verifying outputs — is necessary for reproducible use.

The step most authors miss

Doing CRediT right? Don’t stop at the statement.

A CRediT statement credits you inside one paper. The recognition CRediT was built for happens when those roles are tied to you, persistently. Sign in with your ORCID — free — and claim your CRediT contributions on casrai.org, the home of the standard. They become a verified, portable part of your identity, not a line that disappears into one PDF.

Free: claim your contributions, then export a journal-ready CRediT statement, schema.org structured data, JATS XML, CSV or BibTeX — and preview your public profile. A membership publishes that profile publicly and verifies the journals you serve.

Referenced across the research world

University of Cambridge logoColumbia University logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoCrossref logoUniversity of Cambridge logoColumbia University logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoCrossref logo
  • University of Cambridge logo
  • Columbia University logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo
  • Crossref logo

View CASRAI adoption →