Quiet Failures: Where RAG Quality Comes From
Working draft. I'm still revising this piece, so it may change.
In November 2022, a traveler asked Air Canada’s website chatbot about bereavement fares after his grandmother died. The chatbot told him he could book at full price and apply for the discount within 90 days. The airline’s actual policy, on a page the chatbot linked in that same answer, said the discount didn’t apply once travel was complete. When the case reached a British Columbia tribunal in 2024, the airline argued it couldn’t be held liable for what its chatbot said. The tribunal disagreed.
Nothing in that system crashed. No alert fired. The correct answer sat one click from the wrong one, and the system delivered the wrong one smoothly and with confidence.
That’s the kind of failure this piece is about: the quiet kind. I don’t know how that chatbot was built, so I won’t guess at the cause. But it’s the failure I spent much of 2023 learning to hear in retrieval-augmented generation (RAG), and it’s the one most RAG programs are still set up to miss.
The common approach
Most readers know the shape of RAG by now. The retriever-and-reader pattern for answering questions goes back at least to DrQA in 2017, and a 2020 paper from Facebook AI gave it the name retrieval-augmented generation. The standard build looks like this:
- Split the documents into chunks of a fixed length.
- Convert each chunk into an embedding, a list of numbers that places similar text close together.
- When a question comes in, embed it the same way and retrieve the closest chunks.
- Put those chunks and the question into a prompt.
- Have a language model write the answer.
Evaluation usually happens at the end. Someone asks a set of questions and reads the answers, or an LLM grades them. When the answers disappoint, the usual fixes are a bigger model, a more carefully worded prompt, a longer context window, or a new platform.
This approach is reasonable, and it demos well. Most teams that use it are capable people making sensible choices with the tools in front of them, so I’d rather describe it fairly than argue with a caricature.
Where it plateaus
Look at where those fixes act. A bigger model, a better prompt, and more context all work on the last step, generation. If the passage that answers the question never made it into the prompt, none of them can help. A stronger model handed the wrong passage writes a more fluent wrong answer.
An econometrician would recognize the structure. RAG is a two-stage process, and a better second stage can’t rescue a weak first stage. Retrieval sets the ceiling: if the right passage reaches the model 70% of the time, generation can’t push correctness much past 70%, however capable the model.
Judging only the final answer hides this. A wrong answer caused by retrieval and a wrong answer caused by generation look identical at the end, and they call for completely different investments.
Measuring each stage
In spring 2023 I was building a system to help underwriters find answers in their company’s own guidelines. The generation model was FLAN-T5-XXL, run locally, with a context window measured in hundreds of tokens. That constraint turned out to be useful. With so little room, we couldn’t cover weak retrieval by stuffing in more text, so every chunk had to earn its place.
We treated the system as a chain of stages and put a measure on each one. A few of the decisions that came out of that work:
- We cleaned the documents before chunking them. Guidelines carry a lot of repeated boilerplate. Removing it left fewer vectors to embed, store, and search.
- We chunked by structure rather than by length alone. Headings set boundaries, tables were kept intact, images were summarized into text, and the overlap between chunks adjusted to the content.
- We kept numbers out of the embeddings. Embeddings capture meaning well and specific values poorly. Numeric values stayed attached to their place in the text by reference, so retrieval found the right passage and the passage carried the right number.
- We tested keyword and hybrid search against embedding search. Guidelines are full of exact terms, where matching the words matters as much as matching the meaning.
We tested each choice against a labeled set of questions where we knew which passages should come back.
What the measurements said
Three findings shaped everything that came after.
When underwriters rated an answer poorly, the cause was usually retrieval. The model had been handed the wrong passage, or an incomplete one.
When the right context was retrieved, answers from different generation models rated about the same. For the lookup questions underwriters mostly asked, the model shaped the style of an answer more than whether it was right. I’d expect that to hold less for questions that combine several passages or work through exceptions, where stronger models earn their cost. For our workload, the model was rarely the bottleneck.
An LLM couldn’t yet grade the answers for us. We compared the judge’s scores for answers users rated good against its scores for answers they rated poor, and the two distributions overlapped. A grader that gives good and bad answers the same scores is measuring nothing useful. Judges have improved since, and some would pass that test today. The lesson that lasted is to validate an instrument against human judgment before trusting it.
The results followed from putting effort where the measurements pointed. Underwriters’ time spent researching guidelines fell 95%, and answers came back in seconds. The projected annual run cost came in about 99.9% below the projected run cost of a competing build, and most of that came from three design choices: chunking tuned to retrieval, tightly scoped prompts that kept answers short, and caching answers to questions already asked so we didn’t pay to generate them twice.
Two kinds of quiet
The boilerplate cleanup is the example I return to most, because one defect showed up as two different quiet failures.
On the engineering side, boilerplate bloated the index. More vectors meant more storage, slower searches, and higher cost. Nothing broke. The system just got heavier.
On the statistical side, near-identical boilerplate chunks crowded the top of the retrieval results. A question about a specific condition could pull back several copies of the same standard language and push the passage that mattered out of the few slots the model would see. Nothing broke there either. The answers just got a little worse.
One fix addressed both, and that’s why I treat science and engineering as equal partners in this work. There’s an active debate in our field about whether building AI products still needs statistical training, or whether strong software engineering is enough. In my experience, each discipline hears failures the other misses.
Engineering failures tend to be loud. A pipeline throws an error, and someone fixes it. Statistical failures tend to be quiet. A model with data leakage, or a retriever returning near-duplicates, runs cleanly and produces confident output. Engineering has its quiet failures too, like an index slowly filling with noise.
Excellent engineering built on a flawed measurement can ship something that doesn’t work at all. Sound measurement with adequate engineering usually ships something that does. The teams I trust have both, and they can hear both.
Knowing when to stop
Measurement has a cost, and part of the job is knowing when more of it won’t pay for itself. Economists call this the value of information: measure further only when the answer could change a decision.
Early on, we agonized over retrieval quality, and every check took weeks. Over many iterations we learned which patterns signaled trouble, and we built a faster check around them. Once the approach was tuned, we kept checking as we added documents, but a check took a few hours instead of weeks. We could have gone deeper. We didn’t, because the deeper checks had stopped finding anything that would change what we built.
The prompt template followed the same pattern. Its job was to act as a guardrail, keeping answers grounded in the retrieved text and saying so when the answer wasn’t there, and to return answers in a style underwriters found useful. It reached that standard quickly. Another team took on further improvements while we built the rest of the system, and after two months the results were where we’d left them.
I expected that outcome. The remaining errors came from rare edge cases that barely moved the metrics, and the edge cases that mattered were already handled. The curve had flattened.
Good enough is a real standard, as long as it’s a measured one. What I want from a team is the ability to tell good enough from not enough, and to say which one we’re looking at.
What’s changed since 2023
Two developments would change how I’d build this today.
Context windows can now hold an entire set of guidelines. For a small, stable collection of documents, putting everything in the prompt and caching it may now beat retrieval on cost and simplicity. It has trade-offs. Long prompts cost more per question and add latency, models can still miss material buried in the middle of a long context, and retrieval makes it easier to respect who is allowed to see what. For some collections it’s a real alternative, and it deserves a priced comparison before anyone picks a default.
Agents now decide what to search for. Many systems let an agent search, read, and search again. That makes the first-stage problem more frequent, because every search an agent runs is a retrieval step that can fail quietly. The same discipline applies: measure the searches as well as the final answer.
How I teach it
When I built RAG material for UConn’s MS in Quantitative Economics program, I put retrieval evaluation before generation. Students label which passages should answer each question, then measure precision and recall at k before they ever call a language model.
Economists take to this quickly, because it’s a measurement problem built on questions they already ask. What is the estimate? How noisy is it? Would a better estimate change my decision? The student notebook and the mentor project guide are public if you’d like to use them.
If you build these systems
- Label which passages should answer a set of real questions, and measure retrieval on its own before judging answers.
- Validate any automated grader against human ratings before trusting its scores.
- Decide in advance what result would change your next decision, and stop measuring once nothing will.
The costliest failures in RAG never throw an error. Measuring each stage is how you hear them, and how you know when what you have is good enough.