RAG isn't dead, but unverified RAG should be. Here's what checking every sentence actually cost me on Groq's free tier, and a few other things I learned along the way.
I rebuilt my RAG system so that no sentence reaches the user until it has been checked against the passage it cites. The first sentence started showing up sooner, and nothing unverified was ever shown.
Then I ran it under heavy overload. It delivered 62.8% of requests. The old version delivered 67.4%.
Honestly this one hurt a bit, because my own safety feature was the reason. I will explain it below.
That run also changed how I read the "RAG is dead" posts. Yes, context windows are huge now, and coding agents find things with grep instead of vector databases. But none of that answers the question that actually cost me those requests: who checks the answer?
TL;DR
- Checking every sentence made answers appear sooner, but under heavy load it cost throughput: 62.8% delivered against 67.4%.
- When 30 requests came in 2 seconds, the system made only 6 model calls. Same questions share one answer.
- The cheapest correct answer is a refusal that never calls the model.
- My slowest request spent 29.2 of its 29.8 seconds just waiting in a queue.
- A small "is this sentence supported?" judge model would have blocked about 1 in 5 good sentences.
What I built
The Relay answers questions only from three research papers: Attention Is All You Need, Moshi and H-Net. Every sentence must cite the passage it came from. If the papers don't say something, it has to say so instead of guessing. And it has to survive Groq's free tier while requests come in bursts.
The flow is: queue → cache → retrieval (BM25 plus embeddings) → evidence check → model call → per-sentence verification. No LangChain, no vector database. The papers make only about a thousand chunks, so plain NumPy search takes under a millisecond.
You can try it without any API key. It ships with a stand-in model that I calibrated from real Groq measurements and most of my load tests ran against that.
1. "RAG is dead" is really about retrieval. My problem was trust.
The good "RAG is dead" arguments aren't saying what the headlines say. This AI Engineer talk points out that grep and BM25 are retrieval and the debate mixes up RAG with vector search. This post by Akita argues that agents are moving to big context and simple text search.
I agree with both. But my requirements were:
- Answer only from these papers.
- Show where each claim came from.
- Say no when the papers don't cover it.
A bigger context window doesn't give you any of these. A model with all three papers in front of it can still write a sentence the papers don't support. On a free tier, sending all three papers with every question would also blow past the per-minute limit straight away. (To be fair, I didn't test a long-context version, so I'm not claiming it gives worse answers.)
So retrieval isn't dead. The mandatory vector database might be. Answering without checking should be.
2. When everyone asks at once, ask the model once
Bursts are when things break: something goes wrong, and suddenly everyone asks the same thing at the same moment.
So I added SingleFlight. If the same question is already being answered, a new request doesn't make its own model call. It just waits for that answer and gets the same verified sentences. Once the answer is done, repeats come straight from the cache.
In my burst test, 30 requests arrived within 2 seconds, but there were only 6 different questions. The result:
| What happened | Requests |
|---|---|
| Made a model call | 6 |
| Joined a call already in progress | 17 |
| Served from the cache | 7 |
| Delivered | 30 of 30 |
That's 30 answers from 6 model calls, one per distinct question. On a free tier, this is the difference between serving everyone and getting rate-limited in the first few seconds.
It also works with more than one server. With Redis shared between workers, my tests send 10 identical requests to two workers at the same time, and they make exactly one model call in total.
3. The best "no" never calls the model
I wrote 21 test questions. Six of them the papers can't answer: blockchain, photosynthesis, the TCP handshake, Newton's laws, MySQL vs MongoDB, and one trap.
Across three retrieval settings, the system said no correctly on all 17 graded cases. The 18th hit a network error, and I left it in the results as an error rather than quietly re-running it.
The interesting part is how. With reranking on, five of the six were refused before any model call, because no passage was relevant enough to answer from. No quota spent, just an honest "the papers don't cover this."
4. Three papers can still fool a naive retriever
The bibliography trap. I asked how WavLM is pretrained. The Moshi paper uses WavLM and cites it, so the keywords match strongly, but it never explains WavLM's pretraining. A naive system finds those passages and the model fills the gap from memory. My widest retrieval setting fell for it.
Shared words. "Transformer", "attention" and "chunk" appear in all three papers, so they can't be trusted to tell the papers apart.
Broken PDF text. The attention formula came out garbled when the PDF was converted to text. One answer picked up a stray 0 from it, the checker caught it, and the user got a safe refusal. That was technically a wrong refusal, but it was wrong in the safe direction, and I'll take that trade every time.
5. Two reasoning models thought until they ran out of room
I compared three Groq models on the same six questions. On three of them, both gpt-oss-20b and gpt-oss-120b used their entire output limit on thinking and never wrote an answer. qwen3.8-27b was never cut off, and every answer passed the citation checks. I picked qwen.
Reasoning models aren't bad. But test the model inside your own limits, not on a leaderboard.
6. Read the rate-limit headers carefully
Groq's x-ratelimit-limit-requests: 1000 header looked per-minute to me at first. But its reset time grew by exactly 86.4 seconds per request, and 86,400 seconds in a day divided by 1,000 is 86.4. So it behaves like a daily limit. I haven't proven it, because that would mean watching it refill for hours (Groq's [rate limits page] has the official numbers.)
My quota guard therefore checks the budget before every call, and there are no hidden retries: every retry is counted. In a test where 30% of calls failed on purpose, a retry limit cut extra attempts (1.27 per request against 1.41), but with the limit on, 2 requests failed, and in the run without it, none did. I still keep the limit, because in a real outage, extra retries only hit a provider that is already struggling.
7. Your slow request is probably a queue
Under overload, my slowest request took 29.8 seconds. Of that, 29.2 seconds was waiting for quota. The actual work, retrieval plus the model, took about 0.6 seconds.
We usually blame the model when things are slow. Under load, my problem was the queue. I could only see that because every request records its waiting, working and retrying time separately.
8. Safety has a cost, and mine showed up under overload
v1 waited for the full answer, checked it, then sent it all at once. v2 checks each sentence as it streams. If a sentence fails, the answer stops there, and the bad sentence is never shown.
In normal bursts, this helped: the first verified sentence arrived in a median of 324.5 ms, where v1 showed nothing until the whole answer was ready (614.2 ms median).
Under heavy overload, though, v2 delivered 62.8% against v1's 67.4%.
The reason: when the checker stops an answer halfway, the model stream is cancelled, but the quota reserved for that call stays used for the rest of the minute. Seven answers were stopped early in that run. That held-up quota was worth about three calls, and v2 made exactly three fewer calls than v1.
I fixed the part on my side, and delivery went up from 55.8% to 62.8%. The rest is quota held by the provider. One important caveat: I measured this on my stand-in model. I don't know yet whether Groq gives that quota back on a cancelled stream. If it does, most of this gap may not exist in real use.
So the trade-off is clear: users see verified sentences sooner and never see a wrong one, and under heavy load, slightly fewer people get an answer.
9. Test your judge model before trusting it
The obvious next step was a small AI model that judges whether a passage really supports a sentence. I scored 224 real sentences with one. At the usual 0.5 threshold, it would have blocked about 1 in 5 good sentences, and still missed more than a third of the bad ones.
So it only records a score and blocks nothing. A judge model has its own error rate, so measure it before you let it decide anything. (The labels I compared against were drafted with AI help, and I haven't reviewed them myself yet, so treat these rates as rough.)
What I'm not claiming
- Answer correctness isn't final. Strict word matching marked 19 of 45 answers correct, but most of the "wrong" ones were flagged only because one exact phrase was missing, and several look like simple wording differences. I haven't graded them by hand yet. Citation checks are the firmer number: 44 of 45 passed.
- Most load numbers come from the stand-in, not real Groq. I kept real calls few on purpose, to protect the free quota.
- The samples are small, so small differences are within noise.
- The judge-model analysis isn't public yet. The raw data behind every other number is in the repo linked below.
So, is RAG dead?
The version where you embed everything, grab the top five chunks and trust whatever the model says, yes, that should go.
What should stay: find the right passages, cite them, check every claim before showing it, say no when the evidence isn't there, and plan for your limits. Whether you find those passages with vectors, BM25, grep or a huge context window matters much less than whether anything checks the answer.
Over to you all: when a sentence fails the check halfway through a stream, what would you do? Stop and lose the quota like I do, or let the model finish and throw the rest away? I'm really curious what you'd pick, and why.
Follow up post - https://dev.to/ayush_singh321/my-simulation-exaggerated-the-cost-of-my-own-safety-feature-565p
Top comments (99)
The mechanism you found is the part most safety write-ups never reach: the checker stops an answer halfway, the stream is cancelled, but the quota reserved for that call stays spent for the rest of the minute — so seven stopped answers quietly cost about three calls, which is exactly the three-call gap between v2's 62.8% and v1's 67.4%. The safety feature didn't slow the work; it taxed the budget the work runs on. The queue number makes the same point from the other side — 29.2 of 29.8 seconds waiting, 0.6 seconds of actual work — and you could only see either number because waiting, working and retrying are recorded separately. We learned the matching lesson with a release gate that fails closed: the check itself is cheap, what it costs is everything downstream that has to stop and wait for it. Your honest caveat is that this was measured on the stand-in model — do you plan a smaller real-Groq run to settle whether cancelled-stream quota actually comes back, since that one answer decides whether the 62.8-vs-67.4 gap exists outside the simulation?
Thank you you explained it better than I did: the safety check didn't slow the work, it taxed the budget the work runs on.
I like your release-gate example too. The check is cheap, but everything behind it has to wait. One small detail: v2 made 3 fewer calls than v1 (53 against 56), but delivered 4 fewer answers (54 against 58), so the lost quota explains most of the gap, not all of it. And yes, a small real-Groq test is the next thing I want to do .
The plan is simple that send a few requests, cancel some of them early and let the others finish, then compare x-ratelimit-remaining-tokens after each. Tokens refill all the time, so I will repeat it a few times instead of trusting one reading. It needs only a handful of calls and doesn't come anywhere near the limit. If Groq gives the quota back, most of this gap may not exist in real use. If it doesn't, then letting the stream finish quietly may be better than stopping it. I'll share the result here when I have it
That correction matters, and credit for making it against your own headline number: 3 fewer calls but 4 fewer answers means the cancelled-quota story explains most of the gap, not all of it — there's a fourth lost answer in there with a different cause, and a write-up that rounds that away would be claiming a cleaner mechanism than the data shows. Your test plan is the right shape, especially repeating it because the tokens refill — a single reading either way would be measuring the refill as much as the refund. One thing to watch when you run it: compare the cancelled and finished readings at the same distance from the minute boundary, since a cancel late in the minute and a finish early in the next could look like a refund that never happened. When the result lands, will you post it as an update to this article or as a follow-up post?
Thank you and you are actually right that I shouldn't round that fourth answer away. Honestly I don't know its cause yet In that run, the missing answers showed up as more "busy" refusals at the door (24 against v1's 19) but I have only one run of each version, so one extra could also be normal variation. I won't claim more than the data shows.
Your minute-boundary point is also a good catch. In my earlier probes, the token reset time was only a few seconds each time so I think Groq refills tokens all the time not once a minute, but I haven't proven it and now Ik that I have to work on it. So I will do what you said let the tokens fully refill before each pair, take the cancelled and finished readings at the same timing and then record the reset time with every reading.
About sharing, I will write it as a short follow-up post and add a note at the top of this article linking to it, so anyone reading this one sees the result too. Thanks for these insights.
Recording the reset time with every reading is exactly the move that turns the refill question from a belief into data — if the refill really is continuous, the readings should show it without you having to argue for it. One run of each is also the honest limit to state: in our own paired work the run-to-run wobble has a habit of being bigger than the effect being chased, so a single extra refusal can't carry a conclusion either way. If refill turns out to be continuous, would spacing since the previous call — rather than position inside the minute — become the variable you log for the finished arm too?
dev.to/ayush_singh321/my-simulatio...
this is the follow up post please check it out once
Seeing delivery drop from 67.4% to 62.8% when adding per-sentence verification is a sobering trade-off, and SingleFlight collapsing 30 burst requests into 6 model calls is a clean way to protect a free-tier quota. Sharing that in-flight state via Redis across workers keeps bursts from multiplying upstream calls. Which queue timeout or shedding rule worked best when those 29-second waits started piling up?
Thank you and Honestly I did not test the each rule alone so I can't say which single one is best but three simple rules work together. First the queue is very small and when it is full a new request is turned away straight away (lower-priority requests are dropped first). Second, at the door the system guesses the waiting time from how many requests are ahead, and if that guess is past the deadline it says "busy" immediately instead of making the person wait. Third and I think this one helped the most, the quota guard knows exactly when quota will free up so if that time is after the deadline it stops the request before calling the model. When I put the deadline check back in v2 the number of people who gave up waiting went down from 18 to 8 in the overload test. One honest thing: my deadline is 30 seconds, and that 29-second request was just under it, so the rules allowed it. A shorter deadline would turn it away earlier, but more people would get "busy" instead of an answer. I am still not sure where the right line is. What deadline do you use in production?
One thing I would add to the judge step, before it ever gates a sentence: treat the judge itself as the thing under test, and give it the same three fixed sets you would give any release gate. One set of sentences the papers plainly support, one of sentences that look supported but are not, the WavLM bibliography case being the exact shape, and one of follow-ups where the same claim sits next to a different passage. Score all three with the threshold written down before the run. Your 224-sentence result is useful, but a single rate over one mixed set cannot tell you whether the judge is weak on unsupported claims or simply mislabelled on supported ones.
The second half is the labels. You flagged that they were drafted with AI help and not reviewed by you yet, which means the judge is currently being scored against a reference no one has audited. I would separate the two errors: have a person read a fixed sample of the labels first, keep that sample frozen, and report the judge's result on the audited part separately from the rest. Otherwise the 0.5 threshold is tuned to a reference that may move, and a later change in the rate could be a change in the labels rather than the judge.
That gives you a concrete release condition instead of a score you merely record. The judge can stay out of the blocking path while you build this, and when it does enter it, the condition is that it fails a known bad sentence in the boundary set and still passes the good ones in the positive set. Until it clears both, recording the score is the honest place to leave it.
Thank you and this is a really a clear plan and I agree that right now the judge is being scored against labels nobody has checked so a change in the rate could just be a change in the labels.
So I will do it in your order:
Audit first: the sentences I read by hand (the 53 disagreements plus a sample of 60) become a frozen, audited set, and I will report the judge on that part separately.
Three fixed sets: clearly supported, looks supported but isn't (the WavLM bibliography case is a perfect example), and the same claim next to a different passage.
Threshold first: I will write it down before the run.
And I like your release condition. Until the judge catches the known bad sentences and still passes the good ones, it stays a score and blocks nothing . After the all results i am going to write a follow up in that i will add all the findings and points.
You published the throughput drop instead of hiding it, which is rare and useful. One other way to check the answer without cancelling a mid-stream generation: have the model only pick IDs of already published passages or FAQ entries, then let a rule verifier reject anything that isn't in those entries before you start streaming. Under burst load that turns a lot of checks into a reuse or a cheap refusal, instead of another reserved quota that gets thrown away halfway. I still think sentence-level checks are valuable when the source is long unstructured text; I just wouldn't want them to be the first and only gate.
Thank you and I really like this idea
Two small updates first that after I measured again with 5 runs each, most of that throughput drop turned out to be a bug in my simulator, not the checker. Now v2 delivers 57.0 of 86 against v1's 57.2 and no streams are stopped halfway. I am going to write a follow-up about it. But your point about wasted quota is real: I tested the real Groq API and a cancelled stream didn't get its quota back within the ~1.6 s I watched.
And I fully agree it shouldn't be the only gate. The Relay already has one check before the model: if the retrieved evidence is weak, it refuses with the no model call at all. The repeated questions also come from the cache or from a call that is already running.
Your "pick IDs only" idea goes one step further. For FAQ-style content it would be very cheap and easy to verify by rule and there would be nothing to cancel. The trade-off is that the model can't combine points from several passages. So I see it like you do: ID selection for structured content and the sentence checks for long unstructured text. I am noting it as a possible "answer mode" to try . Thanks once again for these insights it will really help in exploring things in more detailed.
Thanks for re-measuring and publishing the correction — that is more useful than the original drop. The Groq result is the part I would keep in the follow-up: if a cancelled stream does not return its quota within the window you actually wait, any mid-generation check is still a cost even when the checker itself is cheap. On the ID-only trade-off, I would not treat "combine several passages" as a reason to leave that mode. Let the model pick more than one published entry, compose only from those IDs, and have the verifier reject anything that is not in the selected set. You still get a cheap rule check, and you keep the composition the FAQ case actually needs. Looking forward to the follow-up.
Point 3 is the part I would build on. My memory layer refuses at the same place, before any model call: every search returns trusted, degraded or abstained, and it abstains when nothing clears a threshold. Your result in point 9 is why I don't use a fixed cutoff. The threshold is calibrated on the user's own store, because the same score means different things on different corpora.
Your WavLM case is the hard one for that kind of gate as well. A passage that matches strongly but does not answer still clears a score threshold, and I have not solved that either.
github.com/GiulioDER/RE-call
Thanks Giulio calibrating the threshold on the user's own store makes a lot of sense. My gate uses one fixed rerank cutoff, and it's only tuned on three papers, so I wouldn't trust it on a new corpus without re-tuning. Trusted / degraded / abstained is also better than my yes-or-no gate because a "degraded" result can be passed on with a warning instead of being refused outright. For the WavLM case I haven't solved it at the gate either. I only made it smaller: reference-section chunks get a lower score in fusion and reranking, so they rank lower. The real catch comes after the model, when each sentence has to be supported by the passage it cites. Even that has a gap, because in my follow-up tests the word-level checks let through claims where every word is in the passage but the relationship is wrong. I think "this passage matches" and "this passage answers the question" are two different scores, and a single threshold can't stand in for both. Will check out RE-call
Agreed that they're two different questions. One warning from trying it: I once added a second score for "does this passage answer the question", a small QNLI cross-encoder that demoted hits it judged as not answering. On a coding retrieval test, it cut complete coverage from 0.92 to 0.42, dropped MRR from 0.50 to 0.36 and pushed p95 search time from 0.5 s to 37 s. The second score is real, but a small judge model was the wrong way to get it, at least in my case.
That 67.4% to 62.8% drop under load makes total sense once you look at what the checker is doing to your quota budget, especially if cancelled streams still count against the minute limit. Also really like the SingleFlight + refusal-before-model pattern, since blocking unsupported queries before they ever hit the model is the cheapest latency and quota win you can get.
Testing reasoning models under your actual token cap is a good callout too. I've seen
gpt-ossburn through its output budget just thinking while smaller Qwen models finish cleanly with room left for citations.Thanks and one correction here because I got this wrong in the first post too. When I measured it again, most of that 67.4% vs 62.8% gap was not the checker using up quota. It came from a bug in my stand-in model a slow scoring step that ran before each sentence was sent, and a queue rule. After fixing those v2 delivered actually the same as v1 .
Cancelled streams holding up the quota did show up but only when about 1 in 4 answers were bad (−2.6 answers per run) and real Groq held only part of a cancelled call's quota. Agree on refusing before the model call, it is the cheapest win in the whole pipeline. On reasoning models, I haven't tested gpt-oss myself but that matches what I would expect: under a tight output cap, every token spent thinking is a token not left for citations. Thanks for sharing that
Good to know on the correction. It's a relief when a throughput drop turns out to be a bug in the stand-in setup and v2 actually matches v1 once that's fixed. The partial-quota behavior on cancelled Groq streams is a useful detail to have measured too.
The line that stays with me is that the cheapest correct answer is a refusal that never calls the model. Checking every sentence against the passage it cites costs throughput, but it changes what a user can trust, and most teams only discover that trade once the checker is in.
We saw the same priority in a knowledge platform Ascendra Ventures built for a federal ministry. The answers already existed across parliamentary-question archives, departmental portals, PDFs and transcripts, and keyword search failed whenever a question was phrased differently from the document. The system parses those sources, keeps embeddings in a vector store and links schemes, places and programmes in a knowledge graph, so officials get grounded, cited answers. A question that used to mean a day of compiling now returns a sourced draft in moments. The citation was what people relied on, more than the speed.
Your 29.2 of 29.8 seconds in the queue is a good reminder that the model is rarely the slow part. When the system answers "busy" early, do users retry straight away, or does the honest refusal actually take load off?
Thank you for this great comment And I fully agree that the citation is what people trust, more than the speed.
About your question: honestly, I haven't measured real user retries yet. My load tests send requests on a fixed schedule, and nobody retries. What I can say is that an early "busy" is cheap: the system turns the request away before any model call, so it spends no quota. And if the people retry the same question many of those retries get answered by an in-flight call or the cache instead of a new model call.
But if every user retries instantly, the load comes straight back. So I think the honest "busy" only helps if it also tells the user when to try again. Testing that with a few retry patterns is a good next experiment, thanks for the idea
That 62.8% vs 67.4% drop under overload is a great example of why safety checks need load testing instead of only offline accuracy benchmarks. Spending 29.2 of 29.8 seconds sitting in a queue turns a verification step into a throughput bottleneck way faster than people expect. Sharing one answer across identical concurrent queries and refusing cheaply before calling the model seems like a much bigger win in production than tuning the judge prompt alone.
Thank you and I fully agree that the safety checks need load tests one twist is that when I measured again with 5 runs each the check itself was cheap. Most of the drop came from a bug in my simulator and now the safer version matches the old one (57.0 against 57.2). Sharing answers and refusing early really are the big wins
Thanks for posting the re-test numbers. Catching a simulator bug over 5 runs each and seeing the safer path match baseline at 57.0 against 57.2 is a solid reminder to audit the load harness before chasing phantom verifier overhead.
dev.to/ayush_singh321/my-simulatio...
you can check the follow up post
Sharing one verified stream across identical questions is a useful way to protect the request budget. If the original client disconnects while other callers are still waiting, does the shared generation continue for them? That seems like an interesting companion case to the cancellation tests.
Thank you and its the great question Yes, it keeps going. The shared generation is cancelled only when the last listener leaves. If the first client disconnects while others are still waiting, the model call continues. The followers get the full verified answer, they don't spend any extra quota, and the answer still goes into the cache. If the only client leaves, the call is cancelled straight away and nothing is cached so a new request for the same question starts fresh.
There are tests for both the cases and plus the reverse one (a follower leaving doesn't stop the leader). With several workers sharing state through Redis, it also works across workers: a leader whose own client left while it was still queued keeps going for a follower on another worker. You are right that it pairs well with the cancellation tests. It was one of the trickier parts to get right
Thanks for the detailed explanation! Covering both disconnect directions and the cross-worker case makes the shared-generation behavior much clearer. Glad those cases already have tests.
What I appreciate most here is that you didn't hide the trade-off behind a successful safety improvement. Getting verified sentences to users faster is valuable, but losing throughput under heavy load is a real cost that deserves attention.
One thing I'd be particularly interested in seeing in a follow-up is how the results change with actual Groq quota behavior rather than the stand-in model. That caveat could significantly change the interpretation of the 62.8% vs. 67.4% result.
Also, I think the distinction between retrieval quality and answer verification is important. Finding relevant passages is only half the problem; making sure the generated claim is actually supported by them is where trust comes in.
Yes, the real Groq test is exactly what I am planning next and going to implement it . I will cancel some streams and let the others finish then check whether the quota comes back, and I will be sharing the results in a follow-up. And I fully agree on your last point that finding the right passage is only half the job. Checking that every claim is really supported by that passage is where trust comes from. Thanks for the insights this will actually helping me to look on more things.
That sounds like a really useful next experiment. I'm especially interested in whether cancelling some streams actually restores quota for the remaining ones, or whether the provider handles that differently than expected.
Please share the results when you have them. Real measurements from this kind of test are much more valuable than assumptions about how an API behaves. And I'm glad the discussion helped — looking forward to the follow-up! 😄
dev.to/ayush_singh321/my-simulatio...
so i had posted the follow up u can check it out
Just read the follow-up — this is exactly the kind of experiment worth sharing. The biggest takeaway for me is that the original performance problem wasn't really where it first appeared to be: the simulator was producing false failures, the advisory scorer was adding unnecessary latency, and the queue behavior was hiding another issue. I especially appreciate that you went back and manually evaluated answer correctness instead of treating successful delivery as proof of quality. That distinction between a verified answer and a correct answer is incredibly important for RAG systems. Also, the finding that word-level checks can confirm vocabulary while missing incorrect relationships is a great example of why evaluation needs multiple independent methods. Thanks for actually following the evidence rather than defending the original numbers!
Thanks and actually the comments let me think more on this project . The research I did and whatever things I got I learned a lots of things from it so thanks to you too for providing me insights.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.