Fresh-Entity Probes for Ontological Deduction in Domain-Pretrained Language Models

Biomedical language models score well on medical exams. Nobody can tell whether they reach those answers by reasoning over the domain's rules ("every GLP-1 agonist is an antidiabetic agent, so this new GLP-1 agonist is one too") or by recalling conclusions they read during training. The problem is sharper in specialized domains than on the open web. The ontologies that define the domain's rules, such as the Gene Ontology and drug and disease taxonomies, are themselves part of the training text, so any benchmark built from them is contaminated by construction. We propose to separate deduction from recall with fresh entities: invented concept names attached to real ontologies by a single stated premise. Every correct answer about such an entity has to be derived, because no text anywhere could have stated it.

The proposal has two parts. First, we pretrain small biomedical models from scratch where we control exactly which premises and which conclusions each model has seen, including deliberately leaked conclusions. This shows what deduction and contamination look like when the ground truth is known. Second, we use those calibrated models to validate a cheap probe that can then be applied to existing biomedical models whose training data we cannot inspect. A secondary question is whether adding a geometric "rule-preserving" training signal, which represents classes as nested boxes, makes domain models deduce rather than recall.

Core Claim

Fresh-entity entailment questions are generated automatically from a real ontology and checked by a symbolic reasoner, a program that computes all facts logically implied by the ontology's axioms. When paired with the same questions asked about real entities, they give a contamination-robust measure of rule following in specialized models. The quantity of interest is the deduction gap: accuracy on questions about real entities, whose conclusions may have been read, minus accuracy on matched questions about fresh entities, whose conclusions cannot have been read. The two sets are matched on hop depth (how many rule applications are needed) and on relation type (subclass versus mutual exclusion).

We claim three things. In models pretrained under controlled exposure, the gap tracks how many conclusions were actually leaked. Standard string-overlap decontamination does not remove the gap. And the gap's ordering across models reproduces on existing biomedical models.

Relation to Prior Work

Our motivation comes from three findings that measure the symptom but not the mechanism. LiveClin harvests post-cutoff PubMed Central cases and finds a drop of nearly 10 points for GPT-5, but each update costs over $42,000 and 1,700 clinician hours, and it has no formal ground truth. Disentangling Reasoning and Knowledge in Medical Large Language Models uses a classifier to estimate that only 32.8% of MedQA questions need multi-step reasoning, and shows accuracy collapsing under misleading hints. Its labels are heuristic, and it never measures training exposure. Jiang et al. (Investigating Data Contamination for Pre-training Language Models; Does Data Contamination Make a Difference?) pretrain GPT-2 models on 3.3B Pile tokens with injected test data. They find a U-shaped benefit from repetition, peaking around 10 copies, and find that 8- and 13-gram filters miss paraphrased leakage. Their study covers general benchmarks only. We reuse their controlled-pretraining design (it supplies our method) in a domain where the "test data" is a deductive closure rather than a fixed set of items.

Two works constrain how the evaluation can be designed. DyVal generates reasoning problems as random graphs and shows that models strong on static benchmarks fall to near zero. A²RBench verifies generated tasks by program cycle-consistency and reports a 17.7% drop when symbols are renamed. Both avoid contamination through abstraction: synthetic graphs, grids, and toy semantics. That abstraction also throws away the domain knowledge that domain pretraining is supposed to supply. Our fresh entities keep real upper ontologies. For example, a pseudo-word drug sits under a real class chain learned from PubMed, so a correct answer requires domain knowledge and deduction together.

On the rule-preservation side, OWL2Vec* turns OWL axioms into text strings and trains word2vec on them. It reaches Hits@1 of 0.932 on HeLis membership prediction, but it is shallow and reports collapse on classes that lack instances. BoxLM represents medical concepts as boxes centered on frozen BioBERT embeddings, so that a parent class's box encloses its children's boxes, and predicts ICD codes. BoxE shows that boxes can express hierarchy and mutual exclusion. None of the three places the box constraint inside language-model pretraining, and none tests whether its gains come from leakage. Arguments that point embeddings cannot represent class inclusion (Learning Ontology Axioms over Knowledge Graphs via Representation Learning; On2Vec) motivate our geometry ablation.

Research Program

Probe generator. We start from the Gene Ontology and FoodOn/HeLis, which OWL2Vec* used, so that comparison is direct, plus a drug-class taxonomy. For each probe we mint a pronounceable pseudo-word that does not appear in any corpus. We attach it with one premise, for example "Zorvatide is a GLP-1 receptor agonist." A reasoner then computes the entailed answers at hop depths 1 to 4, along with entailed negatives from disjointness axioms. Each fresh probe is matched with a real-entity twin that has the same class path and depth.

A remapped variant renames the intermediate classes in context and states their axioms in the prompt. This variant uses the symbol-renaming diagnostic of A²RBench. It separates "knows the real hierarchy" from "can apply a stated hierarchy." Generation is procedural, so a probe set can be regenerated with new pseudo-words whenever earlier ones might have leaked. That directly addresses the second-order contamination risk the file raises for dynamic benchmarks.

