Prompt Engineering

Prompt engineering is the iterative writing and testing of prompts to get accurate, consistent outputs from a large language model, as in evidence review.

Status
Published, version 1.0.0
Last reviewed
10 Nov 2026, by Dr Darrin Baines
Report a problem
Tell us if something is wrong or out of date

Concept Architecture

Prompt Engineering in Evidence Review and Health Economic Modelling

Prompt engineering is the work of writing a prompt for a large language model, checking the replies against known answers and revising the prompt until performance stops improving. In health technology assessment it is how an analyst turns a general model into a tool for one task, such as screening records for a systematic review or drafting code for a health economic model. NICE ECD20 (2026), the NICE framework on AI methods for evidence, treats it as part of LLM customisation, which changes how a model is used without changing its weights. Each revision is chosen by looking at results, so prompt engineering behaves like model fitting and needs the same separation of development and validation data. A prompt that scores well on the records used to write it can do worse on new ones.

A search over possible prompts

Liu and colleagues, in a survey of prompting methods, define prompt engineering as creating the prompting function that performs best on the task, by hand or by algorithm. They note that manual design takes time and experience and that even experienced designers may miss the best prompt. Automated methods search over strings of real tokens, usually natural-language phrases, called hard prompts, or over trained vectors in the model's embedding space, called soft prompts, which usually cannot be read as text. Analysts using a commercial model through an Application Programming Interface work almost entirely with hard prompts.

Schulhoff and colleagues, in a systematic review called the Prompt Report, describe prompt engineering as an iterative process of developing a prompt by changing the prompting technique in use. They separate a prompting technique, a way of structuring one prompt, from a prompt engineering technique, a strategy for iterating on a prompt to improve it, and their taxonomy lists 58 text-based prompting techniques. Zhou and colleagues use a narrower definition that covers only the wording of a single prompt and leaves out chains of model calls and access to external tools. In batch evidence work the usual product is a Prompt Template, with placeholders filled afresh for each record.

Techniques the practice draws on

Most named techniques change one part of a prompt, and an engineered prompt often combines several. The ECD20 glossary calls most of these prompt engineering techniques or methods, and its introduction lists retrieval-augmented generation among the techniques that can reduce hallucinations.

TechniqueWhat the engineer changesUse noted in NICE ECD20 (2026)
Few-Shot PromptingAdds solved examples of the taskGenerally improves data extraction
Chain-of-Thought PromptingAsks for reasoning steps before the answerCan help where screening criteria are complex, with little gain for routine screening
Self-Consistency (AI)Repeats a reasoning prompt and keeps the most common answerMay help extraction that needs some reasoning
Role PromptingGives the model a personaA cautious persona for screening, kept brief and validated
Prompt ChainingSplits a task into a sequence of smaller promptsOne way of delivering extraction questions
Retrieval-augmented generationAdds retrieved source passages to the promptMay reduce false negatives in extraction

Prompt (AI) sets out the parts of a single prompt, and prompt engineering decides what goes into them and checks whether each change helped.

Manual and automated prompt engineering

The Automatic Prompt Engineer (APE) of Zhou and colleagues automates the search, with one language model proposing candidate instructions from input and output examples, each candidate scored by how well a model performs when following it, and the best kept. Its instructions matched or beat those written by human annotators on 24 of 24 Instruction Induction tasks and 17 of 21 curated BIG-Bench tasks.

The Prompt Report also documents a manual exercise in a health setting, in which an experienced prompt engineer tried to get GPT-4 to flag entrapment, a marker of suicidal crisis, in forum posts with 121 labelled posts for development and 100 held back for testing. After 47 recorded steps and about 20 hours, starting from a prompt that returned no usable labels, the best prompt reached an F1 score of 0.53 on the development posts. Removing a project email that had been pasted in as background cut performance sharply, and a copy of the email pasted in twice by accident had helped, which the authors took as a sign of how hard prompt sensitivity is to explain. An automated search with the DSPy library reached an F1 of 0.548 on the 100 test posts, with recall 0.952 and precision 0.385, and the authors report that it did much better there than the human prompts. Automation combined with human revision worked best, and the authors stressed involving domain experts who know what the labels mean.

Prompt engineering for model construction

Reason and colleagues used GPT-4 to rebuild two published partitioned survival models, in non-small cell lung cancer and renal cell carcinoma, as R code. They developed prompts iteratively, evaluating the generated models and adjusting the prompts until reasonable changes brought no further gain. The 8,192-token limit, and better results when one model element was built at a time, meant many prompts per model, 33 in the final lung cancer set.

