Order the layers you'd investigate when debugging a RAG faithfulness regression that just shipped to production, from most likely to least likely cause.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Order debugging hypotheses by base rate, not by what's easiest to blame: check the prompt diff first, then model version, then run an isolated retrieval eval, and treat query drift as the last resort.
Imagine the office printer suddenly prints garbage. You don't start by suspecting cosmic rays. You first check what changed most recently and most easily: did someone load the wrong paper or swap a setting? Only after the obvious culprits do you investigate slow, weird causes like a failing internal part. Debugging a RAG system that suddenly gives ungrounded answers works the same way. The thing engineers touch most often is the prompt template, which ships to everyone the instant it merges. Next is the model version, which lives in config and can silently change. Then you check retrieval quality, but that needs a careful repeatable test. The user's questions slowly changing is real, but it's slow and the hardest to confirm, so you save it for last.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: define the regression, justify the base rate ordering layer by layer, and explain the isolated retrieval experiment plus the eval-gate fix.
| Layer | Base-rate of change | Cost to confirm | Triage rank |
|---|---|---|---|
| Prompt template | High, edited weekly, ships at 100% on merge | Trivial, git diff | 1st |
| Model version | Medium, can change in a config deploy | Cheap, config diff | 2nd |
| Retrieval quality | Medium, but needs reproducible eval | Expensive, replay fixed eval set | 3rd |
| Query drift | Low and slow, a trend not a step | Slowest, compare distributions over time | 4th |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Debugging by suspicion instead of base rate. Engineers blame the LLM or retrieval first because they're mysterious, while the prompt diff, the highest probability cause, sits unread.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.