Where Does Biomedical Pre-Training's PubMedQA Gain Come From?

Biomedical language models are pre-trained on PubMed abstracts. Their flagship reasoning benchmark, PubMedQA, is built from the same kind of abstracts: the question is an article's title, the answer is read off its conclusion. Removing the exact source abstracts is easy, because every benchmark item carries a PubMed identifier. The harder problem is that science repeats itself. The same finding shows up again in replications, meta-analyses, reviews and follow-up studies, each worded differently. A model can therefore "know" the answer to a PubMedQA item without ever having seen its source abstract, and nobody has measured how much of the reported domain-pre-training gain comes from this.

We propose to find out by retraining, not by inspecting text. We continually pre-train the same small model on PubMed under controlled deletions: the source abstracts, then their semantic neighbors, then a random slice of equal size. We then ask how much PubMedQA accuracy each deletion takes away. Semantic neighbors are found with embedding-based similarity, meaning text is mapped to vectors and "same meaning" becomes "nearby vectors." Because a detector is judged by how much benchmark gain disappears when its hits are removed, the same experiment also ranks contamination detectors (general versus biomedical encoders, cosine versus rank-based scoring, n-gram filters) on the one criterion that matters.

Core Claim

Our hypothesis is that a meaningful share of the PubMedQA advantage of PubMed-pretrained models survives removal of the exact source abstracts. We expect that share to disappear when claim-level semantic neighbors are removed, and not when an equal number of random abstracts are removed. We further expect a biomedical encoder to find the neighbors that matter more efficiently, measured as gain removed per token deleted, than a general encoder or an n-gram filter.

If the hypothesis fails, and removing source abstracts by identifier accounts for all of the inflation, the embedding machinery is unnecessary for this domain. That is itself a useful and reportable result.

The main output is a decomposition of the domain gain. Let $A(\cdot)$ be PubMedQA accuracy after continual pre-training on a given corpus and identical fine-tuning. Let $D$ be the full PubMed corpus, $S$ the source abstracts of the evaluation items, $N_k$ the semantic neighbors returned by detector $k$, and $R$ a random token-matched removal. Then

$$ \underbrace{A(D)-A(D\setminus S)}_{\text{verbatim}},\qquad \underbrace{A(D\setminus S)-A(D\setminus (S\cup N_k))}_{\text{soft}}-\underbrace{\big[A(D\setminus S)-A(D\setminus (S\cup R))\big]}_{\text{random-removal control}} $$

are the verbatim and soft contributions. We compare both against the total gain $A(D)-A(W)$, where $W$ is a token-matched general web corpus.

Why This Is Open

The motivating evidence comes from two strands. Soft Contamination Means Benchmarks Test Shallow Generalization used cosine similarity plus LLM verification on the Olmo3 corpora. It found semantic duplicates for 78% of CodeForces problems and roughly 20% gains on MuSR from fine-tuning on them. Its study is general-domain and code/logic only, it inserts contamination by fine-tuning rather than removing it from pre-training, and it concedes that its cosine heuristic likely undercounts duplicates.

Investigating Data Contamination for Pre-training Language Models and its companion Does Data Contamination Make a Difference? pre-trained GPT-2 models from scratch with injected benchmark text. They showed that input-text-only contamination inflates scores and that 13-gram filters fail. They detected only lexically, however, and left embedding-based detection as future work. We borrow their controlled-pretraining design but reverse its direction: we delete naturally occurring contamination rather than inserting artificial contamination.

On the domain side, PubMedQA documents that items come straight from PubMed abstracts. BioBART (continual pre-training of BART on 41 GB of PubMed) and Dr. LLaMA (BioGPT-Large with GPT-4 augmentation) attribute their gains to domain knowledge without auditing this overlap. Disentangling Reasoning and Knowledge in Medical LLMs finds that most medical benchmark items test recall. It also finds that models collapse under adversarial prefills, which is consistent with, though not proof of, recall-driven scores.

Two papers constrain the design. Correlation Coefficients and Semantic Textual Similarity shows cosine similarity is sensitive to outlier dimensions and that Spearman correlation can beat it (STS14 tweet-news 74.89 versus 70.18). We therefore treat the scoring function as an experimental variable. Reproducibility Issues for BERT-based Evaluation Metrics shows that undocumented preprocessing can swing neural metric results by up to 11%. We therefore fix and release every preprocessing choice in the neighbor search.

Research Program

Corpus. We assemble a PubMed abstract corpus comparable to the one BioBART used. We also build a token-matched general corpus from FineWeb.

Evaluation pool. The evaluation pool has two parts. The first is the expert-labeled PubMedQA set (PQA-L), whose roughly 500-item test split is too small to resolve differences of a few points on its own. The second is a 10,000-item held-out set built with PubMedQA's own automatic PQA-A recipe from abstracts that we reserve.

Candidate generation. Neighbor search runs at the claim level. The conclusion of each evaluation abstract is compared against every sentence of every corpus abstract. Candidate neighbors come from five detectors, run with the same approximate-nearest-neighbor index and the same candidate budget:

  1. MinHash and 13-gram overlap.
  2. A general sentence encoder (text-embedding-3-large, as used zero-shot in BITS Pilani at SemEval-2024).
  3. LaBSE.
  4. A PubMed-pretrained encoder.
  5. The PubMed-pretrained encoder with Spearman rather than cosine scoring.

