Should the system prompt remain identical across all turns of a conversation, or vary per turn?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Keep the system prompt stable across turns to enable prompt caching and consistent behavior; put per-turn dynamic data in the user message, not the system block.
Think of the system prompt as the standing instructions you give to a new employee on day one: who they are, what they do, how they should behave. You do not rewrite the job description every time they answer a customer call. You let the standing instructions stay put and the customer-specific details show up in each conversation. Language models work the same way. The system message is the standing instructions; user messages are the per-call details. Rewriting the standing instructions every turn confuses the model and throws away a big cache discount the provider gives you for keeping prefixes stable.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: the two reasons system stability matters (caching + behavior consistency), where dynamic data belongs, and how to handle mid-conversation mode shifts.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Editing the system prompt every turn with dynamic context, which invalidates the provider cache and produces inconsistent behavior across the conversation.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.