Prompt Template

A prompt template is a reusable prompt pattern for a large language model, with placeholders filled per case, such as each abstract in a systematic 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 Template in Evidence Review and Model Input Extraction

A prompt template is the fixed wording of a request to a large language model, written once with marked gaps that a script fills for each case before the request is sent. In a systematic review the gaps usually hold the protocol and one title and abstract, or one trial report, so a single template yields thousands of prompts that differ only in the inserted material. For an HTA analyst the template is what gets tested, versioned and reported, since every record passes through the same wording. NICE ECD20 (2026), the NICE framework on AI methods for evidence, treats a validated prompt template as the basis for consistent screening and, for discrete tasks with a person fully in the loop, says that sharing templates with model names and versions aids transparency. It belongs in the methods of a review or economic submission, much as a data extraction form does.

Fixed text and placeholders in a prompt template

A template has two kinds of content. The fixed text carries the role, the task instruction, any rules about evidence use and the required answer format, and it stays identical across every call. The placeholders mark where variable material goes, and a script replaces each one with the content for the current case.

Part of the templateFixed or filledTypical content in evidence work
Role and task instructionFixedA cautious reviewer applying a stated protocol
Answer specificationFixedSingle letters for include, exclude or unsure, or named fields for extraction
Case placeholdersFilled per callProtocol, title, abstract, or the text of one trial report
Example placeholdersFilled per task or per callSolved cases, as used in Few-Shot Prompting
Retrieved-content placeholdersFilled per callPassages found by retrieval-augmented generation

The NICE ECD20 (2026) glossary notes that besides placeholders for variables a template may hold placeholders for few-shot examples and retrieved content. The example screening prompt in its evidence synthesis chapter is itself a template, with empty tagged sections for the protocol, title and abstract and a reply limited to one character. A filled template is an ordinary prompt, described in general under Prompt (AI).

How the research literature defines templates

In the 2023 survey by Liu and colleagues, a template is a text string with an input slot for the case and an answer slot for the text the model will produce, and building a prompt means filling the input slot. An answer slot inside the text gives a cloze prompt and one at the end a prefix prompt, the form that suits the left-to-right generative models now used in evidence work. They also separate static templates, where one template serves every input, from dynamic ones built afresh for each input, and the screening template shown in NICE guidance is of the static, hand-written kind.

Bach and colleagues built PromptSource, a system for writing and sharing prompts, on the view that a prompt is a function that turns one dataset example into a natural-language input and a target output. Its templates, written in the Jinja2 templating language, used fields of the underlying record as placeholders, and more than 2,000 prompts were reviewed before joining the shared pool. In early experiments, templates that did not state the valid answers tended to do worse than those that listed them, and each template was stored with metadata such as its name, source, valid outputs and evaluation metrics, a habit that suits a review team's prompt library.

Prompt templates in NICE ECD20

For title and abstract screening, NICE ECD20 (2026) regards sending each record separately through an API with the same validated template as a more dependable route to consistent, reproducible results than batching records in a chatbot session, where context window limits and long conversations can degrade performance. ECD20 expects templates to be tuned on development records kept apart from the review set, while allowing changes during a pilot before the main screening run, and its principles chapter asks for independent datasets for optimisation, customisation and validation.

For data extraction, ECD20 notes that questions may all go in one prompt, follow one another in the same exchange (Prompt Chaining) or each go to a separate call, and that separate calls limit ordering effects and interference between items. Few-shot examples generally improve extraction. ECD20 does not currently recommend fully automated extraction, accepts support and semi-automation only when every extracted item is verified against the primary source, and asks reports to set out the extraction rules and templates and to state how many items were captured for each element of interest.

The principles chapter suggests keeping a prompt library, sees sharing templates with model names and version numbers as an aid to transparency when a human stays fully in the loop on discrete tasks, and asks for re-validation to be considered when prompts change substantively. For a health economic model, ECD20 limits AI to support with a human closely in the loop, so whatever a template elicits, whether model code or candidate parameter values, is checked by a person before it enters the model.

Designing a template for extracting model inputs

Schmidt and colleagues tested GPT-4 for data extraction with a system instruction asking for a JSON object of a given shape, each field set by the user, and for false to be returned when the data were absent. They found the prompts sensitive to small changes of wording, to the position of an item in the sequence, since all fields went in one request, and even to the field label, with n_participants working much better than study_size.

