Separating instructions from context and input data in prompt templates
Key Takeaway
Put the data a prompt template works with, such as merge field values, inside triple quotes ("""), and keep the instructions outside them. Using triple quotes is the most important technique for organizing complex prompts.
A prompt template mixes two kinds of content: instructions that tell the model what to do, and data the model should work with, such as merge field values from a record. When the two blur together, the model can mistake data for extra commands. The template also becomes hard to read, update and troubleshoot. Fencing the data inside triple quotes keeps instructions and data clearly apart.
Instructions and data in a prompt template
A prompt template combines two kinds of content:
| What it includes | |
|---|---|
| Instructions: what you want the model to do | The task, instructions, tone and length |
| Data: the information the model should use | Relevant CRM data that merge fields pull in from a record |
When both kinds sit in the same sentences, the model can treat the data as extra instructions. Mixing data and instructions also makes the prompt hard to parse. Without a clear separation, these problems appear:
- Merge fields blend into the sentences, so updates are error-prone.
- There is no clear boundary between instructions and data.
- It is hard to tell which merge field is which.
- Failures are hard to troubleshoot.
A well-structured prompt produces repeatable output, not just better output. Repeatable output is what makes a prompt useful in a business context.