prompt template
In plain wordsA reusable prompt with blanks to fill in — for example, 'Summarize this email for a busy manager: {email}' — so a program can send the same tested instructions with different content each time.
A parameterized promptprompt, n.: The message or instructions you give an AI system — a question, a request, some examples or a document — that it responds to. Clearer prompts generally get better results. containing fixed instructions and named placeholders that software fills at run time with inputs such as user questions, retrieved passages, examples or dates, using string formatting or a templating language such as Jinja. Templates separate stable, tested instructions from changing data, so they can be versioned, evaluated and reused across calls; frameworks such as LangChainLangChain, prop. n.: A popular free software toolkit, and the company behind it, for building applications that connect AI language models to documents, databases, tools and multi-step workflows. and DSPyDSPy, prop. n.: A free software framework in which programmers describe what each step of an AI pipeline should do, and the framework automatically works out good prompts and examples instead of hand-writing them. and prompt managementprompt management, n.: Treating the written instructions given to AI models like valuable code: storing them in one place, tracking every change, testing new versions and rolling back bad ones. tools are organized around them. In the earlier prompt-based learning literature, a template wraps an input in a pattern with a slot for the model to fill (for example 'X. Overall, it was a [MASK] movie.'), and a verbalizer maps the filled word to a label. Inserting untrusted text into a template is a common route for prompt injectionprompt injection, n.: Tricking an AI system by slipping in text that it mistakes for instructions — for example, a hidden line in an email telling an AI assistant to forward the user's messages to a stranger..
Change the prompt template once and every support-ticket summary picks it up.
Origin
Templates with slots were central to 2020–2021 prompt-based learning, such as Timo Schick and Hinrich Schütze's pattern–verbalizer pairs, and were systematized in Pengfei Liu and colleagues' 2021 survey. The PromptSource project (2022) collected templates for many public datasets, and LLM application frameworks made 'prompt template' a standard engineering term from late 2022.
Usage note
Not the same as a chat templatechat template, n.: The exact text layout a chat AI was trained on for marking who is speaking — system, user or assistant. Software must reproduce it precisely, or the model performs noticeably worse., which formats role-labeled messages into the token sequence a particular model expects; a prompt template produces the content of those messages.
Related
- promptprompt, n.: The message or instructions you give an AI system — a question, a request, some examples or a document — that it responds to. Clearer prompts generally get better results.
- chat templatechat template, n.: The exact text layout a chat AI was trained on for marking who is speaking — system, user or assistant. Software must reproduce it precisely, or the model performs noticeably worse.
- prompt engineeringprompt engineering, n.: The skill of writing requests to an AI — picking the words, examples, format and background information it receives — so that it reliably gives the result you want, without retraining it.
- prompt managementprompt management, n.: Treating the written instructions given to AI models like valuable code: storing them in one place, tracking every change, testing new versions and rolling back bad ones.
- few-shot promptingfew-shot prompting, n.: Showing an AI a handful of examples of a task — inputs with the answers you want — inside the prompt, so it can copy the pattern for a new case.
- LangChainLangChain, prop. n.: A popular free software toolkit, and the company behind it, for building applications that connect AI language models to documents, databases, tools and multi-step workflows.
- chat templatechat template, n.: The exact text layout a chat AI was trained on for marking who is speaking — system, user or assistant. Software must reproduce it precisely, or the model performs noticeably worse.
Sources
- Liu, P., Yuan, W., Fu, J., Jiang, Z., Hayashi, H. & Neubig, G. (2023). Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processing. ACM Computing Surveys 55(9). arxiv.org/abs/2107.13586v1
- Bach, S. H. et al. (2022). PromptSource: An Integrated Development Environment and Repository for Natural Language Prompts. ACL 2022 System Demonstrations.
Mentioned in
promptprompt, n.: The message or instructions you give an AI system — a question, a request, some examples or a document — that it responds to. Clearer prompts generally get better results., chat templatechat template, n.: The exact text layout a chat AI was trained on for marking who is speaking — system, user or assistant. Software must reproduce it precisely, or the model performs noticeably worse., prompt managementprompt management, n.: Treating the written instructions given to AI models like valuable code: storing them in one place, tracking every change, testing new versions and rolling back bad ones.