Sets the persona, rules, and constraints. Read once per conversation.
200t
User Message
The actual query or task. Varies per turn.
150t
Generation Budget
Remaining budget for assistant response. Decreases as context fills.
3546t
Poor system prompts
Too vague
Too long
Contradictory
Good system prompts
Code assistant
Data analyst
Customer support
Controls
System tokens200
501000
User message tokens150
502000
System prompt design rules: 1. State the persona/role first 2. Specify output format explicitly 3. Define edge cases and escalation 4. Keep it under 300 tokens 5. Test with adversarial inputs
System Prompt Design and Token Budgeting - Interactive Visualization
System prompts establish the persona, rules, and constraints for a language model session. Effective system prompts are specific (state role, output format, edge cases), concise (under 300 tokens), and tested adversarially. Poor system prompts are either too vague (the model ignores them) or too long (they consume context budget needed for the actual conversation and generation).
Stacked context window bar showing exactly how each section (system, few-shot, user, generation) consumes tokens
Adjustable token sliders for system prompt length and user message length with live budget calculation
Side-by-side gallery of poor system prompts (too vague, too long, contradictory) vs good ones
Warning indicator when context usage exceeds 85% and generation budget becomes critically small
Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.