Does Legal Pre-Training Teach Models to Read Contracts or to Guess Them?

When a language model is further trained on a large pile of specialized text, such as contracts, its benchmark scores usually rise. Nobody can currently say why. One possibility is that the model reads the document better. The other is that it has absorbed what contracts usually say and answers from that expectation. On real contracts the two explanations produce the same aggregate score, because typical documents contain typical values. They come apart the moment a document says something unusual: a liability cap of $3.7M instead of the customary figure, or a missing indemnity clause that most contracts include. Those are exactly the cases where a contract-review error costs money.

We propose to separate these two sources of gain with counterfactual document edits. We alter the values and clauses in held-out contracts while keeping each document grammatical and legally coherent. We then track, across checkpoints of continued pre-training on contract text, how much of the model's accuracy survives the edit. The accuracy that survives is reading. The accuracy that disappears was the model's prior happening to be right. Two edit directions give a controlled version of the invention-versus-omission split. Deleting a customary clause tests whether the model invents it. Inserting an atypical one tests whether the model misses it.

Core Claim

Aggregate gains from domain continued pre-training are a mixture of two components: better reading of the input, and stronger parametric priors over what domain documents contain. Only the first transfers to atypical documents. We claim the mixture can be measured directly. For each extraction instance with original text $x$ and a counterfactual edit $x'$ that changes the gold answer, write $A_{\text{orig}}$ for accuracy on originals and $A_{\text{cf}}$ for accuracy on the edited versions. Then

$$A_{\text{orig}} = A_{\text{cf}} + \Delta_{\text{prior}}, \qquad \Delta_{\text{prior}} = A_{\text{orig}} - A_{\text{cf}},$$

where $A_{\text{cf}}$ estimates reading competence and $\Delta_{\text{prior}}$ estimates accuracy that exists only because the gold answer matched what the model expected.

We further define a prior pull rate: the fraction of counterfactual errors in which the model outputs the original value or the most frequent value for that clause type in its pre-training corpus, compared with the rate expected under uniform confusion.

The hypothesis we expect to be most informative, and which could fail, is this. As legal continued pre-training proceeds, $A_{\text{orig}}$ rises while $A_{\text{cf}}$ stays flat or falls, and prior pull grows. If so, part of the small legal pre-training gain reported for CUAD is prior-matching rather than reading.

Where This Sits

The motivating evidence comes from two audits. LegalHalluLens (conference version here) audits general frontier and open instruction-tuned models on CUAD clause extraction. It shows that an aggregate hallucination rate of about 52% hides roughly 30% error on temporal claims versus about 70% on numeric and obligation claims. It introduces the Risk Direction Index, a signed score separating fabricated clauses from omitted ones. It also observes models defaulting to a common $5M liability cap despite explicit instructions not to. That paper never trains a model, so it cannot say whether domain pre-training creates, entrenches, or corrects such priors. Its typed rates also cannot tell a reading failure from a prior override, because both show up as the same wrong answer. Our counterfactual design supplies that missing separation and places it along a pre-training trajectory.

Quantifying Memorization in Continual Pre-training motivates the prior-entrenchment hypothesis. It shows that continued pre-training on an industry corpus (Nikkei, versus Japanese Wikipedia) sharply increases verbatim memorization, with maximum exact-match length rising from 15 to 27 characters. That work measures memorization only as string leakage and never asks what it does to downstream behavior. We borrow its matched-corpus design, with a domain arm and an equal-token general arm, and connect memorized regularities to downstream errors.

The method draws on three sources. The first is the oracle-substitution logic of TIDE, which attributes an aggregate score to error types by fixing one type at a time. The second is the invariance and directional tests of CheckList, which check whether a prediction moves correctly when the input is perturbed. The third is the seen-versus-unseen slicing of Rethinking Generalization in NER, which found 10–20 point F1 drops on unseen entities in general news data. Our edits push this slicing further: instead of relying on naturally unseen items, which differ from seen ones in many ways, we construct unseen values inside otherwise identical documents.

Pre-train or Annotate? found that domain pre-training mainly helps unseen entities. This favors the reading account and is the result most likely to contradict our hypothesis. We treat it as a live alternative. That work measured unseen entity names in procedural text. Contract values have heavily skewed distributions in which the prior is often right, so the two findings can both hold, and our design tests which regime legal extraction falls into.

CUAD supplies the benchmark and the puzzle. There, pretraining on 8GB of extra legal text "only improved performance by about 3%". Our decomposition asks what that 3% consists of.

Research Program

Counterfactual edits. We build counterfactual versions of the CUAD test contracts for clause categories with checkable answers: numeric caps and amounts, dates and durations, notice periods, governing law, and the presence or absence of obligation clauses. Value edits replace the gold span with a plausible but atypical value. The new value is drawn from the same unit and range but chosen to be rare in the pre-training corpus. Consistent downstream references (totals, cross-references) are updated with rule-based propagation.

Structural edits. These run in two directions. In the deletion direction, a clause present in most contracts of that type is removed, and asserting it counts as invention. In the insertion direction, an atypical but well-formed obligation is added, and failing to extract it counts as omission. This produces a controlled invention-versus-omission score. In LegalHalluLens the direction of error depends on whatever documents happen to be in the data; here each direction is tested against a known perturbation.

Scoring for value categories is exact match after normalization, which avoids depending on an LLM judge, a known weakness of LegalHalluLens. Attorneys will review a random sample of edits for legal coherence, and incoherent edits will be discarded.