GPT-4 made more errors with functions from health economic modelling packages than with base R and mishandled assumptions such as vial wastage, so the team added generic contextual information with worked examples, reused unchanged for both models. Outputs varied even at temperature 0, so they generated 15 scripts per model. Of these, 14 of 15 lung cancer scripts were completely error-free, as were 9 of 15 renal cell scripts after one input calculation was simplified by hand, and error-free scripts reproduced the published incremental cost-effectiveness ratios to within 1%.

NICE ECD20 (2026) limits AI in health economic evaluation to support with a human closely in the loop, such as code that a person checks before running it. A prompt engineered for model building therefore yields a draft for model validation and checking, not a finished model.

What NICE ECD20 asks of engineered prompts

ECD20 separates tuning, which changes a model through fine-tuning of an LLM or hyperparameter optimisation of a traditional model, from customisation, which includes prompt engineering and leaves the model unchanged. It does not try to track provider settings or platform configurations as the field changes. For screening, it asks for prompt templates to be optimised on held-out development data, though prompts may be refined in pilot experiments before the remaining records are screened. Its validation principle requires independent datasets for model selection, optimisation, customisation and validation, and it names holdout and cross-validation as ways to draw them. Prompts are among the changes after which re-validation should be considered.

On reporting, ECD20 accepts that the final prompt alone may be enough to reproduce results, as long as the reasons for preferring it to earlier drafts are clear. It suggests keeping a prompt library and having more than one person check each prompt and keeping its wording neutral to limit Context Bias. For data extraction, it accepts AI support or semi-automation only if every AI-extracted item is verified against the primary source.

Worked example tuning an extraction prompt

All numbers here are illustrative. A team building a cost-utility model wants a prompt that extracts five items from each trial abstract, including arm sizes and median progression-free survival, all of which are reported in the abstracts used. It splits 100 hand-checked abstracts into 60 for development (60 × 5 = 300 items) and 40 held out (40 × 5 = 200 items), then judges each prompt version by its true positive rate. Because every item is reported and each version returns nothing beyond the five items, this rate equals the overall concordance that NICE ECD20 (2026) names as the primary extraction metric.

TPR=TPTP+FN,Δ=TPRdev−TPRtest\text{TPR} = \frac{TP}{TP + FN}, \qquad \Delta = \text{TPR}_{\text{dev}} - \text{TPR}_{\text{test}}

where TPTP is the number of reported items extracted correctly, FNFN is the number of reported items missed or extracted wrongly, TPR is the true positive rate (the sensitivity of the prompt), TPRdev\text{TPR}_{\text{dev}} is the rate for the chosen version on the development abstracts, TPRtest\text{TPR}_{\text{test}} is its rate on the held-out abstracts, and Δ\Delta is the optimism from choosing the version on the development data.

1. Iterations. Version 1, a plain instruction, gets 231 items right, so TPR is 231 / 300 = 0.77. Version 2 adds a definition and unit for each item, giving 252 / 300 = 0.84. Version 3 adds two solved examples, giving 270 / 300 = 0.90. Version 4 tells the model to use only the abstract text and to put each value in its own fixed output field, giving 276 / 300 = 0.92. Version 5 rewords the instruction and gives 273 / 300 = 0.91, so the team keeps version 4.

2. Held-out test. Version 4 gets 174 of the 200 held-out items right, so TPR is 174 / 200 = 0.87 and FN is 200 − 174 = 26. The optimism is 0.92 − 0.87 = 0.05.

3. Stability. Five repeated runs on the held-out set return identical values for 188 of 200 items, a share of 188 / 200 = 0.94.

4. Interpretation. The team reports 0.87, not 0.92, because the development figure was used to pick the winner, much as overfitting flatters a predictive model judged on its own training data. About 13 items in 100 would still be missing or wrong and 12 items change between runs, so every value still goes to a human checker, as ECD20 requires. The methods report gives the final prompt and why version 4 was kept.

Limits and common misreadings

A prompt tuned for one model may not suit another. Sclar and colleagues found accuracy differences of up to 76 points between formats with the same meaning in LLaMA-2-13B and about 10 points on average across tasks and models. Format performance correlated only weakly between models, so a change of model or provider calls for re-testing the prompt.

A good prompt does not make a model reliable. ECD20 notes that justifications a model gives are often produced after the fact, and that testing on data the model saw in training can flatter results. Fine-Tuning changes a model's weights, whereas prompt engineering leaves the model unchanged, so the engineered prompt has to be sent with every call. Prompts can also send confidential data to an outside provider, which is why Reason and colleagues put dummy values in place of sensitive model inputs in their data prompts.

