When a language model is adapted to a specialist field such as law or medicine, it is often trained in stages, one corpus after another, with the target domain last. Two well-supported findings disagree about how to order those stages. In machine translation, ordering domains from least to most similar to the target works best. In large-scale continual pretraining, a random order beats a similarity-sorted order. This note argues that the two findings may not conflict at all. They measured different things. The translation work scored the target domain only, while the continual-pretraining work scored how much broad knowledge survived. If that is right, the order of stages is not a detail to tune for one number. It is a dial that trades accuracy on the target task against the model's ability to serve other, unseen tasks.
We propose to measure that trade-off directly. We will run controlled sequences of domain-adaptive pretraining and record, after every stage, two things: target-domain task accuracy, and transfer to a fixed panel of held-out downstream tasks. We then test one cheap scheduling rule that this view suggests: visit distant domains in random order, and finish with a short similarity-ordered tail. The point of the rule is to buy the target gains of a smooth final approach without the loss of breadth that full similarity sorting causes.
Core Claim
The claim has three parts. First, similarity-ordered curricula raise final target accuracy but lower cross-task transfer, measured as frozen-feature probe accuracy on held-out tasks. Random orders do the reverse. Each published result is one end of this trade-off. Second, the trade-off is larger for causal (left-to-right) decoders than for masked-language-model encoders, since encoders forget much less across domain sequences. Third, a hybrid schedule with a random prefix and a similarity-ordered tail gives a better pair of outcomes than either pure strategy. We also claim that the effect comes from the ordering inside the tail, not merely from putting target-related data last.
Prior Work and Where This Sits
Two papers motivate the proposal by disagreeing. Neural Machine Translation Training in a Multi-Domain Scenario found that ordering training from least to most target-similar domain gives the best translation into the target domain. In a related result, QCRI's Machine Translation Systems for IWSLT'16 showed that out-of-domain-then-in-domain training beats a pooled mixture. Investigating Continual Pretraining in Large Language Models: Insights and Implications studied 159 domains from M2D2, a large corpus split into fine-grained topic domains. It found that random order preserves knowledge and transfer better than similarity order. It also found that RoBERTa barely forgets compared with GPT-family models, and that Llama2-7B needs about 100MB per domain before it adapts meaningfully. Neither line measured both endpoints on the same runs, and that is the gap we fill.
Don't Stop Pretraining: Adapt Language Models to Domains and Tasks supplies the method we reuse. It introduced domain-adaptive pretraining, which continues pretraining on unlabeled domain text, followed by task-adaptive pretraining on the task's own unlabeled text. It also showed that pretraining on irrelevant domains hurts the target. We keep that two-step final approach fixed and vary only what comes before it.
Several papers constrain the design. Don't Stop Pretraining? Make Prompt-based Fine-tuning Powerful Learner showed that the downstream evaluation format can reverse the sign of an adaptation step: task-adaptive pretraining cut QNLI accuracy by 9.2% under prompt-based fine-tuning. We therefore evaluate transfer with format-neutral frozen-feature probes and treat prompted evaluation as a separate check. Multi-stage pipelines such as AnesSuite and TALLRec report outward transfer from specialist curricula, for example gains on MedQA and MMLU in AnesSuite. Neither varies stage order, so they show that the breadth axis matters without telling us how ordering moves it.
For measuring transfer, Transferability-Guided Cross-Domain Cross-Task Transfer Learning introduced F-OTCE. It is a fast transferability score that aligns source and target features with optimal transport, a method for matching two point clouds at minimal cost, and then reads off how predictable target labels are from source labels. That paper and OTCE used such scores on static, single-step vision transfers. We use F-OTCE only as a secondary diagnostic across checkpoints in a sequence. Linear probes remain the primary measure, because they are just as cheap here and easier to interpret.
Research Program
The core artifact is a "transfer ledger." For each training sequence, we save a checkpoint after every domain stage. At each checkpoint we record three things. The first is target-domain perplexity. The second is accuracy on a target downstream task after the fixed domain-then-task adaptation and fine-tuning. The third is mean linear-probe accuracy on a panel of held-out tasks that are unrelated to the target. The ledger lets us draw each ordering as a path through the plane of target accuracy versus breadth, rather than as a single final number.
We select 24 M2D2 domains, with a small cluster related to each target and the rest spread across distant topics. Each stage uses at least 100MB of text, following the critical-mass result. Targets are legal and clinical long-document classification: SCOTUS and ECtHR for law, MIMIC discharge summaries for medicine. Target-related M2D2 domains form the "near" cluster.
Models span the axis along which forgetting is known to differ: RoBERTa-base, GPT-2 Small and Medium, and a roughly 1B-parameter causal model. Llama2-7B is used only for a final confirmation on the two best schedules, because cost limits it there.
To explain the trade-off, we track the effective rank of the representations at each checkpoint. Effective rank estimates how many feature directions the representation really uses. The prediction is that similarity ordering narrows the representation step by step during the tail, while random order keeps it broad.
Baselines
The naive reference is the base model with no intermediate domains. It receives only the final domain-then-task adaptation and fine-tuning, using the same tokens and tuning budget as everything else. This tells us whether intermediate domains help at all.
The pooled baseline mixes all 24 domains into a single stage with the same total token count. The translation results say this washes out niche signal on the target, but it may well keep breadth.
The two published strategies are the main competitors. One is the least-to-most-similar order from Neural Machine Translation Training in a Multi-Domain Scenario. The other is random order, the winner in Investigating Continual Pretraining in Large Language Models, run over five seeds. Random order is the strongest existing method on breadth. No reported result was found on Lacuna for random-order continual pretraining on SCOTUS, ECtHR or MIMIC, or on our probe panel. The only quantitative anchors in the file are the 100MB threshold and qualitative forgetting comparisons. As an outside reference point on SCOTUS, Efficient Document Embeddings via Self-Contrastive Bregman Divergence Learning reports a micro-F1 of 71.4 for a head-only Longformer with SimCSE and a Bregman regularizer. That paper's setup differs from ours, so we cite the number for scale only.
We also add a replay baseline: random order with 10% of each stage's data replaced by general text. Replay is the standard remedy for forgetting.
Two ablations isolate the key ingredient. The first, "recency only," uses a random prefix followed by the same near-cluster tail in random internal order. It tests whether gains come from similarity ordering or just from ending near the target. The second reverses the tail, going from most to least similar.
All arms get identical token counts, data, learning-rate schedules, the same final adaptation, and the same hyperparameter search over final fine-tuning. Beating the baselines means the hybrid matches similarity order on target accuracy, within seed variance, while matching random order on panel breadth. In other words, it must lie on the better side of both pure strategies across seeds. It must also beat the recency-only ablation on target accuracy, or the similarity-ordering story fails.
Why not just…?
Why not just pool everything into one stage? Pooling is the simplest way to keep breadth, and the translation evidence against it concerns only the target endpoint. It is a real threat on our breadth axis, so it is a full arm in the study. If pooling matches the hybrid on both axes, the conclusion is that ordering does not matter at this scale. We would report that as such.
Why not just add replay of general data? Replay directly limits forgetting and could close the breadth gap of similarity ordering without any scheduling. We run similarity order plus replay as well as random order plus replay. If similarity order plus replay matches the hybrid on both axes, the practical recommendation becomes "add replay," and the ordering claim shrinks to an explanation of the published conflict. That remains a useful result.
Why not just train on the target domain alone, skipping intermediate domains? The finding in Don't Stop Pretraining that the in-domain-then-task approach captures most gains suggests intermediate domains may be pointless for the target. The naive reference arm tests exactly this. If it ties every sequence on target accuracy, the study is reframed as one about breadth costs alone.
Why not just use F-OTCE or another transferability score instead of probes? In this setting, probes are already only seconds per task. The value of F-OTCE is unproven for language-model checkpoints. We therefore report how well F-OTCE rank-correlates with probe accuracy across checkpoints, but make no claim that depends on it.
Proposed Experiments
The first decisive check is the reconciliation itself. On RoBERTa, GPT-2 and the 1B model, do similarity order and random order cross over? Similarity order should win on SCOTUS, ECtHR and MIMIC accuracy, and random order should win on the panel average. The breadth panel uses linear probes on the SentEval transfer tasks, STS benchmarks, and a fixed subset of MTEB classification and clustering tasks, all frozen-feature and format-neutral. Seeds and paired bootstrap set the confidence intervals. If there is no crossover, the central claim is wrong.
The second check is architecture dependence. Is the gap between orderings much smaller for RoBERTa than for causal models, as the forgetting asymmetry predicts?
The third check pits the hybrid against both pure strategies, the replay arms, and the recency-only ablation, with tail lengths of 2, 4 and 6 stages. We confirm the best two schedules on Llama2-7B.
As a format control, we re-evaluate breadth with prompt-based few-shot fine-tuning on SST-2, MNLI and QNLI. This tests whether the probe ranking of schedules holds under prompting, given the sign flip reported for prompted evaluation.
Finally, the effective-rank traces test the proposed mechanism. If breadth losses do not follow drops in rank during similarity-ordered tails, we report the trade-off without the narrowing explanation.
References
- Neural Machine Translation Training in a Multi-Domain Scenario
- QCRI's Machine Translation Systems for IWSLT'16
- Investigating Continual Pretraining in Large Language Models: Insights and Implications
- Don't Stop Pretraining: Adapt Language Models to Domains and Tasks
- Don’t Stop Pretraining? Make Prompt-based Fine-tuning Powerful Learner
- AnesSuite: A Comprehensive Benchmark and Dataset Suite for Anesthesiology Reasoning in LLMs
- TALLRec: An Effective and Efficient Tuning Framework to Align Large Language Model with Recommendation
- Transferability-Guided Cross-Domain Cross-Task Transfer Learning
- OTCE: A Transferability Metric for Cross-Domain Cross-Task Representations
- Efficient Document Embeddings via Self-Contrastive Bregman Divergence Learning