How GroundedMed is built and tested
An agentic RAG pipeline that answers research questions from medical abstracts, with every finding cited and checked, tested on two hash-locked PubMedQA test sets with the decision rules written before the runs. Every result below is read from the stored result files.
What it does
- Planner (AI) turns the question into a few search queries.
- Retriever (code) searches 2,500 abstracts by meaning, reranks the best matches and keeps the top 5. If even the best match is weak, an evidence gate says "not enough evidence" instead of answering.
- Synthesizer (AI) writes a yes / no / maybe verdict as short findings, each citing one of those abstracts.
- Critic (AI) checks each finding against the abstract it cites. It can remove findings or hold back the verdict, but never add anything. When it flags an answer that would otherwise be refused, the synthesizer gets one guided rewrite with the critic's notes, and the critic checks that once.
- Validator (code) drops any finding whose citation is not one of the abstracts retrieved for that question, so every finding on screen cites a source you can open.
How it's tested
- Locked test sets, each run once. 200 test questions were frozen (IDs and hash) before any system was built. Later, a fresh set of 400 was locked the same way from questions nobody had looked at, before any tuning. Baseline and agent ran once on each set (the closed-book control on the first); everything tuned was tuned on separate dev questions.
- Rules before results. The decision rules for the latest test were written down and coded into its scorer before it ran, and code blocks a second run on a locked set unless overridden with a recorded reason (never used).
- Refusals count as wrong, so refusing hard questions can't look like skill.
- Paired statistics. Wilson 95% ranges for each system's percentages; for differences, a paired bootstrap over the same questions (2000 resamples) and an exact sign test. Claim support uses a bootstrap over questions; time and cost a bootstrap.
- Independent judge (v1.0.0). An AI from a different company (gemini-3.1-pro-preview, Google), never the system's own critic, rated each finding against the abstract it cites, blinded to which system wrote it.
- All figures are produced by the evaluation code and shown here unchanged, only rounded for display (percentages to one decimal, seconds to two, dollars to four; a value very close to zero keeps a second decimal so its sign stays visible).
Latest test (v1.1.0): 400 fresh questions
Run on 2026-11-10, scored on 2026-11-10. Accuracy is against PubMedQA's own yes / no / maybe answers; a refusal counts as wrong.
| Baseline | Agent | |
|---|---|---|
| Correct answers | 76.5% 306/400 95%: 72.1–80.4% | 76.0% 304/400 95%: 71.6–79.9% |
| Refused ("not enough evidence") | 16 | 18 |
| Hit@1 / Hit@5 (source paper ranked first / in the top 5) | 98.0% / 99.5% | 98.0% / 99.5% |
| Typical time (median) | 4.67 s | 12.58 s |
| AI cost per question (mean) | $0.0131 | $0.0304 |
The guided rewrite ran on 11 of the 400 questions, all of which would otherwise have been refused; 7 of them ended with the right answer.
Agent and baseline were statistically tied: paired difference −0.5 pts (95% range −2.75 to +1.75), exact sign test p = 0.81. Measured on a developer laptop, one question at a time; cost = Claude tokens at list price only. This test had no closed-book or AI-judge run.
First test (v1.0.0): 200 questions
The agent as it was at v1.0.0, with a closed-book control and the independent AI judge. Systems tested on 2026-10-25, scored on 2026-10-26 (scoring code bd81999, recorded as 498b76a).
Reading the abstracts is what makes the answers good
Share of the 200 test questions answered correctly (PubMedQA's own yes / no / maybe answers; a refusal counts as wrong).
+22.5 pts baseline vs closed-book (95% range +15.0 to +29.5)
+20.0 pts agent vs closed-book (95% range +12.5 to +27.0)
Without the abstracts, the AI did no better than always answering "yes" (55.0%). Both gains are well clear of zero.
What the agent's critic adds
The agent adds a planner and a critic on top of the baseline. The critic checks every finding and limitation against the abstract it cites, removes what it can't back up, and holds back a verdict its findings don't support. On the same 200 questions, an independent AI judge from a different company rated the agent's limitations fully supported more often.
Better-supported answers
- Limitations fully supported: 91.3% vs 86.2%: +5.1 pts (95% range +1.8 to +8.6; clear)
- Findings fully supported: 95.0% vs 93.2%: +1.8 pts (95% range −0.04 to +3.7; just includes 0, so no clear difference)
- Answers with any item not fully supported: 40/192 (20.8%) vs 70/197 (35.5%)
Agent and baseline side by side
- Overall accuracy: 74.0% vs 76.5%
- Questions answered: 95.0% vs 97.5%; the critic holds back a verdict when the cited evidence doesn't support it
- Accuracy on the questions each answered: 77.9% vs 78.5%
- Time: typical answer 11.79 s vs 4.23 s
- AI cost per question: $0.0287 vs $0.0131
Support figures are the AI judge's estimate; the second-AI cross-check below tests the judge itself.
Answer accuracy against PubMedQA's answers
This is ground-truth accuracy: does the yes / no / maybe verdict match PubMedQA's label? A refusal counts as wrong. Coverage is always shown next to accuracy-when-answered, because refusing hard questions would otherwise look like skill.
Dot = result; line = 95% range (Wilson). Axis starts at 40% so the ranges are readable. Exact values are in the table.
| Baseline | Agent | Closed-book | |
|---|---|---|---|
| Overall accuracy | 76.5% 153/200 95%: 70.2–81.8% | 74.0% 148/200 95%: 67.5–79.6% | 54.0% 108/200 95%: 47.1–60.8% |
| Coverage | 97.5% 195/200 95%: 94.3–98.9% | 95.0% 190/200 95%: 91.0–97.3% | 100.0% 200/200 95%: 98.1–100.0% |
| Accuracy when answered | 78.5% 153/195 95%: 72.2–83.7% | 77.9% 148/190 95%: 71.5–83.2% | 54.0% 108/200 95%: 47.1–60.8% |
Closed-book = the same AI with no abstracts at all; it scored about the same as always saying "yes" (55.0%), so the abstracts matter.
Finding the right abstract
| Baseline | Agent | |
|---|---|---|
| Hit@1 (source paper ranked first) | 98.5% 197/200 | 98.5% 197/200 |
| Hit@5 (source paper in the top 5) | 100.0% 200/200 | 100.0% 200/200 |
These are favourable by design of the benchmark; see Limitations.
Speed and cost
| Baseline | Agent | Closed-book | |
|---|---|---|---|
| Typical time (p50) | 4.23 s 95%: 4.15–4.41 s | 11.79 s 95%: 11.48–12.08 s | 1.00 s 95%: 0.97–1.03 s |
| Slow case (p95) | 6.21 s 95%: 5.72–6.97 s | 15.83 s 95%: 14.48–17.92 s | 1.65 s 95%: 1.55–1.99 s |
| AI cost per question (mean) | $0.0131 95%: $0.0128–$0.0134 | $0.0287 95%: $0.0280–$0.0294 | $0.0011 95%: $0.0011–$0.0011 |
Measured on a developer laptop, one question at a time (not production load). Cost = Claude tokens at list price only; search and reranking were on a free allowance and are not included. Ranges: bootstrap 95%.
Are the findings backed by their sources? AI-judge estimate
Not the same thing as the accuracy above. An independent AI judge (gemini-3.1-pro-preview, Google; not the AI that writes the answers) read each finding with the abstract it cites and labelled it fully, partly or not supported. We report fully supported only.
| Baseline | Agent | Agent minus baseline | |
|---|---|---|---|
| Findings fully supported | 93.2% 455/488 95%: 90.7–95.5% | 95.0% 421/443 95%: 92.7–97.2% | +1.8 pts −0.04 to +3.7 |
| Limitations fully supported | 86.2% 344/399 95%: 82.5–89.6% | 91.3% 306/335 95%: 88.1–94.4% | +5.1 pts +1.8 to +8.6 |
| Answers with at least one item not fully supported | 70/197 | 40/192 | — |
The agent's critic removes items it can't back up and holds back unsupported verdicts, so the two systems are judged on different numbers of items. The findings difference is within noise: its range just includes 0.
Second-AI cross-check
To test the judge, a second AI from a different company (ChatGPT, OpenAI) labelled a blind sample of 30 of the same items without seeing the judge's labels. It agreed with the judge on 14/20 = 70.0% (95%: 48.1–85.5%) of the items the judge accepted, and on 8/10 = 80.0% (95%: 49.0–94.3%) of the items the judge rejected. It rejected some items the judge had accepted, which suggests the judge's figures may be optimistic. The sample held findings only, no limitations. Both are AIs and can share blind spots, so agreement does not prove the judge right; how ChatGPT was run is as reported by the project owner. No person checked these items.
Limitations
- PubMedQA questions are often written from the article's title, so finding the right abstract is easier than real-world search. We left titles out of the searchable text and added 1,500 similar-topic abstracts as distractors, but Hit@5 is still 100.0% on the first test and 99.5% on the latest.
- PubMedQA has no sentence-level labels showing which sentence supports an answer, so "supported" is judged by AI, not checked against human annotations.
- The claim-support judge is an AI (a preview model) and was cross-checked only by another AI on 30 findings; its limitation labels were not cross-checked. The judge ran on the first test (v1.0.0) only.
- One run per system on each test (200 and 400 questions): small differences are within the ranges shown.
- PubMedQA is public, so the AI may have seen it in training; the closed-book result suggests it does not simply remember the answers.
- Times are from a developer laptop; costs exclude search and reranking.
- The live demo also screens out questions asking for personal medical advice before Becky answers. That screen is not part of either test.