For inputs to a cost-effectiveness model, field names and definitions in the template should match the model's parameter list, including time point, arm and unit, and an explicit code for data not reported keeps a gap from being filled with a plausible guess. Asking the model to name the section, table or page where each value appears helps the reviewer find it for the check against the primary source that ECD20 requires, whereas ECD20 does not currently recommend generative AI for pulling out supporting text itself. Liu and colleagues showed in 2024 that the models they tested used information at the start or end of a long input more reliably than information in the middle, so a value reported deep inside a long trial report is the one most likely to be missed. For screening with smaller models, ECD20 notes that placing the record before or after the criteria can change performance, so the layout of an extraction template is worth testing on development trials.

Worked example comparing two extraction templates

All numbers in this example are illustrative. A team building a parameter input table extracts 6 items from each of 30 included trials. After pre-processing each trial report runs to about 4,500 words, which at the rough ECD20 glossary figure of 0.75 words per token is 4,500 / 0.75 = 6,000 tokens. Template A asks all 6 questions in one call and has 900 tokens of fixed text. Template B is a set of six one-question templates, each with 250 tokens of fixed text.

T=n×(f+d)T = n \times (f + d)

where TT is the total number of input tokens for the run, nn is the number of calls, ff is the number of tokens of fixed template text in each call and dd is the number of tokens of trial text inserted into each call.

1. Template A. There is one call per trial, so nn is 30. Each call holds 900 + 6,000 = 6,900 tokens, so TT is 30 × 6,900 = 207,000 tokens.

2. Template B. There is one call per item per trial, so nn is 30 × 6 = 180. Each call holds 250 + 6,000 = 6,250 tokens, so TT is 180 × 6,250 = 1,125,000 tokens.

3. Comparison. Template B uses 1,125,000 / 207,000, or about 5.4 times, the input tokens of Template A. Trial text makes up 6,000 of the 6,250 tokens in each call of Template B, or 96%, and the same text is sent 6 times per trial, the kind of repeated content that prompt caching, mentioned in ECD20, is meant to reuse, although the saving depends on the provider and on how each call is laid out.

4. Verification. Under either template a reviewer checks 30 × 6 = 180 extracted items against the trial reports, because ECD20 accepts AI extraction only when every item is verified.

5. Interpretation. Template B costs more to run but follows the separate-call strategy that ECD20 links to fewer ordering effects, and each of its six templates can be revised on its own. The team would tune both on development trials kept apart from the 30 and report the chosen templates with the model name and version.

Why one template is a sample of many

A validated template is one wording out of many for the same task. Sclar and colleagues found that formatting changes which leave the meaning intact moved few-shot accuracy by up to 76 points for LLaMA-2-13B, and that formats suiting one model correlated only weakly with those suiting another. Mizrahi and colleagues tested 20 models on paraphrased instruction templates for 39 tasks, and equivalent templates gave very different absolute scores and model rankings, with T0pp first on one task under one paraphrase and ninth under another.

For HTA work, a team choosing between models on one template may be comparing the template as much as the models. Mizrahi and colleagues accept that a developer fitting a model to one downstream task can pick its best template, provided the choice is confirmed on fresh samples, which matches the held-out data ECD20 asks for. Swapping the model behind an unchanged template is a change of model, one of the changes after which ECD20 asks for re-validation to be considered.

Prompt template, prompt and neighbouring terms

Prompt (AI) is the filled text sent in one call, the template is the reusable pattern behind it, and Prompt Engineering is the practice of designing and refining both. LLM Customisation, as ECD20 uses the term, takes in prompt engineering, retrieval and the setting of hyperparameters without changing model weights, which separates it from Fine-Tuning. Context Bias, which the ECD20 glossary links to task descriptions, word order and tone, is carried by the fixed text into every call.

A template does not make answers correct. Hallucination (AI) can still occur inside a well-formed field. Shared templates also drift as people edit them, so a versioned library that records which version produced which results matters as much as the wording. An AI agent that writes its own prompts as it works escapes this control, since the fixed template then covers only part of what the model sees.

