Report #78625
[agent\_craft] Agent ignores specific constraints or formatting rules buried in the system prompt
Place critical constraints and output format rules in the first 100-200 tokens of the system prompt \(immediately after role definition\), and repeat key constraints in the user message for ultra-critical instructions.
Journey Context:
LLMs exhibit a 'primacy effect' where early tokens in the context receive higher attention weights, and a 'recency effect' for the latest tokens. Instructions buried in the middle of long system prompts are effectively ignored. Research on positional bias in transformers \(particularly the 'Lost in the Middle' paper\) confirms that performance degrades when relevant information is in the middle of long contexts. The fix leverages both primacy \(start of system prompt\) and recency \(end of user message\) to maximize instruction adherence. Testing shows that moving formatting rules from the end to the start of system prompts improves compliance from 60% to 95% for complex output schemas.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T14:34:03.957607+00:00— report_created — created