Verification. A stratified sample of candidates is labeled by an LLM judge. A biomedical annotator checks a subset of those labels to calibrate the judge. The label asks whether the candidate asserts the same finding with the same direction of effect. This yields a precision-recall curve for each detector, and each detector's operating threshold is chosen from that curve.

Retraining. We continually pre-train a GPT-2-large-scale decoder, the scale Jiang et al. used. Every corpus condition gets an identical token budget, with the removed tokens back-filled from unrelated PubMed abstracts so that corpus size never differs. Each condition is then fine-tuned identically on PQA-A. Artificial items that neighbor evaluation items are dropped from fine-tuning in every condition. Each condition uses three seeds, and differences are tested with paired bootstrap tests over items.

Context-reading probe. For 300 PQA-L items, the results in the abstract are edited so that they imply the opposite answer. An annotator verifies each edit. A model that reads the context should flip its answer; a model that recalls the finding should not. The flip rate on this probe is the domain analogue of the contamination resistance defined in The Emperor's New Clothes in Benchmarking?. Fidelity is measured as that paper defines it, using the fully decontaminated model as the reference "clean" model.

Baselines

Web-only model. The naive reference point is the same model continually pre-trained on the token-matched FineWeb corpus instead of PubMed. It defines the total domain gain that everything else decomposes. The literature supplies anchors on PQA-L: the majority answer is 55.2% and multi-phase fine-tuned BioBERT is 68.1% (PubMedQA). BioGPT-Large with GPT-4 augmentation reaches 75.4%, few-shot GPT-4 reaches 74.4%, and human experts reach 78.0% (Dr. LLaMA). These published numbers orient the reader, but they are not the comparison. Every comparison we make is between our own conditions, which share data budget, fine-tuning recipe, tuning budget and seeds.

Identifier-based removal. The strongest competitor on the causal question is removing the source abstracts by identifier ($D\setminus S$) and then applying the 13-gram filter used in industry. It is cheap and exact, and if the gain vanishes here, soft contamination is irrelevant to this benchmark. No reported result found on Lacuna for PubMedQA accuracy after source-abstract removal.

General-encoder neighbor removal. The strongest existing detection method is the Soft Contamination pipeline: cosine similarity over a general encoder, followed by LLM verification. We rerun it on our corpus at the same candidate budget. On detection there is no reported result found on Lacuna for any soft-contamination detector on biomedical corpora. The nearest reported figures are general-domain: 78% of CodeForces problems with semantic duplicates in Soft Contamination, and a 21.8% to 30.2% improvement over n-gram detection for CDD in Generalization or Memorization.

What counts as beating a detector. The biomedical encoder beats the general one if its neighbor removal cuts significantly more accuracy per deleted token, with the random-removal control subtracted.

Random-removal ablation. This isolates the key ingredient. Deleting the same number of tokens at random tests whether "removing similar text" matters, or merely "removing text." Without it, any drop could simply be less domain data.

Why not just…?

Why not just match PubMed identifiers and n-grams? This catches the source abstract but not a meta-analysis restating its conclusion in new words. Jiang et al. already found 13-gram filtering left contaminated performance nearly intact in general text. The threat is real, though: for PubMedQA the verbatim source may carry nearly all of the effect. The $D\setminus S$ condition settles this directly. If the soft term is indistinguishable from the random control, we report that embeddings add nothing here.

Why not just evaluate on a post-cutoff PubMedQA-style set? Building such a set is cheap and we will do it. Temporal holdouts confound contamination with topic drift, however, and Unveiling Causal Reasoning in LLMs shows accuracy drops after cutoff dates without separating the two causes. We will check whether the removal-based soft-gain estimate predicts the temporal gap. Agreement would validate the cheap temporal holdout as a practical proxy. Disagreement would show how much of that gap is drift rather than contamination.

Why not just paraphrase the benchmark as Clean-Eval does? CLEAN-EVAL filters LLM paraphrases with BLEURT, a learned similarity metric, but on general benchmarks. The Emperor's New Clothes finds paraphrasing gives near-zero resistance. Biomedical terminology also leaves little room to reword. We include BLEURT-filtered paraphrases of PQA-L as a mitigation arm and measure their fidelity and resistance against our models of known contamination.

Why not just use output-distribution detection (CDD) with no retraining? CDD detects memorization by measuring how much repeated sampled generations collapse onto one string. A PubMedQA answer is a single yes/no/maybe token, so there is little output diversity to collapse. We will still run CDD on the long-answer rationale and report its agreement with the causal labels.

Decisive Checks

The central test is whether the soft term, with the random control subtracted, is significantly positive across seeds on both the PQA-L test split and the 10,000-item held-out set. A second test is whether the context-flip rate rises as neighbors are removed, as it should if recall is replacing reading in the full model. A third is whether detectors rank the same way on verified precision as on gain removed per token. If they do not, similarity to human judgment is the wrong criterion for choosing contamination detectors.

We will also report the verbatim, soft and residual shares of the total domain gain. The residual share is the portion that can fairly be credited to domain pre-training rather than leakage.