In my last post, I wrote that checking every sentence before showing it made my RAG system worse under load: 62.8% delivered against 67.4% for the old version. Seventy of you commented, and many comments were better questions than the ones I had asked myself. So I measured again, properly.
TL;DR
- Most of that cost wasn't real. It came from a bug in my simulator and two features sitting next to the checker. The sentence checks themselves take about 3 ms.
- After the fixes, v2 delivers as many answers as v1 (57.0 against 57.2 of 86), and shows the first verified sentence sooner.
- When I made sentences fail on purpose, there was still no cost up to about 6% bad answers. At 1 in 4, cancelled streams held quota and v2 fell behind.
- My judge model is worse than I said: about 1 in 4 good sentences blocked, not 1 in 5.
- Graded by hand, the real answers were 36 correct, 8 partly correct, 0 wrong.
1. The bug was in my simulator
Most of my load tests use a stand-in model, a fake model service calibrated from real Groq measurements, so I don't burn my free quota. It answers by copying passage sentences and adding a citation like [P1] to each one.
All 7 stopped answers in the overload run were for an "uncited sentence". The stand-in had its own rule for where a sentence ends, and it missed endings before a bullet point or a footnote number. So it copied two sentences under one tag, and my checker correctly stopped the one without a citation. The checker was right; the simulator was wrong. Across 82 test prompts, false stops went from 15 to 0 once the stand-in split sentences the same way as the checker.
2. Where the rest of the gap came from
I profiled every step and switched suspects off one at a time:
- The sentence checks were cheap: splitting, checking, tracing and sending took about 10–15 ms per request.
- An advisory scoring model was the real cost. It scores how well a passage supports each sentence, blocks nothing, but ran before each sentence was sent: about 130 ms per request under load.
- A queue rule cost about 1 answer per run. My fair queue let a lone user's newer request push out their own older one. That was the "4th lost answer" some of you asked about.
The scoring now runs in the background, and a user's requests never push each other out. With 5 runs per version:
| v1 | v2 now | |
|---|---|---|
| Delivered (of 86) | 57.2 ± 0.4 | 57.0 ± 1.0 |
| First verified sentence (fast requests) | 620 ms | 489 ms |
The 95% interval for the difference is about −1.4 to +1.0 answers. I repeated it on another day with new random seeds and got the same result. The one trade-off: the final event now arrives later (918 against 623 ms), because it waits for the background scores.
3. What if sentences really fail?
After the fix, the stand-in never writes a bad sentence, but a real model does: about 1 answer in 55 in my replay of real Groq answers. So I made the stand-in drop a citation in a set share of answers, and reran overload: 5 runs per version, with v1 and v2 sharing a random seed in each run.
| Bad answers | v1 delivered | v2 delivered | v2 − v1 (95% interval) |
|---|---|---|---|
| 0% | 57.2 | 57.0 | −0.2 (−1.8 to +1.4) |
| ~1% | 56.8 | 57.0 | +0.2 (−1.4 to +1.8) |
| ~6% | 57.6 | 56.8 | −0.8 (−1.8 to +0.2) |
| ~27% | 57.2 | 54.6 | −2.6 (−7.3 to +2.1) |
Neither version ever shows an unchecked sentence. v1 turns a bad answer into a safe refusal; v2 keeps the verified sentences before it and adds a note.
At realistic failure rates, there's no measurable cost. At 1 bad answer in 4, v2 lost 3, 0, 9, 0 and 1 answers per run. The cancelled streams were still holding their quota, so more people were turned away at the door, even though v2 used fewer tokens. So my first post was right about the mechanism, just not the size. And on real Groq it should be smaller still, because Groq held only part of a cancelled call's quota (next section).
4. Does real Groq refund a cancelled stream?
I tested it: 10 real calls, cancelling 3 streams after a few words.
- No refund showed up within the ~1.6 seconds I watched.
- Each cancelled call lowered the counter by 217–355 tokens, less than the 443 reserved, and the headers don't add up exactly per request.
- My 10th call got a 429, even though tokens and daily requests were far from their limits. So Groq has a request-rate limit its headers don't show. I've since added a setting to space out calls.
5. Testing the judge model properly
My first post said a small "is this supported?" judge would block about 1 in 5 good sentences. Commenters pointed out that I'd measured it against AI-drafted labels.
Three fixed test sets (TokenLat's idea), with the thresholds saved to a file before scoring. Every sentence comes from my own evaluation question set:
| Set | Judge correct |
|---|---|
| Exact quotes with their own passage | 39 of 40 kept |
| "Looks right but is wrong" claims with the right passage | 33 of 40 blocked |
| Exact quotes with a different passage | 39 of 40 blocked |
The surprise was the middle set. My word-level checks (a citation is present, the key words and numbers appear in the passage) passed 34 of those 40 false claims. The judge caught most of them, but 7 got past both. All 7 were swaps like "keys and values come from the **decoder", where the paper says the encoder. Every word is in the passage; only the relationship is wrong. Word checks show the words are there, not that the claim is true.
A blind review (Edward Izgorodin's method). I re-read the 224 real answer sentences behind the "1 in 5": all 53 where the judge and the AI labels disagreed, plus a random 60 where they agreed. I labelled each without seeing either one's verdict:
| Group | I read | What I found |
|---|---|---|
| Judge blocks, AI label says "good" | 43 | 40 really were good |
| Judge keeps, AI label says "bad" | 10 | only 2 were bad |
| Both keep | 54 of 155 | 2 were bad |
| Both block | 6 of 16 | all 6 were good |
Scaled up, the judge would block about 1 in 4 good sentences, and catch only about 3 of the roughly 11 that really aren't supported. The AI labels had been too harsh, and that made the judge's mistakes look like correct blocks. It's good at clear contrasts and poor on real, paraphrased answers. It stays a score and blocks nothing.
6. "Delivered" isn't "correct"
golflover made the sharpest point in the thread: my metric counts a verified answer as a success without asking if it's right. So I graded the 44 real answers from my first post's quality test by hand, without seeing the automatic grade:
| Retrieval setting | Correct | Partly correct | Wrong |
|---|---|---|---|
| Small chunks (160 words) | 10 | 4 | 0 |
| Medium chunks + reranking | 12 | 3 | 0 |
| Large chunks (400 words) | 14 | 1 | 0 |
There was no wrong answer. All 17 questions that the papers can't answer were refused, and one answerable question was wrongly refused. "Partly correct" mostly means incomplete, but 2 of the 8 had an inaccurate detail. My first post's keyword-based grader had said only 19 of 45 were correct.
7. Corrections
- "324 ms against 614 ms" in my first post compared v2's first sentence with v1's total time, from different runs. The fair comparison is in section 2: 489 against 620 ms.
- "213–355 tokens" in some replies should be 217–355.
8. What I'm not claiming
- This isn't production traffic. It's a calibrated stand-in on one machine.
- The labels and grades are one person's judgement on 21 questions, not a benchmark.
- The Groq result is 10 calls on one model. A refund later than 1.6 s isn't ruled out.
The lesson
Before you blame the expensive-looking feature, check your simulator and the things next to it. My checker was doing exactly its job. And a check that the words are in the passage isn't a check that the claim is true. I only learned that because someone asked me to test the judge properly.
Code and the raw run data: github.com/AyushSingh110/The-Relay
Thank you to everyone who commented. Almost every section above started as one of your comments.
Top comments (13)
The 130 ms scorer sitting next to the 3 ms checker is such a familiar shape. Our fetch-on-demand arm did the same thing in reverse: the fetch wasn't the expensive part, the instruction to fetch plus the summary it was supposed to save on cost more than the fetch itself — 1,944 tokens a task against 1,472 for the plain trimmed version that never fetched at all. And your word-checks finding is the one that stuck with me: every word present, only the relationship wrong. Our small local model does the same thing at a cruder level, it just answers the loudest issue whatever the question asked. The words are all there. The claim still isn't true.
That is a great parallel thanks for sharing the numbers. The fetch being cheaper than the instructions around it is the same lesson I learned that the cost was in the machinery next to the feature, not the feature itself. I wouldn't have guessed that until I switched each part off one at a time. And "answers the loudest issue whatever the question asked" is a really good way to put it. It is the same failure one level up: and actually in my case the words match but the relationship is wrong in yours the topic matches but the question is wrong. Both pass any check that only asks whether the right words are present. It makes me think a useful check has to compare the answer with the question not just with the source.
That last line is the one I'm stealing — a check that compares the answer with the question, not just with the source. Most checks I know only do the second half. Going to try building that one over our own runs and see what it catches. Have you tried it yourself, or is it still the shape on paper?
Honestly, it is still on paper 😄 Nothing in my pipeline checks the answer against the question yet. The closest thing is the evidence gate, which compares the question with the retrieved passages but that runs before the model and never sees the answer. The only real answer-vs-question check I did was by hand: when I graded 45 answers, most of the "partly correct" ones were on the right topic but incomplete. An automatic check would need to catch that. I'd really like to hear what it catches on your runs, please share if you try it!
Respect for publishing the correction this thoroughly — most people would have quietly moved on after the first post. The simulator bug is the part that will stay with me: the stand-in splitting sentences differently from the checker, so 15 false stops looked like the safety feature was expensive when it was not. That is exactly the kind of measurement error that is hardest to spot, because the numbers looked plausible.
Profiling the suspects one at a time was the right move too. The advisory scoring model costing about 130 ms per request while blocking nothing, and the fair queue costing about an answer per run, are both features sitting next to the checker rather than the checker itself. And the encoder/decoder swap example is perfect — all 7 of those false claims passed the word checks because every word was present, only the relationship was wrong. Word presence is not truth.
What would you change in the simulator to catch a sentence-splitting mismatch automatically next time — for example, asserting the stand-in and the checker share the same splitter before any run starts?
Thanks a lot I really appreciate this. That's close to what I actually did. The stand-in no longer has its own splitter what it does is that it imports the checker's sentence-split function so the two can't drift apart. There is also a test that splits stand-in answers the way the checker does and fails if any sentence comes out without a citation.
The one thing I would still add is a check before each load run. Run a short warm-up with failures switched off and refuse to start if the checker stops anything. Then on a clean stand-in the expected number of stops is zero so any stop means that the simulator is wrong, not the model. The 15 false stops would have been caught before any numbers were recorded.
The broader lesson for me is that when a simulator imitates a component it should reuse that component's code not to copy its logic.
Respect for publishing the correction this thoroughly — most people would've quietly moved on after the first post. "The checker was right; the simulator was wrong" is the line that stays with me. And the judge getting worse on blind review, 1 in 4 good sentences blocked — that's the honest kind of result. One question: at 27% bad answers v2 fell behind because cancelled streams held quota — did the call-spacing fix change that math at all, or is that just the price of the safety?
Thank you so much and as an undergraduate getting this kind of feedback from so many experienced engineers has taught me more than any course. Actually looking for an internship and building projects like this on the side and getting thoughtful feedback from people like you has taught me more than I expected.
So on your question: no, the call spacing doesn't change that math. It fixes a different problem. On the real Groq I hit a 429 even though tokens and daily requests were far from their limits so there is a request-rate limit the headers don't show. Spacing out call starts avoids that 429, but it doesn't release quota from a cancelled stream.
What I actually saw at 27% is that the guard keeps the full reservation when a stream is cancelled because the real usage report never arrives there the likely fix is to release the unused part on cancel or to let the stream finish in the background so the real usage comes back. I haven't tested either yet. So for now, partly yes, it is the price of safety but only at a very high failure rates. At about 6% bad answers or less I couldn't measure any cost. A real model in my replay produced about 1 bad answer in 55.
Respect for going back and measuring again in public. Finding that most of the cost came from a simulator bug and two neighbouring features, and the checks themselves take about 3 ms, is a much more useful result than the first one. Did the forced-failure test change how you think about what to show the user when a sentence fails?
Thanks and that means a lot . So it doesn't actually change what the user sees: an unchecked sentence is still never shown. v2 keeps the sentences that passed and adds a note while the v1 replaces the whole answer with a refusal. What it changed is where I think the cost is. The cost of stopping wasn't in the screen it was in the quota and at about 1 bad answer in 4, cancelled streams were still holding their reservation so the other users got turned away.
The judge test also made me more careful about what actually the "passed" means because word-level checks let through the claims where only the relationship was wrong. One thing I still haven't measured is whether a partial answer with a note is actually more useful to a reader than a clean refusal. That needs real users not a simulator.
the queue rule is my favorite bit. a lone user pushing out their own older request isn't unfair, it's a cat at a flap. asks in, gets in, immediately asks out, and the only thing it shoves aside is itself. so the answer you lost per run wasn't the checker's bill. it was a door tax.
Haha "door tax" is perfect, I am stealing that 😄 It is exactly what actually happened. The rule was meant to stop one user from crowding out others but when only one user was waiting the only person it pushed aside was themselves. The fix was to apply it only when someone else is actually waiting. Now a user alone in the queue is just served in arrival order. One answer per run doesn't sound like much but it was the "4th lost answer" that several people asked about after my first post.
I think the simulator hid the real cost until the live numbers told a clearer story.