Sources

  • Liu P, Yuan W, Fu J, Jiang Z, Hayashi H, Neubig G. Pre-train, prompt, and predict: a systematic survey of prompting methods in natural language processing. ACM Computing Surveys. 2023;55(9). https://doi.org/10.1145/3560815
  • National Institute for Health and Care Excellence. AI methods for evidence framework (ECD20). NICE; published 9 November 2026, including Appendix A glossary. https://www.nice.org.uk/corporate/ecd20
  • Reason T, Rawlinson W, Langham J, Gimblett A, Malcolm B, Klijn S. Artificial intelligence to automate health economic modelling: a case study to evaluate the potential application of large language models. PharmacoEconomics Open. 2024;8(2). https://doi.org/10.1007/s41669-024-00477-8
  • Schulhoff S, Ilie M, Balepur N, Kahadze K, Liu A, Si C, et al. The Prompt Report: a systematic survey of prompt engineering techniques. arXiv:2406.06608. 2024 (version 6, 2025). https://arxiv.org/abs/2406.06608
  • Sclar M, Choi Y, Tsvetkov Y, Suhr A. Quantifying language models' sensitivity to spurious features in prompt design. International Conference on Learning Representations (ICLR 2024). 2024. https://arxiv.org/abs/2310.11324
  • Zhou Y, Muresanu AI, Han Z, Paster K, Pitis S, Chan H, Ba J. Large language models are human-level prompt engineers. International Conference on Learning Representations (ICLR 2023). 2023. https://arxiv.org/abs/2211.01910

Library

Publications

11
  • Journal article

    Optimizing Artificial Intelligence in Health Economics and Outcomes Research: Considerations on Reproducibility, Prompt Strategy, and Error Impact in Automated Data Extraction — Jin H, Vol. 29, No. 7, pp. 1320-1321 ed., 2026 (Value in Health)

    Short Value in Health letter on reproducibility, prompt choice and the impact of errors when LLMs extract HEOR data.

  • Journal article

    Artificial Intelligence to Automate Network Meta-Analyses: Four Case Studies to Evaluate the Potential Application of Large Language Models — Reason T, Benbow E, Langham J, et al, Vol. 8, No. 2, pp. 205-220 ed., 2024 (PharmacoEconomics - Open)

    Four case studies of an LLM preparing data and running network meta-analyses that feed economic models.

  • Journal article

    MSR59 Evaluating Systematic Literature Review Screening Performance of Seven Large Language Models in Response to Different Prompting Strategies — Janoudi G, Rada (Uzun) M, Richter T, et al, Vol. 27, No. 12, p. S449 ed., 2024 (Value in Health)

    Compares seven LLMs and several prompting strategies for review screening, in a conference poster abstract.

  • Journal article

    Data extraction for evidence synthesis using a large language model: A proof-of-concept study — Gartlehner G, Kahwati L, Hilscher R, et al, Vol. 15, No. 4, pp. 576-589 ed., 2024 (Research Synthesis Methods)

    Proof of concept of LLM data extraction for evidence synthesis, judged against human extraction.

  • Journal article

    MSR63 Prompt Engineering for the Use of Generative Artificial Intelligence (AI) in Health Economic Modeling: Findings From a Targeted Literature Review — O'Grady M, Adair N, Arguello R, et al, Vol. 27, No. 12, p. S450 ed., 2024 (Value in Health)

    Targeted review of prompt engineering approaches for generative AI in economic modelling, published as a poster abstract.

  • Journal article

    Artificial intelligence-driven study selection in systematic reviews of randomized controlled trials, emulated trials and economic evaluation studies using large language models — Looareesuwan P, Ponthongmak W, Tansawet A, et al, Vol. 5, No. 8, p. e0001668 ed., 2026 (PLOS Digital Health)

    Tests LLM study selection on five reviews including an economic evaluation review, so results speak to HE work.

  • Journal article

    P28 Development of De Novo Health Economic Models Using Generative AI — Chhatwal J, Yildirim I, Samur S, et al, Vol. 27, No. 12, p. S7 ed., 2024 (Value in Health)

    ISPOR podium abstract testing whether generative AI can build new health economic models from a brief.

  • Journal article

    Artificial Intelligence to Automate Health Economic Modelling: A Case Study to Evaluate the Potential Application of Large Language Models — Reason T, Rawlinson W, Langham J, et al, Vol. 8, No. 2, pp. 191-203 ed., 2024 (PharmacoEconomics - Open)

    Early case study in which GPT-4 rebuilt published cost-effectiveness models in code.

  • Guidance

    ELEVATE-GenAI: Reporting Guidelines for the Use of Large Language Models in Health Economics and Outcomes Research: An ISPOR Working Group Report — Fleurence RL, Dawoud D, Bian J, et al, Vol. 28, No. 11, pp. 1611-1625 ed., 2025 (Value in Health)

    ISPOR reporting checklist for any HEOR study that uses an LLM, so readers can judge how the model was used and checked.

  • Journal article

    Using Generative Artificial Intelligence in Health Economics and Outcomes Research: A Primer on Techniques and Breakthroughs — Reason T, Klijn S, Rawlinson W, et al, Vol. 9, No. 4, pp. 501-517 ed., 2025 (PharmacoEconomics - Open)

    Plain primer on generative AI techniques written for HEOR analysts, with examples from reviews and modelling.

  • Journal article

    EE504 Leveraging Large Language Models for Conceptualizing Health Economic Models: A Feasibility Study in Oncology — Srivastava T, Swami S, Tong T, Vol. 27, No. 12, p. S155 ed., 2024 (Value in Health)

    Oncology feasibility study, reported as a poster abstract, on LLMs helping conceptualise economic models.

