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 at scale investigated how instruction format, instruction count, and context length influence instruction adherence and hallucination in large language models. Two controlled experiments, using the "Book of Veyra" synthetic corpus across five models, revealed key findings. The first experiment, with 960 calls per model, measured instruction-following decay as rule counts increased from 10 to 160. It found that the perfect-response rate collapsed to zero by N=80 for all models and formats, with no consistent markdown advantage. The second experiment, with 5,520 calls per model, assessed recall accuracy, sycophancy, and fabrication across context lengths from 2k to 512k tokens. Recall remained high through 64-128k tokens before sharp degradation, with one model showing a 48-point accuracy spread at 128k tokens. Fabrication was absent, and sycophancy negligible, but outright refusal to answer surged from 0% to 79-90% near context ceilings. The VeyraBench harness and results are publicly available.
Key takeaway
For prompt engineers optimizing LLM performance, understand that instruction adherence collapses rapidly beyond 80 rules, and recall degrades sharply past 64-128k tokens. You should prioritize concise system prompts and manage context length carefully to avoid outright refusal, which surges at context ceilings. Experiment with plain text formats, as markdown offers no consistent advantage and adds token overhead, to ensure your applications remain reliable and efficient.
Key insights
Large language models' instruction adherence and recall degrade significantly with increasing prompt complexity and context length, often resulting in refusal.
Principles
- Instruction adherence collapses by N=80 rules.
- Recall degrades sharply beyond 64-128k tokens.
- Refusal to answer increases near context limits.
Method
A controlled experimental harness, VeyraBench, systematically varied prompt format, instruction count, and context length using a synthetic corpus to evaluate instruction adherence, recall, sycophancy, and fabrication across five models.
In practice
- Limit system prompt instructions to <80.
- Keep context under 64k-128k tokens.
- Test plain text over markdown for formats.
Topics
- Prompt Engineering
- Large Language Models
- Instruction Following
- Context Length
- Recall Accuracy
- VeyraBench
Code references
Best for: AI Engineer, NLP Engineer, Research Scientist, AI Scientist, Machine Learning Engineer, Prompt 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 Artificial Intelligence.