Controlled pretraining. Following Jiang et al.'s scale, we train 124M- and 774M-parameter GPT-2 models from scratch on about 3B tokens of PubMed abstracts, drawn from the kind of corpus BioBART used. Interleaved in the corpus are short synthetic documents that verbalize ontology axioms and introduce a fixed pool of training-time fresh entities through premises only.

The conditions vary only in what is added:

  1. A clean condition, with premises only.
  2. A materialized-closure condition, where all entailed conclusions about training-time fresh entities are verbalized.
  3. Contamination conditions, where evaluation conclusions themselves, paraphrased, are injected at 1, 10, and 20 repetitions to reproduce the U-curve.
  4. Each contaminated condition after 13-gram decontamination.
  5. A box-auxiliary condition. Hidden states over a concept name's tokens are projected to a Gumbel box, and a loss enforces ontological containment and disjoint boxes for mutually exclusive classes, as BoxLM does for ICD codes. Here the boxes shape the language model's own representations.

Evaluation-time fresh entities are always new. Their premises are presented in context or in a short late-training document.

Transfer to existing models. We run the same probes, regenerated with new pseudo-words, on BioBART-Large, a general Llama-3.1-8B-Instruct, and the reinforcement-learning-trained BioMed-R1-8B. We report the deduction gap and the remapping drop for each.

Baselines

The naive reference is the clean domain model with no rule signal and no leakage. It sets the floor for fresh-entity deduction, and every other arm is measured against it on the same tokens, steps, and tokenizer.

The strongest existing method for ontology deduction is OWL2Vec, trained on the same verbalized axioms and premises. It reports Hits@1 of 0.932 on HeLis membership (OWL2Vec*). We rerun it on our fresh-entity split rather than quote that number, because its known weakness on instance-less classes is exactly our setting. A language-model arm "beats" it if it exceeds OWL2Vec's fresh-entity Hits@1 at depth 3 or more.

The strongest contamination detectors are string overlap and perplexity-based membership inference from the contamination survey. We run them on the controlled models, where true exposure is known. The deduction-gap probe beats them if it ranks the contamination conditions correctly where they do not. No reported result was found on Lacuna for these detectors on ontology-derived items. The relevant anchor is Jiang et al.'s report that GT contamination moved GPT-2 large on MMLU from 22.8% to 24.3% and CNN/Daily Mail from 0.5968 to 0.6996 despite standard filtering.

For transfer, BioMed-R1-8B is the strongest robust medical model in the file. It reaches 56.4% adversarial accuracy against 29.3% for base Llama-3.1-8B-Instruct (Disentangling Reasoning and Knowledge). We ask whether its robustness shows up as a smaller deduction gap.

Two ablations isolate the geometric ingredient. The first replaces the box loss with a point-based translational loss with the same number of parameters and the same steps. The second keeps boxes but drops the disjointness term. We would count boxes as helping only if they beat the point loss on depth-3+ and disjointness probes across three seeds.

Why not just…?

Why not just materialize the full deductive closure into the corpus? This is a real threat. For a static ontology, running a reasoner and writing out every conclusion will probably beat any learned deduction on known entities, and our materialized-closure arm tests exactly that. But materialization is contamination of the kind we measure. It cannot cover entities that appear only in new text, which is the case that matters in practice: a drug described in an abstract published after the ontology snapshot. If the materialized model does no better than the clean model on evaluation-time fresh entities, materialization buys recall and not rule following. If it does generalize, that is a positive finding: closure text teaches the rules. We would then recommend it over the box loss.

Why not just use post-cutoff cases, as LiveClin does? Post-cutoff data shows that a drop exists, but not why. Questions about real cases mix rarity, multimodality, and novelty, and every refresh costs tens of thousands of dollars. Fresh entities give formally checked answers at generation cost and isolate one failure: not applying a rule.

Why not just run DyVal or A²RBench? They do avoid contamination, but by discarding domain content, so they cannot tell whether domain pretraining improved deduction over domain concepts. Our remapped variant is A²RBench's diagnostic transplanted onto real ontologies, and we report both side by side.

Why not just train with chain-of-thought or reinforcement learning? DyVal found that 33.8% of GPT-4's failures were unsubstantiated answers, and A²RBench documents correct answers reached through invalid reasoning. Neither shows that reasoning traces fix rule application. Including BioMed-R1 lets the probe test this directly. If BioMed-R1 shows no deduction gap, reinforcement learning is a sufficient fix, and we will say so.

Proposed Experiments

The first decisive check is calibration. Across the controlled conditions, the deduction gap should rise with the number of leaked conclusions, follow the U-shape over repetitions that Jiang et al. report, and survive 13-gram decontamination. Membership-inference scores should fail to separate paraphrased leakage. If the gap does not track known exposure, the probe is invalid and the transfer study stops.

The second check is depth. Fresh-entity accuracy by hop depth should fall faster than real-entity accuracy in the clean model. A flat curve would mean small domain models already compose the rules.

The third check is the box versus point ablation on disjointness and depth-3+ probes, with OWL2Vec* as the external comparison.

The fourth check applies the calibrated probe to BioBART, Llama-3.1-8B-Instruct, and BioMed-R1. We report each model's deduction gap and remapping drop, plus the correlation between the gap and each model's drop on the adversarial-hint setting of Thapa et al. A positive correlation would show that the cheap, regenerable probe predicts the brittleness that costly clinical evaluations reveal.