Frequently Asked Questions (6)

  • What is Prompt Engineering?

    Prompt engineering is the iterative writing and testing of prompts to get accurate, consistent outputs from a large language model, as in evidence review.

    Source: NICE ECD20 (2026)

  • How does NICE ECD20 expect prompt engineering to be validated when a language model screens records for a systematic review?

    NICE ECD20 (2026) asks for screening prompt templates to be optimised on held-out development data, while allowing prompts to be refined in pilot experiments before the remaining records are screened. Its validation principle calls for independent datasets for model selection, optimisation, customisation and validation, drawn from separate data collections or by holdout or cross-validation. Because each prompt revision in prompt engineering is chosen by looking at results, a score on the development records tends to flatter the final prompt, so performance should be judged on records not used to write it. Re-validation should also be considered after a substantive change to the prompts.

    Source: NICE ECD20 (2026)

  • How has prompt engineering been used to build a health economic model in R?

    Reason and colleagues used prompt engineering with GPT-4 to rebuild two published partitioned survival models, in non-small cell lung cancer and renal cell carcinoma, as R code. They revised the prompts until reasonable changes brought no further gain and built one model element at a time, which gave 33 prompts in the final lung cancer set. Generic contextual information with worked examples addressed errors with modelling package functions and assumptions such as vial wastage. Of 15 scripts per model, 14 lung cancer scripts were error-free, as were 9 renal cell scripts after one input calculation was simplified by hand, and error-free scripts reproduced the published incremental cost-effectiveness ratios to within 1%.

    Source: Reason et al. 2024

  • How does prompt engineering differ from fine-tuning a large language model?

    NICE ECD20 (2026) separates tuning, which adapts an existing model through fine-tuning of an LLM or hyperparameter optimisation of a traditional model, from customisation, which tries to improve performance without changing the underlying model. Prompt engineering belongs to customisation. It alters only the text sent to the model, so the weights stay as they were and the engineered prompt has to be sent with every call. Fine-tuning instead changes the weights themselves through further training. Either kind of change can alter performance, and ECD20 lists prompts among the changes after which re-validation of an AI method should be considered.

    Source: NICE ECD20 (2026)

  • How can prompt engineering be automated rather than done by hand?

    Zhou and colleagues treat the instruction in a prompt as a program to be optimised by search. In their Automatic Prompt Engineer, one language model proposes candidate instructions from input and output examples, and the candidate that leads a model to perform best on a chosen score is kept. Its instructions matched or beat those written by human annotators on 24 of 24 Instruction Induction tasks and 17 of 21 curated BIG-Bench tasks. Automated prompt engineering still selects on labelled examples, so in evidence work the chosen prompt needs checking on held-out records before use.

    Source: Zhou et al. 2023

  • Why should prompt engineering be repeated when an evidence team changes language model or provider?

    Sclar and colleagues found that prompt formats with the same meaning gave accuracy differences of up to 76 points when evaluated with LLaMA-2-13B, and that adding few-shot examples, increasing model size or instruction tuning did not remove this sensitivity. Format performance correlated only weakly between models, so a prompt tuned through prompt engineering on one model may not suit another. A screening or extraction prompt therefore needs re-testing after a change of model or provider. The authors also suggest reporting a range of performance across plausible prompt formats rather than a single format.

    Source: Sclar et al. 2024

Trust Record

Verified by Dr Darrin Baines

British health economist

Professional identity: darrinbaines.org

Verification date: 10 Nov 2026

Content version: 1.0.0

Canonical Identity

Term code
HS-HP-DH-101

Stable URI · Machine-readable · Resolvable · CC BY 4.0

This article is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).

Author: Dr Darrin Baines · Publisher: Intelligent Parameters Ltd · Identifier: https://healtheconomics.wiki/concept/prompt-engineering