Sources

  • Bach SH, Sanh V, Yong ZX, Webson A, Raffel C, Nayak NV, et al. PromptSource: an integrated development environment and repository for natural language prompts. Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics: System Demonstrations. 2022:93-104. https://doi.org/10.18653/v1/2022.acl-demo.9
  • Liu NF, Lin K, Hewitt J, Paranjape A, Bevilacqua M, Petroni F, et al. Lost in the middle: how language models use long contexts. Transactions of the Association for Computational Linguistics. 2024;12:157-173. https://doi.org/10.1162/tacl_a_00638
  • 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
  • Mizrahi M, Kaplan G, Malkin D, Dror R, Shahaf D, Stanovsky G. State of what art? A call for multi-prompt LLM evaluation. Transactions of the Association for Computational Linguistics. 2024;12:933-949. https://doi.org/10.1162/tacl_a_00681
  • National Institute for Health and Care Excellence. AI methods for evidence framework (ECD20). NICE; published 9 November 2026. Chapters on introduction to AI in NICE decision making, principles for using AI in evidence activities, AI methods for evidence synthesis and AI methods for health economic evaluation, and Appendix A glossary. https://www.nice.org.uk/corporate/ecd20
  • Schmidt L, Hair K, Graziosi S, Campbell F, Kapp C, Khanteymoori A, et al. Exploring the use of a large language model for data extraction in systematic reviews: a rapid feasibility study. 3rd Workshop on Augmented Intelligence for Technology-Assisted Review Systems (ALTARS 2024). 2024. https://arxiv.org/abs/2405.14445
  • 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

Library

Publications

1
  • 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.

Frequently Asked Questions (6)

  • What is Prompt Template?

    A prompt template is a reusable prompt pattern for a large language model, with placeholders filled per case, such as each abstract in a systematic review.

    Source: NICE ECD20 (2026)

  • How does NICE ECD20 expect a prompt template to be used for title and abstract screening in a systematic review?

    NICE ECD20 (2026) regards sending each title and abstract on its own through an API, with the same validated prompt template every time, as a more dependable route to consistent and reproducible screening than batching many records in one chatbot session. In that second route, long conversations and context window limits can weaken performance. The template should be tuned on development records kept apart from the records being screened, although a pilot may still refine it before the main run. The example screening template in ECD20 has tagged gaps for the protocol, title and abstract and limits the reply to one character, which also cuts cost.

    Source: NICE ECD20 (2026)

  • What should be recorded and reported about a prompt template used in HTA evidence work under NICE ECD20?

    NICE ECD20 (2026) suggests that teams using generative AI keep a prompt library, so the templates behind each piece of work can be found again. For discrete tasks where a human stays fully in the loop, it sees sharing prompt templates together with model names and version numbers as an aid to transparency. For data extraction it asks reports to set out the extraction rules and templates and to state how many items were captured for each element of interest. Re-validation should be considered when prompts change substantively, and swapping the model behind an unchanged template is also a change of model.

    Source: NICE ECD20 (2026)

  • How does the wording of a prompt template for extracting health economic model inputs affect the results?

    Schmidt and colleagues tested GPT-4 for data extraction in systematic reviews with a system instruction that asked for a JSON object of a set shape and for false to be returned when a field's data were absent. The prompts proved sensitive to small changes of wording, to an item's position in the sequence of prompts and even to the label given to each output field, with n_participants working much better than study_size. Field names and definitions in a template for model inputs therefore need testing on development trials before use. Every extracted item still has to be checked against the primary source, the condition NICE ECD20 sets for accepting AI extraction.

    Source: Schmidt et al. 2024

  • Why does the score from one prompt template not show how well a language model performs an evidence review task?

    Mizrahi and colleagues evaluated 20 language models on paraphrased instruction templates for 39 tasks and found that equivalent templates gave very different absolute scores and model rankings. T0pp ranked first on one task under one paraphrase and ninth under another. A team that compares models for an HTA task on a single prompt template may therefore be comparing the template as much as the models. The authors accept that a developer fitting a model to one downstream task can choose its best template, provided the choice is confirmed on a fresh sample of cases, which matches the held-out data that NICE ECD20 asks for.

    Source: Mizrahi et al. 2024

  • How does a prompt template differ from the prompt actually sent to a language model?

    In the 2023 survey by Liu and colleagues, a template is a text string with an input slot for the case and an answer slot for the text the model will produce. Filling the input slot turns the template into a prompt, so the template is the reusable pattern and the prompt is the filled text sent in one call. The survey also separates static templates, where one pattern serves every input, from dynamic ones built afresh for each input. A hand-written screening template applied to every abstract in a systematic review is of the static kind.

    Source: Liu et al. 2023

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-102

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-template