← All questions
LLM FoundationsHard· Prompting & Context Construction

Your RAG system's accuracy changes noticeably when you...

This is a documented, reproducible phenomenon, not measurement noise: LLMs are genuinely sensitive to surface-level formatting choices — whether retrieved passages are separated by newlines or explicit delimiters, whether fields are labeled, even whitespace choices — in ways that move accuracy meaningfully despite the underlying content and question being identical.

The practical implication is that prompt format isn’t an incidental implementation detail you settle once and forget; it’s a variable that needs the same evaluation discipline as a model or retrieval change. Two useful defenses: measure sensitivity directly (comparing outputs across several structurally different but semantically equivalent prompt formats, rather than assuming any one format is “the” format), and treat few-shot examples in the prompt as a lever specifically for reducing that sensitivity — a small number of well-chosen examples tends to stabilize behavior across format variations more reliably than simply using a larger model with no examples at all.

Code playground (Python)