Training arms. We run continued pre-training of an 8B open base model, the same scale FeynTune used for domain variants. The main arm trains on publicly filed commercial contracts deduplicated against all 510 CUAD contracts. A general-text arm uses a matched token count. The key ablation arm trains on the same contract corpus with every numeric value, date, and jurisdiction independently resampled, so the text keeps legal syntax and clause structure but carries no value regularities. We save checkpoints at geometric intervals. After each checkpoint we apply the same fixed supervised fine-tuning on the CUAD training split, and then evaluate original and counterfactual test sets.

Encoder replication. A DeBERTa arm repeats the CUAD extractive setup. This links our decomposition directly to the ~3% legal pre-training gain reported there.

Biomedical transfer check. A smaller second domain tests whether the effect is specific to contracts. We edit PubMedQA contexts (PubMedQA) so that the reported direction or significance of a result is reversed. The gold yes/no answer must flip, a CheckList-style directional test. We compare a biomedical continued-pretraining arm with a general arm on this edited set.

Baselines

The do-nothing reference is the same base model with no continued pre-training, fine-tuned identically on CUAD. It fixes the starting point of both $A_{\text{orig}}$ and $A_{\text{cf}}$ and shows how much prior pull already comes from general pre-training. LegalHalluLens's $5M-cap anecdote suggests this starting level is not zero.

The strongest existing extraction system on this benchmark in the file is CUAD's fine-tuned DeBERTa-xlarge. It reports an AUPR of 47.8% and a Precision at 80% Recall of 44.0% (CUAD). We reproduce it on the CUAD split with the same training data and hyperparameter search budget as our encoder arms, then evaluate it on the counterfactual set. It is the right competitor because it defines what "good at CUAD" currently means.

"Beating" it is not a higher AUPR. Our claim is diagnostic, and the relevant test is whether our decomposition exposes a gap its aggregate score conceals: specifically, a $\Delta_{\text{prior}}$ that is large and grows with legal pre-training. A secondary success would be that the value-randomized arm matches or beats the natural-corpus arm on $A_{\text{cf}}$ at equal compute, which would suggest a practical corpus intervention.

The strongest existing diagnostic is LegalHalluLens's typed audit with its Risk Direction Index. It reports an aggregate rate of about 52%, a roughly 30% versus 70% category gap, and an obligation-claim index moved from −0.078 to −0.014 by its debate pipeline. We run its category typing on every checkpoint's outputs for the original contracts. Our method adds information only if checkpoints with similar typed error rates and similar index values differ substantially in $\Delta_{\text{prior}}$ or prior pull.

The key ablation is the value-randomized corpus. If the natural-corpus and randomized-corpus arms show the same trajectories of $A_{\text{cf}}$ and prior pull, then value regularities in the corpus are not the cause, and the hypothesis fails.

Why not just…?

Why not just slice CUAD by how common each gold value is? This is the most serious simple alternative, and we run it. For each test instance we bin the gold value by its frequency in the pre-training corpus and compare accuracy across bins and checkpoints. Its weakness is confounding. Contracts with rare caps also differ in type, length, drafting style, and clause density. The seen/unseen analysis in Rethinking Generalization in NER inherits the same confound. If frequency slicing and counterfactual edits give the same ordering of checkpoints and the same size of effect, the cheaper method suffices and we will report that. Counterfactuals are needed only if the two disagree. They would disagree, for example, if rare-value contracts are also harder for unrelated reasons.

Why not just apply LegalHalluLens's typed audit to domain-adapted checkpoints? Typed rates say which category fails but not why. A wrong numeric cap produced by misreading and a wrong cap produced by reverting to the customary value count as the same error. The debate pipeline in that paper cut fabricated detections by 45% but acts as a filter rather than a fixer. It changes which outputs survive, not what the model believes contracts contain. Our comparison with the typed audit (see Baselines) directly tests whether the extra axis carries information.

Why not just measure memorization with membership inference or exact-match leakage? Quantifying Memorization already shows these rise with industry pre-training. Leakage measures which strings are stored, and it treats every stored string as equally harmful. Our question is whether stored regularities override the input at test time, a behavioral effect that leakage metrics do not measure. We record leakage at each checkpoint and test whether it predicts prior pull. If it predicts prior pull closely, leakage would be a cheap proxy, which is useful in itself.

Why not just add retrieval or tell the model to rely only on the document? The document is already in context in extractive review, so retrieval adds nothing new. LegalHalluLens reports that explicit prompt constraints failed to stop the $5M default. We include an instruction-only condition ("answer strictly from the text; values may be unusual") at each checkpoint to measure how much prior pull prompting removes.

Decisive Checks

The first check is the trajectory. Across legal continued-pretraining checkpoints, is the rise in $A_{\text{orig}}$ matched by $A_{\text{cf}}$, or does the gap $\Delta_{\text{prior}}$ widen? We compare against the general-text arm with bootstrap confidence intervals over contracts.

The second is the ablation. Does the value-randomized corpus remove the growth in prior pull while keeping most of the gain on counterfactual documents? If so, that isolates corpus value statistics as the cause.

The third is directional. Do the deletion and insertion edits show legal pre-training moving models toward inventing customary clauses, toward omitting atypical ones, or toward neither? Answering this changes LegalHalluLens's Risk Direction Index from an observation about particular models into a measured consequence of training data.

The fourth is transfer. Does the PubMedQA reversal test show the same pattern for biomedical pre-training? The reference points are BioBERT at 68.1% accuracy, the majority guess at 55.2%, and human experts at 78.0% (PubMedQA). No reported result exists on Lacuna for any model on counterfactual-edited PubMedQA or CUAD, so every edited-set number here would be new.

A null result would also be informative. Flat $\Delta_{\text{prior}}$ with rising $A_{\text{cf}}$ would support the reading account suggested by Pre-train or Annotate? and would count as evidence that legal pre-training is safe for atypical contracts.