When a benchmark question leaks into a language model's training data, the model can score well by remembering the question rather than by solving it. The standard way to check training data for leaks matches exact word sequences, and rewording defeats it. The best current fix uses two stages: a cheap text-similarity search pulls a handful of likely matches for each test question out of the corpus, and a strong language model then judges whether any of them is the same question in different words. This note argues that in technical fields such as medicine, the first stage is the weak point. Medical text can be reworded without sharing ordinary vocabulary: a brand drug name becomes its generic compound, "tumor" becomes "neoplasm," a lay anatomical term becomes its Latin form. A general-purpose similarity model may never rank the leaked copy among its top matches, so the judge never sees it.
The proposal is to measure how large this blind spot is. If it is real, we close it by searching on medical meaning instead of surface wording. Each question and each training document is mapped to standardized medical concept identifiers drawn from a curated medical vocabulary. Concept overlap is then combined with a similarity model tuned on medical text, and the numbers in a passage are kept as exact fingerprints. The deliverable has three parts: a test bed of deliberately planted, reworded medical benchmark items with known locations; a measured comparison of how many leaked items each search method recovers; and a real audit of a public biomedical pre-training corpus against public medical benchmarks.
Core Claim
Rewording that preserves medical concepts but changes vocabulary is a distinct kind of contamination. Exact-match filters miss it, and plausibly general-purpose similarity search misses it too. Search keyed on standardized concept identifiers plus a medically tuned similarity model should recover substantially more planted leaks at the same search budget. The claim is falsifiable in a specific way. If a strong general similarity model, simply allowed to return more candidates, recovers the same leaks at similar cost, the domain machinery is unnecessary and we will report that.
Grounding in Prior Work
The motivating evidence comes from Rethinking Benchmark and Contamination for Language Models with Rephrased Samples.
- The threat is real. Fine-tuning Llama-2-13B on reworded MMLU test questions raised its score from about 55 to about 86 while exact-match filters stayed silent.
- The method we build on. That paper's two-stage decontaminator (similarity search, then a GPT-4 judge) found 8 to 18% of HumanEval inside StarCoder and RedPajama.
- What it leaves open. Its first stage is a general sentence-similarity model, and it never measures how many true leaks that stage drops. We keep its judge stage and replace and measure the search stage.
The case that general similarity fails on technical text comes from the domain-representation literature. Detection of medical text semantic similarity based on convolutional neural network matched imaging reports to pathology reports with concept vectors built from the Chinese medical subject-heading hierarchy. It reached a Macro F1 of 0.935, against 0.833 for keyword matching. Contextual semantic embeddings for ontology subsumption prediction showed that encoders fine-tuned on ontology structure beat earlier graph and Word2Vec methods on concept alignment, with a mean reciprocal rank of 0.707 against about 0.444. Neither paper studies contamination. We use their lesson that concept structure carries the meaning surface text hides.
The method supplies come from three sources:
- UMLS::Similarity maps terms onto the Unified Medical Language System. This is a meta-vocabulary that assigns one concept identifier to the many names a medical concept has across vocabularies such as MeSH and SNOMED CT. It also gives graded parent, child, and sibling relations, which we use both to generate rewordings and to build near-miss negatives.
- BioBERT, an encoder further trained on PubMed and used in PubMedQA, supplies the starting medical encoder.
- PubMedQA also reports that 21% of its contexts contain raw statistics without explanatory prose. That suggests exact numeric strings are distinctive fingerprints, which motivates keeping numbers as hard match features.
Two papers constrain the design.
- On The Fragility of Benchmark Contamination Detection in Reasoning Models shows that detectors which inspect the model's own probabilities collapse after reinforcement learning. LiRA, a likelihood-ratio membership test, falls from 89.1% AUROC (area under the ROC curve) toward chance. This supports auditing the data rather than the model.
- Evaluating large language models on a highly-specialized topic, radiation oncology physics assumes specialized exams are rarely leaked. That assumption is exactly what a corpus audit can test.
Research Program
The test bed
We first build a test bed with known ground truth. The source questions are:
- the PubMedQA expert-labeled set (1,000 items);
- the medical subjects of MMLU, including anatomy, clinical knowledge, college medicine and professional medicine;
- the 100-question radiation oncology physics exam, if the authors release it.
Each question is reworded in three ways:
- Generic paraphrase: an LLM rewrite, reproducing the Yang et al. setting.
- Terminology shift: every recognized concept is swapped for a different surface name of the same concept identifier, drawn from a different source vocabulary. Examples are brand to generic, lay to technical, and eponym to descriptive.
- Translation: a rendering into another language.
A medically trained annotator checks a sample for equivalence. We also build hard negatives, which test precision. Each one keeps most of an item's concepts but replaces the key concept with an ontology sibling, so it reads as a different question. The reworded positives and the hard negatives are inserted at random positions into a slice of the PubMed Central subset of the Pile, on the order of tens of millions of documents.
Search methods
We compare search methods at equal numbers of retrieved candidates.
- Our method scores each document by three components: dense similarity from a BioBERT-initialized encoder, overlap between the document's and the question's concept-identifier sets, and exact agreement on numeric tokens.
- Training the encoder. It is fine-tuned contrastively on terminology-shifted pairs built from a held-out pool of PubMed sentences, never from benchmark items. This avoids training on the test bed.
- Combining the components. The weights for the three components are tuned on a development split of planted items.
The judge stage is held fixed across all conditions so that only the search stage varies. Holding it fixed also lets us measure separately whether the judge itself mistakes terminology shifts or sibling swaps.
Score inflation and repair
Planted leaks that no detector can find are only an academic worry unless they inflate scores. So we repeat the Yang et al. experiment in the medical setting. We fine-tune the same model size on terminology-shifted test items and measure the accuracy gain on PubMedQA and the MMLU medical subjects. We then check whether removing the items flagged by each pipeline removes the gain.
Real audit
Finally we audit the full Pile PubMed Central subset against PubMedQA and the MMLU medical subjects. We report flagged items with judge verdicts and a hand-verified sample. This also gives a first measurement relevant to Optimal Splitting of Language Models from Mixtures to Specialized Domains. That paper trains domain experts on exactly such clusters and reports a 9.33% relative perplexity gain, and our audit shows how much benchmark material those clusters contain.
Baselines
The naive reference point is exact-match deduplication: 13-gram matching plus MinHash near-duplicate detection, run over the same corpus slice. It needs no tuning. We expect it to catch almost none of the reworded items, and any method that fails to clearly beat it on generic paraphrases indicates a bug in the test bed.
The strongest existing method is the LLM Decontaminator of Rethinking Benchmark and Contamination for Language Models with Rephrased Samples.
- How we run it. We use its general sentence encoder and its judge prompt, with the same corpus, the same judge model, and the same candidate count $k$ as our method. We also run it with the strongest general-purpose encoder we can obtain, so we are not comparing against a weak version.
- Its reported numbers. The paper reports the 55-to-86 inflation and the 8 to 18% HumanEval prevalence. There is no reported result found on Lacuna for this method's retrieval recall on medical benchmarks, so we establish that number ourselves.
- What counts as beating it. At least a 10-point gain in recall of terminology-shifted items at $k=5$, with no worse false-positive rate on the hard negatives, and with the gain persisting across $k$ up to 50.
The vocabulary-only baseline is BM25 keyword search over text where every recognized medical term is first replaced by its concept identifier using UMLS mapping. It uses no learned encoder. This is the cheapest way to exploit the medical vocabulary, and it gets the same tuning budget as our method's component weights. It may be the real competitor.
The ablations remove one ingredient of our method at a time: concept overlap, the medical encoder, and numeric matching. Comparing the general encoder against the medical encoder with the other two components removed isolates whether medical training of the encoder, as opposed to concept normalization, does the work.
Why not just…?
Why not just retrieve more candidates with a strong general encoder? If a leaked item sits at rank 40 instead of rank 3, raising $k$ to 50 recovers it. The cost is that the expensive judge stage grows linearly with $k$. We will plot recall against $k$ for each encoder and report the $k$ at which the general encoder matches our recall at $k=5$, along with the extra judge calls this implies. If that multiplier is small, say under three, the honest conclusion is that the domain encoder buys little and practitioners should simply raise $k$.
Why not just expand keyword search with medical synonyms? This is the most serious threat. Terminology-shift rewording is, by construction, the kind of change synonym normalization undoes. Our test bed may therefore favor the vocabulary-only baseline, and it may match the full method. Generic paraphrases and translations, where restructured syntax and non-English text weaken pure keyword matching, are where we expect the dense component to matter. If concept-normalized BM25 equals our method on all three rewording types, we will adopt it as the recommendation. In that case the contribution becomes the test bed and the measured blind spot of general encoders.
Why not just test the model directly with PaCoST or a contamination quiz? PaCoST compares a model's confidence on original versus reworded items, and the Data Contamination Quiz asks the model to pick the original from perturbed versions. Both answer whether a given model saw an item, not where the item sits in the data, so neither lets a data builder remove it. PaCoST also needs access to the model's token probabilities. On The Fragility of Benchmark Contamination Detection in Reasoning Models shows that probability-based tests drop toward chance after reinforcement learning, and to 50 to 58% AUROC after chain-of-thought contamination. A data-side audit is unaffected by what happens to the model afterwards. We run PaCoST on the fine-tuned inflated model as a complementary check, not as a substitute.
Decisive Checks
Step 1: confirm the blind spot. On terminology-shifted items, the general encoder's recall at $k=5$ should fall well below its recall on generic paraphrases. If it does not, the premise fails and the project reduces to the audit.
Step 2: compare against the cheap fix. Among the methods, the full method must beat concept-normalized BM25 on the paraphrase and translation conditions. Otherwise the simpler method wins.
Step 3: confirm the gains are real and removable. In the inflation experiment, fine-tuning on terminology-shifted items should raise medical benchmark accuracy measurably. Removing the items our pipeline flags should erase most of that gain, while removing only the general pipeline's flags should leave a residual.
Step 4: report real prevalence. For the real audit, we report flagged PubMedQA and MMLU-medical prevalence in the Pile PubMed Central subset with a hand-verified precision estimate. The result either confirms or undercuts the common assumption that specialized medical exams are rarely leaked.
References
- Rethinking Benchmark and Contamination for Language Models with Rephrased Samples
- Detection of medical text semantic similarity based on convolutional neural network
- Contextual semantic embeddings for ontology subsumption prediction
- UMLS::Similarity: Measuring the Relatedness and Similarity of Biomedical Concepts
- PubMedQA: A Dataset for Biomedical Research Question Answering
- On The Fragility of Benchmark Contamination Detection in Reasoning Models
- Evaluating large language models on a highly-specialized topic, radiation oncology physics
- Measuring Massive Multitask Language Understanding
- Optimal Splitting of Language Models from Mixtures to Specialized Domains
- PaCoST: Paired Confidence Significance Testing for Benchmark Contamination Detection in Large Language Models
- Data Contamination Quiz: A Tool to Detect and Estimate Contamination in Large Language Models