clinical-rag-eval
Biomedical RAG on PubMedQA, measured stage by stage. Code and data ยท Releases
0.892 Recall@1
Hybrid DBSF + MedCPT cross-encoder, abstracts, up from 0.793 for BM25, at 182 ms p95 end to end.
Measured on: NVIDIA GeForce RTX 5060 Laptop GPU (8.0 GB), Windows-11-10.0.26200-SP0; device cuda, fp16. Each hardware set-up has its own charts and table; don't compare latencies between them.
Results: NVIDIA GeForce RTX 5060 Laptop GPU (8.0 GB), Windows-11-10.0.26200-SP0; device cuda, fp16
Qdrant 1.20.0.
Retrieval quality: Recall@1
Share of the 1,000 questions whose gold abstract is ranked first. Hover a row for its value.
Latency: end-to-end p95
One query at a time: query encoding + Qdrant search + reranking. Systems in one results file run interleaved; compare within a run.
All numbers
| Pipeline | Recall@1 | Recall@5 | MRR@10 | nDCG@10 | Rerank p95 (ms) | End-to-end p95 (ms) |
|---|---|---|---|---|---|---|
| BM25 (Qdrant sparse, IDF) | 0.793 | 0.908 | 0.843 | 0.865 | - | 30 |
| Dense (bge-small-en-v1.5) | 0.822 | 0.952 | 0.878 | 0.900 | - | 51 |
| Hybrid, RRF fusion | 0.829 | 0.959 | 0.885 | 0.908 | - | 55 |
| Hybrid, DBSF fusion | 0.843 | 0.958 | 0.893 | 0.913 | - | 54 |
| Hybrid DBSF + bge-reranker-base, chunks | 0.660 | 0.878 | 0.754 | 0.798 | 220 | 264 |
| Hybrid DBSF + bge-reranker-base, abstracts | 0.831 | 0.949 | 0.883 | 0.905 | 150 | 199 |
| Hybrid DBSF + MiniLM-L6 (ms-marco), chunks | 0.832 | 0.939 | 0.880 | 0.901 | 64 | 117 |
| Hybrid DBSF + MiniLM-L6 (ms-marco), abstracts | 0.864 | 0.959 | 0.905 | 0.922 | 53 | 107 |
| Hybrid DBSF + MedCPT cross-encoder, chunks | 0.872 | 0.967 | 0.915 | 0.931 | 187 | 234 |
| Hybrid DBSF + MedCPT cross-encoder, abstracts | 0.892 | 0.975 | 0.930 | 0.943 | 134 | 182 |
Results: Apple M4 (16 GB), macOS-26.3.1-arm64-arm-64bit; device mps, fp32
Qdrant 1.20.0.
Retrieval quality: Recall@1
Share of the 1,000 questions whose gold abstract is ranked first. Hover a row for its value.
Latency: end-to-end p95
One query at a time: query encoding + Qdrant search + reranking. Systems in one results file run interleaved; compare within a run. Queries were rewritten by mlx-community/Qwen3-1.7B-bf16 (mlx-lm 0.32.2, mlx 0.32.5; Mac mini M4 16 GB, MLX bf16) in an earlier run. Its saved time is added to the end-to-end time, so that total wasn't measured in one go. The rewriting may not reproduce exactly (see the README's caveats).
All numbers
| Pipeline | Recall@1 | Recall@5 | MRR@10 | nDCG@10 | Rerank p95 (ms) | End-to-end p95 (ms) |
|---|---|---|---|---|---|---|
| BM25 (Qdrant sparse, IDF) | 0.793 | 0.908 | 0.843 | 0.865 | - | 16 |
| Dense (bge-small-en-v1.5) | 0.823 | 0.949 | 0.878 | 0.899 | - | 32 |
| Hybrid, DBSF fusion | 0.842 | 0.957 | 0.892 | 0.911 | - | 29 |
| Hybrid DBSF + MedCPT cross-encoder, abstracts | 0.891 | 0.975 | 0.930 | 0.942 | 1212 | 1229 |
| Query rewriting + DBSF + MedCPT, abstracts | 0.866 | 0.964 | 0.910 | 0.926 | 1167 | 1976 |
Is it significant?
Paired exact McNemar tests on Recall@1 over the per-query runs; Holm-adjusted within each family of comparisons.
Runs on: NVIDIA GeForce RTX 5060 Laptop GPU (8.0 GB), Windows-11-10.0.26200-SP0; device cuda, fp16
| Comparison | Recall@1 diff (points) | p | Holm p |
|---|---|---|---|
| Dense vs BM25 | +2.9 | 0.021 | 0.086 |
| Hybrid RRF vs BM25 | +3.6 | 0.00013 | 0.00065 |
| Hybrid DBSF vs BM25 | +5.0 | 9.7e-07 | 5.8e-06 |
| Hybrid RRF vs Dense | +0.7 | 0.5 | 0.5 |
| Hybrid DBSF vs Dense | +2.1 | 0.029 | 0.088 |
| Hybrid DBSF vs Hybrid RRF | +1.4 | 0.054 | 0.11 |
| Hybrid DBSF + MedCPT (chunks) vs Hybrid DBSF | +2.9 | 0.0035 | 0.014 |
| Hybrid DBSF + MedCPT (abstracts) vs Hybrid DBSF | +4.9 | 8.5e-07 | 4.3e-06 |
| Hybrid DBSF + bge-reranker-base (chunks) vs Hybrid DBSF | -18.3 | 1.7e-33 | 1e-32 |
| Hybrid DBSF + bge-reranker-base (abstracts) vs Hybrid DBSF | -1.2 | 0.33 | 0.64 |
| Hybrid DBSF + MiniLM-L6 (chunks) vs Hybrid DBSF | -1.1 | 0.32 | 0.64 |
| Hybrid DBSF + MiniLM-L6 (abstracts) vs Hybrid DBSF | +2.1 | 0.04 | 0.12 |
Runs on: Apple M4 (16 GB), macOS-26.3.1-arm64-arm-64bit; device mps, fp32
| Comparison | Recall@1 diff (points) | p | Holm p |
|---|---|---|---|
| Rewritten query + Hybrid DBSF + MedCPT (abstracts) vs Hybrid DBSF + MedCPT (abstracts) | -2.5 | 0.0008 | 0.0008 |
Answer quality
Answers to all questions
Pipeline: hybrid_dbsf+rerank_parent (ncbi/MedCPT-Cross-Encoder), top 3 abstracts. Generator: mlx-community/Qwen3-1.7B-bf16 (mlx-lm 0.32.2, mlx 0.32.5; Mac mini M4 16 GB, MLX bf16). Retrieval was run earlier (Apple M4 (16 GB), macOS-26.3.1-arm64-arm-64bit; device mps, fp32).
| Questions | Accuracy | Macro-F1 | Accuracy / macro-F1 of always saying "yes" | Gold abstract in the context | Cites the gold abstract | No label found | Generation p50 / p95 (s) |
|---|---|---|---|---|---|---|---|
| 1,000 | 0.400 | 0.350 | 0.552 / 0.237 | 0.969 | 0.591 | 34 | 6.6 / 9.5 |
Final ablation with RAGAS
| Pipeline | Recall@5 | nDCG@10 | Faithfulness | Context recall | Answer correctness | Retrieval p95 (ms) |
|---|---|---|---|---|---|---|
| BM25 | 0.908 | 0.865 | 0.750 | 0.761 | 0.584 | 16 |
| Dense | 0.949 | 0.899 | 0.726 | 0.747 | 0.609 | 32 |
| Hybrid DBSF | 0.957 | 0.911 | 0.783 | 0.744 | 0.563 | 29 |
| Hybrid + MedCPT reranking | 0.975 | 0.942 | 0.776 | 0.789 | 0.553 | 1229 |
| Hybrid + reranking + query rewriting | 0.964 | 0.926 | 0.672 | 0.789 | 0.558 | 1976 |
Recall@5, nDCG@10 and the retrieval p95 cover 1,000 questions (Apple M4 (16 GB), macOS-26.3.1-arm64-arm-64bit; device mps, fp32). The p95 doesn't include generating the answer. For the last row, it includes the rewriting time, which was measured separately and then added.
The RAGAS scores cover the first 30 questions in dataset order, the same ones in every row. Answers come from mlx-community/Qwen3-1.7B-bf16 (mlx-lm 0.32.2, mlx 0.32.5; Mac mini M4 16 GB, MLX bf16), with the top 3 abstracts. RAGAS 0.4.4; evaluator mlx-community/Qwen3-4B-4bit (mlx-lm 0.32.2, mlx 0.32.5; Mac mini M4 16 GB, MLX 4-bit); embeddings BAAI/bge-small-en-v1.5. The evaluator hasn't been checked against experts. Every answer could be scored on all three. With 30 questions, small differences can be chance.
Data
PubMedQA (MIT licence), 1,000 expert-labelled questions; 62,249-abstract corpus. More results are added as they are run (see the milestones).
Generated by python -m clinical_rag.site
from results/.