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.

0.60.70.80.91.0BM25 (Qdrant sparse, IDF): 0.8BM25 (Qdrant sparse, IDF)Dense (bge-small-en-v1.5): 0.8Dense (bge-small-en-v1.5)Hybrid, RRF fusion: 0.8Hybrid, RRF fusionHybrid, DBSF fusion: 0.8Hybrid, DBSF fusionHybrid DBSF + bge-reranker-base, chunks: 0.7Hybrid DBSF + bge-reranker-base, chunksHybrid DBSF + bge-reranker-base, abstracts: 0.8Hybrid DBSF + bge-reranker-base, abstractsHybrid DBSF + MiniLM-L6 (ms-marco), chunks: 0.8Hybrid DBSF + MiniLM-L6 (ms-marco), chunksHybrid DBSF + MiniLM-L6 (ms-marco), abstracts: 0.9Hybrid DBSF + MiniLM-L6 (ms-marco), abstractsHybrid DBSF + MedCPT cross-encoder, chunks: 0.9Hybrid DBSF + MedCPT cross-encoder, chunksHybrid DBSF + MedCPT cross-encoder, abstracts: 0.9Hybrid DBSF + MedCPT cross-encoder, abstracts

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.

0 ms75 ms150 ms225 ms300 msBM25 (Qdrant sparse, IDF): 30 msBM25 (Qdrant sparse, IDF)Dense (bge-small-en-v1.5): 51 msDense (bge-small-en-v1.5)Hybrid, RRF fusion: 55 msHybrid, RRF fusionHybrid, DBSF fusion: 54 msHybrid, DBSF fusionHybrid DBSF + bge-reranker-base, chunks: 264 msHybrid DBSF + bge-reranker-base, chunksHybrid DBSF + bge-reranker-base, abstracts: 199 msHybrid DBSF + bge-reranker-base, abstractsHybrid DBSF + MiniLM-L6 (ms-marco), chunks: 117 msHybrid DBSF + MiniLM-L6 (ms-marco), chunksHybrid DBSF + MiniLM-L6 (ms-marco), abstracts: 107 msHybrid DBSF + MiniLM-L6 (ms-marco), abstractsHybrid DBSF + MedCPT cross-encoder, chunks: 234 msHybrid DBSF + MedCPT cross-encoder, chunksHybrid DBSF + MedCPT cross-encoder, abstracts: 182 msHybrid DBSF + MedCPT cross-encoder, abstracts

All numbers

PipelineRecall@1Recall@5MRR@10nDCG@10Rerank p95 (ms)End-to-end p95 (ms)
BM25 (Qdrant sparse, IDF)0.7930.9080.8430.865-30
Dense (bge-small-en-v1.5)0.8220.9520.8780.900-51
Hybrid, RRF fusion0.8290.9590.8850.908-55
Hybrid, DBSF fusion0.8430.9580.8930.913-54
Hybrid DBSF + bge-reranker-base, chunks0.6600.8780.7540.798220264
Hybrid DBSF + bge-reranker-base, abstracts0.8310.9490.8830.905150199
Hybrid DBSF + MiniLM-L6 (ms-marco), chunks0.8320.9390.8800.90164117
Hybrid DBSF + MiniLM-L6 (ms-marco), abstracts0.8640.9590.9050.92253107
Hybrid DBSF + MedCPT cross-encoder, chunks0.8720.9670.9150.931187234
Hybrid DBSF + MedCPT cross-encoder, abstracts0.8920.9750.9300.943134182

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.

0.60.70.80.91.0BM25 (Qdrant sparse, IDF): 0.8BM25 (Qdrant sparse, IDF)Dense (bge-small-en-v1.5): 0.8Dense (bge-small-en-v1.5)Hybrid, DBSF fusion: 0.8Hybrid, DBSF fusionHybrid DBSF + MedCPT cross-encoder, abstracts: 0.9Hybrid DBSF + MedCPT cross-encoder, abstractsQuery rewriting + DBSF + MedCPT, abstracts: 0.9Query rewriting + DBSF + MedCPT, abstracts

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).

0 ms500 ms1000 ms1500 ms2000 msBM25 (Qdrant sparse, IDF): 16 msBM25 (Qdrant sparse, IDF)Dense (bge-small-en-v1.5): 32 msDense (bge-small-en-v1.5)Hybrid, DBSF fusion: 29 msHybrid, DBSF fusionHybrid DBSF + MedCPT cross-encoder, abstracts: 1229 msHybrid DBSF + MedCPT cross-encoder, abstractsQuery rewriting + DBSF + MedCPT, abstracts: 1976 msQuery rewriting + DBSF + MedCPT, abstracts

All numbers

PipelineRecall@1Recall@5MRR@10nDCG@10Rerank p95 (ms)End-to-end p95 (ms)
BM25 (Qdrant sparse, IDF)0.7930.9080.8430.865-16
Dense (bge-small-en-v1.5)0.8230.9490.8780.899-32
Hybrid, DBSF fusion0.8420.9570.8920.911-29
Hybrid DBSF + MedCPT cross-encoder, abstracts0.8910.9750.9300.94212121229
Query rewriting + DBSF + MedCPT, abstracts0.8660.9640.9100.92611671976

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

ComparisonRecall@1 diff (points)pHolm p
Dense vs BM25+2.90.0210.086
Hybrid RRF vs BM25+3.60.000130.00065
Hybrid DBSF vs BM25+5.09.7e-075.8e-06
Hybrid RRF vs Dense+0.70.50.5
Hybrid DBSF vs Dense+2.10.0290.088
Hybrid DBSF vs Hybrid RRF+1.40.0540.11
Hybrid DBSF + MedCPT (chunks) vs Hybrid DBSF+2.90.00350.014
Hybrid DBSF + MedCPT (abstracts) vs Hybrid DBSF+4.98.5e-074.3e-06
Hybrid DBSF + bge-reranker-base (chunks) vs Hybrid DBSF-18.31.7e-331e-32
Hybrid DBSF + bge-reranker-base (abstracts) vs Hybrid DBSF-1.20.330.64
Hybrid DBSF + MiniLM-L6 (chunks) vs Hybrid DBSF-1.10.320.64
Hybrid DBSF + MiniLM-L6 (abstracts) vs Hybrid DBSF+2.10.040.12

Runs on: Apple M4 (16 GB), macOS-26.3.1-arm64-arm-64bit; device mps, fp32

ComparisonRecall@1 diff (points)pHolm p
Rewritten query + Hybrid DBSF + MedCPT (abstracts) vs Hybrid DBSF + MedCPT (abstracts)-2.50.00080.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).

QuestionsAccuracyMacro-F1Accuracy / macro-F1 of always saying "yes"Gold abstract in the contextCites the gold abstractNo label foundGeneration p50 / p95 (s)
1,0000.4000.3500.552 / 0.2370.9690.591346.6 / 9.5

Final ablation with RAGAS

PipelineRecall@5nDCG@10FaithfulnessContext recallAnswer correctnessRetrieval p95 (ms)
BM250.9080.8650.7500.7610.58416
Dense0.9490.8990.7260.7470.60932
Hybrid DBSF0.9570.9110.7830.7440.56329
Hybrid + MedCPT reranking0.9750.9420.7760.7890.5531229
Hybrid + reranking + query rewriting0.9640.9260.6720.7890.5581976

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/.