Prompt Design at Scale: How Format, Instruction Count, and Context Length Shape Instruction Adherence and Hallucination in Large Language Models
Summary
A study on prompt design for Large Language Models (LLMs) investigated how instruction format, count, and context length affect instruction adherence and hallucination. Using a synthetic corpus, "Book of Veyra," across five models, two controlled experiments were conducted. Experiment 1, involving 960 calls per model, found that instruction-following collapsed to a zero perfect-response rate by 80 rules, regardless of format or placement (system-prompt vs. user-turn). No consistent markdown advantage was observed; one 35B model even preferred plain text. Experiment 2, with 5,520 calls per model, showed recall accuracy remained high through 64-128k tokens before sharp, format-dependent degradation, with one model's accuracy spread reaching 48 points at 128k tokens. Fabrication was absent (0/5,760 probes), and sycophancy was negligible (<=8.3%), but refusal to answer sharply increased to 79-90% near context limits. Token overhead of +22% to +37% for non-plain text formats also influenced performance. The researchers released the VeyraBench harness, corpus generator, and raw results.
Key takeaway
For Prompt Engineers designing complex LLM applications, you must critically evaluate instruction count and context length. Your instruction sets should ideally remain below 80 rules to prevent complete adherence failure. Furthermore, for tasks requiring high recall, keep your context windows under 64k-128k tokens to avoid sharp accuracy degradation and increased refusal rates. Do not assume markdown offers a universal advantage; test plain text, as it can perform better and reduce token overhead for your specific model.
Key insights
LLM instruction adherence and recall degrade significantly with increasing instruction count and context length, with format effects being model-specific.
Principles
- Instruction-following collapses by 80 rules.
- Recall degrades sharply beyond 64-128k tokens.
- Prompt format impact is model-dependent.
Method
Two controlled experiments crossed instruction format, count, and context length on a synthetic corpus ("Book of Veyra") across five LLMs, measuring adherence, recall, and hallucination.
In practice
- Limit instructions to under 80 per prompt.
- Keep context under 64k-128k tokens for recall.
- Test formats like plain text; markdown isn't always superior.
Topics
- Prompt Engineering
- Instruction Adherence
- Context Length
- Large Language Models
- Model Evaluation
- Hallucinations
Code references
Best for: AI Engineer, NLP Engineer, AI Architect, AI Scientist, Prompt Engineer, Machine Learning Engineer
Related on AIssential
See Counsel's argued verdicts on the open AI decisions leaders are weighing →
Editorial summary, takeaway, and curation by AIssential. Original article published by Takara TLDR - Daily AI Papers.