HIPAA and FDA RAG Eval: A Test Set for Regulatory RAG
An internal showcase build: 162 synthetic question, answer, and context rows over HIPAA and FDA guidance, plus the 345-chunk corpus they came from, generated and judged locally.
- Industries
- Healthcare
- Author
- Solvren AI Engineering
- Published
- Last updated
Internal showcase build: Solvren AI built and measured this on public or synthetic data. There is no client.
Problem
Teams building RAG over regulation need a test set before they can tell whether a change helped. Writing one by hand is slow.
We wanted to see how far a local pipeline with small open models gets at generating one, and to report plainly where its answers are wrong.
This is an internal showcase build, not a client engagement. All source text is public US government material.
What we built
- 162 question, answer, and context rows, each tied by chunk_id to its gold passage, written from the point of view of a compliance officer or healthcare privacy analyst.
- The full 345-chunk corpus, so the 183 chunks with no kept question act as realistic distractors for recall@k and MRR.
- Sources: 45 CFR Part 164 (eCFR snapshot of 2026-10-06, Subparts A, C, D, and E) and FDA’s February 2026 guidance on cybersecurity in medical devices.
- Generated with Qwen3-4B and judged with Qwen3-8B, both 4-bit through mlx-lm on an Apple M5 (16 GB). No cloud APIs were used.
- Published as SolvrenAI/hipaa-fda-rag-eval, with code at github.com/solvren-ai/rag-eval-generator, a local port of an AWS sample.
How it works
-
1Chunk sources
45 CFR Part 164 by section, FDA guidance by page: 345 chunks.
-
2Generate
Qwen3-4B writes a question, answer, and context for each chunk.
-
3Judge
Qwen3-8B scores four critiques from 1 to 5.
-
4Filter
Keep rows scoring 4 or higher on all four: 162 kept.
-
5Publish
QA rows plus the full corpus, joined by chunk_id.
Chunk, then generate
The CFR is split one document per section and the FDA PDF one per page, then chunked to 1,500 characters. For each chunk, Qwen3-4B writes a question, a shorter rewrite, a reference answer grounded only in the chunk, and the supporting sentences.
A separate judge
Qwen3-8B, a larger model loaded only after the generator was unloaded, scores every row 1 to 5 on four critiques: groundedness, relevance, standalone, and answer correctness. LLM judges tend to favour their own model. A separate, larger judge reduces that but does not remove it, since both models are from the same family.
Filter
A row is kept only when all four judge scores are 4 or higher: 345 generated, 162 kept. On the generator’s own self-scores, 247 rows would have passed.
Overlap flag
The Privacy Rule rows overlap with the training data of our HIPAA embedding model. Those 70 rows carry in_embedding_train = true, so that model can be scored on the other 92 without leakage.
Controls
- Generator and judge are different models, loaded one at a time.
- All four judge critiques must score 4 or higher for a row to be kept.
- Every row ships its judge scores and one-sentence rationales, plus the generator’s self-scores, so users can re-filter.
- A leakage flag on rows that overlap with our embedding model’s training data.
- Public source text only; no PHI or personal data.
- Local generation: nothing left the machine, which matters if the same pipeline is pointed at internal policies.
Results
Note: Use it mainly for retrieval evaluation. 7 of 25 spot-checked reference answers (about 28%) are not fully correct: dropped conditions, "should" stated as "must", incomplete lists, and one wrong answer. The spot-check was done by an LLM agent, and no row has had human review. Answers also skew heavily to "Yes", so a system that always says yes scores well on answer metrics; report yes/no and open questions separately, and verify answers before treating them as ground truth.
| Measure | Result |
|---|---|
| Rows generated / kept | 345 / 162 |
| Corpus chunks, including 183 distractors | 345 |
| Spot-check of 25 kept answers (LLM agent) | 18 correct, 6 partial, 1 wrong |
| Yes/no questions | 107 of 162 (66%) |
| Answers opening “Yes” vs “No” | 91 vs 6 |
| Local runtime, Apple M5 (generate / judge) | 45 min / 32 min |
We publish only numbers we measured.
Why it fits regulated teams
Regulated teams need to test a RAG system before it answers compliance questions, and they need to know how far to trust the test. This set publishes its own error rate next to the data. Questions are single-hop, the text is a fixed 2026 snapshot, and nothing in it is legal advice.
Related industries: Healthcare
FAQ
Was this built for a client?
No. It is an internal showcase build on public HIPAA and FDA text. The dataset and the generator code are public.
Can I use the reference answers as ground truth?
Not without checking them. About 1 in 4 spot-checked answers was imprecise and one was wrong. The questions and source chunks are more reliable than the answers, so the set works best for retrieval evaluation via chunk_id.
Why do so many answers say "Yes"?
It is a pipeline artifact. The generator turns statements in a chunk into questions, so most yes/no questions restate a rule. The filter then keeps 65% of "Yes" rows but only 10% of "No" rows, because "No" answers are where the generator most often misreads an exception.
How do I use it to test the HIPAA embedding model?
Filter out the 70 rows with in_embedding_train = true and score retrieval on the remaining 92, so the model is not tested on text it was trained on.