Introduction
Several machine learning (ML) areas underwent a paradigm shift in the last decade, transitioning from training custom models on task-specific data toward leveraging in-context learning (ICL) to obtain predictions without any parameter updates [7 , 20 , 66 , 61 , 1 ] . The tabular modality enjoyed its own such paradigm shift after the development of amortized pre-trained models known as prior-fitted networks (PFNs) [38 , 21 , 22 , 46 , 47 ] , which provide classification and regression predictions on novel datasets in a single forward pass, outperforming the status quo of gradient boosted trees [9 , 26 , 45 , 15 ] . PFNs for tabular data, such as TabPFN [21 , 22 , 16 ] and TabICL [46 , 47 ] , are trained on millions of synthetic datasets to ingest a training set (the “support set”) and test features (the “query set”) as in-context prompts and return accurate predictions, capturing rich and complex inductive biases which make up the tabular modality.
Still, PFNs largely inherit the same fundamental limitations as classical ML, remaining brittle under distribution shift [48 , 51 , 18 , 27 , 59 , 37 , 11 , 68 ] . Because their synthetic priors construct the support and query sets as independent draws from the same generative process, PFNs expect by design that the support and the query follow the same distribution. Consequently, the model may experience silent performance deterioration when deployment data drifts substantially from the support set, while it is unclear whether existing out-of-distribution (OOD) detectors designed for the classical paradigm [19 , 31 , 28 , 34 , 52 , 57 , 64 , 23 , 67 ] are suitable for the in-context regime. Reliable deterioration detection is crucial if we are to leverage PFNs’ strong performance in high-stakes applications, such as healthcare [2 , 43 , 10 ] .
A partial solution is to compute certain distributional statistics between training and deployment data to flag deviations in the covariate distribution [14 , 35 , 32 , 49 , 33 , 69 ] . However, these approaches are inherently label-agnostic and therefore sensitive to benign shifts, where changes in the input space do not necessarily degrade model performance. More recently, methods that employ model disagreement have emerged as a more robust alternative [40 , 25 , 12 , 60 , 54 , 41 ] , leveraging the differences in a trained model’s ability to disagree with its own predictions in- and out-of-distribution as an indicator of deterioration. However, these methods rely on perturbing the weights of a model that has been fine-tuned for a specific task, whereas an amortized PFN’s weights remain fixed across tasks, and retraining is prohibitive and can degrade performance. Exploring how to apply disagreement-based detection in this regime is therefore a natural extension.
We introduce CALD (Calibrated Anchor-Loss Disagreement), a deployment deterioration monitoring mechanism for PFNs split into two phases (Figure 1 ). In the Calibration phase (2), CALD samples a small labeled anchor set from an in-distribution (ID) validation batch and treats the remainder as a held-out ID eval set. The decoder is then briefly fine-tuned under a dual objective consisting of an agreement term on the anchor and a disagreement term on the eval set with respect to the PFN’s own pseudolabels. Repeating this procedure across many validation draws yields a distribution of anchor losses in the ID setting. During the Deployment phase (3), we run the same fine-tuning procedure, substituting a (possibly OOD) unlabeled deployment batch for the eval set. We compare the resulting anchor loss against the losses in the ID distribution, and flag it if it falls in the lower tail. This is motivated by the idea that a lower loss is achievable when the evaluated samples occupy a different region of the PFN’s internal class-conditioned representations compared to the anchor samples.
Figure 1. CALD in three steps. (1) Setup. In the PFN’s feature space, a labeled anchor (★) sits inside the ID manifold ; the unlabeled eval batch (✕) arrives with unknown origin — it may sit on or off the ID manifold. (2) Calibration. L a n c \mathcal{L}_{\mathrm{anc}} L anc provides a stable ID reference; L e v a l \mathcal{L}_{\mathrm{eval}} L eval pulls the decoder off its eval pseudolabels. A short T T T -step finetune optimizes their sum, and the angle between g a , g e g_a,g_e g a , g e reveals the eval’s origin: on ID, the gradients fight (⟨ g a , g e ⟩ < 0 \langle g_a,g_e\rangle< 0 ⟨ g a , g e ⟩ < 0 ; λ \lambda λ stays high); off ID, they are nearly orthogonal (≈ 0 \approx0 ≈ 0 ; λ \lambda λ drops). The post-finetune anchor loss λ : = L a n c ( θ T ) \lambda:= \mathcal{L}_{\mathrm{anc}}(\theta_T) λ := L anc ( θ T ) is the test statistic. (3) Deployment. Repeating step 2 across K K K known-ID eval batches yields a calibration record; reject H 0 : X e v a l ∗ ∼ p 0 H_0 : X_{\mathrm{eval}}^* \sim p_0 H 0 : X eval ∗ ∼ p 0 (flag OOD) when λ ∗ \lambda^* λ ∗ falls below the α \alpha α -quantile q α q_\alpha q α (red region).
Our contributions are as follows:
A detector for tabular ICL. We propose CALD, to our knowledge the first deployment-time deterioration detector for PFNs that exploits their specific structure at inference.
Supporting theory. We derive conditions under which the post-finetune anchor loss is provably lower in expectation under sufficiently severe shift than under ID eval, with the gap controlled by the alignment of the anchor-agreement and eval-disagreement gradient fields.
Benchmark evaluation. We evaluate CALD on 14 datasets spanning covariate, domain, and structured covariate shift, across four shift severities, for both TabPFN and TabICL. CALD matches or outperforms 15 post-hoc baselines on harmful shifts, and on benign shifts achieves the most favorable trade-off among all methods evaluated (Table 1 ).
Table 1. Detection performance (TPR@5% FPR) across 14 shifts ordered by harm. Columns are sorted by ID→ \to → OOD accuracy drop Δ \Delta Δ (second header row, %). Harmful/benign split via Hoeffding bound at δ = 0.05 \delta= 0.05 δ = 0.05 , N = min ( rounds × eval , ∣ D O O D ∣ ) = 1,280 N = \min(\operatorname{rounds} \times\operatorname{eval}, |D_{\mathrm{OOD}}|) = 1{,}280 N = min ( rounds × eval , ∣ D OOD ∣ ) = 1 , 280 from the deterioration survey of Appendix § 10 .3: Δ ∗ ≈ 4.8 % \Delta^\ast\approx4.8\% Δ ∗ ≈ 4.8% . For harmful shifts (Δ > Δ ∗ \Delta> \Delta^\ast Δ > Δ ∗ ), TPR = rate of correct alarms. For benign shifts (Δ ≤ Δ ∗ \Delta\le\Delta^\ast Δ ≤ Δ ∗ ), TPR = rate of correct silence (1 − false-alarm rate). A good detector scores high in both regions.
Ablations and mechanism. We show that the detection signal scales with the harm a shift inflicts rather than with its magnitude, and we verify the gradient-interference mechanism behind the theory directly on the deployed models, by measuring the proof’s premise along the finetuning trajectories. We further provide a large suite of ablations, among which are the finetuning budget and its deployment cost, the disagreement weight, a frozen deployment configuration covered by the false-alarm guarantee, robustness to anchor quality, and detectability across shift types.
Post-hoc OOD detection. A long line of work scores each input under a frozen classifier by inspecting the softmax shape [19 , 31 , 44 , 34 ] , the distance from the training data in the model’s feature space [28 , 52 , 57 , 64 ] , and auxiliary-loss gradients [23 ] . Yang et al. [67 ] survey the space. Label-agnostic two-sample tests [35 , 33 , 69 ] target distributional change directly and can therefore lead to false positives on benign covariate shifts. Every detector in this family relies on a single forward pass through a frozen model and we adopt the strongest of these as baselines.
Disagreement-based monitoring. The observation that independently trained models often agree on ID samples but disagree on OOD samples [40 , 25 ] has been leveraged in several lines of work. Detectron [12 ] trains a small ensemble under a constrained-disagreement objective and derives its verdict from the deployment-batch disagreement rate. Rosenfeld and Garg [54 ] add to this by introducing disagreement discrepancy and provable error bounds. Finally, D3M [41 ] constructs a harm-calibrated Bayesian three-stage test with explicit FPR/TPR guarantees. All three assume a fixed converged classifier whose weights are perturbed externally, which is prohibitive in the PFN regime, where training a second copy is not an option. CALD instead perturbs the decoder of a model and reads its signal from the anchor loss rather than from the disputed prediction itself.
Adaptation under shift. A separate body of work tries to account for, rather than detect, distributional shifts. Methods include test-time adaptation [63 , 42 , 24 , 58 , 65 ] , source-free DA [30 ] , and feature alignment [56 , 62 ] . This line of work is distinct from detection, answering the question of how should we change the model? as opposed to should this prediction be trusted? , and treating one as a substitute for the other is risky when the shift falls outside the family the adapter was designed for. The in-context translation of this idea is Drift-Resilient TabPFN [17 ] , which retrains the PFN prior on synthetic data sampled from evolving structural causal models. On our 14-dataset benchmark it does not close the deterioration gap: mean δ O O D = − 1.4 \delta_{\mathrm{OOD}} = -1.4 δ OOD = − 1.4 pp across all datasets and − 2.2 -2.2 − 2.2 pp on the harmful subset, with PACS, CIFAR-10, and Waterbirds made measurably worse by the adapted prior, and every harmful dataset remains harmful by the same Hoeffding criterion. Full numbers are in Appendix § 10 .5. If anything, the result argues for placing a detector ahead of the adapter, including to flag when the adapter is itself the source of the problem.
Background and Method
Prior-Fitted Networks
Prior-fitted networks (PFNs) [38 ] are tabular foundation models pretrained to perform classification in-context, without any task-specific gradient updates at deployment. During pretraining, a PFN is exposed to millions of synthetic supervised tasks drawn from a designer-specified prior p ( θ ) p(\theta) p ( θ ) over data-generating processes. Each task contributes a labeled support set D s u p = ( X s u p , y s u p ) \mathcal{D}^{\mathrm{sup}} = (X_{\mathrm{sup}}, y_{\mathrm{sup}}) D sup = ( X sup , y sup ) of n n n examples that serve as the in-context prompt, together with a query batch with known labels. The model is optimized by minimizing the in-context cross-entropy between its predictions on the query and the ground-truth labels from the same generative process. After pretraining, a PFN approximates the posterior predictive distribution (PPD):
p ( y ∣ x , D s u p ) = ∫ p ( y ∣ x , θ ) p ( θ ∣ D s u p ) d θ , (1) p(y \mid x, \mathcal{D}^{\mathrm{sup}}) = \int p(y \mid x, \theta) p(\theta\mid\mathcal{D}^{\mathrm{sup}})\,\mathrm{d}\theta, \tag*{(1)} p ( y ∣ x , D sup ) = ∫ p ( y ∣ x , θ ) p ( θ ∣ D sup ) d θ , (1)
amortizing Bayesian inference into a single forward pass over the sequence ( X s u p , y s u p , x ) (X_{\mathrm{sup}}, y_{\mathrm{sup}}, x) ( X sup , y sup , x ) .
We view TabPFN and TabICL as PFN instantiations specialized to tabular classification and regression, with priors built from structural causal models (SCMs), Bayesian neural networks, and (for TabICL) tree-like inductive biases via XGBoost-fitted SCM edges. Both represent the current frontier in tabular supervised learning and are the empirical subjects of this work, though we note that the following exposition applies to the broader PFN family [36 , 3 , 53 ] .
Failure Monitoring of PFNs for Classification
PFN priors are largely ID: for each pretraining task, support and query sets are sampled from the same generative model. Thus, they do not account for queries whose covariates are OOD with respect to the support, which can produce post-hoc performance gaps beyond acceptable ranges. Detecting this requires a computable signal that distinguishes ID from OOD batches, from which we may build a hypothesis test. Per the model disagreement literature [12 , 41 , 60 , 54 ] , it is easier to force a model to disagree with its own predictions on OOD than on ID data; classical-paradigm methods such as DETECTRON [12 ] and D3M [41 ] exploit this by perturbing the weights of a fixed converged classifier. In the following, we show how forcing model disagreement can be done for PFNs and extract a relevant signal that helps distinguish ID and OOD, building the foundations of CALD.
In-Context Model Disagreement Optimization
Let us consider how disagreement could be maximized in the ICL paradigm with PFNs. Denote the ID distribution by p 0 p_0 p 0 and let D s u p = ( X s u p , y s u p ) ∼ p 0 n \mathcal{D}^{\mathrm{sup}} = (X_{\mathrm{sup}}, y_{\mathrm{sup}}) \sim p_0^n D sup = ( X sup , y sup ) ∼ p 0 n be a size-n n n ID support. We partition the queries into two disjoint roles:
Anchor ( X a n c , y a n c ) ∼ p 0 (X_{\mathrm{anc}}, y_{\mathrm{anc}}) \sim p_0 ( X anc , y anc ) ∼ p 0 with X a n c ∩ X s u p = ∅ X_{\mathrm{anc}} \cap X_{\mathrm{sup}} = \emptyset X anc ∩ X sup = ∅ . A held-out set of labeled ID samples. Their true labels y a n c y_{\mathrm{anc}} y anc are known and serve as a reference ID signal.
Eval (X e v a l X_{\mathrm{eval}} X eval ) ∼ p 1 \sim p_1 ∼ p 1 = ? p 0 \overset{?}{=} p_0 = ? p 0 . A batch of unlabeled query points whose distributional origin is unknown at test time, the target of our disagreement forcing.
Let q θ q_\theta q θ denote a PFN. Conditional on D s u p \mathcal{D}^{\mathrm{sup}} D sup , its forward pass returns logits and predictions:
z ∈ R C , q θ ( ⋅ ∣ x , D s u p ) : = softmax ( z ) ∈ Δ C − 1 , y ^ = arg max y q θ ( y ∣ x , D s u p ) (2) z \in\mathbb{R}^{C}, \quad q_\theta(\cdot\mid x, \mathcal{D}^{\mathrm{sup}}) := \operatorname{softmax}(z) \in\Delta^{C-1}, \quad\hat{y} = \operatorname*{arg\,max}_{y} q_\theta(y \mid x, \mathcal{D}^{\mathrm{sup}}) \tag*{(2)} z ∈ R C , q θ ( ⋅ ∣ x , D sup ) := softmax ( z ) ∈ Δ C − 1 , y ^ = y arg max q θ ( y ∣ x , D sup ) (2)
for each x ∈ X a n c ∪ X e v a l x \in X_{\mathrm{anc}} \cup X_{\mathrm{eval}} x ∈ X anc ∪ X eval , where C C C is the number of classes. Write y ^ e v a l \hat{y}_{\mathrm{eval}} y ^ eval for predictions (pseudolabels) the model assigns to X e v a l X_{\mathrm{eval}} X eval .
To force q θ q_\theta q θ to disagree with itself on X e v a l X_{\mathrm{eval}} X eval while remaining in agreement with the true labels from the anchor, we compute the cross-entropy (CE) loss rewarding correct predictions for the anchor:
L a n c ( θ ) = 1 ∣ X a n c ∣ ∑ ( x , y ) ∈ ( X a n c , y a n c ) − log q θ ( y ∣ x , D s u p ) (3) \mathcal{L}_{\mathrm{anc}}(\theta) = \frac{1}{\lvert X_{\mathrm{anc}}\rvert} \sum_{(x,y)\in(X_{\mathrm{anc}},y_{\mathrm{anc}})} -\log q_\theta(y \mid x,\mathcal{D}^{\mathrm{sup}}) \tag*{(3)} L anc ( θ ) = ∣ X anc ∣ 1 ( x , y ) ∈ ( X anc , y anc ) ∑ − log q θ ( y ∣ x , D sup ) (3)
and the Disagreement Cross-Entropy (DCE) loss [12 ] for the eval set, rewarding the model for placing low probability on its own initial pseudolabels:
L e v a l ( θ ) = 1 ∣ X e v a l ∣ ∑ ( x , y ) ∈ ( X e v a l , y ^ e v a l ) [ 1 C − 1 ∑ c ≠ y − log q θ ( c ∣ x , D s u p ) ] (4) \mathcal{L}_{\mathrm{eval}}(\theta) = \frac{1}{\lvert X_{\mathrm{eval}}\rvert} \sum_{(x,y)\in(X_{\mathrm{eval}},\hat{y}_{\mathrm{eval}})} \left[\frac{1}{C-1}\sum_{c\ne y}-\log q_\theta(c \mid x,\mathcal{D}^{\mathrm{sup}})\right] \tag*{(4)} L eval ( θ ) = ∣ X eval ∣ 1 ( x , y ) ∈ ( X eval , y ^ eval ) ∑ C − 1 1 c = y ∑ − log q θ ( c ∣ x , D sup ) (4)
If minimizing the CE loss bumps logits for the correct class up, minimizing the DCE loss pushes logits for the pseudolabel class down. Performing gradient descent on the joint objective
L ( θ ) = L a n c ( θ ) + β L e v a l ( θ ) (5) \mathcal{L}(\theta) = \mathcal{L}_{\mathrm{anc}}(\theta) + \beta\mathcal{L}_{\mathrm{eval}}(\theta) \tag*{(5)} L ( θ ) = L anc ( θ ) + β L eval ( θ ) (5)
with disagreement weight β = 1 \beta= 1 β = 1 throughout unless otherwise stated (Appendix § 11 .3 ablates it), thus has the effect of forcing q θ q_\theta q θ to disagree on the eval set while remaining performant on ID samples.
CALD: Calibrated Anchor-Loss Disagreement
Finetuning q θ q_\theta q θ under (5) exerts two competing pressures on θ \theta θ : L a n c \mathcal{L}_{\mathrm{anc}} L anc pulls the decoder toward the true labels on the anchor, while L e v a l \mathcal{L}_{\mathrm{eval}} L eval pushes it away from its own pretrained pseudolabels on the eval batch. The driving observation behind CALD is the way these pressures resolve.
The post-finetune anchor loss λ : = L a n c ( θ T ) \lambda:= \mathcal{L}_{\mathrm{anc}}(\theta_T) λ := L anc ( θ T ) is systematically lower when X e v a l X_{\mathrm{eval}} X eval is OOD than when X e v a l X_{\mathrm{eval}} X eval is ID (Figure 1 , Panel 2). CALD turns this one-dimensional signal into a calibrated one-sided test by collecting a null record of λ \lambda λ under known-ID conditions and rejecting at deployment when the observed λ ∗ \lambda^* λ ∗ falls into the lower tail of that record. We defer justification to Section 4.
Given hyperparameters T T T (finetune steps), K K K (calibration rounds), η \eta η (learning rate), and α \alpha α (test level), CALD proceeds in two phases (full pseudocode in Appendix § 8 .1):
Calibration phase. For each round k = 1 , … , K k = 1,\ldots,K k = 1 , … , K , draw an ID eval batch X e v a l ( k ) ∼ p 0 X_{\mathrm{eval}}^{(k)} \sim p_0 X eval ( k ) ∼ p 0 , freeze its pseudolabels y ^ e v a l ( k ) \hat{y}_{\mathrm{eval}}^{(k)} y ^ eval ( k ) assigned by q θ 0 q_{\theta_0} q θ 0 to X e v a l ( k ) X_{\mathrm{eval}}^{(k)} X eval ( k ) , and reset θ ← θ 0 \theta\leftarrow\theta_0 θ ← θ 0 . At each of T T T gradient steps, the PFN forward-passes the joint sequence ( X s u p , y s u p , X a n c , X e v a l ( k ) ) (X_{\mathrm{sup}}, y_{\mathrm{sup}}, X_{\mathrm{anc}}, X_{\mathrm{eval}}^{(k)}) ( X sup , y sup , X anc , X eval ( k ) ) : the anchor logits supply L a n c ( θ ) \mathcal{L}_{\mathrm{anc}}(\theta) L anc ( θ ) against the true labels y a n c y_{\mathrm{anc}} y anc , the eval logits supply L e v a l ( θ ) \mathcal{L}_{\mathrm{eval}}(\theta) L eval ( θ ) against the frozen pseudolabels y ^ e v a l ( k ) \hat{y}_{\mathrm{eval}}^{(k)} y ^ eval ( k ) , and the joint loss is descended via θ ← θ − η ∇ θ L ( θ ) \theta\leftarrow\theta- \eta\nabla_\theta\mathcal{L}(\theta) θ ← θ − η ∇ θ L ( θ ) with only the decoder trainable. Record the post-finetune anchor loss λ ( k ) : = L a n c ( θ T ) \lambda^{(k)} := \mathcal{L}_{\mathrm{anc}}(\theta_T) λ ( k ) := L anc ( θ T ) . After K K K rounds, we have an empirical null record { λ ( k ) } k = 1 K \{\lambda^{(k)}\}_{k=1}^{K} { λ ( k ) } k = 1 K under known-ID conditions.
Deployment phase. On a deployment batch X e v a l ∗ X_{\mathrm{eval}}^* X eval ∗ of unknown origin, freeze its pseudolabels y ^ e v a l ∗ \hat{y}_{\mathrm{eval}}^* y ^ eval ∗ , reset θ ← θ 0 \theta\leftarrow\theta_0 θ ← θ 0 , and run the same T T T -step finetune, forward-passing ( X s u p , y s u p , X a n c , X e v a l ∗ ) (X_{\mathrm{sup}}, y_{\mathrm{sup}}, X_{\mathrm{anc}}, X_{\mathrm{eval}}^*) ( X sup , y sup , X anc , X eval ∗ ) at each step and recording the deployment statistic λ ∗ : = L a n c ( θ T ) \lambda^* := \mathcal{L}_{\mathrm{anc}}(\theta_T) λ ∗ := L anc ( θ T ) . The verdict is a one-sided test against the calibration record:
λ ∗ < Quantile α ( λ ( 1 ) , … , λ ( K ) ) ⟹ declare OOD . (6) \lambda^* < \operatorname{Quantile}_{\alpha}\left(\lambda^{(1)},\ldots,\lambda^{(K)}\right) \Longrightarrow\text{declare OOD}. \tag*{(6)} λ ∗ < Quantile α ( λ ( 1 ) , … , λ ( K ) ) ⟹ declare OOD . (6)
The support set D s u p \mathcal{D}^{\mathrm{sup}} D sup and anchor ( X a n c , y a n c ) (X_{\mathrm{anc}}, y_{\mathrm{anc}}) ( X anc , y anc ) are held fixed across both phases.
Theory
This section justifies the headline of § 3.4 : that λ O O D < λ I D \lambda_{\mathrm{OOD}} < \lambda_{\mathrm{ID}} λ OOD < λ ID in expectation, and that the resulting one-sided test has controlled Type-I error. § 4.1 gives an informal mechanistic argument, § 4.2 states the formal results, and § 4.3 flags one related claim (monotone scaling of the signal with harm severity) that we support empirically but do not prove.
Intuitive argument
The two terms of L ( θ ) \mathcal{L}(\theta) L ( θ ) impose complementary forces on the shared decoder, and the way they resolve depends on whether the pretrained PFN is confident on its eval pseudolabels. When X e v a l ∼ p 0 X_{\mathrm{eval}} \sim p_0 X eval ∼ p 0 , the PFN places high probability on its own (correct) pseudolabels, so ∇ L e v a l \nabla\mathcal{L}_{\mathrm{eval}} ∇ L eval is large in magnitude and points in a direction that conflicts with ∇ L a n c \nabla\mathcal{L}_{\mathrm{anc}} ∇ L anc ; forcing disagreement on in-distribution points actively interferes with maintaining anchor agreement, and the anchor loss stays elevated after T T T steps. When X e v a l X_{\mathrm{eval}} X eval is shifted, however, the PFN is uncertain on the same pseudolabels: ∇ L e v a l \nabla\mathcal{L}_{\mathrm{eval}} ∇ L eval is small in magnitude and approximately orthogonal to ∇ L a n c \nabla\mathcal{L}_{\mathrm{anc}} ∇ L anc , so the disagreement pressure does not impede anchor descent and the anchor loss drops below its ID counterpart. The post-finetune λ : = L a n c ( θ T ) \lambda:= \mathcal{L}_{\mathrm{anc}}(\theta_T) λ := L anc ( θ T ) therefore summarizes in a single scalar whether the eval-side optimization pressure can co-exist with anchor agreement, with E [ λ O O D ] < E [ λ I D ] \mathbb{E}[\lambda_{\mathrm{OOD}}] < \mathbb{E}[\lambda_{\mathrm{ID}}] E [ λ OOD ] < E [ λ ID ] .
Theoretical guarantees
We summarize the two main results that justify CALD ; full statements, assumptions, and proofs are deferred to Appendix A.
The first result establishes that the post-finetune anchor loss is, in expectation, smaller under harmful shift than under in-distribution eval. It rests on a gradient-geometry analysis of the joint objective (5): the disagreement gradient on ID eval interferes with anchor descent (driving the anchor loss up by a structural amount γ > 0 \gamma> 0 γ > 0 ), while on far-OOD eval it becomes approximately orthogonal to the anchor gradient (controlled by a parameter ϵ \epsilon ϵ that vanishes as ∥ p 1 − p 0 ∥ T V → 1 \lVert p_1 - p_0 \rVert_{\mathrm{TV}} \to1 ∥ p 1 − p 0 ∥ TV → 1 ).
Theorem 4.1 (Main separation, simplified). Let E [ λ I D ] \mathbb{E}[\lambda_{\mathrm{ID}}] E [ λ ID ] and E [ λ O O D ] \mathbb{E}[\lambda_{\mathrm{OOD}}] E [ λ OOD ] denote the expected post-finetune anchor losses when the eval batch is drawn from p 0 p_0 p 0 and p 1 p_1 p 1 respectively. Under the assumptions stated in Appendix A, there exist constants γ > 0 \gamma> 0 γ > 0 and ϵ ≥ 0 \epsilon\ge0 ϵ ≥ 0 (the ID interference strength and the OOD feature-orthogonality parameters, respectively) such that
E [ λ I D ] − E [ λ O O D ] ≥ T η ( γ − ϵ B ) − O ( T 2 η 2 ) , (7) \mathbb{E}[\lambda_{\mathrm{ID}}] - \mathbb{E}[\lambda_{\mathrm{OOD}}] \ge T\eta(\gamma- \epsilon B) - O(T^2\eta^2), \tag*{(7)} E [ λ ID ] − E [ λ OOD ] ≥ T η ( γ − ϵ B ) − O ( T 2 η 2 ) , (7) where B B B collects bounded architecture- and data-dependent constants. Whenever ϵ < γ / B \epsilon< \gamma/B ϵ < γ / B and T η T\eta T η is in the small-step regime, the right-hand side is strictly positive and E [ λ O O D ] < E [ λ I D ] \mathbb{E}[\lambda_{\mathrm{OOD}}] < \mathbb{E}[\lambda_{\mathrm{ID}}] E [ λ OOD ] < E [ λ ID ] .
The separation gap grows linearly in the finetune budget T η T\eta T η (within the small-step regime), is driven by a structural ID quantity γ \gamma γ that depends only on the pretrained classifier and p 0 p_0 p 0 , and admits its severity dependence through ϵ \epsilon ϵ . The full version (Theorem A.9 ) makes the constants explicit.
It is important to acknowledge that Theorem 4.1 certifies detection in the far-OOD regime only. At finite shift severity its condition ϵ < γ / B \epsilon< \gamma/B ϵ < γ / B is not satisfied on any of the ten benchmarks on which we estimated it. Outside the far-OOD regime we therefore make no formal claim and instead measure the proof’s operative premise directly: the time-averaged gradient-interference gap Δ t r a j : = E O O D [ ⟨ g ˉ a , g ˉ e ⟩ ] − E I D [ ⟨ g ˉ a , g ˉ e ⟩ ] \Delta_{\mathrm{traj}} := \mathbb{E}_{\mathrm{OOD}}[\langle\bar{g}_a,\bar{g}_e\rangle] - \mathbb{E}_{\mathrm{ID}}[\langle\bar{g}_a,\bar{g}_e\rangle] Δ traj := E OOD [⟨ g ˉ a , g ˉ e ⟩] − E ID [⟨ g ˉ a , g ˉ e ⟩] is positive on nine of the ten datasets, and the two cells where it is weakest or negative are exactly the two with near-zero λ \lambda λ -separation (§5.4, Figure 3 (b); Table 18 ). These measurements support the theorem’s mechanism at moderate shift severity and help predict where the detector will struggle. A useful extension for future work would be to derive a finite-ϵ \epsilon ϵ bound using constants estimated from data instead of worst-case values.
Figure 3. (a) Per-step Spearman ρ \rho ρ between cos ( g a , g e ) \cos(g_a,g_e) cos ( g a , g e ) and Δ L a n c \Delta L_{\mathrm{anc}} Δ L anc , ID vs. OOD; negative ρ \rho ρ is the prediction of Equation (9) . (b) The proof’s premise Δ t r a j \Delta_{\mathrm{traj}} Δ traj of Equation (10) (left axis, symlog) and the λ \lambda λ -gap E [ λ I D ] − E [ λ O O D ] \mathbb{E}[\lambda_{\mathrm{ID}}]-\mathbb{E}[\lambda_{\mathrm{OOD}}] E [ λ ID ] − E [ λ OOD ] it produces (right axis), per dataset; TabPFN, fixed η = 10 − 3 \eta=10^{-3} η = 1 0 − 3 .
Figure 3: The gradient cross-term governs anchor descent, and its ID/OOD gap is what the detector reads. (a) The first-order law holds in both regimes; the two near-zero or positive ID bars (Covertype, Diabetes Readmission) are cells where the cosine is pinned at its fighting extreme with no spread, see text. (b) The premise Δ t r a j > 0 \Delta_{\mathrm{traj}}>0 Δ traj > 0 holds on nine of ten datasets, and the two cells where it is weakest or negative (CIFAR-10, UCI Heart) are exactly the two with near-zero λ \lambda λ -gap. Datasets: Cov=Covertype, Wat=Waterbirds, Cif=CIFAR-10, Flk=Folktables, Adl=Adult Income, Dia=Diabetes Readmission, Cre=Credit Default, Bnk=Bank Marketing, CmR/CmD=Camelyon17 (ResNet18/DINOv2), Cel=CelebA, UCI=UCI Heart.
Table 18. The proof’s premise, measured directly on the finetuning trajectories. Δ t r a j > 0 \Delta_{\mathrm{traj}} > 0 Δ traj > 0 iff the gradient-interference mechanism of Theorem 4.1 operates; the λ \lambda λ -gap is the raw ID/OOD separation of the statistic. Both columns are computed under fixed η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 (within-configuration); they are not comparable to Table 10 or to the selected-LR AUROC column of Table 17 .
The second result certifies the practical decision rule. The detector observes only K K K calibration anchor losses and a single deployment statistic, and rejects ID when the deployment value falls below the empirical α \alpha α -quantile of the calibration set. A standard exchangeability argument controls the false-alarm rate.
Proposition 4.2 (Finite-sample Type-I error control, simplified). Suppose the anchor set, support set, and finetune hyperparameters are fixed across rounds, the eval batches are i.i.d. draws, and the inner finetune loop is deterministic given its inputs. Under the null H 0 : X e v a l ∗ ∼ p 0 H_0 : X^{*}_{\mathrm{eval}} \sim p_0 H 0 : X eval ∗ ∼ p 0 , the one-sided test in (6) satisfies
P H 0 ( reject H 0 ) ≤ α + 1 K + 1 . (8) \mathbb{P}_{H_0}(\operatorname{reject} H_0) \le\alpha+ \frac{1}{K+1}. \tag*{(8)} P H 0 ( reject H 0 ) ≤ α + K + 1 1 . (8)
The slack 1 / ( K + 1 ) 1/(K+1) 1/ ( K + 1 ) is the cost of using a finite calibration set; it vanishes as K → ∞ K \to\infty K → ∞ . Combining Theorem 4.1 with Proposition 4.2 gives a detector with controlled Type-I error and a non-vanishing power gap whenever the OOD shift is severe enough to satisfy the feature-orthogonality regime; we expand on the corresponding power analysis in Appendix § 8 .§ 16.4 .
Proposition 4.2 requires the calibration and deployment batches to be exchangeable under the null hypothesis. Here, “in-distribution” means that the batches come from the same covariate distribution; no geometric boundary between ID and OOD data is needed (Definition A.10 , Appendix § 8 .§ 16.4 ). The hyperparameters must also be fixed in advance so that calibration and deployment use the same scoring procedure. The per-cell learning-rate selection in Table 1 (Appendix § 10 .4) uses both ID and known OOD trajectories, so the guarantee does not cover that procedure. A fixed learning rate avoids this dependence on known OOD data and appears practical: it gives similar average detection performance, while observed no-shift false-alarm rates remain close to the theoretical bound across the tested settings (see Appendix § 11 .5).
Calibration to harm severity is empirical
Theorem 4.1 delivers a separation in the far-OOD regime, but it does not predict that the detection signal scales monotonically with the magnitude of the shift or with the model’s accuracy drop. We observe this calibration-to-harm property empirically (Figure 2 ): on a controlled 2D Gaussian sweep and on a Waterbirds severity sweep, AUROC rises smoothly from 0.5 at zero shift to 1.0 at catastrophic shift, while small benign translations remain near chance; large benign translations do fire, as Lemma A.12 predicts for any feature-space monitor. We treat this as a desirable structural property of the gradient cross-term ⟨ g a , g e ⟩ \langle g_a,g_e\rangle ⟨ g a , g e ⟩ tracking shift severity; we explore it in §5.3.
Figure 2. (a) Synthetic 2D Gaussian. (b) Real (Waterbirds, α \alpha α sweep).
Figure 2: Detection AUROC scales with shift severity. CALD’s AUROC rises monotonically with the induced accuracy gap on both controlled synthetic shift (left) and real subpopulation shift (right). At zero shift severity the AUROC is at chance; at maximum severity it saturates at 1.0. On the synthetic sweep, a small benign translation (0.7 σ 0.7\sigma 0.7 σ ) stays near chance, while larger benign translations (2.1 σ 2.1\sigma 2.1 σ , 7.1 σ 7.1\sigma 7.1 σ ) fire.
Experiments
We evaluate CALD against post-hoc OOD-detection baselines on 14 datasets and the two PFN architectures (TabPFN and TabICL). Our experiments are designed to support three claims: (i) CALD reliably flags harmful distribution shift, (ii) it is markedly more resilient to benign-shift false alarms than label-blind baselines, though not immune to them, and (iii) the gradient mechanism of §4 is the one operating in the deployed models. Extended experimental details, dataset descriptions, and baselines are deferred to Appendix C; hyperparameter sweeps, deployment cost, design choices, the frozen deployment configuration, anchor robustness, feature collapse, a two-signal harm detector, and detectability across shift types are ablated in Appendix D. The code repository for CALD is available at https://github.com/teivng/cald.
Setup
Datasets: we evaluate on 14 datasets covering two regimes. (i) Raw tabular shift (7 datasets): UCI Heart Disease, Diabetes Readmission, Adult Income, Bank Marketing, Credit Default, Covertype, and Folktables ACS Income; and (ii) structured shift via foundation-model representations (7 datasets): Camelyon17, CIFAR-10→ \to → 10.1, PACS, Waterbirds, CelebA, CivilComments, and Amazon Reviews, where image and text inputs are encoded by pretrained foundation models (DINOv2, ResNet-18, Jina-v3) and the resulting representations are passed to TabPFN/TabICL as ordinary tabular features. Per-dataset descriptions, ID/OOD splits, and a survey of the resulting accuracy deteriorations across the severity spectrum (catastrophic, moderate, negligible, benign) are given in Appendices C.1 and C.3. Baselines: we compare against 15 post-hoc OOD detection signals computed without finetuning: MSP, Entropy, Energy, Mahalanobis distance, Relative Mahalanobis (RMD), KNN distance, ViM, BBSD-softmax, BBSD-embedding, MMD, H-divergence, GradNorm, GradOrth, GAIA-Z, and WeiPer. Detailed descriptions are in Appendix C.2.
PFN models. We apply CALD to two SoTA PFN models: TabPFN v2.5 [16 ] and TabICL v2 [47 ] .
Evaluation metrics. We report TPR@5% FPR (primary), the true-positive rate at a fixed 5% false-positive operating point set by the empirical α = 0.05 \alpha= 0.05 α = 0.05 quantile of the calibration anchor-loss distribution, and AUROC (secondary).
Main Results: Deterioration Detection
Table 1 reports TPR@5%FPR for CALD and the 15 post-hoc baselines across 14 datasets and both PFN architectures. All results use 10 seeds, 50 calibration rounds, T = 50 T = 50 T = 50 finetune steps, and eval batches of 128 points; the full table with standard deviations and the learning-rate selection protocol are deferred to Appendix C.4.
CALD reliably flags harmful shift. Across the seven harmful columns, the better CALD variant scores TPR ≥ 0.99 \ge0.99 ≥ 0.99 on CivilComments, Camelyon, Waterbirds, CIFAR, PACS, and Covertype, whereas for UCI Heart, both variants reach only 0.71 TPR at the chosen calibration size.
CALD is more resilient to benign shifts than baselines, but not immune. On four of seven benign datasets the better CALD variant achieves correct-silence rate ≥ 0.92 \ge0.92 ≥ 0.92 (Adult, Amazon, Folktables-TabPFN, CelebA-TabICL); on Credit Default, TabICL recovers 0.76 silence where TabPFN false-alarms at 0.00. The honest weakness are Bank (≤ 0.02 \le0.02 ≤ 0.02 ), Diabetes Readmission (≤ 0.08 \le0.08 ≤ 0.08 ), and Folktables under TabICL (0.42). All three have small accuracy gaps (∣ Δ ∣ ≤ 4.4 % |\Delta| \le4.4\% ∣Δ∣ ≤ 4.4% ) close to the Hoeffding floor, and Appendix B dissects the mechanism: the post-finetune anchor loss is a feature-space quantity, sensitive to any reweighting of the input domain, whereas the harm label is determined entirely by reweighting on the model’s mistake region (Lemma A.12). When a benign shift moves substantial mass on the complement of the mistake region, the gradient geometry registers a real distributional difference and CALD fires.
TabICL outperforms TabPFN, especially on subpopulation shift. TabICL strictly dominates TabPFN on four datasets whose shift is defined at the subgroup level: Camelyon (0.19 → \to → 1.00), Waterbirds (0.46 → \to → 0.99), CelebA (0.27 → \to → 0.97), and Credit Default (0.00 → \to → 0.76). On eight of the other ten datasets the two architectures track within 0.05; Folktables (0.98 → \to → 0.42) is the one cell where TabPFN dominates. The likely culprit is decoder capacity: TabICL’s trainable decoder (Linear 512 → \to → 1024 → \to → C C C ) is roughly an order of magnitude larger than TabPFN’s (192 → \to → 384 → \to → C C C ), and on subtle group-level shifts the disagree-finetune dynamics need enough decoder expressivity to separate ID from OOD anchor descent. TabPFN’s tighter decoder appears to bottleneck the signal whenever the shift does not register as a global feature-space displacement.
No baseline matches CALD’s harm/benign trade-off. D-MMD, H-divergence, and KNN each score ≥ 0.95 \ge0.95 ≥ 0.95 on a majority of harmful columns but ≤ 0.10 \le0.10 ≤ 0.10 on a majority of benign columns: their headline harmful-side TPR comes from always alarming , not from harm-calibration. RMD shows the opposite trade-off: benign-side silence comparable to CALD , but harmful-side TPR collapsing to
0.40–0.67 on the moderate shifts (Camelyon, Waterbirds, CIFAR). CALD is the only detector in the table that simultaneously achieves high harmful-side TPR on a majority of datasets and benign-side silence on a majority of datasets. We emphasize that this is a relative claim, not an absolute one: CALD does false-alarm on a minority of benign cells (Bank and Diabetes for both PFNs; Credit, Folktables, and CelebA for one of the two), and we view this remaining benign sensitivity as the realistic ceiling of a feature-space monitor that is blind to test labels.
Calibration to harm
A deterioration monitor is only useful if its alarm scales with the harm a shift inflicts rather than with how novel the shifted inputs look. While Theorem 4.1 certifies a separation in the far-OOD limit, it does not determine how the statistic λ \lambda λ behaves as severity grows (§4.3). We therefore ask directly whether λ \lambda λ tracks severity, and whether it stays silent on shifts of comparable feature-space magnitude that do not hurt the model.
We sweep shift severity in two settings. The first is a controlled 2D Gaussian in which harm and novelty can be dialed independently: rotating the class boundary is harmful, while translating the inputs along the boundary is benign, and both are matched in feature-space magnitude. The second is real subpopulation shift on Waterbirds, where the fraction α \alpha α of spuriously-correlated minority samples in the eval batch sets the accuracy drop.
In Figure 2 , on both the controlled and the real sweep, AUROC sits at chance when there is no shift, rises monotonically with the accuracy gap, and saturates at the most severe setting. On the benign axis, a small translation stays near chance throughout, while larger translations fire. This suggests that within these controlled regimes, λ \lambda λ tracks severity, and distinguishes harm from novelty only when the benign shift is small, which is the property that separates CALD from the always-alarming baselines in Table 1 . The property is empirical and should only be treated as such, as on some real-world benign datasets the post-finetune anchor loss separates ID from OOD despite a small accuracy gap, and Lemma A.12 shows why no feature-space monitor can be perfectly harm-calibrated; we refer the reader to Appendix § 9 .§ 16 for a closer look.
The gradient cross-term
The proof of Theorem 4.1 tracks the anchor loss along the T T T finetuning steps and asks how much of its descent the eval-disagreement term interferes with, under ID versus OOD eval. That interference is carried by the inner product ⟨ g a , g e ⟩ \langle g_a, g_e\rangle ⟨ g a , g e ⟩ between the anchor-agreement gradient g a = ∇ L a n c g_a = \nabla\mathcal{L}_{\mathrm{anc}} g a = ∇ L anc and the eval-disagreement gradient g e = ∇ L e v a l g_e=\nabla L_{\mathrm{eval}} g e = ∇ L eval . Expanding one step of the joint update to first order,
Δ L a n c ( t ) ≈ − η ∥ g a ( t ) ∥ 2 − η ⟨ g a ( t ) , g e ( t ) ⟩ (9) \Delta L_{\mathrm{anc}}^{(t)} \approx-\eta\lVert g_a^{(t)}\rVert^2-\eta\langle g_a^{(t)},g_e^{(t)}\rangle \tag*{(9)} Δ L anc ( t ) ≈ − η ∥ g a ( t ) ∥ 2 − η ⟨ g a ( t ) , g e ( t ) ⟩ (9)
so the anchor loss descends at the vanilla rate − η ∥ g a ∥ 2 -\eta\lVert g_a\rVert^2 − η ∥ g a ∥ 2 corrected by the cross-term. Theorem 4.1 makes two claims about it. First, that the cross-term is what governs anchor descent step by step, so that the first-order analysis describes the regime the detector actually runs in. Second, that its typical value differs by regime: strongly negative on ID eval, where the disagreement gradient fights anchor descent and holds λ \lambda λ up, and near zero on OOD eval, where the two gradients decouple and λ \lambda λ falls. We examine each in turn.
The cross-term governs anchor descent. We record cos ( g a ( t ) , g e ( t ) ) \cos(g_a^{(t)},g_e^{(t)}) cos ( g a ( t ) , g e ( t ) ) and Δ L a n c ( t ) \Delta L_{\mathrm{anc}}^{(t)} Δ L anc ( t ) at every finetune step and compute the Spearman correlation between them per dataset, separately for ID and OOD eval. Equation (9) predicts a negative correlation : the more aligned the two gradients, the faster the anchor loss falls.
In Figure 3 (a), the correlation is negative for every dataset under OOD eval, and for every dataset but two under ID eval. The two exceptions, Covertype and Diabetes Readmission under ID eval, are cells where the cosine is pinned near its fighting extreme across every step with the anchor loss rising throughout, which is the ID behavior the theorem describes; with no spread in the cosine there is nothing for a rank correlation to pick up. This suggests that the first-order law holds on all six datasets measured, and that it holds equally under ID and OOD eval. The law itself therefore does not separate the two regimes; what separates them must be the value of the cross-term, which we measure next.
The proof’s premise. Theorem 4.1 lower-bounds the separation E [ λ I D ] − E [ λ O O D ] \mathbb{E}[\lambda_{\mathrm{ID}}] - \mathbb{E}[\lambda_{\mathrm{OOD}}] E [ λ ID ] − E [ λ OOD ] by T η ( γ − ϵ B ) T\eta(\gamma- \epsilon B) T η ( γ − ϵ B ) , and the proof obtains this bound from the premise that by averaging the gradients over the T T T steps (Proposition A.8 ), the cross-term is more negative under ID eval than under OOD eval. Writing g ˉ a \bar{g}_a g ˉ a , g ˉ e \bar{g}_e g ˉ e for the time-averaged gradients, the premise is
Δ t r a j : = E O O D ⟨ g ˉ a , g ˉ e ⟩ − E I D ⟨ g ˉ a , g ˉ e ⟩ > 0 , (10) \Delta_{\mathrm{traj}} := \mathbb{E}_{\mathrm{OOD}}\langle\bar{g}_a,\bar{g}_e\rangle- \mathbb{E}_{\mathrm{ID}}\langle\bar{g}_a,\bar{g}_e\rangle> 0, \tag*{(10)} Δ traj := E OOD ⟨ g ˉ a , g ˉ e ⟩ − E ID ⟨ g ˉ a , g ˉ e ⟩ > 0 , (10)
and the constants γ \gamma γ and ϵ \epsilon ϵ are the theorem’s worst-case way of guaranteeing it. The certifying condition ϵ < γ / B \epsilon< \gamma/B ϵ < γ / B turns out not to hold on any of the ten benchmarks on which we estimate it (Appendix § 11 .§ 16.1 , Table 17 ): at finite severity, none of them is far-OOD in the theorem’s sense. We therefore measure the premise itself, computing Δ t r a j \Delta_{\mathrm{traj}} Δ traj by exact full-decoder autograd along the finetuning trajectories, alongside the λ \lambda λ -gap E [ λ I D ] − E [ λ O O D ] \mathbb{E}[\lambda_{\mathrm{ID}}] - \mathbb{E}[\lambda_{\mathrm{OOD}}] E [ λ ID ] − E [ λ OOD ] it is supposed to produce.
Table 17. Theorem 4.1’s condition at finite severity. Empirical estimates of both sides of ϵ < γ B ϕ 2 B C \epsilon< \frac{\gamma}{B_{\phi}^{2}B_C} ϵ < B ϕ 2 B C γ (TabPFN). The condition fails on every dataset: ϵ ^ \hat{\epsilon} ϵ ^ is O ( 1 ) O(1) O ( 1 ) while the right-hand side is near zero or negative. The AUROC column repeats Table 10 ’s selected-LR values for reference.
In Figure 3 (b), Δ t r a j \Delta_{\mathrm{traj}} Δ traj is positive on nine of the ten datasets, including the moderate-overlap benchmarks on which the formal condition is vacuous. The two datasets on which it is weakest or negative, CIFAR-10 and UCI Heart, are also the two with a near-zero λ \lambda λ -gap under this configuration, so the measurement anticipates the detector’s weakest cells rather than rationalizing its successes after the fact. This suggests that while Theorem 4.1 certifies detection in the far-OOD regime only, the gradient mechanism it is built on is present across the near-OOD benchmarks and is what drives detection there. We refer the reader to Appendix § 11 .§ 16.1 for the full analysis, including the estimated constants of the condition and the per-dataset λ \lambda λ -gap (Table 18 ).
Conclusion and Limitations
We introduced CALD, a deployment-time deterioration monitor for tabular PFNs that turns a brief decoder finetune of the frozen model into a detection signal. We ground our method in theory for harmful shift, and observe that across 14 datasets, CALD matches or outperforms 15 post-hoc baselines on harmful shifts, giving the most favorable harm/benign trade-off among the methods compared (Table 1 ).
The theory, however, is lacking on the benign side. Lemma A.12 essentially states that the accuracy gap depends only on mass moved on the model’s mistake region M M M , while the post-finetune λ \lambda λ integrates the gradient cross-term over the whole input domain, so a feature-space monitor cannot achieve perfect harm-calibration. Empirically this surfaces on Bank, Diabetes, Credit, Folktables, and CelebA (each under at least one of the two PFNs in Table 1 ), benign shifts that nonetheless move substantial mass off M M M ; Appendix § 9 dissects the tabular cases. The conformal test also relies on IID exchangeability, so pure label shift, concept shift, open-set or adversarial inputs, and engineering errors are out of scope. Closing the harm gap likely requires a complementary signal tied to the density-ratio integral on M M M , sketched in Proposition A.21 and left to future work.
Concretely, a tabular PFN’s impending failure leaves a mechanistic trace in the gradient geometry of a brief decoder fine-tune, reachable from a frozen pretrained model with no extra training data. The limitations above bound this particular feature-space readout. CALD thus probes this trace through the decoder, while PFNs expose gradients with respect to the support set itself. Probes that exploit this, such as measuring how disagreement-labeled deployment points placed in the support affect predictions on the anchor, are a natural direction for richer, genuinely in-context deterioration sensors.
Acknowledgements and Disclosure of Funding
RGK gratefully acknowledges support from the Canada Research Chairs Program (CRC-2022-00049) and the Canada CIFAR AI Chairs Program. This research was funded in part by an NFRF Special Call Award (NFRFR-2022-00526), an NSERC Discovery Grant (RGPIN-2022-04546) and a CIHR Team Grant (RN549848–534930). HB is supported by Swedish Research Council Grant 2022-04748, as well as the Sweden-America Foundation. Resources used in preparing this research were provided, in part, by the Province of Ontario, the Government of Canada through CIFAR, and companies sponsoring the Vector Institute. VN humbly acknowledges the help and support provided by Eugenia Distefano and all members of the technical staff of the University of Toronto’s Department of Computer Science in maintaining the Cluster.
Theory
This appendix develops the theoretical foundations behind CALD . We first state the algorithm in pseudocode, then build up the formal argument that the post-finetuning anchor loss λ \lambda λ is, in expectation, lower on OOD eval batches than on ID eval batches.
Algorithm
We restate CALD in pseudocode for completeness; the verbal description in § 3.4 suffices for the reader who does not need step-by-step detail.
Algorithm 1: Calibrated Anchor-Loss Disagreement (CALD)
Input: Support set D s u p \mathcal{D}^{\mathrm{sup}} D sup , anchor set ( X a n c , y a n c ) (X_{\mathrm{anc}}, y_{\mathrm{anc}}) ( X anc , y anc ) , ID distribution p 0 p_0 p 0 , steps T T T , rounds K K K , learning rate η \eta η , level α \alpha α
Output: OOD verdict for test batch X e v a l ∗ X_{\mathrm{eval}}^* X eval ∗
// -- Phase 1: Calibration on known-ID data --
for k = 1 , … , K k = 1, \ldots, K k = 1 , … , K do
Sample X e v a l ( k ) ∼ p 0 X_{\mathrm{eval}}^{(k)} \sim p_0 X eval ( k ) ∼ p 0
y ^ ( k ) ← arg max q θ 0 ( y ∣ X e v a l ( k ) , D s u p ) \hat{y}^{(k)} \leftarrow\arg\max q_{\theta_0}(y \mid X_{\mathrm{eval}}^{(k)}, \mathcal{D}^{\mathrm{sup}}) y ^ ( k ) ← arg max q θ 0 ( y ∣ X eval ( k ) , D sup ) // pseudolabels (no grad)
θ ← θ 0 \theta\leftarrow\theta_0 θ ← θ 0
for t = 1 , … , T t = 1, \ldots, T t = 1 , … , T do
ℓ a n c ← L C E ( q θ ( y ∣ X a n c , D s u p ) , y a n c ) \ell_{\mathrm{anc}} \leftarrow\mathcal{L}_{\mathrm{CE}}(q_\theta(y \mid X_{\mathrm{anc}}, \mathcal{D}^{\mathrm{sup}}), y_{\mathrm{anc}}) ℓ anc ← L CE ( q θ ( y ∣ X anc , D sup ) , y anc )
ℓ d i s ← L D C E ( q θ ( y ∣ X e v a l ( k ) , D s u p ) , y ^ ( k ) ) \ell_{\mathrm{dis}} \leftarrow\mathcal{L}_{\mathrm{DCE}}(q_\theta(y \mid X_{\mathrm{eval}}^{(k)}, \mathcal{D}^{\mathrm{sup}}), \hat{y}^{(k)}) ℓ dis ← L DCE ( q θ ( y ∣ X eval ( k ) , D sup ) , y ^ ( k ) )
θ ← θ − η ∇ θ ( ℓ a n c + ℓ d i s ) \theta\leftarrow\theta- \eta\nabla_\theta(\ell_{\mathrm{anc}} + \ell_{\mathrm{dis}}) θ ← θ − η ∇ θ ( ℓ anc + ℓ dis )
end
λ ( k ) ← L C E ( q θ ( y ∣ X a n c , D s u p ) , y a n c ) \lambda^{(k)} \leftarrow\mathcal{L}_{\mathrm{CE}}(q_\theta(y \mid X_{\mathrm{anc}}, \mathcal{D}^{\mathrm{sup}}), y_{\mathrm{anc}}) λ ( k ) ← L CE ( q θ ( y ∣ X anc , D sup ) , y anc ) // post-finetune anchor loss
end
// -- Phase 2: Detection on test batch --
y ^ ∗ ← arg max q θ 0 ( y ∣ X e v a l ∗ , D s u p ) \hat{y}^* \leftarrow\arg\max q_{\theta_0}(y \mid X_{\mathrm{eval}}^*, \mathcal{D}^{\mathrm{sup}}) y ^ ∗ ← arg max q θ 0 ( y ∣ X eval ∗ , D sup )
θ ← θ 0 \theta\leftarrow\theta_0 θ ← θ 0
for t = 1 , … , T t = 1, \ldots, T t = 1 , … , T do
ℓ a n c ← L C E ( q θ ( y ∣ X a n c , D s u p ) , y a n c ) \ell_{\mathrm{anc}} \leftarrow\mathcal{L}_{\mathrm{CE}}(q_\theta(y \mid X_{\mathrm{anc}}, \mathcal{D}^{\mathrm{sup}}), y_{\mathrm{anc}}) ℓ anc ← L CE ( q θ ( y ∣ X anc , D sup ) , y anc )
ℓ d i s ← L D C E ( q θ ( y ∣ X e v a l ∗ , D s u p ) , y ^ ∗ ) \ell_{\mathrm{dis}} \leftarrow\mathcal{L}_{\mathrm{DCE}}(q_\theta(y \mid X_{\mathrm{eval}}^*, \mathcal{D}^{\mathrm{sup}}), \hat{y}^*) ℓ dis ← L DCE ( q θ ( y ∣ X eval ∗ , D sup ) , y ^ ∗ )
θ ← θ − η ∇ θ ( ℓ a n c + ℓ d i s ) \theta\leftarrow\theta- \eta\nabla_\theta(\ell_{\mathrm{anc}} + \ell_{\mathrm{dis}}) θ ← θ − η ∇ θ ( ℓ anc + ℓ dis )
end
λ ∗ ← L C E ( q θ ( y ∣ X a n c , D s u p ) , y a n c ) \lambda^* \leftarrow\mathcal{L}_{\mathrm{CE}}(q_\theta(y \mid X_{\mathrm{anc}}, \mathcal{D}^{\mathrm{sup}}), y_{\mathrm{anc}}) λ ∗ ← L CE ( q θ ( y ∣ X anc , D sup ) , y anc )
// -- Verdict --
if λ ∗ < Quantile α ( λ ( 1 ) , … , λ ( K ) ) \lambda^* < \operatorname{Quantile}_{\alpha}(\lambda^{(1)}, \ldots, \lambda^{(K)}) λ ∗ < Quantile α ( λ ( 1 ) , … , λ ( K ) ) then
return OOD
else
return ID
end
Justification of the Detection Signal
We develop a formal argument that the post-finetuning anchor loss λ \lambda λ is, in expectation, lower on OOD eval batches than on ID eval batches. The argument is a first-order gradient-geometry analysis of the joint objective in (5) , combined with the tilted-attention interpretation of transformer PFNs due to Nagler [39 ] . We state the main proposition as a one-step result, then extend to the full T T T -step trajectory used in Algorithm 1 using a standard small-step regime. The separation E [ λ O O D ] < E [ λ I D ] \mathbb{E}[\lambda_{\mathrm{OOD}}] < \mathbb{E}[\lambda_{\mathrm{ID}}] E [ λ OOD ] < E [ λ ID ] is proven in the far-OOD regime (where the feature-orthogonality assumption holds with small parameter ϵ \epsilon ϵ ; see Theorem A.9 ). Conversely, in the near-OOD regime the signed direction is a heuristic prediction that is empirically supported by a severity sweep rather than a theorem.
The argument formalizes the informal intuition in § 3.4 that forcing disagreement on ID points tugs against anchor agreement, while forcing disagreement on OOD points does not . We isolate the Frobenius inner product ⟨ g a , g e ⟩ F \langle g_a,g_e\rangle_F ⟨ g a , g e ⟩ F of the anchor and disagreement gradients at initialization as the key quantity of interest: it controls whether anchor descent is impeded or free. We then show that ⟨ g a , g e ⟩ F \langle g_a,g_e\rangle_F ⟨ g a , g e ⟩ F is controlled by a feature-space kernel ⟨ ϕ ( x a ) , ϕ ( x e ) ⟩ \langle\phi(x_a),\phi(x_e)\rangle ⟨ ϕ ( x a ) , ϕ ( x e )⟩ , and that this kernel collapses in the OOD limit under Nagler’s exponential-tilting interpretation of attention.
The appendix builds up in six stages:
Algebra (Sections A.3–A.4): we write out the last-layer gradients of CE and DCE and observe that they factor as outer products of a label-space residual and a backbone-feature vector. This reduces the gradient cross-term to a sum of products of two scalar quantities (Lemma A.1 ).
First-step geometry (Sections A.5–A.7): a short Taylor expansion yields the anchor-loss decrement after one step as − η ∥ g a ∥ F 2 − η ⟨ g a , g e ⟩ F -\eta\lVert g_a\rVert_F^2-\eta\langle g_a,g_e\rangle_F − η ∥ g a ∥ F 2 − η ⟨ g a , g e ⟩ F (Proposition A.2 ). The sign and magnitude of the cross-term is then analyzed in two regimes: upper-bounded under a feature-orthogonality assumption (Corollary A.4 ), and strictly negative under an ID-confidence assumption (Proposition A.6 ).
PFN theory (Section A.8): we use Nagler [39 Theorems 5.4 & 6.3] `` to argue that the feature-orthogonality assumption is a structural consequence of transformer attention in the far-OOD limit. The key object is an exponentially tilted measure over the support set that collapses to the untilted marginal as ∥ p 1 − p 0 ∥ T V → 1 \lVert p_1-p_0\rVert_{\mathrm{TV}}\to1 ∥ p 1 − p 0 ∥ TV → 1 .
Main separation results (Sections A.9–A.12): multi-step lift (Proposition A.8 ), the Main Separation Theorem that composes all preceding pieces into E [ λ O O D ] < E [ λ I D ] \mathbb{E}[\lambda_{\mathrm{OOD}}]<\mathbb{E}[\lambda_{\mathrm{ID}}] E [ λ OOD ] < E [ λ ID ] (Theorem A.9 ), a conformal-prediction argument establishing Type-I error control (Proposition A.11 ), and a multiclass extension.
Harm characterization (Section A.13): we extend Nagler’s tilting from features to predictions, derive a density-ratio decomposition of the accuracy gap Δ \Delta Δ , and introduce a second signal μ ^ \hat{\mu} μ ^ that estimates Δ \Delta Δ directly (Proposition A.21 ). This bridges the gap between distributional-difference detection and predictive-harm detection.
Summary of assumptions (Section A.14): We summarize our main assumptions for both the main separation theorem as well as the harm detection extension.
Gradient interpretation. Two gradients live in a large parameter space R C × d \mathbb{R}^{C\times d} R C × d . The anchor gradient g a g_a g a points in the direction that, if walked along, most rapidly increases the probability assigned to the true labels on the anchor set. The disagreement gradient g e g_e g e points in the direction that most rapidly reduces the probability assigned to the (frozen) pseudo-labels on the eval set. Gradient descent moves in the direction − ( g a + g e ) -(g_a+g_e) − ( g a + g e ) . The question ‘does this step also improve the anchor loss?’ therefore reduces to: does − ( g a + g e ) -(g_a+g_e) − ( g a + g e ) have positive inner product with the direction − g a -g_a − g a that purely improves anchor loss? This inner product is ∥ g a ∥ F 2 + ⟨ g a , g e ⟩ F \lVert g_a\rVert_F^2+\langle g_a,g_e\rangle_F ∥ g a ∥ F 2 + ⟨ g a , g e ⟩ F , and its sign determines whether the disagreement gradient aligns with anchor descent or interferes with it.
Setup and Notation
We document the formal setup in two pieces. We start with an important design choice that the subsequent analysis depends on. Then, we introduce the notation used throughout this appendix.
Why the analysis trains only the last layer. Our analysis models the finetune as acting on the last linear (or small MLP) layer with every other parameter frozen; the deployed detector updates the whole decoder, and Appendix D.2 shows the two are empirically indistinguishable. This restriction is what makes our analysis tractable. A frozen backbone provides a fixed feature map ϕ \phi ϕ , and all gradient computations reduce to linear algebra in the last-layer parameter space. The per-sample gradient becomes a rank-one outer product of a label-space residual and a feature vector, which factorizes the gradient cross-term into a label × \times × feature product.
Notation. Let ϕ : X × ( X × Y ) n → R d \phi:\mathcal{X}\times(\mathcal{X}\times\mathcal{Y})^n\to\mathbb{R}^d ϕ : X × ( X × Y ) n → R d denote the PFN’s backbone map, which takes a query x x x and a support set D s u p = { ( X i , Y i ) } i = 1 n \mathcal{D}^{\mathrm{sup}}=\{(X_i,Y_i)\}_{i=1}^n D sup = {( X i , Y i ) } i = 1 n and returns a d d d -dimensional representation. We write ϕ ( x ) : = ϕ ( x ; D s u p ) \phi(x):=\phi(x;\mathcal{D}^{\mathrm{sup}}) ϕ ( x ) := ϕ ( x ; D sup ) when the support set is held fixed; all arguments in this appendix treat D s u p \mathcal{D}^{\mathrm{sup}} D sup as a fixed conditioning set. Concretely, ϕ ( x ) \phi(x) ϕ ( x ) is the transformer’s penultimate activation at query x x x , with the support-set context incorporated through attention. The trainable parameter is the last-layer weight matrix W ∈ R C × d W \in\mathbb{R}^{C \times d} W ∈ R C × d , which absorbs the corresponding bias by the usual one-augmentation of ϕ \phi ϕ (i.e., appending a constant 1-coordinate). Predictions take the form
q W ( y ∣ x ) = softmax ( W ϕ ( x ) ) y . (11) q_W(y \mid x) = \operatorname{softmax}(W\phi(x))_y. \tag*{(11)} q W ( y ∣ x ) = softmax ( W ϕ ( x ) ) y . (11)
All other PFN parameters are frozen at their pretrained values θ 0 \theta_0 θ 0 , so ϕ \phi ϕ does not depend on W W W . Write W 0 W_0 W 0 for the initial decoder (the decoder weights of the pretrained PFN) and p x : = q W 0 ( ⋅ ∣ x ) ∈ Δ C − 1 p_x := q_{W_0}(\cdot\mid x) \in\Delta^{C-1} p x := q W 0 ( ⋅ ∣ x ) ∈ Δ C − 1 for the initial predicted distribution at query x x x . The initial prediction p x p_x p x is the PFN’s usual in-context prediction before any finetuning.
Let ( X a n c , y a n c ) = { ( x a ( i ) , y a ( i ) ) } i = 1 n a (X_{\mathrm{anc}}, y_{\mathrm{anc}}) = \{(x_a^{(i)}, y_a^{(i)})\}_{i=1}^{n_a} ( X anc , y anc ) = {( x a ( i ) , y a ( i ) ) } i = 1 n a be the labeled ID anchor set and X e v a l = { x e ( j ) } j = 1 n e X_{\mathrm{eval}} = \{x_e^{(j)}\}_{j=1}^{n_e} X eval = { x e ( j ) } j = 1 n e the unlabeled eval batch. Pseudo-labels y ^ ( j ) : = arg max c p x e ( j ) ( c ) \hat{y}^{(j)} := \arg\max_c p_{x_e^{(j)}}(c) y ^ ( j ) := arg max c p x e ( j ) ( c ) are frozen at initialization and do not change during finetuning (cf. the pseudolabel step of Algorithm 1). Define the per-sample losses
ℓ C E ( W ; x , y ) = − log q W ( y ∣ x ) , (12) \ell_{\mathrm{CE}}(W; x, y) = -\log q_W(y \mid x), \tag*{(12)} ℓ CE ( W ; x , y ) = − log q W ( y ∣ x ) , (12)
ℓ D C E ( W ; x , y ^ ) = − 1 C − 1 ∑ c ≠ y ^ log q W ( c ∣ x ) , (13) \ell_{\mathrm{DCE}}(W; x, \hat{y}) = -\frac{1}{C-1}\sum_{c\ne\hat{y}}\log q_W(c \mid x), \tag*{(13)} ℓ DCE ( W ; x , y ^ ) = − C − 1 1 c = y ^ ∑ log q W ( c ∣ x ) , (13)
and the batch losses
L a n c ( W ) = 1 n a ∑ i = 1 n a ℓ C E ( W ; x a ( i ) , y a ( i ) ) , L d i s ( W ) = 1 n e ∑ j = 1 n e ℓ D C E ( W ; x e ( j ) , y ^ ( j ) ) . (14) \mathcal{L}_{\mathrm{anc}}(W) = \frac{1}{n_a}\sum_{i=1}^{n_a}\ell_{\mathrm{CE}}(W; x_a^{(i)}, y_a^{(i)}), \qquad\mathcal{L}_{\mathrm{dis}}(W) = \frac{1}{n_e}\sum_{j=1}^{n_e}\ell_{\mathrm{DCE}}(W; x_e^{(j)}, \hat{y}^{(j)}). \tag*{(14)} L anc ( W ) = n a 1 i = 1 ∑ n a ℓ CE ( W ; x a ( i ) , y a ( i ) ) , L dis ( W ) = n e 1 j = 1 ∑ n e ℓ DCE ( W ; x e ( j ) , y ^ ( j ) ) . (14)
The finetuning objective is L ( W ) = L a n c ( W ) + L d i s ( W ) \mathcal{L}(W) = \mathcal{L}_{\mathrm{anc}}(W) + \mathcal{L}_{\mathrm{dis}}(W) L ( W ) = L anc ( W ) + L dis ( W ) . The post-finetuning anchor loss, which is the detection statistic of interest, is
λ : = L a n c ( W T ) , W t + 1 = W t − η ∇ W L ( W t ) . (15) \lambda:= \mathcal{L}_{\mathrm{anc}}(W_T), \qquad W_{t+1} = W_t - \eta\nabla_W \mathcal{L}(W_t). \tag*{(15)} λ := L anc ( W T ) , W t + 1 = W t − η ∇ W L ( W t ) . (15)
Last-Layer Gradient Geometry
Gradient of CE. We derive (17) explicitly so that the reader can see why the outer-product structure emerges. Write the pre-softmax logits as z : = W ϕ ( x ) ∈ R C z := W\phi(x) \in\mathbb{R}^{C} z := W ϕ ( x ) ∈ R C , so q W ( c ∣ x ) = e z c ∑ c ′ e z c ′ q_W(c \mid x) = \frac{e^{z_c}}{\sum_{c'} e^{z_{c'}}} q W ( c ∣ x ) = ∑ c ′ e z c ′ e z c . The per-sample CE loss is ℓ C E = − log q W ( y ∣ x ) = − z y + log ∑ c ′ e z c ′ \ell_{\mathrm{CE}} = -\log q_W(y \mid x) = -z_y + \log\sum_{c'} e^{z_{c'}} ℓ CE = − log q W ( y ∣ x ) = − z y + log ∑ c ′ e z c ′ . The gradient with respect to z z z is the standard softmax residual
∂ ℓ C E ∂ z c = q W ( c ∣ x ) − 1 { c = y } = ( q W ( ⋅ ∣ x ) − e y ) c . (16) \frac{\partial\ell_{\mathrm{CE}}}{\partial z_c} = q_W(c \mid x) - \mathbb{1}\{c = y\} = \left(q_W(\cdot\mid x) - e_y\right)_c. \tag*{(16)} ∂ z c ∂ ℓ CE = q W ( c ∣ x ) − 1 { c = y } = ( q W ( ⋅ ∣ x ) − e y ) c . (16)
To push this back to W W W , use the chain rule: ∂ z c / ∂ W c ′ , d ′ = ϕ d ′ ( x ) 1 { c = c ′ } \partial z_c/\partial W_{c',d'} = \phi_{d'}(x)\mathbb{1}\{c = c'\} ∂ z c / ∂ W c ′ , d ′ = ϕ d ′ ( x ) 1 { c = c ′ } , so
∂ ℓ C E ∂ W c , d = ( q W ( c ∣ x ) − 1 { c = y } ) ϕ d ( x ) . \frac{\partial\ell_{\mathrm{CE}}}{\partial W_{c,d}} = \left(q_W(c \mid x) - \mathbb{1}\{c = y\}\right)\phi_d(x). ∂ W c , d ∂ ℓ CE = ( q W ( c ∣ x ) − 1 { c = y } ) ϕ d ( x ) .
Reading the right-hand side as the ( c , d ) (c,d) ( c , d ) entry of an outer product between the vector q W ( ⋅ ∣ x ) − e y ∈ R C q_W(\cdot\mid x)-e_y \in\mathbb{R}^{C} q W ( ⋅ ∣ x ) − e y ∈ R C and the vector ϕ ( x ) ∈ R d \phi(x) \in\mathbb{R}^{d} ϕ ( x ) ∈ R d yields
∇ W ℓ C E ( W ; x , y ) = ( q W ( ⋅ ∣ x ) − e y ) ϕ ( x ) ⊤ . (17) \nabla_W \ell_{\mathrm{CE}}(W; x, y) = \left(q_W(\cdot\mid x) - e_y\right)\phi(x)^{\top}. \tag*{(17)} ∇ W ℓ CE ( W ; x , y ) = ( q W ( ⋅ ∣ x ) − e y ) ϕ ( x ) ⊤ . (17)
This is a rank-one C × d C \times d C × d matrix: the first factor lives in label space and records the per-class prediction error; the second factor lives in feature space and records ‘which direction in W W W to push’.
Gradient of DCE. The disagreement cross-entropy ℓ D C E ( W ; x , y ^ ) = − 1 C − 1 ∑ c ≠ y ^ log q W ( c ∣ x ) \ell_{\mathrm{DCE}}(W; x, \hat{y}) = -\frac{1}{C-1}\sum_{c\ne\hat{y}}\log q_W(c \mid x) ℓ DCE ( W ; x , y ^ ) = − C − 1 1 ∑ c = y ^ log q W ( c ∣ x ) is itself a cross-entropy, against the uniform-on-non-pseudolabel target u y ^ ∈ Δ C − 1 u_{\hat{y}} \in\Delta^{C-1} u y ^ ∈ Δ C − 1 defined by ( u y ^ ) c = 1 { c ≠ y ^ } / ( C − 1 ) (u_{\hat{y}})_c = \mathbb{1}\{c \ne\hat{y}\}/(C-1) ( u y ^ ) c = 1 { c = y ^ } / ( C − 1 ) . Indeed,
CE ( q W ( ⋅ ∣ x ) , u y ^ ) = − ∑ c ( u y ^ ) c log q W ( c ∣ x ) = − 1 C − 1 ∑ c ≠ y ^ log q W ( c ∣ x ) = ℓ D C E . \operatorname{CE}(q_W(\cdot\mid x), u_{\hat{y}}) = -\sum_c (u_{\hat{y}})_c \log q_W(c \mid x) = -\frac{1}{C-1}\sum_{c\ne\hat{y}}\log q_W(c \mid x) = \ell_{\mathrm{DCE}}. CE ( q W ( ⋅ ∣ x ) , u y ^ ) = − c ∑ ( u y ^ ) c log q W ( c ∣ x ) = − C − 1 1 c = y ^ ∑ log q W ( c ∣ x ) = ℓ DCE .
Applying the same chain-rule calculation as for CE, with target u y ^ u_{\hat{y}} u y ^ replacing e y e_y e y ,
∇ W ℓ D C E ( W ; x , y ^ ) = ( q W ( ⋅ ∣ x ) − u y ^ ) ϕ ( x ) ⊤ . (18) \nabla_W \ell_{\mathrm{DCE}}(W; x, \hat{y}) = \left(q_W(\cdot\mid x) - u_{\hat{y}}\right)\phi(x)^{\top}. \tag*{(18)} ∇ W ℓ DCE ( W ; x , y ^ ) = ( q W ( ⋅ ∣ x ) − u y ^ ) ϕ ( x ) ⊤ . (18)
This gradient is again rank-one and shares the feature factor ϕ ( x ) \phi(x) ϕ ( x ) with the CE gradient in (17).
Batch gradients. Both gradients are rank-one matrices in R C × d \mathbb{R}^{C \times d} R C × d . Evaluating at initialization, write
r a ( i ) : = p x a ( i ) − e y a ( i ) , r e ( j ) : = p x e ( j ) − u y ^ ( j ) (19) r_a^{(i)} := p_{x_a}^{(i)} - e_{y_a}^{(i)}, \qquad r_e^{(j)} := p_{x_e}^{(j)} - u_{\hat{y}^{(j)}} \tag*{(19)} r a ( i ) := p x a ( i ) − e y a ( i ) , r e ( j ) := p x e ( j ) − u y ^ ( j ) (19)
for the anchor- and eval-residual vectors in R C \mathbb{R}^{C} R C . r a ( i ) r_a^{(i)} r a ( i ) measures the prediction error on anchor point i i i in label space, while r e ( j ) r_e^{(j)} r e ( j ) is the corresponding direction in which the disagreement loss pushes the prediction away from the pseudolabel on eval point j j j . The initial batch gradients are the averaged rank-one matrices
g a : = ∇ W L a n c ( W 0 ) = 1 n a ∑ i = 1 n a r a ( i ) ϕ ( x a ( i ) ) ⊤ , (20) g_a := \nabla_W \mathcal{L}_{\mathrm{anc}}(W_0) = \frac{1}{n_a}\sum_{i=1}^{n_a} r_a^{(i)} \phi(x_a^{(i)})^\top, \tag*{(20)} g a := ∇ W L anc ( W 0 ) = n a 1 i = 1 ∑ n a r a ( i ) ϕ ( x a ( i ) ) ⊤ , (20)
g e : = ∇ W L d i s ( W 0 ) = 1 n e ∑ j = 1 n e r e ( j ) ϕ ( x e ( j ) ) ⊤ . (21) g_e := \nabla_W \mathcal{L}_{\mathrm{dis}}(W_0) = \frac{1}{n_e}\sum_{j=1}^{n_e} r_e^{(j)} \phi(x_e^{(j)})^\top. \tag*{(21)} g e := ∇ W L dis ( W 0 ) = n e 1 j = 1 ∑ n e r e ( j ) ϕ ( x e ( j ) ) ⊤ . (21)
Why we care about ⟨ g a , g e ⟩ F \langle g_a, g_e\rangle_F ⟨ g a , g e ⟩ F . The joint update moves W W W in the direction − ( g a + g e ) -(g_a + g_e) − ( g a + g e ) ; whether this also descends the anchor loss depends on the alignment between − ( g a + g e ) -(g_a + g_e) − ( g a + g e ) and the pure anchor-descent direction − g a -g_a − g a . Specifically, the first-order change in anchor loss is η ⟨ g a , g a + g e ⟩ F = η ( ∥ g a ∥ F 2 + ⟨ g a , g e ⟩ F ) \eta\langle g_a, g_a + g_e\rangle_F = \eta(\lVert g_a\rVert_F^2 + \langle g_a, g_e\rangle_F) η ⟨ g a , g a + g e ⟩ F = η (∥ g a ∥ F 2 + ⟨ g a , g e ⟩ F ) , a sum of a non-negative self-term and the gradient cross-term ⟨ g a , g e ⟩ F \langle g_a, g_e\rangle_F ⟨ g a , g e ⟩ F whose sign determines whether the disagreement gradient aligns with (s i g n ≥ 0 \mathit{sign} \ge0 sign ≥ 0 ) or interferes with (s i g n < 0 \mathit{sign} < 0 sign < 0 ) anchor descent. Proposition A.2 makes this Taylor-level statement precise. Before that, it is useful to see that this inner product has a simple structure: it decomposes into a weighted sum over anchor-eval pairs, where each pair contributes a product of a label-space scalar and a feature-space scalar. This factorization is what makes the rest of the analysis tractable.
Lemma A.1 (Gradient cross-term factorization). The Frobenius inner product of g a g_a g a and g e g_e g e factorizes as
⟨ g a , g e ⟩ F = 1 n a n e ∑ i = 1 n a ∑ j = 1 n e C i j K i j , (22) \langle g_a, g_e\rangle_F = \frac{1}{n_a n_e}\sum_{i=1}^{n_a}\sum_{j=1}^{n_e} C_{ij}K_{ij}, \tag*{(22)} ⟨ g a , g e ⟩ F = n a n e 1 i = 1 ∑ n a j = 1 ∑ n e C ij K ij , (22) where C i j : = ⟨ r a ( i ) , r e ( j ) ⟩ ∈ [ − 2 , 2 ] C_{ij} := \langle r_a^{(i)}, r_e^{(j)}\rangle\in[-2,2] C ij := ⟨ r a ( i ) , r e ( j ) ⟩ ∈ [ − 2 , 2 ] is a label-space residual inner product and K i j : = ⟨ ϕ ( x a ( i ) ) , ϕ ( x e ( j ) ) ⟩ K_{ij} := \langle\phi(x_a^{(i)}), \phi(x_e^{(j)})\rangle K ij := ⟨ ϕ ( x a ( i ) ) , ϕ ( x e ( j ) )⟩ is a feature-space kernel.
Proof. We first establish the general outer-product identity. Let A = u v ⊤ ∈ R C × d A = uv^\top\in\mathbb{R}^{C \times d} A = u v ⊤ ∈ R C × d and B = u ′ v ′ ⊤ ∈ R C × d B = u'v'^\top\in\mathbb{R}^{C \times d} B = u ′ v ′⊤ ∈ R C × d be rank-one matrices with u , u ′ ∈ R C u,u' \in\mathbb{R}^{C} u , u ′ ∈ R C and v , v ′ ∈ R d v,v' \in\mathbb{R}^{d} v , v ′ ∈ R d . The Frobenius inner product is
⟨ A , B ⟩ F = ∑ c = 1 C ∑ d ′ = 1 d A c , d ′ B c , d ′ = ∑ c , d ′ ( u c v d ′ ) ( u c ′ v d ′ ′ ) = ( ∑ c u c u c ′ ) ( ∑ d ′ v d ′ v d ′ ′ ) = ⟨ u , u ′ ⟩ ⟨ v , v ′ ⟩ . \begin{aligned}
\langle A,B\rangle_F
&= \sum_{c=1}^{C}\sum_{d'=1}^{d} A_{c,d'}B_{c,d'} \\
&= \sum_{c,d'}(u_cv_{d'})(u'_cv'_{d'}) \\
&= \left(\sum_c u_cu'_c\right)\left(\sum_{d'}v_{d'}v'_{d'}\right)
= \langle u,u'\rangle\langle v,v'\rangle.
\end{aligned} ⟨ A , B ⟩ F = c = 1 ∑ C d ′ = 1 ∑ d A c , d ′ B c , d ′ = c , d ′ ∑ ( u c v d ′ ) ( u c ′ v d ′ ′ ) = ( c ∑ u c u c ′ ) ( d ′ ∑ v d ′ v d ′ ′ ) = ⟨ u , u ′ ⟩ ⟨ v , v ′ ⟩ . In words: the Frobenius inner product of two rank-one matrices splits into the product of the two ‘left’ inner products and the two ‘right’ inner products. This is why decoder-only updates make the analysis tractable.
Now expand the cross-term using bilinearity:
⟨ g a , g e ⟩ F = ⟨ 1 n a ∑ i r a ( i ) ϕ ( x a ( i ) ) ⊤ , 1 n e ∑ j r e ( j ) ϕ ( x e ( j ) ) ⊤ ⟩ F = 1 n a n e ∑ i , j ⟨ r a ( i ) ϕ ( x a ( i ) ) ⊤ , r e ( j ) ϕ ( x e ( j ) ) ⊤ ⟩ F = 1 n a n e ∑ i , j ⟨ r a ( i ) , r e ( j ) ⟩ ⟨ ϕ ( x a ( i ) ) , ϕ ( x e ( j ) ) ⟩ = 1 n a n e ∑ i , j C i j K i j , \begin{aligned}
\langle g_a,g_e\rangle_F
&= \left\langle\frac{1}{n_a}\sum_i r_a^{(i)}\phi(x_a^{(i)})^\top,\frac{1}{n_e}\sum_j r_e^{(j)}\phi(x_e^{(j)})^\top\right\rangle_F \\
&= \frac{1}{n_an_e}\sum_{i,j}\left\langle r_a^{(i)}\phi(x_a^{(i)})^\top,r_e^{(j)}\phi(x_e^{(j)})^\top\right\rangle_F \\
&= \frac{1}{n_an_e}\sum_{i,j}\langle r_a^{(i)},r_e^{(j)}\rangle\langle\phi(x_a^{(i)}),\phi(x_e^{(j)})\rangle
= \frac{1}{n_an_e}\sum_{i,j}C_{ij}K_{ij},
\end{aligned} ⟨ g a , g e ⟩ F = ⟨ n a 1 i ∑ r a ( i ) ϕ ( x a ( i ) ) ⊤ , n e 1 j ∑ r e ( j ) ϕ ( x e ( j ) ) ⊤ ⟩ F = n a n e 1 i , j ∑ ⟨ r a ( i ) ϕ ( x a ( i ) ) ⊤ , r e ( j ) ϕ ( x e ( j ) ) ⊤ ⟩ F = n a n e 1 i , j ∑ ⟨ r a ( i ) , r e ( j ) ⟩ ⟨ ϕ ( x a ( i ) ) , ϕ ( x e ( j ) )⟩ = n a n e 1 i , j ∑ C ij K ij , where the third equality applies the rank-one identity to each pair ( i , j ) (i,j) ( i , j ) .
For the bound ∣ C i j ∣ ≤ 2 |C_{ij}| \le2 ∣ C ij ∣ ≤ 2 : by Cauchy–Schwarz, ∣ C i j ∣ ≤ ∥ r a ( i ) ∥ 2 ∥ r e ( j ) ∥ 2 |C_{ij}| \le\lVert r_a^{(i)}\rVert_2 \lVert r_e^{(j)}\rVert_2 ∣ C ij ∣ ≤ ∥ r a ( i ) ∥ 2 ∥ r e ( j ) ∥ 2 . Each residual is a difference of two distributions in Δ C − 1 \Delta^{C-1} Δ C − 1 , so ∥ r a ( i ) ∥ 2 = ∥ p x a − e y a ∥ 2 ≤ 2 \lVert r_a^{(i)}\rVert_2 = \lVert p_{x_a} - e_{y_a}\rVert_2 \le\sqrt{2} ∥ r a ( i ) ∥ 2 = ∥ p x a − e y a ∥ 2 ≤ 2 (the maximum squared ℓ 2 \ell_2 ℓ 2 distance between two probability vectors on C C C classes is 2 2 2 , attained when both are point masses on different classes). Hence ∣ C i j ∣ ≤ 2 ⋅ 2 = 2 |C_{ij}| \le\sqrt{2}\cdot\sqrt{2}=2 ∣ C ij ∣ ≤ 2 ⋅ 2 = 2 .
(22) is the basis of the analysis. The entire gradient interaction between the anchor and eval batches collapses onto the elementwise product of a label-space matrix C ∈ R n a × n e C \in\mathbb{R}^{n_a \times n_e} C ∈ R n a × n e and a feature-space Gram matrix K ∈ R n a × n e K \in\mathbb{R}^{n_a \times n_e} K ∈ R n a × n e . The label part C i j C_{ij} C ij is bounded, easy to interpret, and typically negative under ID (we will see this in Proposition A.6 ). The feature part K i j K_{ij} K ij is the part that ‘knows’ whether the eval batch is OOD: as we will show in Section A.8, OOD queries produce feature vectors that collapse to a single input-independent direction, making K i j K_{ij} K ij small under OOD.
First-Step Anchor Descent
Why a first-step analysis is meaningful. Algorithm 1 takes T = 50 T = 50 T = 50 gradient steps per round at a learning rate selected from { 10 − 2 , 10 − 3 , 10 − 4 } \{10^{-2}, 10^{-3}, 10^{-4}\} { 1 0 − 2 , 1 0 − 3 , 1 0 − 4 } (default 10 − 3 10^{-3} 1 0 − 3 ). One might worry that the first step tells us nothing about the cumulative effect of fifty. However, there are two insights that make the first-step analysis informative. First, in the small-step regime (Assumption A.7) the cumulative anchor-loss decrement after T T T steps is a linear combination of first-step quantities up to O ( T 2 η 2 ) O(T^2\eta^2) O ( T 2 η 2 ) corrections (Proposition A.8 ). Second, the sign of the first-step cross-term is a discrete feature that typically persists along the trajectory when the backbone is frozen, because the feature-space kernel K i j K_{ij} K ij is the same at every step. This means that the sign analysis at step one carries to step T T T under mild regularity conditions.
Proposition A.2 (First-step anchor descent). Let W 1 = W 0 − η ( g a + g e ) W_1 = W_0 - \eta(g_a + g_e) W 1 = W 0 − η ( g a + g e ) be the update after one gradient step on the joint loss L \mathcal{L} L . Then
L a n c ( W 1 ) − L a n c ( W 0 ) = − η ∥ g a ∥ F 2 − η ⟨ g a , g e ⟩ F + R ( η ) , (23) \mathcal{L}_{\mathrm{anc}}(W_1) - \mathcal{L}_{\mathrm{anc}}(W_0) = -\eta\lVert g_a\rVert_F^2 - \eta\langle g_a,g_e\rangle_F + R(\eta), \tag*{(23)} L anc ( W 1 ) − L anc ( W 0 ) = − η ∥ g a ∥ F 2 − η ⟨ g a , g e ⟩ F + R ( η ) , (23) with remainder ∣ R ( η ) ∣ ≤ 1 2 L a η 2 ∥ g a + g e ∥ F 2 |R(\eta)| \le\frac{1}{2}L_a\eta^2\lVert g_a+g_e\rVert_F^2 ∣ R ( η ) ∣ ≤ 2 1 L a η 2 ∥ g a + g e ∥ F 2 , where L a L_a L a is the Lipschitz constant of ∇ L a n c \nabla\mathcal{L}_{\mathrm{anc}} ∇ L anc along the segment [ W 0 , W 1 ] [W_0,W_1] [ W 0 , W 1 ] .
Proof. The loss L a n c : R C × d → R \mathcal{L}_{\mathrm{anc}}:\mathbb{R}^{C\times d}\to\mathbb{R} L anc : R C × d → R is twice continuously differentiable, being a composition of the affine map W ↦ W ϕ ( x ) W\mapsto W\phi(x) W ↦ W ϕ ( x ) with the softmax-cross-entropy function, both of which are smooth. On the bounded segment [ W 0 , W 1 ] = { W 0 + t ( W 1 − W 0 ) : t ∈ [ 0 , 1 ] } [W_0,W_1]=\{W_0+t(W_1-W_0):t\in[0,1]\} [ W 0 , W 1 ] = { W 0 + t ( W 1 − W 0 ) : t ∈ [ 0 , 1 ]} , ∇ L a n c \nabla\mathcal{L}_{\mathrm{anc}} ∇ L anc is L a L_a L a -Lipschitz for some finite L a L_a L a ; we bound L a L_a L a explicitly in the proof of Proposition A.8 .
Step 1 (Taylor expansion with integral remainder). For any twice continuously differentiable f : R C × d → R f:\mathbb{R}^{C\times d}\to\mathbb{R} f : R C × d → R and any W 0 , W 1 W_0,W_1 W 0 , W 1 ,
f ( W 1 ) = f ( W 0 ) + ⟨ ∇ f ( W 0 ) , W 1 − W 0 ⟩ F + ∫ 0 1 ( 1 − t ) ⟨ W 1 − W 0 , ∇ 2 f ( W 0 + t ( W 1 − W 0 ) ) [ W 1 − W 0 ] ⟩ F d t . \begin{aligned}
f(W_1) &= f(W_0) + \langle\nabla f(W_0), W_1-W_0\rangle_F \\
&\quad+ \int_0^1 (1-t)\langle W_1-W_0,\nabla^2 f(W_0+t(W_1-W_0))[W_1-W_0]\rangle_F\,dt.
\end{aligned} f ( W 1 ) = f ( W 0 ) + ⟨ ∇ f ( W 0 ) , W 1 − W 0 ⟩ F + ∫ 0 1 ( 1 − t ) ⟨ W 1 − W 0 , ∇ 2 f ( W 0 + t ( W 1 − W 0 )) [ W 1 − W 0 ] ⟩ F d t .
Applying this to f = L a n c f=\mathcal{L}_{\mathrm{anc}} f = L anc and denoting the integral as R ( η ) R(\eta) R ( η ) gives
L a n c ( W 1 ) − L a n c ( W 0 ) = ⟨ ∇ L a n c ( W 0 ) , W 1 − W 0 ⟩ F + R ( η ) . \mathcal{L}_{\mathrm{anc}}(W_1)-\mathcal{L}_{\mathrm{anc}}(W_0)=\langle\nabla\mathcal{L}_{\mathrm{anc}}(W_0),W_1-W_0\rangle_F+R(\eta). L anc ( W 1 ) − L anc ( W 0 ) = ⟨ ∇ L anc ( W 0 ) , W 1 − W 0 ⟩ F + R ( η ) .
Step 2 (compute the linear term). By definition ∇ L a n c ( W 0 ) = g a \nabla\mathcal{L}_{\mathrm{anc}}(W_0)=g_a ∇ L anc ( W 0 ) = g a , and the update direction is W 1 − W 0 = − η ( g a + g e ) W_1-W_0=-\eta(g_a+g_e) W 1 − W 0 = − η ( g a + g e ) . Hence
⟨ ∇ L a n c ( W 0 ) , W 1 − W 0 ⟩ F = ⟨ g a , − η ( g a + g e ) ⟩ F = − η ⟨ g a , g a ⟩ F − η ⟨ g a , g e ⟩ F = − η ∥ g a ∥ F 2 − η ⟨ g a , g e ⟩ F , \begin{aligned}
\langle\nabla\mathcal{L}_{\mathrm{anc}}(W_0),W_1-W_0\rangle_F
&=\langle g_a,-\eta(g_a+g_e)\rangle_F\\
&=-\eta\langle g_a,g_a\rangle_F-\eta\langle g_a,g_e\rangle_F\\
&=-\eta\lVert g_a\rVert_F^2-\eta\langle g_a,g_e\rangle_F,
\end{aligned} ⟨ ∇ L anc ( W 0 ) , W 1 − W 0 ⟩ F = ⟨ g a , − η ( g a + g e ) ⟩ F = − η ⟨ g a , g a ⟩ F − η ⟨ g a , g e ⟩ F = − η ∥ g a ∥ F 2 − η ⟨ g a , g e ⟩ F ,
using bilinearity of the Frobenius inner product.
Step 3 (bound the remainder). By L a L_a L a -Lipschitzness of ∇ L a n c \nabla\mathcal{L}_{\mathrm{anc}} ∇ L anc on [ W 0 , W 1 ] [W_0, W_1] [ W 0 , W 1 ] , the Hessian has operator norm ≤ L a \le L_a ≤ L a on the segment. Plugging this into the integral remainder,
∣ R ( η ) ∣ ≤ ∫ 0 1 ( 1 − t ) L a ∥ W 1 − W 0 ∥ F 2 d t \lvert R(\eta)\rvert\le\int_0^1 (1-t)L_a\lVert W_1-W_0\rVert_F^2\,dt ∣ R ( η )∣ ≤ ∫ 0 1 ( 1 − t ) L a ∥ W 1 − W 0 ∥ F 2 d t = L a η 2 ∥ g a + g e ∥ F 2 ∫ 0 1 ( 1 − t ) d t = 1 2 L a η 2 ∥ g a + g e ∥ F 2 . = L_a\eta^2\lVert g_a+g_e\rVert_F^2\int_0^1(1-t)\,dt = \tfrac{1}{2}L_a\eta^2\lVert g_a+g_e\rVert_F^2. = L a η 2 ∥ g a + g e ∥ F 2 ∫ 0 1 ( 1 − t ) d t = 2 1 L a η 2 ∥ g a + g e ∥ F 2 . Combining steps 1–3 gives (23).
Interpretation: the cross-term controls the first-order descent rate. The significance of Proposition A.2 is that the first-order anchor descent rate is entirely controlled by the sign and magnitude of the cross-term ⟨ g a , g e ⟩ F \langle g_a,g_e\rangle_F ⟨ g a , g e ⟩ F . Fix η \eta η small enough such that the remainder R ( η ) = O ( η 2 ) R(\eta)=O(\eta^2) R ( η ) = O ( η 2 ) is negligible compared to the first-order terms of size O ( η ) O(\eta) O ( η ) . Then
L a n c ( W 1 ) − L a n c ( W 0 ) ≈ − η ( ∥ g a ∥ F 2 + ⟨ g a , g e ⟩ F ) . \mathcal{L}_{\mathrm{anc}}(W_1)-\mathcal{L}_{\mathrm{anc}}(W_0)\approx-\eta\left(\lVert g_a\rVert_F^2+\langle g_a,g_e\rangle_F\right). L anc ( W 1 ) − L anc ( W 0 ) ≈ − η ( ∥ g a ∥ F 2 + ⟨ g a , g e ⟩ F ) .
Since ∥ g a ∥ F 2 ≥ 0 \lVert g_a\rVert_F^2\ge0 ∥ g a ∥ F 2 ≥ 0 , the three qualitatively distinct regimes are (see Figure 4 ):
Figure 4. The three regimes of Proposition A.2. The first-order anchor-loss decrement after one joint-loss step equals η \eta η times the projection of g a + g e g_a + g_e g a + g e (dashed) onto the direction of g a g_a g a (blue). When g e g_e g e (orange) makes an acute angle with g a g_a g a (left), descent is unimpeded or better; this is the OOD regime (Corollary A.4 ). When g e g_e g e makes an obtuse but bounded angle (middle), descent is damped but still positive (the typical ID regime, Proposition A.6 ). When g e g_e g e is strongly anti-aligned with g a g_a g a (right), the projection turns negative and anchor loss does not decrease. The detector’s signal comes from the ID regime sitting in the middle panel and the OOD regime sitting approximately on the left.
Alignment or orthogonality ⟨ g a , g e ⟩ F ≥ 0 \langle g_a,g_e\rangle_F\ge0 ⟨ g a , g e ⟩ F ≥ 0 : anchor loss decreases at rate ≥ η ∥ g a ∥ F 2 \ge\eta\lVert g_a\rVert_F^2 ≥ η ∥ g a ∥ F 2 . The disagree gradient either actively helps anchor descent (positive inner product) or is geometrically unrelated to it (zero inner product). This is the regime we will argue for OOD eval batches.
Damped descent ⟨ g a , g e ⟩ F ∈ ( − ∥ g a ∥ F 2 , 0 ) \langle g_a,g_e\rangle_F\in(-\lVert g_a\rVert_F^2,0) ⟨ g a , g e ⟩ F ∈ ( − ∥ g a ∥ F 2 , 0 ) : anchor loss still decreases, but at a rate strictly smaller than η ∥ g a ∥ F 2 \eta\lVert g_a\rVert_F^2 η ∥ g a ∥ F 2 . The disagree gradient partially cancels the anchor gradient. This is the typical ID regime.
Stall or increase ⟨ g a , g e ⟩ F ≤ − ∥ g a ∥ F 2 \langle g_a,g_e\rangle_F\le-\lVert g_a\rVert_F^2 ⟨ g a , g e ⟩ F ≤ − ∥ g a ∥ F 2 : anchor loss stalls or increases. The disagree gradient more than cancels the anchor gradient. This is an extreme ID regime in which anchor and eval are particularly entangled.
The informal claim that the disagreement gradient ‘interferes with anchor agreement’ in the ID regime but not in the OOD regime translates to this cross-term being negative under ID and near-zero under OOD. The next two subsections make each direction rigorous: Corollary A.4 upper-bounds ∣ ⟨ g a , g e ⟩ F ∣ \lvert\langle g_a,g_e\rangle_F\rvert ∣⟨ g a , g e ⟩ F ∣ under an OOD feature-orthogonality assumption, while Proposition A.6 lower-bounds it by a negative quantity under an ID confidence assumption.
Feature-Orthogonality Corollary
Corollary A.4 below gives an upper bound on ∣ ⟨ g a , g e ⟩ F ∣ \lvert\langle g_a,g_e\rangle_F\rvert ∣⟨ g a , g e ⟩ F ∣ when anchor and eval features are approximately orthogonal. This happens whenever cos ( ϕ ( x a ) , ϕ ( x e ) ) \cos(\phi(x_a),\phi(x_e)) cos ( ϕ ( x a ) , ϕ ( x e )) is small.
Assumption A.3 (Feature orthogonality). There exists ϵ ≥ 0 \epsilon\ge0 ϵ ≥ 0 such that, for every anchor-eval pair ( i , j ) (i,j) ( i , j ) ,
∣ ⟨ ϕ ( x a ( i ) ) , ϕ ( x e ( j ) ) ⟩ ∣ ≤ ϵ ∥ ϕ ( x a ( i ) ) ∥ ∥ ϕ ( x e ( j ) ) ∥ . (24) \left|\left\langle\phi(x_a^{(i)}),\phi(x_e^{(j)})\right\rangle\right| \le\epsilon\left\|\phi(x_a^{(i)})\right\| \left\|\phi(x_e^{(j)})\right\|. \tag*{(24)} ⟨ ϕ ( x a ( i ) ) , ϕ ( x e ( j ) ) ⟩ ≤ ϵ ϕ ( x a ( i ) ) ϕ ( x e ( j ) ) . (24)
The parameter ϵ ∈ [ 0 , 1 ] \epsilon\in[0,1] ϵ ∈ [ 0 , 1 ] is the worst-case cosine between anchor and eval features. When ϵ = 0 \epsilon= 0 ϵ = 0 the two feature sets lie in orthogonal subspaces; when ϵ = 1 \epsilon= 1 ϵ = 1 they are identical up to scale.
Corollary A.4 (Orthogonal features imply unimpeded anchor descent). Assume ∥ ϕ ( x ) ∥ ≤ B ϕ \|\phi(x)\| \le B_\phi ∥ ϕ ( x ) ∥ ≤ B ϕ for all x x x in X a n c ∪ X e v a l \mathcal{X}_{\mathrm{anc}} \cup\mathcal{X}_{\mathrm{eval}} X anc ∪ X eval and set B C : = max i , j ∣ C i j ∣ ≤ 2 B_C := \max_{i,j}|C_{ij}| \le2 B C := max i , j ∣ C ij ∣ ≤ 2 (from Lemma A.1). Under Assumption A.3,
∣ ⟨ g a , g e ⟩ F ∣ ≤ ϵ B ϕ 2 B C . (25) \left|\langle g_a,g_e\rangle_F\right| \le\epsilon B_\phi^2 B_C. \tag*{(25)} ∣ ⟨ g a , g e ⟩ F ∣ ≤ ϵ B ϕ 2 B C . (25) Consequently, when ϵ = o ( ∥ g a ∥ F 2 / ( B ϕ 2 B C ) ) \epsilon= o(\|g_a\|_F^2/(B_\phi^2B_C)) ϵ = o ( ∥ g a ∥ F 2 / ( B ϕ 2 B C )) , the first-step anchor descent in (23) reduces to − η ∥ g a ∥ F 2 ( 1 + o ( 1 ) ) -\eta\|g_a\|_F^2(1+o(1)) − η ∥ g a ∥ F 2 ( 1 + o ( 1 )) , i.e., the disagreement gradient leaves anchor descent unimpeded at first order in the step size η \eta η .
Proof. Start from the factorization (22) . For each pair ( i , j ) (i,j) ( i , j ) , bound the summand by the product of term-wise bounds:
∣ C i j K i j ∣ = ∣ C i j ∣ ∣ ⟨ ϕ ( x a ( i ) ) , ϕ ( x e ( j ) ) ⟩ ∣ ≤ B C ⋅ ϵ ∥ ϕ ( x a ( i ) ) ∥ ∥ ϕ ( x e ( j ) ) ∥ (Assumption A.3; definition of B C ) ≤ B C ⋅ ϵ B ϕ 2 (boundedness of ϕ ). \begin{aligned}
|C_{ij}K_{ij}| &= |C_{ij}|\left|\left\langle\phi(x_a^{(i)}),\phi(x_e^{(j)})\right\rangle\right| \\
&\le B_C\cdot\epsilon\|\phi(x_a^{(i)})\|\|\phi(x_e^{(j)})\| && \text{(Assumption A.3; definition of }B_C\text{)}\\
&\le B_C\cdot\epsilon B_\phi^2 && \text{(boundedness of }\phi\text{).}
\end{aligned} ∣ C ij K ij ∣ = ∣ C ij ∣ ⟨ ϕ ( x a ( i ) ) , ϕ ( x e ( j ) ) ⟩ ≤ B C ⋅ ϵ ∥ ϕ ( x a ( i ) ) ∥∥ ϕ ( x e ( j ) ) ∥ ≤ B C ⋅ ϵ B ϕ 2 (Assumption A.3; definition of B C ) (boundedness of ϕ ). Averaging over the n a n e n_a n_e n a n e pairs in (22) (the triangle inequality applied to the sum),
∣ ⟨ g a , g e ⟩ F ∣ = ∣ 1 n a n e ∑ i , j C i j K i j ∣ ≤ 1 n a n e ∑ i , j ∣ C i j K i j ∣ ≤ 1 n a n e ⋅ n a n e ⋅ ϵ B ϕ 2 B C = ϵ B ϕ 2 B C . \left|\langle g_a,g_e\rangle_F\right| = \left|\frac{1}{n_a n_e}\sum_{i,j}C_{ij}K_{ij}\right| \le\frac{1}{n_a n_e}\sum_{i,j}|C_{ij}K_{ij}| \le\frac{1}{n_a n_e}\cdot n_a n_e\cdot\epsilon B_\phi^2B_C = \epsilon B_\phi^2B_C. ∣ ⟨ g a , g e ⟩ F ∣ = n a n e 1 i , j ∑ C ij K ij ≤ n a n e 1 i , j ∑ ∣ C ij K ij ∣ ≤ n a n e 1 ⋅ n a n e ⋅ ϵ B ϕ 2 B C = ϵ B ϕ 2 B C . For the consequence, plug this bound into (23) :
L a n c ( W 1 ) − L a n c ( W 0 ) = − η ∥ g a ∥ F 2 ( 1 + ⟨ g a , g e ⟩ F ∥ g a ∥ F 2 ) + O ( η 2 ) , \mathcal{L}_{\mathrm{anc}}(W_1)-\mathcal{L}_{\mathrm{anc}}(W_0)=-\eta\|g_a\|_F^2\left(1+\frac{\langle g_a,g_e\rangle_F}{\|g_a\|_F^2}\right)+O(\eta^2), L anc ( W 1 ) − L anc ( W 0 ) = − η ∥ g a ∥ F 2 ( 1 + ∥ g a ∥ F 2 ⟨ g a , g e ⟩ F ) + O ( η 2 ) , and observe that the ratio ⟨ g a , g e ⟩ F / ∥ g a ∥ F 2 \langle g_a,g_e\rangle_F/\|g_a\|_F^2 ⟨ g a , g e ⟩ F /∥ g a ∥ F 2 is o ( 1 ) o(1) o ( 1 ) exactly when ϵ = o ( ∥ g a ∥ F 2 / ( B ϕ 2 B C ) ) \epsilon=o(\|g_a\|_F^2/(B_\phi^2B_C)) ϵ = o ( ∥ g a ∥ F 2 / ( B ϕ 2 B C )) .
Intuitive reading. When anchor and eval features lie in approximately orthogonal subspaces of R d \mathbb{R}^d R d , moving the decoder in the direction − g e -g_e − g e (which is a sum of rank-one outer products with eval features) has little effect on the decoder’s behavior on anchor features. The disagreement gradient is, to first order, invisible to the anchor gradient. Therefore, the joint update − ( g a + g e ) -(g_a+g_e) − ( g a + g e ) acts on the anchor loss as if only − g a -g_a − g a had been applied, and anchor loss descends at the usual rate η ∥ g a ∥ F 2 \eta\|g_a\|_F^2 η ∥ g a ∥ F 2 .
ID Interference
The OOD corollary of the previous subsection showed that ⟨ g a , g e ⟩ F \langle g_a,g_e\rangle_F ⟨ g a , g e ⟩ F is small when features are orthogonal. But to get a detector we need separation: the cross-term must not just be zero but negative under ID, so anchor descent is visibly damped. This subsection establishes that separation.
Why this is not obvious. A casual reader might expect that any gradient that is not orthogonal to g a g_a g a contributes random noise. However, the claim here is stronger: under the mild ID conditions listed below, the sign of ⟨ g a , g e ⟩ F \langle g_a,g_e\rangle_F ⟨ g a , g e ⟩ F is systematically negative . This asymmetry between the OOD regime (cross-term ≈ 0 \approx0 ≈ 0 ) and the ID regime (cross-term < 0 < 0 < 0 ) is the source of the detector’s signal: E [ λ O O D ] − E [ λ I D ] \mathbb{E}[\lambda_{\mathrm{OOD}}]-\mathbb{E}[\lambda_{\mathrm{ID}}] E [ λ OOD ] − E [ λ ID ] is bounded above by − η E p 0 ⊗ p 0 [ ⟨ g a , g e ⟩ F ] < 0 -\eta\mathbb{E}_{p_0\otimes p_0}[\langle g_a,g_e\rangle_F] < 0 − η E p 0 ⊗ p 0 [⟨ g a , g e ⟩ F ] < 0 at first order, where p 0 ⊗ p 0 p_0\otimes p_0 p 0 ⊗ p 0 denotes the product distribution under which the anchor pair ( x a , y a ) (x_a,y_a) ( x a , y a ) and the eval pair ( x e , y ^ ) (x_e,\hat y) ( x e , y ^ ) are drawn independently, each from p 0 p_0 p 0 .
Assumption A.5 (ID confidence, correctness, and class symmetry). Recall from Section A.3 that p x : = q W 0 ( ⋅ ∣ x ) ∈ Δ C − 1 p_x := q_{W_0}(\cdot\mid x) \in\Delta^{C-1} p x := q W 0 ( ⋅ ∣ x ) ∈ Δ C − 1 is the initial PFN prediction at query x x x , and the pseudolabel function is y ^ ( x ) : = arg max c p x ( c ) \hat{y}(x) := \arg\max_c p_x(c) y ^ ( x ) := arg max c p x ( c ) . Under sampling ( x a , y a ) , ( x e , y ^ ) ∼ p 0 ⊗ p 0 (x_a,y_a),(x_e,\hat{y}) \sim p_0 \otimes p_0 ( x a , y a ) , ( x e , y ^ ) ∼ p 0 ⊗ p 0 , and for a constant τ < 1 / ( 2 ( C − 1 ) ) \tau< 1/(2(C-1)) τ < 1/ ( 2 ( C − 1 )) :
(i) The initial model is non-trivially correct on the anchor: E p 0 [ p x a ( y a ) ] ≥ 1 / 2 \mathbb{E}_{p_0}[p_{x_a}(y_a)] \ge1/2 E p 0 [ p x a ( y a )] ≥ 1/2 .
(ii) The initial model is non-trivially confident on eval: E p 0 [ p x e ( y ^ ( x e ) ) ] ≥ 1 − τ \mathbb{E}_{p_0}[p_{x_e}(\hat{y}(x_e))] \ge1-\tau E p 0 [ p x e ( y ^ ( x e ))] ≥ 1 − τ .
(iii) Backbone features are p 0 p_0 p 0 -centered and non-degenerate: E p 0 [ ϕ ( x ) ] = 0 \mathbb{E}_{p_0}[\phi(x)] = 0 E p 0 [ ϕ ( x )] = 0 and E p 0 [ ∥ ϕ ( x ) ∥ 2 ] > 0 \mathbb{E}_{p_0}[\lVert\phi(x)\rVert^2] > 0 E p 0 [∥ ϕ ( x ) ∥ 2 ] > 0 .
(iv) (Class symmetry) The class-conditional feature means μ c : = E p 0 [ ϕ ( x ) ∣ y ( x ) = c ] \mu_c := \mathbb{E}_{p_0}[\phi(x) \mid y(x)=c] μ c := E p 0 [ ϕ ( x ) ∣ y ( x ) = c ] span C C C distinct directions, and the predictor satisfies p x ( c ) − 1 / C ∝ ⟨ ϕ ( x ) , μ c ⟩ p_x(c)-1/C \propto\langle\phi(x),\mu_c\rangle p x ( c ) − 1/ C ∝ ⟨ ϕ ( x ) , μ c ⟩ , up to first order.
(v) (Accuracy) The initial classifier is accurate on ID: P p 0 ( y ^ ( x ) = y ( x ) ) ≥ 1 − τ \mathbb{P}_{p_0}(\hat{y}(x)=y(x)) \ge1-\tau P p 0 ( y ^ ( x ) = y ( x )) ≥ 1 − τ .
Condition (iii) can be arranged by subtracting the p 0 p_0 p 0 -mean from ϕ \phi ϕ ; we revisit this when connecting to Nagler’s limiting feature in Section A.8. Condition (iv) is the class-symmetry assumption that makes the label-disagreement case reverse the sign of the feature covariance; it is standard in linearized-network analyses. We state the proposition for general C C C but prove it first in the illustrative binary case, then give the multiclass extension.
Proposition A.6 (ID interference). Under Assumption A.5,
E p 0 ⊗ p 0 [ C i j K i j ] < 0 , (26) \mathbb{E}_{p_0\otimes p_0}\left[C_{ij}K_{ij}\right] < 0, \tag*{(26)} E p 0 ⊗ p 0 [ C ij K ij ] < 0 , (26) so in expectation ⟨ g a , g e ⟩ F < 0 \langle g_a,g_e\rangle_F < 0 ⟨ g a , g e ⟩ F < 0 , and Proposition A.2 gives damped anchor descent.
Proof. We prove the binary (C = 2 C=2 C = 2 ) case in full and then indicate the multiclass extension.
Step 1 (binary simplification of residuals). When C = 2 C=2 C = 2 and the pseudolabel is y ^ \hat{y} y ^ , the uniform-on-non-pseudolabel distribution is u y ^ = e 1 − y ^ u_{\hat{y}}=e_{1-\hat{y}} u y ^ = e 1 − y ^ (a one-hot on the flipped class). Hence r e ( j ) = p x e ( j ) − e 1 − y ^ ( j ) r_e^{(j)}=p_{x_e}^{(j)}-e_{1-\hat{y}}^{(j)} r e ( j ) = p x e ( j ) − e 1 − y ^ ( j ) , which is the same as the CE residual against the flipped label. For the anchor, r a ( i ) = p x a ( i ) − e y a ( i ) r_a^{(i)}=p_{x_a}^{(i)}-e_{y_a}^{(i)} r a ( i ) = p x a ( i ) − e y a ( i ) as before.
Step 2 (binary residual inner product). Write p x = ( 1 − p x + , p x + ) ⊤ p_x=(1-p_x^+,p_x^+)^\top p x = ( 1 − p x + , p x + ) ⊤ with p x + : = p x ( 1 ) p_x^+ := p_x(1) p x + := p x ( 1 ) , and identify p x 0 = 1 − p x + p_x^0=1-p_x^+ p x 0 = 1 − p x + , p x 1 = p x + p_x^1=p_x^+ p x 1 = p x + . A direct calculation gives
p x − e 0 = ( − p x + , p x + ) ⊤ = − p x 1 ( 1 , − 1 ) ⊤ , p x − e 1 = ( 1 − p x + , − ( 1 − p x + ) ) ⊤ = p x 0 ( 1 , − 1 ) ⊤ . p_x-e_0=(-p_x^+,p_x^+)^\top=-p_x^1(1,-1)^\top,\qquad p_x-e_1=(1-p_x^+,-(1-p_x^+))^\top=p_x^0(1,-1)^\top. p x − e 0 = ( − p x + , p x + ) ⊤ = − p x 1 ( 1 , − 1 ) ⊤ , p x − e 1 = ( 1 − p x + , − ( 1 − p x + ) ) ⊤ = p x 0 ( 1 , − 1 ) ⊤ .
Both residuals are scalar multiples of e : = ( 1 , − 1 ) ⊤ e:=(1,-1)^\top e := ( 1 , − 1 ) ⊤ . We can write this uniformly as
p x − e c = ( − 1 ) c + 1 ( 1 − p x c ) e . p_x-e_c=(-1)^{c+1}(1-p_x^c)e. p x − e c = ( − 1 ) c + 1 ( 1 − p x c ) e .
Define α x c : = ( − 1 ) c + 1 ( 1 − p x c ) \alpha_x^c := (-1)^{c+1}(1-p_x^c) α x c := ( − 1 ) c + 1 ( 1 − p x c ) ; note ∣ α x c ∣ = 1 − p x c |\alpha_x^c|=1-p_x^c ∣ α x c ∣ = 1 − p x c , and the sign depends on c c c . Then r a = α x a y a e r_a=\alpha_{x_a}^{y_a}e r a = α x a y a e and r e = p x e − u y ^ = p x e − e 1 − y ^ = α x e 1 − y ^ e r_e=p_{x_e}-u_{\hat{y}}=p_{x_e}-e_{1-\hat{y}}=\alpha_{x_e}^{1-\hat{y}}e r e = p x e − u y ^ = p x e − e 1 − y ^ = α x e 1 − y ^ e . Hence
⟨ r a , r e ⟩ = α x a y a α x e 1 − y ^ ⟨ e , e ⟩ = 2 α x a y a α x e 1 − y ^ . \langle r_a,r_e\rangle=\alpha_{x_a}^{y_a}\alpha_{x_e}^{1-\hat{y}}\langle e,e\rangle=2\alpha_{x_a}^{y_a}\alpha_{x_e}^{1-\hat{y}}. ⟨ r a , r e ⟩ = α x a y a α x e 1 − y ^ ⟨ e , e ⟩ = 2 α x a y a α x e 1 − y ^ .
Step 3 (sign of each factor under Assumption A.5). Condition on y a y_a y a and y ^ ( x e ) \hat{y}(x_e) y ^ ( x e ) . By the definition of α \alpha α :
α x a y a = ( − 1 ) y a + 1 ( 1 − p x a y a ) \alpha_{x_a}^{y_a}=(-1)^{y_a+1}(1-p_{x_a}^{y_a}) α x a y a = ( − 1 ) y a + 1 ( 1 − p x a y a ) . Since p x a y a ≤ 1 p_{x_a}^{y_a}\le1 p x a y a ≤ 1 , the magnitude is 1 − p x a y a ≥ 0 1-p_{x_a}^{y_a}\ge0 1 − p x a y a ≥ 0 . The sign is ( − 1 ) y a + 1 (-1)^{y_a+1} ( − 1 ) y a + 1 .
α x e 1 − y ^ = ( − 1 ) ( 1 − y ^ ) + 1 ( 1 − p x e 1 − y ^ ) = ( − 1 ) y ^ p x e y ^ \alpha_{x_e}^{1-\hat{y}}=(-1)^{(1-\hat{y})+1}(1-p_{x_e}^{1-\hat{y}})=(-1)^{\hat{y}}p_{x_e}^{\hat{y}} α x e 1 − y ^ = ( − 1 ) ( 1 − y ^ ) + 1 ( 1 − p x e 1 − y ^ ) = ( − 1 ) y ^ p x e y ^ (using 1 − p x e 1 − y ^ = p x e y ^ 1-p_{x_e}^{1-\hat{y}}=p_{x_e}^{\hat{y}} 1 − p x e 1 − y ^ = p x e y ^ ). The magnitude is p x e y ^ = p x e ( y ^ ( x e ) ) p_{x_e}^{\hat{y}}=p_{x_e}(\hat{y}(x_e)) p x e y ^ = p x e ( y ^ ( x e )) , which by Assumption A.5(ii) is ≥ 1 − τ \ge1-\tau ≥ 1 − τ . The sign is ( − 1 ) y ^ (-1)^{\hat{y}} ( − 1 ) y ^ .
Multiplying the signs:
sign ( ⟨ r a , r e ⟩ ) = ( − 1 ) y a + 1 ⋅ ( − 1 ) y ^ = − ( − 1 ) y a + y ^ . \operatorname{sign}(\langle r_a,r_e\rangle)=(-1)^{y_a+1}\cdot(-1)^{\hat{y}}=-(-1)^{y_a+\hat{y}}. sign (⟨ r a , r e ⟩) = ( − 1 ) y a + 1 ⋅ ( − 1 ) y ^ = − ( − 1 ) y a + y ^ .
When y a = y ^ y_a=\hat{y} y a = y ^ (label agreement): sign = − 1 =-1 = − 1 . When y a ≠ y ^ y_a\ne\hat{y} y a = y ^ (label disagreement): sign = + 1 =+1 = + 1 .
Step 4 (sign of the feature kernel under class symmetry). Under Assumption A.5(iv) with C = 2 C = 2 C = 2 , the class-conditional feature means are μ 0 = − μ 1 = : − μ \mu_0 = -\mu_1 =: -\mu μ 0 = − μ 1 =: − μ (centering forces μ 0 + μ 1 = 0 \mu_0 + \mu_1 = 0 μ 0 + μ 1 = 0 ). Since the anchor draw x a x_a x a and the eval draw x e x_e x e are independent under p 0 ⊗ p 0 p_0 \otimes p_0 p 0 ⊗ p 0 , conditioning on ( y a , y ^ ( x e ) ) (y_a, \hat{y}(x_e)) ( y a , y ^ ( x e )) makes ϕ ( x a ) \phi(x_a) ϕ ( x a ) and ϕ ( x e ) \phi(x_e) ϕ ( x e ) conditionally independent, so
E [ K i j ∣ y a , y ^ ] = ⟨ E [ ϕ ( x a ) ∣ y a ] , E [ ϕ ( x e ) ∣ y ^ ( x e ) ] ⟩ = ⟨ μ y a , m y ^ ⟩ . \mathbb{E}[K_{ij} \mid y_a, \hat{y}] = \langle\mathbb{E}[\phi(x_a) \mid y_a], \mathbb{E}[\phi(x_e) \mid\hat{y}(x_e)] \rangle= \langle\mu_{y_a}, m_{\hat{y}}\rangle. E [ K ij ∣ y a , y ^ ] = ⟨ E [ ϕ ( x a ) ∣ y a ] , E [ ϕ ( x e ) ∣ y ^ ( x e )]⟩ = ⟨ μ y a , m y ^ ⟩ .
where we write m c : = E [ ϕ ( x e ) ∣ y ^ ( x e ) = c ] m_c := \mathbb{E}[\phi(x_e) \mid\hat{y}(x_e) = c] m c := E [ ϕ ( x e ) ∣ y ^ ( x e ) = c ] for the predicted-class conditional mean. By Assumption A.5(v), P p 0 ( y ^ ( x ) ≠ y ( x ) ) ≤ τ \mathbb{P}_{p_0}(\hat{y}(x) \ne y(x)) \le\tau P p 0 ( y ^ ( x ) = y ( x )) ≤ τ , and a standard total-probability decomposition gives
m c = μ c + O ( τ ) m_c = \mu_c + O(\tau) m c = μ c + O ( τ )
with the O ( τ ) O(\tau) O ( τ ) constant controlled by the uniform backbone bound B ϕ B_\phi B ϕ and the posterior P ( y = c ∣ y ^ = c ) ≥ 1 − O ( τ ) \mathbb{P}(y = c \mid\hat{y} = c) \ge1 - O(\tau) P ( y = c ∣ y ^ = c ) ≥ 1 − O ( τ ) implied by (v) and the law of total probability. Hence E [ K i j ∣ y a , y ^ ] = ⟨ μ y a , μ y ^ ⟩ + O ( τ B ϕ 2 ) \mathbb{E}[K_{ij} \mid y_a, \hat{y}] = \langle\mu_{y_a}, \mu_{\hat{y}}\rangle+ O(\tau B_\phi^2) E [ K ij ∣ y a , y ^ ] = ⟨ μ y a , μ y ^ ⟩ + O ( τ B ϕ 2 ) , with ⟨ μ y a , μ y ^ ⟩ = + ∥ μ ∥ 2 \langle\mu_{y_a}, \mu_{\hat{y}}\rangle= +\|\mu\|^2 ⟨ μ y a , μ y ^ ⟩ = + ∥ μ ∥ 2 under label agreement and − ∥ μ ∥ 2 -\|\mu\|^2 − ∥ μ ∥ 2 under disagreement. For τ B ϕ 2 < ∥ μ ∥ 2 \tau B_\phi^2 < \|\mu\|^2 τ B ϕ 2 < ∥ μ ∥ 2 (denoting the regime of any useful ID classifier) the conditional feature kernel is strictly positive under label agreement and strictly negative under label disagreement.
Step 5 (combining Steps 3 and 4). The product C i j K i j C_{ij}K_{ij} C ij K ij has sign equal to the product of the signs computed in Steps 3 and 4:
Label agreement (y a = y ^ y_a = \hat{y} y a = y ^ ): C i j < 0 C_{ij} < 0 C ij < 0 and E [ K i j ∣ y a = y ^ ] > 0 \mathbb{E}[K_{ij} \mid y_a = \hat{y}] > 0 E [ K ij ∣ y a = y ^ ] > 0 , so the contribution to E [ C i j K i j ] \mathbb{E}[C_{ij}K_{ij}] E [ C ij K ij ] is negative .
Label disagreement (y a ≠ y ^ y_a \ne\hat{y} y a = y ^ ): C i j > 0 C_{ij} > 0 C ij > 0 and E [ K i j ∣ y a ≠ y ^ ] < 0 \mathbb{E}[K_{ij} \mid y_a \ne\hat{y}] < 0 E [ K ij ∣ y a = y ^ ] < 0 , so the contribution to E [ C i j K i j ] \mathbb{E}[C_{ij}K_{ij}] E [ C ij K ij ] is also negative .
Both events contribute negatively, so E [ C i j K i j ] < 0 \mathbb{E}[C_{ij}K_{ij}] < 0 E [ C ij K ij ] < 0 (Figure 5 ). This proves the binary case.
Figure 5. The “double negative” mechanism of Proposition A.6 . In both possible label configurations, the product C i j K i j C_{ij}K_{ij} C ij K ij ends up negative: in the first case because K > 0 K > 0 K > 0 multiplies C < 0 C < 0 C < 0 , in the second case because K < 0 K < 0 K < 0 multiplies C > 0 C > 0 C > 0 . Since these are the only two cases, the expectation E [ C i j K i j ] \mathbb{E}[C_{ij}K_{ij}] E [ C ij K ij ] is negative regardless of the label marginal. This is the mechanism that forces ID anchor descent into the “damped” regime of Figure 4 (middle panel).
Step 6 (multiclass extension). For general C C C , we again condition on the label pair ( y a , y ^ ) (y_a, \hat{y}) ( y a , y ^ ) . Conditional independence of ϕ ( x a ) \phi(x_a) ϕ ( x a ) and ϕ ( x e ) \phi(x_e) ϕ ( x e ) gives
E [ K i j ∣ y a = c , y ^ = c ′ ] = ⟨ μ c , μ c ′ ⟩ . \mathbb{E}[K_{ij} \mid y_a = c, \hat{y} = c'] = \langle\mu_c, \mu_{c'}\rangle. E [ K ij ∣ y a = c , y ^ = c ′ ] = ⟨ μ c , μ c ′ ⟩ .
Centering (∑ c μ c = 0 \sum_c \mu_c = 0 ∑ c μ c = 0 ) and the class-symmetry condition (iv) force ⟨ μ c , μ c ′ ⟩ \langle\mu_c, \mu_{c'}\rangle ⟨ μ c , μ c ′ ⟩ to be positive when c = c ′ c = c' c = c ′ and to have average value − ∥ μ ∥ 2 / ( C − 1 ) < 0 -\|\mu\|^2/(C - 1) < 0 − ∥ μ ∥ 2 / ( C − 1 ) < 0 when c ≠ c ′ c \ne c' c = c ′ . The residual inner product E [ C i j ∣ y a = c , y ^ = c ′ ] \mathbb{E}[C_{ij} \mid y_a = c, \hat{y} = c'] E [ C ij ∣ y a = c , y ^ = c ′ ] generalizes to a label-pair-indexed quantity that, under Assumption A.5(i)–(ii), is negative for c = c ′ c = c' c = c ′ (the generalization of the binary “− p x e ( y ^ ) -p_{x_e}(\hat{y}) − p x e ( y ^ ) ” term) and positive for c ≠ c ′ c \ne c' c = c ′ . The product E [ C i j K i j ∣ c , c ′ ] \mathbb{E}[C_{ij}K_{ij} \mid c, c'] E [ C ij K ij ∣ c , c ′ ] is therefore negative for both c = c ′ c = c' c = c ′ and c ≠ c ′ c \ne c' c = c ′ , and summing over ( c , c ′ ) (c, c') ( c , c ′ ) weighted by their joint probability completes the argument.
Intuitive reading. Under label agreement, anchor and eval points tend to lie in the same class region, so their features are positively correlated (K i j > 0 K_{ij} > 0 K ij > 0 ), but the residual inner product is negative (C i j < 0 C_{ij} < 0 C ij < 0 ) because the anchor wants to push toward the correct class while the disagreement term wants to push away from it. Under label disagreement, features are negatively correlated (K i j < 0 K_{ij} < 0 K ij < 0 ), but the residual inner product is positive (C i j > 0 C_{ij} > 0 C ij > 0 ) for the mirror reason. The product C i j K i j C_{ij}K_{ij} C ij K ij is negative in both cases, and these are the only two cases, so the expectation is negative regardless of how the labels mix. This is why the ID regime gives a strictly damped anchor descent rather than a random-sign perturbation: the mechanism aligns the two factors of the product so that the sign is consistent across both label configurations, y a = y ^ y_a = \hat{y} y a = y ^ and y a ≠ y ^ y_a \ne\hat{y} y a = y ^ alike.
Contrast with OOD. Under Corollary A.4 , the feature kernel K i j K_{ij} K ij shrinks to size O ( ϵ ) O(\epsilon) O ( ϵ ) in the far-OOD regime, so the product C i j K i j C_{ij}K_{ij} C ij K ij also shrinks to O ( ϵ ) O(\epsilon) O ( ϵ ) regardless of the label configuration. The sign of C i j C_{ij} C ij no longer has a K i j K_{ij} K ij of matching sign to multiply with; the whole product goes to zero. Combining with Proposition A.6 , we have in the far-OOD regime (where ϵ B ϕ 2 B C < γ \epsilon B_\phi^2 B_C < \gamma ϵ B ϕ 2 B C < γ )
E [ λ O O D ] − E [ λ I D ] ≈ γ E [ ⟨ g a , g e ⟩ F I D ] − γ E [ ⟨ g a , g e ⟩ F O O D ] < 0. \mathbb{E}[\lambda_{\mathrm{OOD}}] - \mathbb{E}[\lambda_{\mathrm{ID}}] \approx\gamma\mathbb{E}[\langle g_a, g_e\rangle_F^{\mathrm{ID}}] - \gamma\mathbb{E}[\langle g_a, g_e\rangle_F^{\mathrm{OOD}}] < 0. E [ λ OOD ] − E [ λ ID ] ≈ γ E [⟨ g a , g e ⟩ F ID ] − γ E [⟨ g a , g e ⟩ F OOD ] < 0.
where the first expectation is − γ < 0 -\gamma< 0 − γ < 0 by Proposition A.6 and the second is O ( ϵ ) O(\epsilon) O ( ϵ ) by Corollary A.4 . We note that for near-OOD, where ϵ \epsilon ϵ is not small, the signed inequality is not rigorously established.
Why Feature-Orthogonality Holds Under OOD: Nagler's Tilting
Assumption A.3 (ϵ \epsilon ϵ small in the OOD regime) is the key empirical claim of this paper. We now argue that it is a structural consequence of the attention mechanism in trained transformer PFNs, using the framework of Nagler [39 ] . The goal of this subsection is to give a mechanistic reason why the feature vector ϕ ( x e ) \phi(x_e) ϕ ( x e ) collapses to a prediction-uninformative direction when x e x_e x e is OOD.
Nagler [39 ] ’s argument as stated concludes pointwise feature collapse: every far-OOD query maps to the same direction ϕ ∞ \phi_\infty ϕ ∞ . That conclusion depends on a few idealized assumptions: a one-layer attention mechanism (Nagler [39 ] assume a single layer; PFNs in practice are multi-layer) and the strict total-variation limit ∥ p 1 − p 0 ∥ T V → 1 \lVert p_1-p_0\rVert_{\mathrm{TV}}\to1 ∥ p 1 − p 0 ∥ TV → 1 . Hence, this behavior is best read as a limit point instead of a literal description of any specific experiment. We use the argument here to motivate Assumption A.3, which is much weaker than full collapse: it asks only that anchor and eval features be on average near-perpendicular. Note that the weaker condition can hold even when full collapse fails (OOD features fanning out within a subspace orthogonal to the span of the ID features give orthogonality without collapse), and the separation theorem (Theorem A.9 ) only needs the weaker condition.
What attention computes (informally). In a PFN’s forward pass, the query x e x_e x e attends to the support set and produces a feature as a weighted average of transformed support tokens. The weights are softmax-normalized query-key similarities: α i ∝ exp ( v ( x e ) T w q , s i ) \alpha_i \propto\exp(v(x_e)^\mathsf{T}w_{q,s_i}) α i ∝ exp ( v ( x e ) T w q , s i ) , where s i s_i s i is the i i i -th support token and v ( x e ) v(x_e) v ( x e ) is the query’s encoding. When the query resembles some support samples strongly, those attention weights dominate, and the feature is determined by a local neighborhood of x e x_e x e in the support set. When no support sample resembles the query, the weights are approximately uniform, and the feature becomes a global average over the support set. The rest of this subsection formalizes this explanation of OOD feature collapse.
Locality of trained PFNs. Nagler [39 ] , Theorem 5.4 establishes that any PFN with vanishing bias on a sufficiently rich class P \mathcal{P} P of ID distributions must be local : the prediction at a query x x x depends only on support samples ( X i , Y i ) (X_i,Y_i) ( X i , Y i ) with ∥ X i − x ∥ ≤ ϵ n \lVert X_i-x\rVert\le\epsilon_n ∥ X i − x ∥ ≤ ϵ n , where ϵ n → 0 \epsilon_n\to0 ϵ n → 0 . Labels of samples far from x x x can be flipped arbitrarily without changing the prediction. A well-trained TabPFN approximates this property empirically.
Attention as exponential tilting. Nagler [39 ] , Theorem 6.3] promotes the informal picture above to an exact statement about the limiting feature (in the regime where the bias converges to a deterministic function q ˉ θ \bar q_\theta q ˉ θ . The limiting feature takes the form
u ˉ ( x ) = ∑ h = 1 H W v ( h ) E V ∼ g h ( ⋅ ∣ x ) [ V ] , (27) \bar u(x) = \sum_{h=1}^{H} W_v^{(h)} \mathbb{E}_{V\sim g_h(\cdot\mid x)}[V], \tag*{(27)} u ˉ ( x ) = h = 1 ∑ H W v ( h ) E V ∼ g h ( ⋅ ∣ x ) [ V ] , (27)
where the attention head h h h induces the exponentially tilted measure
g h ( s ∣ x ) = exp ( v ( x ) ⊤ W q ( h ) s ) E V ∼ p 0 [ exp ( v ( x ) ⊤ W q ( h ) V ) ] p 0 ( s ) (28) g_h(s \mid x) = \frac{\exp\left(v(x)^\top W_q^{(h)}s\right)}{\mathbb{E}_{V\sim p_0}\left[\exp\left(v(x)^\top W_q^{(h)}V\right)\right]}p_0(s) \tag*{(28)} g h ( s ∣ x ) = E V ∼ p 0 [ exp ( v ( x ) ⊤ W q ( h ) V ) ] exp ( v ( x ) ⊤ W q ( h ) s ) p 0 ( s ) (28)
on the support marginal p 0 p_0 p 0 . The vector v ( x ) ∈ R d + 1 v(x) \in\mathbb{R}^{d+1} v ( x ) ∈ R d + 1 is the query’s encoding and W q ( h ) , W v ( h ) W_q^{(h)}, W_v^{(h)} W q ( h ) , W v ( h ) are the learned query and value projection matrices for head h h h .
Interpreting (28) . The tilted measure g h ( ⋅ ∣ x ) g_h(\cdot\mid x) g h ( ⋅ ∣ x ) is p 0 p_0 p 0 reweighted by the exponential factor exp ( v ( x ) ⊤ W q ( h ) s ) \exp(v(x)^\top W_q^{(h)}s) exp ( v ( x ) ⊤ W q ( h ) s ) , normalized to sum to one. Two extreme cases help build intuition:
If the tilt exp ( v ( x ) ⊤ W q ( h ) s ) \exp(v(x)^\top W_q^{(h)}s) exp ( v ( x ) ⊤ W q ( h ) s ) has a sharp peak at some s ∗ ∈ supp ( p 0 ) s^* \in\operatorname{supp}(p_0) s ∗ ∈ supp ( p 0 ) , then g h ( ⋅ ∣ x ) g_h(\cdot\mid x) g h ( ⋅ ∣ x ) concentrates on a small neighborhood of s ∗ s^* s ∗ . The resulting feature E V ∼ g h [ V ] \mathbb{E}_{V\sim g_h}[V] E V ∼ g h [ V ] is close to s ∗ s^* s ∗ , and depends strongly on x x x (which determines where the peak is).
If the tilt is approximately constant over s ∼ p 0 s \sim p_0 s ∼ p 0 , the normalized measure g h ( ⋅ ∣ x ) g_h(\cdot\mid x) g h ( ⋅ ∣ x ) is indistinguishable from p 0 p_0 p 0 . The feature is E V ∼ p 0 [ V ] \mathbb{E}_{V\sim p_0}[V] E V ∼ p 0 [ V ] , the p 0 p_0 p 0 -mean, and depends on x x x only through higher-order perturbations.
Implication for OOD queries. Consider a query x e x_e x e drawn from a shifted distribution p 1 ≠ p 0 p_1 \ne p_0 p 1 = p 0 . The tilt (28) assigns high mass to support samples s s s that are similar to x e x_e x e in the metric induced by W q ( h ) W_q^{(h)} W q ( h ) . Two regimes emerge, corresponding to the two extreme cases above (Figure 6 ):
Figure 6. (a) ID query. The tilt has a sharp peak near x e x_e x e , so the tilted measure g h ( ⋅ ∣ x e ) g_h(\cdot\mid x_e) g h ( ⋅ ∣ x e ) concentrates on a small neighborhood of x e x_e x e within the support. The mean feature depends strongly on where x e x_e x e is. (b) OOD query. The tilt is nearly flat over the support of p 0 p_0 p 0 , so g h ( ⋅ ∣ x e ) ≈ p 0 g_h(\cdot\mid x_e) \approx p_0 g h ( ⋅ ∣ x e ) ≈ p 0 . The mean feature degenerates to E V ∼ p 0 [ V ] \mathbb{E}_{V\sim p_0}[V] E V ∼ p 0 [ V ] , the same input-independent direction for every OOD query. Exponential tilting of the support measure (Nagler Theorem 6.3). Each attention head reweights the support distribution p 0 p_0 p 0 (solid blue) by a tilt factor ψ ( s ; x e ) = exp ( v ( x e ) ⊤ W q s ) \psi(s; x_e) = \exp(v(x_e)^\top W_qs) ψ ( s ; x e ) = exp ( v ( x e ) ⊤ W q s ) (dashed orange) to produce the head’s effective sampling distribution g h ( s ∣ x e ) g_h(s \mid x_e) g h ( s ∣ x e ) (thick green). When the query x e x_e x e is close to the support, the tilt concentrates the measure on a small neighborhood of x e x_e x e and the resulting feature is query-specific. When x e x_e x e is far from the support, the tilt is approximately constant and the measure collapses back to p 0 p_0 p 0 , giving the same feature ϕ ∞ \phi_\infty ϕ ∞ for every far-OOD query.
ID query (x e ∼ p 0 x_e \sim p_0 x e ∼ p 0 , close to the support): v ( x e ) ⊤ W q ( h ) s v(x_e)^\top W_q^{(h)}s v ( x e ) ⊤ W q ( h ) s has a sharp maximum over s ∼ p 0 s \sim p_0 s ∼ p 0 , so g h ( ⋅ ∣ x e ) g_h(\cdot\mid x_e) g h ( ⋅ ∣ x e ) concentrates on a localized neighborhood of x e x_e x e within the support. The feature u ˉ ( x e ) \bar u(x_e) u ˉ ( x e ) is then a kernel-smoothed average over that neighborhood and depends strongly on x e x_e x e ; distinct ID queries produce distinct features.
Far-OOD query (x e x_e x e outside the support of p 0 p_0 p 0 ): no support sample s s s is especially similar to x e x_e x e , so v ( x e ) ⊤ W q ( h ) s v(x_e)^\top W_q^{(h)}s v ( x e ) ⊤ W q ( h ) s is approximately constant over s ∼ p 0 s \sim p_0 s ∼ p 0 . The tilt degenerates, g h ( ⋅ ∣ x e ) → p 0 g_h(\cdot\mid x_e) \to p_0 g h ( ⋅ ∣ x e ) → p 0 , and the feature collapses to
u ˉ ( x e ) → ϕ ∞ : = ∑ h = 1 H W v ( h ) E V ∼ p 0 [ V ] , (29) \bar u(x_e) \to\phi_\infty:= \sum_{h=1}^{H} W_v^{(h)} \mathbb{E}_{V\sim p_0}[V], \tag*{(29)} u ˉ ( x e ) → ϕ ∞ := h = 1 ∑ H W v ( h ) E V ∼ p 0 [ V ] , (29)
a single input-dependent vector. Figure 7 visualizes the resulting ID-vs-OOD feature geometry: under ID, features occupy a rich, input-dependent region and anchor-eval inner products are Θ ( 1 ) \Theta(1) Θ ( 1 ) ; under far-OOD they collapse to ϕ ∞ \phi_\infty ϕ ∞ and centered inner products shrink to O ( ϵ ) O(\epsilon) O ( ϵ ) .
Figure 7. Feature-space picture of Corollary A.4. Under ID (left), anchor and eval features coexist in the ID feature region and the kernel K i j K_{ij} K ij is typically positive. Under OOD (right), eval features are forced by the attention mechanism onto a single input-independent direction ϕ ∞ \phi_\infty ϕ ∞ , so the centered kernel ⟨ ϕ ~ ( x a ) , ϕ ~ ( x e ) ⟩ \langle\tilde{\phi}(x_a),\tilde{\phi}(x_e)\rangle ⟨ ϕ ~ ( x a ) , ϕ ~ ( x e )⟩ becomes small (Assumption A.3). This is what switches the gradient geometry from Figure 4 (middle) to Figure 4 (left).
From feature collapse to feature orthogonality. Define the centered feature ϕ ~ ( x ) : = ϕ ( x ) − ϕ ∞ \tilde{\phi}(x) := \phi(x) - \phi_\infty ϕ ~ ( x ) := ϕ ( x ) − ϕ ∞ . For far-OOD x e x_e x e , ϕ ~ ( x e ) → 0 \tilde{\phi}(x_e) \to0 ϕ ~ ( x e ) → 0 . For ID x a x_a x a , ϕ ~ ( x a ) \tilde{\phi}(x_a) ϕ ~ ( x a ) retains input-specific structure inherited from the local tilt. Consequently,
∣ ⟨ ϕ ~ ( x a ) , ϕ ~ ( x e ) ⟩ ∣ = ∥ ϕ ~ ( x a ) ∥ ∥ ϕ ~ ( x e ) ∥ ∣ cos ( ϕ ~ ( x a ) , ϕ ~ ( x e ) ) ∣ ⟶ 0 (30) \left\lvert\left\langle\tilde{\phi}(x_a),\tilde{\phi}(x_e)\right\rangle\right\rvert= \lVert\tilde{\phi}(x_a)\rVert\lVert\tilde{\phi}(x_e)\rVert\left\lvert\cos(\tilde{\phi}(x_a),\tilde{\phi}(x_e))\right\rvert\longrightarrow0 \tag*{(30)} ⟨ ϕ ~ ( x a ) , ϕ ~ ( x e ) ⟩ = ∥ ϕ ~ ( x a )∥ ∥ ϕ ~ ( x e )∥ cos ( ϕ ~ ( x a ) , ϕ ~ ( x e )) ⟶ 0 (30)
as x e x_e x e recedes from supp ( p 0 ) \operatorname{supp}(p_0) supp ( p 0 ) : the factor ∥ ϕ ~ ( x e ) ∥ → 0 \lVert\tilde{\phi}(x_e)\rVert\to0 ∥ ϕ ~ ( x e )∥ → 0 forces the product to zero regardless of the cosine. This verifies Assumption A.3 in the far-OOD limit, with ϵ \epsilon ϵ controlled by ∥ ϕ ~ ( x e ) ∥ \lVert\tilde{\phi}(x_e)\rVert ∥ ϕ ~ ( x e )∥ .
Note on centering. Assumption A.5(iii) asked for feature centering E p 0 [ ϕ ( x ) ] = 0 \mathbb{E}_{p_0}[\phi(x)] = 0 E p 0 [ ϕ ( x )] = 0 . This is either automatic (under the tilting picture with a centering layer in the architecture) or can be enforced by working with the empirically centered feature ϕ ~ \tilde{\phi} ϕ ~ ; either way, all preceding statements apply verbatim.
The feature-collapse picture above gives ϵ → 0 \epsilon\to0 ϵ → 0 in Assumption A.3 only in the far-OOD limit ∥ p 1 − p 0 ∥ T V → 1 \lVert p_1-p_0\rVert_{\mathrm{TV}} \to1 ∥ p 1 − p 0 ∥ TV → 1 , via Proposition A.15. For near-OOD, OOD features stay close to ID features and the anchor-eval cosine remains Θ ( 1 ) \Theta(1) Θ ( 1 ) , so Theorem A.9’s signed lower bound is vacuous.
Multi-Step Extension
Proposition A.2 analyzes the first gradient step. Algorithm 1 uses T = 50 T = 50 T = 50 steps, so we need a multi-step statement. The main idea is that in a small-step regime, the T T T -step decrement is the sum of T T T first-step decrements plus a telescoping error of size O ( T 2 η 2 L ) O(T^2\eta^2L) O ( T 2 η 2 L ) . The sign of the cross-term at the first step therefore determines the sign of the cumulative descent, provided that the cross-term does not flip sign along the trajectory.
Assumption A.7 (Small-step regime). The joint loss L \mathcal{L} L has L L L -Lipschitz gradient on the trajectory { W t } t = 0 T \{W_t\}_{t=0}^{T} { W t } t = 0 T , and T η L ≤ 1 / 2 T\eta L \le1/2 T η L ≤ 1/2 .
The smoothness constant. For the last-layer parametrization q W ( y ∣ x ) = softmax ( W ϕ ( x ) ) y q_W(y \mid x) = \operatorname{softmax}(W\phi(x))_y q W ( y ∣ x ) = softmax ( W ϕ ( x ) ) y , the Hessian of the per-sample CE loss with respect to W W W is the Kronecker product
∇ W 2 ℓ C E ( W ; x , y ) = J ( q W ) ⊗ ϕ ( x ) ϕ ( x ) ⊤ , \nabla_W^2 \ell_{\mathrm{CE}}(W;x,y) = \mathcal{J}(q_W) \otimes\phi(x)\phi(x)^\top, ∇ W 2 ℓ CE ( W ; x , y ) = J ( q W ) ⊗ ϕ ( x ) ϕ ( x ) ⊤ ,
where J ( q ) : = diag ( q ) − q q T J(q) := \operatorname{diag}(q) - qq^{\mathsf{T}} J ( q ) := diag ( q ) − q q T is the Jacobian of the softmax at q = q W ( ⋅ ∣ x ) q = q_W(\cdot\mid x) q = q W ( ⋅ ∣ x ) . For any unit vector v ∈ R C v \in\mathbb{R}^{C} v ∈ R C , v T J ( q ) v = ∑ c q c v c 2 − ( ∑ c q c v c ) 2 = Var c ∼ q ( v c ) ≤ 1 / 2 v^{\mathsf{T}}J(q)v = \sum_c q_c v_c^2 - \left(\sum_c q_c v_c\right)^2 = \operatorname{Var}_{c\sim q}(v_c) \le1/2 v T J ( q ) v = ∑ c q c v c 2 − ( ∑ c q c v c ) 2 = Var c ∼ q ( v c ) ≤ 1/2 , with the maximum achieved by a two-class concentrated q q q and v v v pointing along the corresponding axis. Hence ∥ J ( q ) ∥ o p ≤ 1 / 2 \lVert J(q)\rVert_{\mathrm{op}} \le1/2 ∥ J ( q ) ∥ op ≤ 1/2 . The second Kronecker factor has operator norm ∥ ϕ ( x ) ∥ 2 ≤ B ϕ 2 \lVert\phi(x)\rVert^2 \le B_\phi^2 ∥ ϕ ( x ) ∥ 2 ≤ B ϕ 2 , and the operator norm of a Kronecker product is the product of operator norms, so
L ≤ B ϕ 2 / 2. (31) L \le B_\phi^2/2. \tag*{(31)} L ≤ B ϕ 2 /2. (31)
The DCE Hessian admits the same bound: DCE is itself a cross-entropy against u y ^ u_{\hat{y}} u y ^ , so its Hessian has the same J ( q ) ⊗ ϕ ϕ T J(q) \otimes\phi\phi^{\mathsf{T}} J ( q ) ⊗ ϕ ϕ T form. Averaging over the batch preserves the bound.
Proposition A.8 (T -step anchor descent). Under Assumption A.7, let g ˉ a : = 1 T ∑ t = 0 T − 1 ∇ L a n c ( W t ) \bar{g}_a := \frac{1}{T}\sum_{t=0}^{T-1}\nabla\mathcal{L}_{\mathrm{anc}}(W_t) g ˉ a := T 1 ∑ t = 0 T − 1 ∇ L anc ( W t ) and g ˉ e : = 1 T ∑ t = 0 T − 1 ∇ L d i s ( W t ) \bar{g}_e := \frac{1}{T}\sum_{t=0}^{T-1}\nabla\mathcal{L}_{\mathrm{dis}}(W_t) g ˉ e := T 1 ∑ t = 0 T − 1 ∇ L dis ( W t ) denote the time-averaged gradients along the trajectory. Then
L a n c ( W T ) − L a n c ( W 0 ) = − T η ( ∥ g ˉ a ∥ F 2 + ⟨ g ˉ a , g ˉ e ⟩ F ) + O ( T 2 η 2 L B g 2 ) , (32) \mathcal{L}_{\mathrm{anc}}(W_T) - \mathcal{L}_{\mathrm{anc}}(W_0) = -T\eta\left(\lVert\bar{g}_a\rVert_F^2 + \langle\bar{g}_a,\bar{g}_e\rangle_F\right) + O(T^2\eta^2 L B_g^2), \tag*{(32)} L anc ( W T ) − L anc ( W 0 ) = − T η ( ∥ g ˉ a ∥ F 2 + ⟨ g ˉ a , g ˉ e ⟩ F ) + O ( T 2 η 2 L B g 2 ) , (32) *where B g : = max t ∥ ∇ L ( W t ) ∥ F B_g := \max_t \lVert\nabla\mathcal{L}(W_t)\rVert_F B g := max t ∥ ∇ L ( W t ) ∥ F is a trajectory-uniform gradient bound. Furthermore, if ⟨ g a ( t ) , g a ( 0 ) ⟩ F ≥ ( 1 − κ ) ∥ g a ( t ) ∥ F ∥ g a ( 0 ) ∥ F \langle g_a^{(t)},g_a^{(0)}\rangle_F \ge(1-\kappa)\lVert g_a^{(t)}\rVert_F\lVert g_a^{(0)}\rVert_F ⟨ g a ( t ) , g a ( 0 ) ⟩ F ≥ ( 1 − κ ) ∥ g a ( t ) ∥ F ∥ g a ( 0 ) ∥ F for all t ≤ T t \le T t ≤ T (gradients do not rotate substantially), then ∥ g ˉ a ∥ F 2 = ∥ g a ( 0 ) ∥ F 2 ( 1 + O ( κ ) ) \lVert\bar{g}_a\rVert_F^2 = \lVert g_a^{(0)}\rVert_F^2(1+O(\kappa)) ∥ g ˉ a ∥ F 2 = ∥ g a ( 0 ) ∥ F 2 ( 1 + O ( κ )) .
Proof. We apply Proposition A.2 at each step of the trajectory and sum, controlling the accumulated error from the Hessian terms.
Step 1 (first-step expansion at each t t t ). For each t = 0 , 1 , … , T − 1 t=0,1,\ldots,T-1 t = 0 , 1 , … , T − 1 , apply Taylor’s theorem to L a n c \mathcal{L}_{\mathrm{anc}} L anc on the segment [ W t , W t + 1 ] [W_t,W_{t+1}] [ W t , W t + 1 ] with W t + 1 = W t − η ( g a ( t ) + g e ( t ) ) W_{t+1}=W_t-\eta(g_a^{(t)}+g_e^{(t)}) W t + 1 = W t − η ( g a ( t ) + g e ( t ) ) and g ⋆ ( t ) : = ∇ L ⋆ ( W t ) g_\star^{(t)}:=\nabla\mathcal{L}_\star(W_t) g ⋆ ( t ) := ∇ L ⋆ ( W t ) for ⋆ ∈ { a n c , d i s } \star\in\{\mathrm{anc},\mathrm{dis}\} ⋆ ∈ { anc , dis } :
L a n c ( W t + 1 ) − L a n c ( W t ) = − η ∥ g a ( t ) ∥ F 2 − η ⟨ g a ( t ) , g e ( t ) ⟩ F + R t , \mathcal{L}_{\mathrm{anc}}(W_{t+1})-\mathcal{L}_{\mathrm{anc}}(W_t)=-\eta\lVert g_a^{(t)}\rVert_F^2-\eta\langle g_a^{(t)},g_e^{(t)}\rangle_F+R_t, L anc ( W t + 1 ) − L anc ( W t ) = − η ∥ g a ( t ) ∥ F 2 − η ⟨ g a ( t ) , g e ( t ) ⟩ F + R t ,
with ∣ R t ∣ ≤ 1 2 L η 2 ∥ g a ( t ) + g e ( t ) ∥ F 2 ≤ 1 2 L η 2 B g 2 \lvert R_t\rvert\le\frac{1}{2}L\eta^2\lVert g_a^{(t)}+g_e^{(t)}\rVert_F^2\le\frac{1}{2}L\eta^2B_g^2 ∣ R t ∣ ≤ 2 1 L η 2 ∥ g a ( t ) + g e ( t ) ∥ F 2 ≤ 2 1 L η 2 B g 2 .
Step 2 (telescoping). Summing over t = 0 , … , T − 1 t=0,\ldots,T-1 t = 0 , … , T − 1 ,
L a n c ( W T ) − L a n c ( W 0 ) = − η ∑ t = 0 T − 1 ∥ g a ( t ) ∥ F 2 − η ∑ t = 0 T − 1 ⟨ g a ( t ) , g e ( t ) ⟩ F + ∑ t = 0 T − 1 R t , \mathcal{L}_{\mathrm{anc}}(W_T)-\mathcal{L}_{\mathrm{anc}}(W_0)=-\eta\sum_{t=0}^{T-1}\lVert g_a^{(t)}\rVert_F^2-\eta\sum_{t=0}^{T-1}\langle g_a^{(t)},g_e^{(t)}\rangle_F+\sum_{t=0}^{T-1}R_t, L anc ( W T ) − L anc ( W 0 ) = − η t = 0 ∑ T − 1 ∥ g a ( t ) ∥ F 2 − η t = 0 ∑ T − 1 ⟨ g a ( t ) , g e ( t ) ⟩ F + t = 0 ∑ T − 1 R t ,
with the Hessian remainder bounded by ∑ t ∣ R t ∣ ≤ 1 2 T L η 2 B g 2 \sum_t\lvert R_t\rvert\le\frac{1}{2}TL\eta^2B_g^2 ∑ t ∣ R t ∣ ≤ 2 1 T L η 2 B g 2 .
Step 3 (replacing sums by time-averaged gradients). The trajectory displacement is ∥ W t − W 0 ∥ ≤ t η B g ≤ T η B g \lVert W_t-W_0\rVert\le t\eta B_g\le T\eta B_g ∥ W t − W 0 ∥ ≤ t η B g ≤ T η B g , and L L L -Lipschitzness of ∇ L \nabla\mathcal{L} ∇ L gives ∥ g ⋆ ( t ) − g ⋆ ( 0 ) ∥ F ≤ L T η B g \lVert g_\star^{(t)}-g_\star^{(0)}\rVert_F\le LT\eta B_g ∥ g ⋆ ( t ) − g ⋆ ( 0 ) ∥ F ≤ L T η B g for ⋆ ∈ { a n c , d i s } \star\in\{\mathrm{anc},\mathrm{dis}\} ⋆ ∈ { anc , dis } at every t t t . Hence each g ⋆ ( t ) g_\star^{(t)} g ⋆ ( t ) lies within an L T η B g LT\eta B_g L T η B g -ball of g ˉ ⋆ \bar{g}_\star g ˉ ⋆ , and
∣ 1 T ∑ t ∥ g a ( t ) ∥ F 2 − ∥ g ˉ a ∥ F 2 ∣ ≤ ( L T η B g ) 2 , ∣ 1 T ∑ t ⟨ g a ( t ) , g e ( t ) ⟩ F − ⟨ g ˉ a , g ˉ e ⟩ F ∣ ≤ ( L T η B g ) 2 , \left|\frac{1}{T}\sum_t\lVert g_a^{(t)}\rVert_F^2-\lVert\bar{g}_a\rVert_F^2\right|\le(LT\eta B_g)^2,\qquad
\left|\frac{1}{T}\sum_t\langle g_a^{(t)},g_e^{(t)}\rangle_F-\langle\bar{g}_a,\bar{g}_e\rangle_F\right|\le(LT\eta B_g)^2, T 1 t ∑ ∥ g a ( t ) ∥ F 2 − ∥ g ˉ a ∥ F 2 ≤ ( L T η B g ) 2 , T 1 t ∑ ⟨ g a ( t ) , g e ( t ) ⟩ F − ⟨ g ˉ a , g ˉ e ⟩ F ≤ ( L T η B g ) 2 ,
each by direct expansion and Cauchy–Schwarz. Multiplying by T η T\eta T η converts this to an error of size T 3 η 3 L 2 B g 2 T^3\eta^3L^2B_g^2 T 3 η 3 L 2 B g 2 in the anchor-loss decrement. Under Assumption A.7 (T η L ≤ 1 / 2 T\eta L\le1/2 T η L ≤ 1/2 ), this is dominated by the Hessian remainder T 2 η 2 L B g 2 T^2\eta^2LB_g^2 T 2 η 2 L B g 2 , so the total remainder in (32) is O ( T 2 η 2 L B g 2 ) O(T^2\eta^2LB_g^2) O ( T 2 η 2 L B g 2 ) .
Step 4 (small-rotation corollary). If g a ( t ) g_a^{(t)} g a ( t ) stays within angle arccos ( 1 − κ ) \arccos(1-\kappa) arccos ( 1 − κ ) of g a ( 0 ) g_a^{(0)} g a ( 0 ) for all t t t , then ∥ g ˉ a ∥ F 2 \lVert\bar{g}_a\rVert_F^2 ∥ g ˉ a ∥ F 2 is within a ( 1 − O ( κ ) ) (1-O(\kappa)) ( 1 − O ( κ )) factor of ∥ g a ( 0 ) ∥ F 2 \lVert g_a^{(0)}\rVert_F^2 ∥ g a ( 0 ) ∥ F 2 by direct calculation: decompose each g a ( t ) = α t g a ( 0 ) + β t h t g_a^{(t)}=\alpha_tg_a^{(0)}+\beta_th_t g a ( t ) = α t g a ( 0 ) + β t h t with ∥ h t ∥ = 1 \lVert h_t\rVert=1 ∥ h t ∥ = 1 , h t ⊥ g a ( 0 ) h_t\perp g_a^{(0)} h t ⊥ g a ( 0 ) , and α t ∥ g a ( 0 ) ∥ F ≥ ( 1 − κ ) ∥ g a ( t ) ∥ F \alpha_t\lVert g_a^{(0)}\rVert_F\ge(1-\kappa)\lVert g_a^{(t)}\rVert_F α t ∥ g a ( 0 ) ∥ F ≥ ( 1 − κ ) ∥ g a ( t ) ∥ F , then average.
Proposition A.8 inherits the sign structure of the one-step result. If the OOD feature-orthogonality of Corollary A.4 holds uniformly along the trajectory (which requires only that the backbone is frozen, not that W W W stays close to W 0 W_0 W 0 : the feature-space kernel K i j K_{ij} K ij does not depend on W W W at all), then OOD anchor descent at the time-averaged rate is ≈ − T η ∥ g ˉ a ∥ F 2 \approx-T\eta\lVert\bar{g}_a\rVert_F^2 ≈ − T η ∥ g ˉ a ∥ F 2 . By Proposition A.6, ID anchor descent is strictly damped to − T η ( ∥ g ˉ a ∥ F 2 + ⟨ g ˉ a , g ˉ e ⟩ F ) -T\eta(\lVert\bar{g}_a\rVert_F^2+\langle\bar{g}_a,\bar{g}_e\rangle_F) − T η (∥ g ˉ a ∥ F 2 + ⟨ g ˉ a , g ˉ e ⟩ F ) with ⟨ g ˉ a , g ˉ e ⟩ F < 0 \langle\bar{g}_a,\bar{g}_e\rangle_F<0 ⟨ g ˉ a , g ˉ e ⟩ F < 0 .
Main Separation Theorem
The preceding subsections have established: (i) anchor descent is controlled by the gradient cross-term (Proposition A.2); (ii) under OOD feature orthogonality the cross-term is O ( ϵ ) O(\epsilon) O ( ϵ ) (Corollary A.4); (iii) under ID confidence the cross-term has a strictly negative expectation − γ -\gamma − γ for some γ > 0 \gamma> 0 γ > 0 (Proposition A.6); (iv) the first-step analysis lifts to T T T steps in the small-step regime (Prop A.8). We now compose these into a separation theorem that underpins the detector.
Theorem A.9 (Main separation). Let p 1 p_1 p 1 be an eval distribution and write E [ λ I D ] \mathbb{E}[\lambda_{\mathrm{ID}}] E [ λ ID ] , E [ λ O O D ] \mathbb{E}[\lambda_{\mathrm{OOD}}] E [ λ OOD ] for the expected post-finetuning anchor losses when X e v a l X_{\mathrm{eval}} X eval is drawn i.i.d. from p 0 p_0 p 0 and from p 1 p_1 p 1 respectively. Suppose the core gradient-geometry assumptions hold: A1–A3 of Table 2 (design and boundedness), together with Assumption A.7 (small-step regime), Assumption A.3 (with parameter ϵ \epsilon ϵ under p 1 p_1 p 1 ), and Assumption A.5 (under p 0 p_0 p 0 ). Let γ : = − E p 0 ⊗ p 0 [ C i j K i j ] > 0 \gamma:= -\mathbb{E}_{p_0\otimes p_0}[C_{ij}K_{ij}] > 0 γ := − E p 0 ⊗ p 0 [ C ij K ij ] > 0 denote the ID interference strength from Proposition A.6. Then
E [ λ I D ] − E [ λ O O D ] ≥ T η ( γ − ϵ B ϕ 2 B C ) − O ( T 2 η 2 L B g 2 ) , (33) \mathbb{E}[\lambda_{\mathrm{ID}}] - \mathbb{E}[\lambda_{\mathrm{OOD}}] \ge T\eta(\gamma-\epsilon B_{\phi}^{2}B_C)-O(T^{2}\eta^{2}LB_g^{2}), \tag*{(33)} E [ λ ID ] − E [ λ OOD ] ≥ T η ( γ − ϵ B ϕ 2 B C ) − O ( T 2 η 2 L B g 2 ) , (33) where B ϕ B_{\phi} B ϕ , B C B_C B C , L L L , B g B_g B g are the constants defined earlier. In particular, whenever ϵ < γ / ( B ϕ 2 B C ) \epsilon< \gamma/(B_{\phi}^{2}B_C) ϵ < γ / ( B ϕ 2 B C ) and T η T\eta T η is in the small-step regime of Assumption A.7, the right-hand side is strictly positive and E [ λ O O D ] < E [ λ I D ] \mathbb{E}[\lambda_{\mathrm{OOD}}] < \mathbb{E}[\lambda_{\mathrm{ID}}] E [ λ OOD ] < E [ λ ID ] .
Table 2. Summary of assumptions used in the theoretical argument.
Proof. Apply Proposition A.8 separately under p 0 p_0 p 0 and p 1 p_1 p 1 . Let g ˉ a I D \bar{g}_a^{\mathrm{ID}} g ˉ a ID , g ˉ e I D \bar{g}_e^{\mathrm{ID}} g ˉ e ID and g ˉ a O O D \bar{g}_a^{\mathrm{OOD}} g ˉ a OOD , g ˉ e O O D \bar{g}_e^{\mathrm{OOD}} g ˉ e OOD denote the respective time-averaged gradients, and let λ ( W 0 ) = L a n c ( W 0 ) \lambda(W_0)=\mathcal{L}_{\mathrm{anc}}(W_0) λ ( W 0 ) = L anc ( W 0 ) be the pre-finetuning anchor loss (the same in both regimes since it depends only on the anchor, not on the eval batch). Then
λ I D − λ ( W 0 ) = − T η ( ∥ g ˉ a I D ∥ F 2 + ⟨ g ˉ a I D , g ˉ e I D ⟩ F ) + O ( T 2 η 2 L B g 2 ) , \lambda_{\mathrm{ID}}-\lambda(W_0)=-T\eta\left(\lVert\bar{g}_a^{\mathrm{ID}}\rVert_F^2+\langle\bar{g}_a^{\mathrm{ID}},\bar{g}_e^{\mathrm{ID}}\rangle_F\right)+O(T^2\eta^2LB_g^2), λ ID − λ ( W 0 ) = − T η ( ∥ g ˉ a ID ∥ F 2 + ⟨ g ˉ a ID , g ˉ e ID ⟩ F ) + O ( T 2 η 2 L B g 2 ) ,
λ O O D − λ ( W 0 ) = − T η ( ∥ g ˉ a O O D ∥ F 2 + ⟨ g ˉ a O O D , g ˉ e O O D ⟩ F ) + O ( T 2 η 2 L B g 2 ) . \lambda_{\mathrm{OOD}}-\lambda(W_0)=-T\eta\left(\lVert\bar{g}_a^{\mathrm{OOD}}\rVert_F^2+\langle\bar{g}_a^{\mathrm{OOD}},\bar{g}_e^{\mathrm{OOD}}\rangle_F\right)+O(T^2\eta^2LB_g^2). λ OOD − λ ( W 0 ) = − T η ( ∥ g ˉ a OOD ∥ F 2 + ⟨ g ˉ a OOD , g ˉ e OOD ⟩ F ) + O ( T 2 η 2 L B g 2 ) .
Subtract:
E [ λ I D − λ O O D ] = T η [ E ∥ g ˉ a O O D ∥ F 2 − E ∥ g ˉ a I D ∥ F 2 + E ⟨ g ˉ a O O D , g ˉ e O O D ⟩ F − E ⟨ g ˉ a I D , g ˉ e I D ⟩ F ] + O ( T 2 η 2 L B g 2 ) . (34) \mathbb{E}[\lambda_{\mathrm{ID}}-\lambda_{\mathrm{OOD}}]
=
T\eta\left[
\mathbb{E}\lVert\bar{g}_a^{\mathrm{OOD}}\rVert_F^2-\mathbb{E}\lVert\bar{g}_a^{\mathrm{ID}}\rVert_F^2
+\mathbb{E}\langle\bar{g}_a^{\mathrm{OOD}},\bar{g}_e^{\mathrm{OOD}}\rangle_F
-\mathbb{E}\langle\bar{g}_a^{\mathrm{ID}},\bar{g}_e^{\mathrm{ID}}\rangle_F
\right]+O(T^2\eta^2LB_g^2). \tag*{(34)} E [ λ ID − λ OOD ] = T η [ E ∥ g ˉ a OOD ∥ F 2 − E ∥ g ˉ a ID ∥ F 2 + E ⟨ g ˉ a OOD , g ˉ e OOD ⟩ F − E ⟨ g ˉ a ID , g ˉ e ID ⟩ F ] + O ( T 2 η 2 L B g 2 ) . (34)
The anchor gradient g ˉ a \bar{g}_a g ˉ a depends only on the anchor set and the classifier at W t W_t W t ; it is the same in expectation at t = 0 t=0 t = 0 whether the eval batch is from p 0 p_0 p 0 or p 1 p_1 p 1 , because the finetuning trajectory is anchored at W 0 W_0 W 0 and the leading term is the same first-step gradient. Along the trajectory, W t I D W_t^{\mathrm{ID}} W t ID and W t O O D W_t^{\mathrm{OOD}} W t OOD diverge by at most O ( T η B g ) O(T\eta B_g) O ( T η B g ) (both trajectories have per-step displacement ≤ η B g \le\eta B_g ≤ η B g ), so by L L L -Lipschitz continuity of ∇ L a n c \nabla\mathcal{L}_{\mathrm{anc}} ∇ L anc and Cauchy–Schwarz, E ∥ g ˉ a O O D ∥ F 2 − E ∥ g ˉ a I D ∥ F 2 = O ( T η L B g 2 ) \mathbb{E}\lVert\bar{g}_a^{\mathrm{OOD}}\rVert_F^2-\mathbb{E}\lVert\bar{g}_a^{\mathrm{ID}}\rVert_F^2=O(T\eta LB_g^2) E ∥ g ˉ a OOD ∥ F 2 − E ∥ g ˉ a ID ∥ F 2 = O ( T η L B g 2 ) . Multiplied by the outer T η T\eta T η factor, this is O ( T 2 η 2 L B g 2 ) O(T^2\eta^2LB_g^2) O ( T 2 η 2 L B g 2 ) and is subsumed in the second-order remainder. Hence
E [ λ I D − λ O O D ] = T η ( E ⟨ g ˉ a , g ˉ e O O D ⟩ F − E ⟨ g ˉ a , g ˉ e I D ⟩ F ) + O ( T 2 η 2 L B g 2 ) , \mathbb{E}[\lambda_{\mathrm{ID}}-\lambda_{\mathrm{OOD}}]
=
T\eta\left(\mathbb{E}\langle\bar{g}_a,\bar{g}_e^{\mathrm{OOD}}\rangle_F-\mathbb{E}\langle\bar{g}_a,\bar{g}_e^{\mathrm{ID}}\rangle_F\right)+O(T^2\eta^2LB_g^2), E [ λ ID − λ OOD ] = T η ( E ⟨ g ˉ a , g ˉ e OOD ⟩ F − E ⟨ g ˉ a , g ˉ e ID ⟩ F ) + O ( T 2 η 2 L B g 2 ) ,
where we have identified g ˉ a I D ≈ g ˉ a O O D = : g ˉ a \bar{g}_a^{\mathrm{ID}}\approx\bar{g}_a^{\mathrm{OOD}}=:\bar{g}_a g ˉ a ID ≈ g ˉ a OOD =: g ˉ a to leading order.
Apply Corollary A.4 to the OOD term:
∣ E ⟨ g ˉ a , g ˉ e O O D ⟩ F ∣ ≤ ϵ B ϕ 2 B C . \left|\mathbb{E}\langle\bar{g}_a,\bar{g}_e^{\mathrm{OOD}}\rangle_F\right|\le\epsilon B_{\phi}^{2}B_C. E ⟨ g ˉ a , g ˉ e OOD ⟩ F ≤ ϵ B ϕ 2 B C .
Apply Proposition A.6 to the ID term:
E ⟨ g ˉ a , g ˉ e I D ⟩ F ≤ − γ . \mathbb{E}\langle\bar{g}_a,\bar{g}_e^{\mathrm{ID}}\rangle_F\le-\gamma. E ⟨ g ˉ a , g ˉ e ID ⟩ F ≤ − γ .
Substituting and using ∣ a ∣ ≤ ϵ B ϕ 2 B C ⇒ − ϵ B ϕ 2 B C ≤ a |a|\le\epsilon B_{\phi}^{2}B_C\Rightarrow-\epsilon B_{\phi}^{2}B_C\le a ∣ a ∣ ≤ ϵ B ϕ 2 B C ⇒ − ϵ B ϕ 2 B C ≤ a ,
E [ λ I D − λ O O D ] ≥ T η ( − ϵ B ϕ 2 B C − ( − γ ) ) + O ( T 2 η 2 L B g 2 ) = T η ( γ − ϵ B ϕ 2 B C ) + O ( T 2 η 2 L B g 2 ) . \begin{aligned}
\mathbb{E}[\lambda_{\mathrm{ID}}-\lambda_{\mathrm{OOD}}]\ge T\eta\left(-\epsilon B_{\phi}^{2}B_C-(-\gamma)\right)+O(T^2\eta^2LB_g^2) \\
&= T\eta\left(\gamma-\epsilon B_{\phi}^{2}B_C\right)+O(T^2\eta^2LB_g^2).
\end{aligned} E [ λ ID − λ OOD ] ≥ T η ( − ϵ B ϕ 2 B C − ( − γ ) ) + O ( T 2 η 2 L B g 2 ) = T η ( γ − ϵ B ϕ 2 B C ) + O ( T 2 η 2 L B g 2 ) .
■ \blacksquare ■
What the theorem says. The separation between expected ID and OOD anchor losses is at least T η T\eta T η times an architecture-independent gap γ − ϵ B ϕ 2 B C \gamma-\epsilon B_{\phi}^{2}B_{C} γ − ϵ B ϕ 2 B C , which is positive whenever the OOD feature orthogonality is strong enough to overwhelm the ID interference constant. The factor T η T\eta T η means longer finetuning amplifies the separation linearly (within the small-step regime), while the constant γ \gamma γ is a structural property of the ID data and the pretrained classifier and is independent of the shift’s geometry. Severity dependence enters through ϵ \epsilon ϵ : Proposition A.15’s feature collapse drives ϕ ~ ( x e ) ⟶ 0 \widetilde{\phi}(x_{e})\longrightarrow0 ϕ ( x e ) ⟶ 0 (and hence ϵ ⟶ 0 \epsilon\longrightarrow0 ϵ ⟶ 0 ) in the far-OOD regime ∥ p 1 − p 0 ∥ T V ⟶ 1 \lVert p_{1}-p_{0}\rVert_{\mathrm{TV}}\longrightarrow1 ∥ p 1 − p 0 ∥ TV ⟶ 1 , but ϵ \epsilon ϵ can be Θ ( 1 ) \Theta(1) Θ ( 1 ) for near-OOD. The theorem’s signed lower bound is therefore only applicable in the far-OOD regime.
When the theorem fails. Theorem A.9’s guarantee becomes vacuous when ϵ B ϕ 2 B C ≥ γ \epsilon B_{\phi}^{2}B_{C}\geq\gamma ϵ B ϕ 2 B C ≥ γ , i.e., when OOD features retain too much ID-like structure relative to the ID interference strength. In this regime the theorem imposes no signed constraint on the separation, and the observed direction is an empirical matter: the ! flags in Table 10 mark the dataset–model pairs where it reverses (λ O O D > λ I D \lambda_{\mathrm{OOD}}>\lambda_{\mathrm{ID}} λ OOD > λ ID for the majority of seeds). All four such cells are benign shifts, and all four coincide with the cells where the learning-rate stability rule falls back to η = 10 − 4 \eta=10^{-4} η = 1 0 − 4 .
Table 10. Per-dataset detection performance of the post-finetune anchor loss λ ^ \hat{\lambda} λ ^ . AUROC and TPR@5% FPR for distinguishing ID from OOD eval batches, under the same protocol as Table 1 (seeds 42–51, K = 50 K = 50 K = 50 calibration rounds, per-seed 5%-quantile thresholds, learning rate selected per cell by the tail-stability rule). Direction ✓: OOD < ID as expected; !: reversed for the majority of seeds. All four reversed cells are benign shifts and coincide with the cells where the learning-rate stability rule falls back to η = 10 − 4 \eta= 10^{-4} η = 1 0 − 4 . The per-cell selection lies outside the conformal guarantee of Proposition 4.2 , which covers a configuration fixed in advance; the certified frozen-η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 configuration is reported alongside these results in Appendix § 11 .5.
Statistical Validity of the Hypothesis Test
Theorem A.9 establishes a separation between expected anchor losses under ID and OOD distributions. The practical detector of Algorithm 1 does not observe these expectations directly; it observes K K K calibration samples λ ( 1 ) , … , λ ( K ) \lambda^{(1)},\ldots,\lambda^{(K)} λ ( 1 ) , … , λ ( K ) and a single test statistic λ ∗ \lambda^{*} λ ∗ , and rejects H 0 H_{0} H 0 when λ ∗ \lambda^{*} λ ∗ falls below the empirical α \alpha α -quantile of the calibration set. We now verify that this decision rule controls Type-I error at level α \alpha α (up to a finite-K K K correction), via a standard conformal prediction argument.
We first make precise what “in-distribution” means for this test. In a continuous feature space the data need not occupy a sharply bounded set, and density typically decays gradually rather than defining a natural in/out boundary.
Definition A.10 (In-distribution evaluation batch). Let p 0 p_{0} p 0 denote the data-generating distribution on inputs and labels, and p 0 X p_{0}^{X} p 0 X its covariate marginal. The support set, the anchor set ( X a n c , y a n c ) (X_{\mathrm{anc}},y_{\mathrm{anc}}) ( X anc , y anc ) , and the K K K calibration batches are sampled from p 0 p_{0} p 0 . Conditional on the fixed support and anchor sets, a deployment evaluation batch is in-distribution when
H 0 : X e v a l ∗ ∼ ( p 0 X ) ⊗ n e , H_{0}: X_{\mathrm{eval}}^{*}\sim(p_{0}^{X})^{\otimes n_{e}}, H 0 : X eval ∗ ∼ ( p 0 X ) ⊗ n e , that is, when it is drawn from the same covariate distribution as—and is therefore exchangeable with—the calibration batches.
This is a distribution-level definition. One could instead posit a pointwise ID region, for example a density level set { x : d p 0 X / d μ ( x ) > c } \{x:d p_{0}^{X}/d\mu(x)>c\} { x : d p 0 X / d μ ( x ) > c } or a support neighborhood { x : d ( x , supp p 0 X ) ≤ r } \{x:d(x,\operatorname{supp}p_{0}^{X})\leq r\} { x : d ( x , supp p 0 X ) ≤ r } , but both require an arbitrary choice of c c c or r r r . Note that CALD uses neither: the detector thresholds the calibrated statistic λ \lambda λ , and the validity of Proposition A.11 below follows from the exchangeability in Definition A.10 alone, independent of dimension, support geometry, or the existence of a density. The feature-separation parameter ϵ \epsilon ϵ of Theorem A.9 plays a different role: it governs the power analysis, not the definition of ID versus OOD—in the far-OOD limit ∥ p 1 − p 0 ∥ T V → 1 \lVert p_{1}-p_{0}\rVert_{\mathrm{TV}}\to1 ∥ p 1 − p 0 ∥ TV → 1 the tilting argument predicts ϵ → 0 \epsilon\to0 ϵ → 0 , while for near-OOD shifts ϵ \epsilon ϵ may remain Θ ( 1 ) \Theta(1) Θ ( 1 ) , making the power bound vacuous even where the detector has empirical power.
Proposition A.11 (Finite-sample Type-I error control). Consider the calibrated-disagreement-detection test defined in Algorithm 1. Assume that the anchor set ( X a n c , y a n c ) (X_{\mathrm{anc}},y_{\mathrm{anc}}) ( X anc , y anc ) , the support set D s u p D^{\mathrm{sup}} D sup , and all finetuning hyperparameters ( T , η ) (T,\eta) ( T , η ) are fixed; that the eval batches X e v a l ( 1 ) , … , X e v a l ( K ) , X e v a l ∗ X_{\mathrm{eval}}^{(1)},\ldots,X_{\mathrm{eval}}^{(K)},X_{\mathrm{eval}}^{*} X eval ( 1 ) , … , X eval ( K ) , X eval ∗ across rounds are i.i.d. draws; and that the finetuning inner loop is deterministic given its inputs. Under the null hypothesis H 0 : X e v a l ∗ ∼ p 0 H_{0}:X_{\mathrm{eval}}^{*}\sim p_{0} H 0 : X eval ∗ ∼ p 0 (same distribution as the calibration eval batches), the one-sided test
Reject H 0 ⟺ λ ∗ < λ ( α ( K + 1 ) ) (35) \operatorname{Reject} H_{0}\Longleftrightarrow\lambda^{*}<\lambda^{\left(\alpha(K+1)\right)} \tag*{(35)} Reject H 0 ⟺ λ ∗ < λ ( α ( K + 1 ) ) (35)
(where λ ( k ) \lambda^{(k)} λ ( k ) denote the calibration statistics in ascending order) satisfies
P H 0 ( R e j e c t ) ≤ ⌈ α ( K + 1 ) ⌉ K + 1 ≤ α + 1 K + 1 . (36) \mathbb{P}_{H_0}(\mathrm{Reject}) \le\frac{\lceil\alpha(K+1)\rceil}{K+1} \le\alpha+ \frac{1}{K+1}. \tag*{(36)} P H 0 ( Reject ) ≤ K + 1 ⌈ α ( K + 1 )⌉ ≤ α + K + 1 1 . (36)
Proof. Under H 0 H_0 H 0 and the stated i.i.d. conditions, the K + 1 K+1 K + 1 random variables
λ ( 1 ) , … , λ ( K ) , λ ∗ \lambda^{(1)},\ldots,\lambda^{(K)},\lambda^* λ ( 1 ) , … , λ ( K ) , λ ∗
are i.i.d. because each λ ( k ) \lambda^{(k)} λ ( k ) and λ ∗ \lambda^* λ ∗ is a deterministic function of a fresh eval batch X e v a l ( k ) X_{\mathrm{eval}}^{(k)} X eval ( k ) (resp. X e v a l ∗ X_{\mathrm{eval}}^* X eval ∗ ) applied through the same fixed anchor, support, and finetuning procedure. In particular they are exchangeable : the joint law is invariant under any permutation of the indices. Let R R R denote the rank of λ ∗ \lambda^* λ ∗ among the K + 1 K+1 K + 1 statistics when they are sorted in ascending order (breaking ties uniformly at random). By exchangeability, R R R is uniformly distributed on { 1 , 2 , … , K + 1 } \{1,2,\ldots,K+1\} { 1 , 2 , … , K + 1 } . The test rejects exactly when λ ∗ < λ ( ⌈ α ( K + 1 ) ⌉ ) \lambda^* < \lambda^{(\lceil\alpha(K+1)\rceil)} λ ∗ < λ (⌈ α ( K + 1 )⌉) , i.e., when λ ∗ \lambda^* λ ∗ is among the ⌈ α ( K + 1 ) ⌉ − 1 \lceil\alpha(K+1)\rceil-1 ⌈ α ( K + 1 )⌉ − 1 smallest of the K + 1 K+1 K + 1 statistics, i.e., when R ≤ ⌈ α ( K + 1 ) ⌉ − 1 R \le\lceil\alpha(K+1)\rceil-1 R ≤ ⌈ α ( K + 1 )⌉ − 1 . Hence
P H 0 ( R e j e c t ) = P ( R ≤ ⌈ α ( K + 1 ) ⌉ − 1 ) = ⌈ α ( K + 1 ) ⌉ − 1 K + 1 ≤ α ( K + 1 ) K + 1 = α , \mathbb{P}_{H_0}(\mathrm{Reject}) = \mathbb{P}\left(R \le\lceil\alpha(K+1)\rceil-1\right) = \frac{\lceil\alpha(K+1)\rceil-1}{K+1} \le\frac{\alpha(K+1)}{K+1} = \alpha, P H 0 ( Reject ) = P ( R ≤ ⌈ α ( K + 1 )⌉ − 1 ) = K + 1 ⌈ α ( K + 1 )⌉ − 1 ≤ K + 1 α ( K + 1 ) = α ,
using ⌈ α ( K + 1 ) ⌉ ≤ α ( K + 1 ) + 1 \lceil\alpha(K+1)\rceil\le\alpha(K+1)+1 ⌈ α ( K + 1 )⌉ ≤ α ( K + 1 ) + 1 in the inequality. This gives the tight bound P H 0 ( R e j e c t ) ≤ α \mathbb{P}_{H_0}(\mathrm{Reject}) \le\alpha P H 0 ( Reject ) ≤ α . The weaker (but standard) form quoted in (36) , P H 0 ( R e j e c t ) ≤ ⌈ α ( K + 1 ) ⌉ / ( K + 1 ) ≤ α + 1 / ( K + 1 ) \mathbb{P}_{H_0}(\mathrm{Reject}) \le\lceil\alpha(K+1)\rceil/(K+1) \le\alpha+1/(K+1) P H 0 ( Reject ) ≤ ⌈ α ( K + 1 )⌉ / ( K + 1 ) ≤ α + 1/ ( K + 1 ) , is the discretization version obtained by dropping the − 1 -1 − 1 : its slack 1 / ( K + 1 ) 1/(K+1) 1/ ( K + 1 ) quantifies the cost of using a finite calibration set.
Power analysis. Proposition A.11 controls Type-I error only; power depends on the separation established in Theorem A.9. A power statement requires two ingredients. First, a mean separation: E [ λ O O D ] ≤ E [ λ I D ] − Δ λ \mathbb{E}[\lambda_{\mathrm{OOD}}] \le\mathbb{E}[\lambda_{\mathrm{ID}}]-\Delta_\lambda E [ λ OOD ] ≤ E [ λ ID ] − Δ λ for some Δ λ > 0 \Delta_\lambda> 0 Δ λ > 0 . Theorem A.9 supplies one, with Δ λ ≥ T η ( γ − ϵ B ϕ 2 B C ) \Delta_\lambda\ge T\eta(\gamma-\epsilon B_\phi^2 B_C) Δ λ ≥ T η ( γ − ϵ B ϕ 2 B C ) . Second, concentration: λ I D \lambda_{\mathrm{ID}} λ ID and λ O O D \lambda_{\mathrm{OOD}} λ OOD must be sufficiently tight around their means. The batch-gradient structure gives an O ( 1 / n e ) O(1/\sqrt{n_e}) O ( 1/ n e ) standard deviation under the small-step regime, but a full Hoeffding-type bound would need to be proved separately. Given both ingredients, the detector’s power approaches 1 as K → ∞ K \to\infty K → ∞ for any Δ λ \Delta_\lambda Δ λ exceeding the concentration noise. We leave a detailed power analysis as a direction for future work.
Assumption satisfied in the experimental setup. The assumptions of Proposition A.11 match Algorithm 1’s protocol: anchor and support are fixed across calibration rounds (only eval batches are resampled), the finetuning inner loop is deterministic given its inputs (full-batch gradient descent with no randomness beyond the initial draw), and the eval batches are i.i.d. from p 0 p_0 p 0 during calibration.
Multiclass Case
All statements in Lemma A.1, Proposition A.2, Corollary A.4, and Proposition A.8 hold for arbitrary C ≥ 2 C \ge2 C ≥ 2 : the outer-product structure ∇ ℓ = ( q − t a r g e t ) ϕ ⊤ \nabla\ell= (q-\mathrm{target})\phi^\top ∇ ℓ = ( q − target ) ϕ ⊤ produces a C C C -dimensional first factor but carries through unchanged. The IID-inference argument in Proposition A.6 uses binary structure for concreteness; the extension to C > 2 C>2 C > 2 replaces the two-component sign analysis with a joint distribution over label pairs ( y a , y ^ ( x e ) ) ∈ [ C ] 2 (y_a,\hat{y}(x_e)) \in[C]^2 ( y a , y ^ ( x e )) ∈ [ C ] 2 . Under a class-symmetry condition (p 0 p_0 p 0 marginally balanced over classes, or ϕ \phi ϕ covariance block-diagonal across class regions), the label-agreement contribution dominates and gives the same negative expected sign for the cross-term.
Distributional Difference vs. Predictive Harm
The theory developed so far controls the gradient cross-term ⟨ g a , g e ⟩ \langle g_a,g_e\rangle ⟨ g a , g e ⟩ via the TV distance ∥ p 1 − p 0 ∥ T V \|p_1-p_0\|_{\mathrm{TV}} ∥ p 1 − p 0 ∥ TV : an unsigned measure of distributional difference. But a detector of performance deterioration should fire only on shifts that actually hurt predictive accuracy. As the benign-shift experiments (Adult Income, Diabetes Readmission) show, these notions are not equivalent.
This subsection bridges the gap. We:
Formally decompose the accuracy gap into a density-ratio integral that makes the sign structure of harm explicit.
Extend Nagler’s tilting from features to predictions : at far-OOD inputs, not only does the feature collapse, but so does the classifier’s output, converging to a constant distribution q ∞ q_{\infty} q ∞ .
Propose a second, accuracy-sensitive signal μ ^ \hat{\mu} μ ^ that estimates the accuracy gap Δ \Delta Δ directly (Proposition A.21), with λ ^ \hat{\lambda} λ ^ serving as a shift-confirmation gate.
The additional assumptions required by Proposition A.21 are catalogued in Section A.14.
Accuracy gap as a signed density-ratio integral
Let ℓ 01 ( q , x , y ) : = 1 { y ≠ arg max c q ( c ∣ x ) } \ell_{01}(q,x,y) := \mathbb{1}\{y \ne\arg\max_c q(c \mid x)\} ℓ 01 ( q , x , y ) := 1 { y = arg max c q ( c ∣ x )} be the 0-1 loss and acc q ( p ) : = 1 − E ( x , y ) ∼ p [ ℓ 01 ( q , x , y ) ] \operatorname{acc}_q(p) := 1 - \mathbb{E}_{(x,y)\sim p}[\ell_{01}(q,x,y)] acc q ( p ) := 1 − E ( x , y ) ∼ p [ ℓ 01 ( q , x , y )] . The accuracy gap between p 0 p_0 p 0 and p 1 p_1 p 1 under the fixed (pretrained) classifier q = q W 0 q=q_{W_0} q = q W 0 is
Δ ( q , p 0 , p 1 ) : = acc q ( p 0 ) − acc q ( p 1 ) . (37) \Delta(q,p_0,p_1) := \operatorname{acc}_q(p_0) - \operatorname{acc}_q(p_1). \tag*{(37)} Δ ( q , p 0 , p 1 ) := acc q ( p 0 ) − acc q ( p 1 ) . (37)
Lemma A.12 (Density-ratio decomposition of the accuracy gap). Suppose p 0 p_0 p 0 and p 1 p_1 p 1 have densities with respect to a common reference measure on X × Y \mathcal{X} \times\mathcal{Y} X × Y , with p 0 ( x , y ) > 0 p_0(x,y)>0 p 0 ( x , y ) > 0 wherever p 1 ( x , y ) > 0 p_1(x,y)>0 p 1 ( x , y ) > 0 , and let r ( x , y ) : = p 1 ( x , y ) / p 0 ( x , y ) r(x,y):=p_1(x,y)/p_0(x,y) r ( x , y ) := p 1 ( x , y ) / p 0 ( x , y ) denote the density ratio. Then
Δ ( q , p 0 , p 1 ) = E p 0 [ ( r − 1 ) ℓ 01 ] . (38) \Delta(q,p_0,p_1)=\mathbb{E}_{p_0}[(r-1)\ell_{01}]. \tag*{(38)} Δ ( q , p 0 , p 1 ) = E p 0 [( r − 1 ) ℓ 01 ] . (38)
Proof. Step 1 (rewrite Δ \Delta Δ in loss form). Since acc q ( p ) = 1 − E p [ ℓ 01 ( q , x , y ) ] \operatorname{acc}_q(p)=1-\mathbb{E}_p[\ell_{01}(q,x,y)] acc q ( p ) = 1 − E p [ ℓ 01 ( q , x , y )] ,
Δ = acc q ( p 0 ) − acc q ( p 1 ) = ( 1 − E p 0 [ ℓ 01 ] ) − ( 1 − E p 1 [ ℓ 01 ] ) = E p 1 [ ℓ 01 ] − E p 0 [ ℓ 01 ] . \Delta=\operatorname{acc}_q(p_0)-\operatorname{acc}_q(p_1)=(1-\mathbb{E}_{p_0}[\ell_{01}])-(1-\mathbb{E}_{p_1}[\ell_{01}])=\mathbb{E}_{p_1}[\ell_{01}]-\mathbb{E}_{p_0}[\ell_{01}]. Δ = acc q ( p 0 ) − acc q ( p 1 ) = ( 1 − E p 0 [ ℓ 01 ]) − ( 1 − E p 1 [ ℓ 01 ]) = E p 1 [ ℓ 01 ] − E p 0 [ ℓ 01 ] .
Step 2 (change of measure). The support condition { p 1 > 0 } ⊆ { p 0 > 0 } \{p_1>0\}\subseteq\{p_0>0\} { p 1 > 0 } ⊆ { p 0 > 0 } ensures the density ratio r = p 1 / p 0 r=p_1/p_0 r = p 1 / p 0 is well-defined and finite p 0 p_0 p 0 -almost everywhere. For any bounded f : X × Y → R f:\mathcal{X}\times\mathcal{Y}\to\mathbb{R} f : X × Y → R ,
E p 1 [ f ] = ∫ f p 1 = ∫ f ⋅ p 1 p 0 ⋅ p 0 = ∫ f r p 0 = E p 0 [ r f ] . \mathbb{E}_{p_1}[f]=\int f p_1=\int f\cdot\frac{p_1}{p_0}\cdot p_0=\int f r p_0=\mathbb{E}_{p_0}[rf]. E p 1 [ f ] = ∫ f p 1 = ∫ f ⋅ p 0 p 1 ⋅ p 0 = ∫ f r p 0 = E p 0 [ r f ] .
Applied to f = ℓ 01 f=\ell_{01} f = ℓ 01 : E p 1 [ ℓ 01 ] = E p 0 [ r ℓ 01 ] \mathbb{E}_{p_1}[\ell_{01}]=\mathbb{E}_{p_0}[r\ell_{01}] E p 1 [ ℓ 01 ] = E p 0 [ r ℓ 01 ] .
Step 3 (subtract and combine).
Δ = E p 0 [ r ℓ 01 ] − E p 0 [ ℓ 01 ] = E p 0 [ ( r − 1 ) ℓ 01 ] . \Delta=\mathbb{E}_{p_0}[r\ell_{01}]-\mathbb{E}_{p_0}[\ell_{01}]=\mathbb{E}_{p_0}[(r-1)\ell_{01}]. Δ = E p 0 [ r ℓ 01 ] − E p 0 [ ℓ 01 ] = E p 0 [( r − 1 ) ℓ 01 ] .
Reading the decomposition. The gap is the p 0 p_0 p 0 -expectation of the 0-1 loss weighted by the signed excess density r − 1 r-1 r − 1 :
On the mistake region M : = { ( x , y ) : ℓ 01 ( q , x , y ) = 1 } M:=\{(x,y):\ell_{01}(q,x,y)=1\} M := {( x , y ) : ℓ 01 ( q , x , y ) = 1 } : if r > 1 r>1 r > 1 (shift puts more mass there), the integrand ( r − 1 ) ℓ 01 (r-1)\ell_{01} ( r − 1 ) ℓ 01 is positive, so the contribution to Δ \Delta Δ is positive (i.e., acc p 1 < acc p 0 \operatorname{acc}_{p_1}<\operatorname{acc}_{p_0} acc p 1 < acc p 0 ; harmful). Conversely, if r < 1 r<1 r < 1 on M M M , the shift pulls mass out of the mistake region, the contribution is negative, and Δ < 0 \Delta<0 Δ < 0 (OOD accuracy exceeds ID accuracy; benign).
Thus Δ \Delta Δ is controlled entirely by how the shift re-weights the mistake region. In contrast, ∥ p 1 − p 0 ∥ T V \lVert p_1-p_0\rVert_{\mathrm{TV}} ∥ p 1 − p 0 ∥ TV is controlled by re-weighting of the entire domain. Two shifts with the same TV distance can produce very different Δ \Delta Δ values depending on whether they transfer mass into or out of the mistake region.
Corollary A.13 (TV upper bound is loose). ∣ Δ ( q , p 0 , p 1 ) ∣ ≤ 2 ∥ p 1 − p 0 ∥ T V |\Delta(q,p_0,p_1)|\le2\lVert p_1-p_0\rVert_{\mathrm{TV}} ∣Δ ( q , p 0 , p 1 ) ∣ ≤ 2 ∥ p 1 − p 0 ∥ TV , with equality if and only if { ∣ r − 1 ∣ > 0 } ⊆ M \{|r-1|>0\}\subseteq M { ∣ r − 1∣ > 0 } ⊆ M up to p 0 p_0 p 0 -null sets and ( r − 1 ) ℓ 01 (r-1)\ell_{01} ( r − 1 ) ℓ 01 has constant sign on M M M (i.e., the shift is supported on the mistake region and the density ratio is monotone in one direction).
Proof. Step 1 (absolute-value bound inside expectation). By Lemma A.12 and the triangle inequality,
∣ Δ ∣ = ∣ E p 0 [ ( r − 1 ) ℓ 01 ] ∣ ≤ E p 0 [ ∣ r − 1 ∣ ℓ 01 ] . |\Delta| = \left|\mathbb{E}_{p_0}[(r-1)\ell_{01}]\right| \le\mathbb{E}_{p_0}[|r-1|\ell_{01}]. ∣Δ∣ = ∣ E p 0 [( r − 1 ) ℓ 01 ] ∣ ≤ E p 0 [ ∣ r − 1∣ ℓ 01 ] .
Since ℓ 01 ( q , x , y ) ∈ { 0 , 1 } \ell_{01}(q,x,y) \in\{0,1\} ℓ 01 ( q , x , y ) ∈ { 0 , 1 } , ∣ r − 1 ∣ ℓ 01 ≤ ∣ r − 1 ∣ |r-1|\ell_{01} \le|r-1| ∣ r − 1∣ ℓ 01 ≤ ∣ r − 1∣ pointwise, hence
E p 0 [ ∣ r − 1 ∣ ℓ 01 ] ≤ E p 0 [ ∣ r − 1 ∣ ] . \mathbb{E}_{p_0}[|r-1|\ell_{01}] \le\mathbb{E}_{p_0}[|r-1|]. E p 0 [ ∣ r − 1∣ ℓ 01 ] ≤ E p 0 [ ∣ r − 1∣ ] .
Step 2 (identify E p 0 [ ∣ r − 1 ∣ ] \mathbb{E}_{p_0}[|r-1|] E p 0 [ ∣ r − 1∣ ] with TV distance). The standard density-based formula for total variation distance reads
∥ p 1 − p 0 ∥ T V = 1 2 ∫ ∣ p 1 − p 0 ∣ = 1 2 ∫ ∣ r − 1 ∣ p 0 = 1 2 E p 0 [ ∣ r − 1 ∣ ] . \lVert p_1-p_0\rVert_{\mathrm{TV}} = \frac{1}{2}\int|p_1-p_0| = \frac{1}{2}\int|r-1|p_0 = \frac{1}{2}\mathbb{E}_{p_0}[|r-1|]. ∥ p 1 − p 0 ∥ TV = 2 1 ∫ ∣ p 1 − p 0 ∣ = 2 1 ∫ ∣ r − 1∣ p 0 = 2 1 E p 0 [ ∣ r − 1∣ ] .
Therefore E p 0 [ ∣ r − 1 ∣ ] = 2 ∥ p 1 − p 0 ∥ T V \mathbb{E}_{p_0}[|r-1|] = 2\lVert p_1-p_0\rVert_{\mathrm{TV}} E p 0 [ ∣ r − 1∣ ] = 2 ∥ p 1 − p 0 ∥ TV . Combining with Step 1 gives ∣ Δ ∣ ≤ 2 ∥ p 1 − p 0 ∥ T V |\Delta| \le2\lVert p_1-p_0\rVert_{\mathrm{TV}} ∣Δ∣ ≤ 2 ∥ p 1 − p 0 ∥ TV .
Step 3 (equality conditions). The two inequalities used above are tight under the following conditions:
∣ E [ g ] ∣ = E [ ∣ g ∣ ] |\mathbb{E}[g]| = \mathbb{E}[|g|] ∣ E [ g ] ∣ = E [ ∣ g ∣ ] requires g = ( r − 1 ) ℓ 01 g=(r-1)\ell_{01} g = ( r − 1 ) ℓ 01 to have constant sign p 0 p_0 p 0 -almost surely.
∣ r − 1 ∣ ℓ 01 = ∣ r − 1 ∣ |r-1|\ell_{01}=|r-1| ∣ r − 1∣ ℓ 01 = ∣ r − 1∣ p 0 p_0 p 0 -almost surely requires ℓ 01 ( q , x , y ) = 1 \ell_{01}(q,x,y)=1 ℓ 01 ( q , x , y ) = 1 on { ∣ r − 1 ∣ > 0 } \{|r-1|>0\} { ∣ r − 1∣ > 0 } , i.e., the shift is supported on the mistake region.
Both must hold simultaneously for equality in the TV bound. ■
Corollary A.13 formalizes the central tension: TV distance upper-bounds ∣ Δ ∣ |\Delta| ∣Δ∣ but the bound is rarely tight on benchmark data, because shifts on real-world data rarely align perfectly with the classifier’s mistake region. Figure 8 shows two shifts with similar TV distances but opposite signs of Δ \Delta Δ .
Figure 8. (a) Harmful shift. p 1 p_1 p 1 moves mass into the classifier’s mistake region (shaded), so the accuracy gap Δ > 0 \Delta> 0 Δ > 0 and accuracy drops on the shifted distribution. (b) Benign shift. p 1 p_1 p 1 moves mass away from the mistake region (shaded) into the correct region, so Δ ≤ 0 \Delta\le0 Δ ≤ 0 and accuracy is preserved or improved. Figure 8: Same TV distance, opposite signs of Δ \Delta Δ . Both panels show a shift p 0 → p 1 p_0 \to p_1 p 0 → p 1 of the same magnitude (same ∥ p 1 − p 0 ∥ T V \lVert p_1-p_0\rVert_{\mathrm{TV}} ∥ p 1 − p 0 ∥ TV ) under the same classifier, which has a mistake region on the left of the axis (shaded red). In (a), the shift transfers mass into the mistake region, so accuracy drops. In (b), the shift transfers mass away from the mistake region, so accuracy is preserved or improved. The anchor-loss detector λ ^ \hat{\lambda} λ ^ (Section A.8) has the same value in both cases; it is insensitive to the sign of Δ \Delta Δ . An additional signal is needed.
Far-OOD prediction collapse
Nagler’s tilting argument (Section A.8) established that far-OOD features collapse to a single input-independent direction ϕ ∞ \phi_\infty ϕ ∞ . We now observe that this extends to the classifier’s output: all far-OOD queries receive the same prediction q ∞ q_\infty q ∞ .
Assumption A.14 (Far-OOD regime). The eval distribution p 1 p_1 p 1 satisfies ∥ p 1 − p 0 ∥ T V → 1 \lVert p_1-p_0\rVert_{\mathrm{TV}} \to1 ∥ p 1 − p 0 ∥ TV → 1 in the sense that, for p 1 p_1 p 1 -almost every x e x_e x e , the tilt exp ( v ( x e ) T W q ( h ) s ) \exp(v(x_e)^\mathsf{T}W_q^{(h)}s) exp ( v ( x e ) T W q ( h ) s ) is approximately constant over s ∼ p 0 s \sim p_0 s ∼ p 0 for every head h h h .
We acknowledge that this is the most aggressive assumption in this derivation and it is therefore best read as an idealization; it is defensible only for one-layer attention (Nagler [39 ] ’s tilting theorem assumes a single layer, while TabPFN and TabICL are multi-layer), and only in the strict limit ∥ p 1 − p 0 ∥ T V → 1 \lVert p_1-p_0\rVert_{\mathrm{TV}}\to1 ∥ p 1 − p 0 ∥ TV → 1 , while typical benchmark shifts have TV distance bounded well away from 1. The conclusion of Proposition A.15 below, that all far-OOD queries receive the same prediction q ∞ q_\infty q ∞ , should accordingly be read as the limit point of a trend rather than a description of any specific experiment. We note that the subsequent separation theorem (Theorem A.9) does not depend on this assumption; only the harm theorem (Proposition A.21) does.
Proposition A.15 (Far-OOD prediction collapse). Under Assumption A.14, the PFN’s prediction collapses pointwise: for p 1 p_1 p 1 -almost every x e x_e x e ,
q W 0 ( ⋅ ∣ x e ) ⟶ q ∞ : = softmax ( W 0 ϕ ∞ ) (39) q_{W_0}(\cdot\mid x_e)\longrightarrow q_\infty:= \operatorname{softmax}(W_0\phi_\infty) \tag*{(39)} q W 0 ( ⋅ ∣ x e ) ⟶ q ∞ := softmax ( W 0 ϕ ∞ ) (39) in total variation, where ϕ ∞ : = ∑ h W 0 ( h ) E V ∼ p 0 [ V ] \phi_\infty:= \sum_h W_0^{(h)}\mathbb{E}_{V\sim p_0}[V] ϕ ∞ := ∑ h W 0 ( h ) E V ∼ p 0 [ V ] is the input-independent direction defined in (29); equivalently, q ∞ q_\infty q ∞ is the same constant prediction for every far-OOD query.
Proof. We show successively that (i) the tilted measures at each head approach p 0 p_0 p 0 in total variation, (ii) the tilted mean features approach E p 0 [ V ] \mathbb{E}_{p_0}[V] E p 0 [ V ] in norm, (iii) the backbone feature approaches ϕ ∞ \phi_\infty ϕ ∞ , and (iv) the softmax output approaches q ∞ q_\infty q ∞ in total variation.
Step 1 (tilted measure converges to p 0 p_0 p 0 ). Assumption A.14 posits a sequence ϵ n → 0 \epsilon_n\to0 ϵ n → 0 and a set of x e x_e x e ’s of p 1 p_1 p 1 -mass → 1 \to1 → 1 such that, for every head h h h ,
sup s ∈ supp ( p 0 ) ∣ ψ h ( s ; x e ) − Z h ( x e ) ∣ ≤ ϵ n . \sup_{s\in\operatorname{supp}(p_0)}\left|\psi_h(s;x_e)-Z_h(x_e)\right|\le\epsilon_n. s ∈ supp ( p 0 ) sup ∣ ψ h ( s ; x e ) − Z h ( x e ) ∣ ≤ ϵ n .
where ψ h ( s ; x ) : = exp ( v ( x ) T W v ( h ) s ) \psi_h(s;x):=\exp(v(x)^\mathsf{T}W_v^{(h)}s) ψ h ( s ; x ) := exp ( v ( x ) T W v ( h ) s ) and Z h ( x ) : = E V ∼ p 0 [ ψ h ( V ; x ) ] Z_h(x):=\mathbb{E}_{V\sim p_0}[\psi_h(V;x)] Z h ( x ) := E V ∼ p 0 [ ψ h ( V ; x )] is the partition function. Using this uniform bound,
∥ g h ( ⋅ ∣ x e ) − p 0 ∥ T V = 1 2 E V ∼ p 0 [ ∣ ψ h ( V ; x e ) Z h ( x e ) − 1 ∣ ] ≤ ϵ n 2 Z h ( x e ) . \left\lVert g_h(\cdot\mid x_e)-p_0\right\rVert_{\mathrm{TV}}
=\frac{1}{2}\mathbb{E}_{V\sim p_0}\left[\left|\frac{\psi_h(V;x_e)}{Z_h(x_e)}-1\right|\right]
\le\frac{\epsilon_n}{2Z_h(x_e)}. ∥ g h ( ⋅ ∣ x e ) − p 0 ∥ TV = 2 1 E V ∼ p 0 [ Z h ( x e ) ψ h ( V ; x e ) − 1 ] ≤ 2 Z h ( x e ) ϵ n .
Step 2 (tilted mean feature converges). For any bounded V V V (say ∥ V ∥ ≤ B s \lVert V\rVert\le B_s ∥ V ∥ ≤ B s ),
∥ E V ∼ g h ( ⋅ ∣ x e ) [ V ] − E V ∼ p 0 [ V ] ∥ ≤ 2 B s ⋅ ∥ g h ( ⋅ ∣ x e ) − p 0 ∥ T V ≤ B s ϵ n Z h ( x e ) . \left\lVert\mathbb{E}_{V\sim g_h(\cdot\mid x_e)}[V]-\mathbb{E}_{V\sim p_0}[V]\right\rVert
\le2B_s\cdot\left\lVert g_h(\cdot\mid x_e)-p_0\right\rVert_{\mathrm{TV}}
\le\frac{B_s\epsilon_n}{Z_h(x_e)}. E V ∼ g h ( ⋅ ∣ x e ) [ V ] − E V ∼ p 0 [ V ] ≤ 2 B s ⋅ ∥ g h ( ⋅ ∣ x e ) − p 0 ∥ TV ≤ Z h ( x e ) B s ϵ n .
Step 3 (feature converges to ϕ ∞ \phi_\infty ϕ ∞ ). Substituting Step 2 into the limiting-feature expression (27),
∥ u ˉ ( x e ) − ϕ ∞ ∥ = ∥ ∑ h = 1 H W v ( h ) [ E g h [ V ] − E p 0 [ V ] ] ∥ ≤ ∑ h = 1 H ∥ W v ( h ) ∥ B s ϵ n Z h ( x e ) = : C ϕ ( x e ) ϵ n , \left\lVert\bar{u}(x_e)-\phi_\infty\right\rVert
=\left\lVert\sum_{h=1}^{H}W_v^{(h)}\left[\mathbb{E}_{g_h}[V]-\mathbb{E}_{p_0}[V]\right]\right\rVert
\le\sum_{h=1}^{H}\lVert W_v^{(h)}\rVert\frac{B_s\epsilon_n}{Z_h(x_e)}
=:C_\phi(x_e)\epsilon_n, ∥ u ˉ ( x e ) − ϕ ∞ ∥ = h = 1 ∑ H W v ( h ) [ E g h [ V ] − E p 0 [ V ] ] ≤ h = 1 ∑ H ∥ W v ( h ) ∥ Z h ( x e ) B s ϵ n =: C ϕ ( x e ) ϵ n ,
where C ϕ ( x e ) : = B s ∑ h ∥ W v ( h ) ∥ / Z h ( x e ) < ∞ C_\phi(x_e):=B_s\sum_h\lVert W_v^{(h)}\rVert/Z_h(x_e)<\infty C ϕ ( x e ) := B s ∑ h ∥ W v ( h ) ∥ / Z h ( x e ) < ∞ for p 1 p_1 p 1 -a.e. x e x_e x e (the partition functions are bounded away from zero on the assumed far-OOD set).
Step 4 (softmax is Lipschitz). The softmax map z ↦ softmax ( z ) z\mapsto\operatorname{softmax}(z) z ↦ softmax ( z ) is 1-Lipschitz from ( R C , ∥ ⋅ ∥ 2 ) (\mathbb{R}^{C},\lVert\cdot\rVert_2) ( R C , ∥ ⋅ ∥ 2 ) to the probability simplex under ∥ ⋅ ∥ 2 \lVert\cdot\rVert_2 ∥ ⋅ ∥ 2 (a standard consequence of the Jacobian bound ∥ J ( q ) ∥ o p ≤ 1 / 2 \lVert J(q)\rVert_{\mathrm{op}}\le1/2 ∥ J ( q ) ∥ op ≤ 1/2 used in Section A.9, which gives a tighter constant 1 / 2 1/2 1/2 for differentiable paths; the 1-Lipschitz statement suffices here):
∥ softmax ( z ) − softmax ( z ′ ) ∥ 2 ≤ ∥ z − z ′ ∥ 2 . \left\lVert\operatorname{softmax}(z)-\operatorname{softmax}(z')\right\rVert_2\le\lVert z-z'\rVert_2. ∥ softmax ( z ) − softmax ( z ′ ) ∥ 2 ≤ ∥ z − z ′ ∥ 2 .
Converting to the ℓ 1 \ell_1 ℓ 1 norm used by TV distance via ∥ ⋅ ∥ 1 ≤ C ∥ ⋅ ∥ 2 \lVert\cdot\rVert_1\le\sqrt{C}\lVert\cdot\rVert_2 ∥ ⋅ ∥ 1 ≤ C ∥ ⋅ ∥ 2 ,
∥ softmax ( z ) − softmax ( z ′ ) ∥ 1 ≤ C ∥ z − z ′ ∥ 2 . \left\lVert\operatorname{softmax}(z)-\operatorname{softmax}(z')\right\rVert_1\le\sqrt{C}\lVert z-z'\rVert_2. ∥ softmax ( z ) − softmax ( z ′ ) ∥ 1 ≤ C ∥ z − z ′ ∥ 2 .
Applied to z = W 0 u ˉ ( x e ) z=W_0\bar{u}(x_e) z = W 0 u ˉ ( x e ) and z ′ = W 0 ϕ ∞ z'=W_0\phi_\infty z ′ = W 0 ϕ ∞ , and using ∥ z − z ′ ∥ 2 ≤ ∥ W 0 ∥ o p ∥ u ˉ ( x e ) − ϕ ∞ ∥ 2 \lVert z-z'\rVert_2\le\lVert W_0\rVert_{\mathrm{op}}\lVert\bar{u}(x_e)-\phi_\infty\rVert_2 ∥ z − z ′ ∥ 2 ≤ ∥ W 0 ∥ op ∥ u ˉ ( x e ) − ϕ ∞ ∥ 2 ,
∥ q W 0 ( ⋅ ∣ x e ) − q ∞ ∥ T V = 1 2 ∥ softmax ( W 0 u ˉ ( x e ) ) − softmax ( W 0 ϕ ∞ ) ∥ 1 ≤ C 2 ∥ W 0 ∥ o p C ϕ ( x e ) ϵ n . \left\lVert q_{W_0}(\cdot\mid x_e)-q_\infty\right\rVert_{\mathrm{TV}}
=\frac{1}{2}\left\lVert\operatorname{softmax}(W_0\bar{u}(x_e))-\operatorname{softmax}(W_0\phi_\infty)\right\rVert_1
\le\frac{\sqrt{C}}{2}\lVert W_0\rVert_{\mathrm{op}}C_\phi(x_e)\epsilon_n. ∥ q W 0 ( ⋅ ∣ x e ) − q ∞ ∥ TV = 2 1 ∥ softmax ( W 0 u ˉ ( x e )) − softmax ( W 0 ϕ ∞ ) ∥ 1 ≤ 2 C ∥ W 0 ∥ op C ϕ ( x e ) ϵ n .
As ϵ n → 0 \epsilon_n\to0 ϵ n → 0 (Assumption A.14), the right-hand side vanishes p 1 p_1 p 1 -almost surely, proving q W 0 ( ⋅ ∣ x e ) → q ∞ q_{W_0}(\cdot\mid x_e)\to q_\infty q W 0 ( ⋅ ∣ x e ) → q ∞ in total variation.
Corollary A.16 (Far-OOD accuracy is constant-predictor accuracy). Under Assumption A.14 ,
acc q W 0 ( p 1 ) ⟶ acc q ∞ ( p 1 ) = p Y ∣ p 1 ( y ^ ∞ ) , (40) \operatorname{acc}_{q_{W_0}}(p_1) \longrightarrow\operatorname{acc}_{q_\infty}(p_1) = p_{Y\mid p_1}(\hat{y}_\infty), \tag*{(40)} acc q W 0 ( p 1 ) ⟶ acc q ∞ ( p 1 ) = p Y ∣ p 1 ( y ^ ∞ ) , (40) where y ^ ∞ : = arg max c q ∞ ( c ) \hat{y}_\infty:= \arg\max_c q_\infty(c) y ^ ∞ := arg max c q ∞ ( c ) is the constant prediction at ϕ ∞ \phi_\infty ϕ ∞ and p Y ∣ p 1 p_{Y\mid p_1} p Y ∣ p 1 is the label marginal under p 1 p_1 p 1 .
Proof. Write the accuracy as an expectation:
acc q ( p 1 ) = P ( x , y ) ∼ p 1 ( arg max c q ( c ∣ x ) = y ) . \operatorname{acc}_{q}(p_1) = \mathbb{P}_{(x,y)\sim p_1}\left(\arg\max_c q(c\mid x)=y\right). acc q ( p 1 ) = P ( x , y ) ∼ p 1 ( arg c max q ( c ∣ x ) = y ) .
Step 1 (arg-max converges). Proposition A.15 gives q W 0 ( ⋅ ∣ x e ) ⟶ q ∞ q_{W_0}(\cdot\mid x_e)\longrightarrow q_\infty q W 0 ( ⋅ ∣ x e ) ⟶ q ∞ in TV for p 1 p_1 p 1 -almost every x e x_e x e . We assume that q ∞ q_\infty q ∞ has a unique maximizer, so the arg-max function is continuous at q ∞ q_\infty q ∞ ; ties, if they occur, can be broken by an arbitrary fixed rule without changing the statement. Hence
arg max c q W 0 ( c ∣ x e ) ⟶ arg max c q ∞ ( c ) = y ^ ∞ \arg\max_c q_{W_0}(c\mid x_e)\longrightarrow\arg\max_c q_\infty(c)=\hat{y}_\infty arg c max q W 0 ( c ∣ x e ) ⟶ arg c max q ∞ ( c ) = y ^ ∞
for p 1 p_1 p 1 -almost every x e x_e x e .
Step 2 (accuracy difference is bounded by mismatch probability). By the triangle inequality applied to 1 { arg max q W 0 ( ⋅ ∣ x ) = y } \mathbb{1}\{\arg\max q_{W_0}(\cdot\mid x)=y\} 1 { arg max q W 0 ( ⋅ ∣ x ) = y } versus 1 { y ^ ∞ = y } \mathbb{1}\{\hat{y}_\infty=y\} 1 { y ^ ∞ = y } :
∣ acc q W 0 ( p 1 ) − acc q ∞ ( p 1 ) ∣ = ∣ P p 1 ( arg max q W 0 = y ) − P p 1 ( y ^ ∞ = y ) ∣ ≤ P p 1 ( arg max c q W 0 ( c ∣ x ) ≠ y ^ ∞ ) . \begin{aligned}
\left|\operatorname{acc}_{q_{W_0}}(p_1)-\operatorname{acc}_{q_\infty}(p_1)\right|
=\left|\mathbb{P}_{p_1}(\arg\max q_{W_0}=y)-\mathbb{P}_{p_1}(\hat{y}_\infty=y)\right| \\
&\leq\mathbb{P}_{p_1}\left(\arg\max_c q_{W_0}(c\mid x)\ne\hat{y}_\infty\right).
\end{aligned} acc q W 0 ( p 1 ) − acc q ∞ ( p 1 ) = ∣ P p 1 ( arg max q W 0 = y ) − P p 1 ( y ^ ∞ = y ) ∣ ≤ P p 1 ( arg c max q W 0 ( c ∣ x ) = y ^ ∞ ) .
By Step 1, the right-hand side tends to zero.
Step 3 (evaluate the limit). Since y ^ ∞ \hat{y}_\infty y ^ ∞ is a constant independent of x x x ,
acc q ∞ ( p 1 ) = P ( x , y ) ∼ p 1 ( y ^ ∞ = y ) = P y ∼ p Y ∣ p 1 ( y = y ^ ∞ ) = p Y ∣ p 1 ( y ^ ∞ ) . \operatorname{acc}_{q_\infty}(p_1)=\mathbb{P}_{(x,y)\sim p_1}(\hat{y}_\infty=y)=\mathbb{P}_{y\sim p_{Y\mid p_1}}(y=\hat{y}_\infty)=p_{Y\mid p_1}(\hat{y}_\infty). acc q ∞ ( p 1 ) = P ( x , y ) ∼ p 1 ( y ^ ∞ = y ) = P y ∼ p Y ∣ p 1 ( y = y ^ ∞ ) = p Y ∣ p 1 ( y ^ ∞ ) .
Far-OOD accuracy equals the probability that the constant prediction y ^ ∞ \hat{y}_\infty y ^ ∞ matches the true OOD label. Whether this is harmful depends on the alignment between y ^ ∞ \hat{y}_\infty y ^ ∞ and the OOD label marginal:
Harmful shift: y ^ ∞ \hat{y}_\infty y ^ ∞ poorly aligned with p Y ∣ p 1 p_{Y\mid p_1} p Y ∣ p 1 , so acc q ∞ ( p 1 ) \operatorname{acc}_{q_\infty}(p_1) acc q ∞ ( p 1 ) is low (e.g., Covertype: the classifier predicts a near-uniform distribution over forest types, but OOD elevation concentrates on subalpine species; mismatch).
Benign shift: y ^ ∞ \hat{y}_\infty y ^ ∞ happens to align with p Y ∣ p 1 p_{Y\mid p_1} p Y ∣ p 1 , so acc q ∞ ( p 1 ) \operatorname{acc}_{q_\infty}(p_1) acc q ∞ ( p 1 ) equals or exceeds ID accuracy (e.g., Adult Income: female subgroup has lower base rate of high income, so predicting ‘low income’ as a constant happens to be more accurate than the ID-calibrated conditional prediction).
This gives us a handle on harm that is invisible to the TV-distance-based bound of Corollary A.13.
The two-signal decomposition
We combine the feature-collapse signal (our original λ \lambda λ ) with a prediction-collapse signal that exploits Proposition A.15 .
Definition A.17 (Two-signal quantities). Define the population quantities
λ : = E [ λ I D ] − E [ λ O O D ] , (anchor-loss drop under eval batches; xref‘Proposition A.2‘) \lambda:= \mathbb{E}[\lambda_{\mathrm{ID}}]-\mathbb{E}[\lambda_{\mathrm{OOD}}],\qquad\text{(anchor-loss drop under eval batches; {xref}`Proposition A.2`)} λ := E [ λ ID ] − E [ λ OOD ] , (anchor-loss drop under eval batches; xref ‘Proposition A.2‘) μ : = E ( x , y ) ∼ p 0 [ p x ( y ) ] − E x ∼ p 1 [ p x ( y ^ ( x ) ) ] , (mean confidence drop from anchor to eval). \mu:= \mathbb{E}_{(x,y)\sim p_0}[p_x(y)]-\mathbb{E}_{x\sim p_1}[p_x(\hat{y}(x))],\qquad\text{(mean confidence drop from anchor to eval).} μ := E ( x , y ) ∼ p 0 [ p x ( y )] − E x ∼ p 1 [ p x ( y ^ ( x ))] , (mean confidence drop from anchor to eval). The sample estimators λ ^ \hat{\lambda} λ ^ , μ ^ \hat{\mu} μ ^ replace each population expectation with its empirical average over the relevant batch. Recall y ^ ( x ) = arg max c p x ( c ) \hat{y}(x)=\arg\max_c p_x(c) y ^ ( x ) = arg max c p x ( c ) , so p x ( y ^ ( x ) ) = max c p x ( c ) p_x(\hat{y}(x))=\max_c p_x(c) p x ( y ^ ( x )) = max c p x ( c ) is the maximum softmax probability (MSP) at x x x .
Roles of the two signals. λ \lambda λ tracks distributional difference (Proposition A.2 , Corollary A.4 ): it is large when features shift, regardless of whether the shift hurts. μ \mu μ tracks predictive confusion: when the shift pushes eval points onto ϕ ∞ \phi_\infty ϕ ∞ , each eval MSP collapses to the constant q ∞ ( y ^ ∞ ) q_\infty(\hat{y}_\infty) q ∞ ( y ^ ∞ ) , and μ \mu μ grows proportionally to the gap between ID accuracy and this constant.
Assumption A.18 (ID calibration). The initial classifier is approximately calibrated on p 0 p_0 p 0 :
∣ E ( x , y ) ∼ p 0 [ p x ( y ) ] − acc q W 0 ( p 0 ) ∣ ≤ cal 0 , ∣ E x ∼ p 0 [ max c p x ( c ) ] − acc q W 0 ( p 0 ) ∣ ≤ cal 0 ′ , \left|\mathbb{E}_{(x,y)\sim p_0}[p_x(y)]-\operatorname{acc}_{q_{W_0}}(p_0)\right|\le\operatorname{cal}_0,\qquad\left|\mathbb{E}_{x\sim p_0}\left[\max_c p_x(c)\right]-\operatorname{acc}_{q_{W_0}}(p_0)\right|\le\operatorname{cal}'_0, E ( x , y ) ∼ p 0 [ p x ( y )] − acc q W 0 ( p 0 ) ≤ cal 0 , E x ∼ p 0 [ c max p x ( c ) ] − acc q W 0 ( p 0 ) ≤ cal 0 ′ , for small constants $\operatorname{cal}_0,\operatorname{cal}'_0\ll 1.
The first inequality is standard expected-calibration-error on the true-label posterior; the second says the classifier’s mean MSP on ID is close to its ID accuracy. Both hold for well-calibrated classifiers.
Assumption A.19 (OOD calibration at the collapse point). The limiting prediction q ∞ q_\infty q ∞ and the OOD label marginal p Y ∣ p 1 p_{Y\mid p_1} p Y ∣ p 1 agree at the collapse class y ^ ∞ \hat{y}_\infty y ^ ∞ :
∣ q ∞ ( y ^ ∞ ) − p Y ∣ p 1 ( y ^ ∞ ) ∣ ≤ cal ∞ . \left|q_\infty(\hat{y}_\infty)-p_{Y\mid p_1}(\hat{y}_\infty)\right|\le\operatorname{cal}_\infty. q ∞ ( y ^ ∞ ) − p Y ∣ p 1 ( y ^ ∞ ) ≤ cal ∞ .
This is weaker than full calibration on p 1 p_1 p 1 (which is unavailable without OOD labels): it only constrains the classifier’s confidence in its constant prediction to match the frequency of that class under p 1 p_1 p 1 . We treat cal ∞ \operatorname{cal}_\infty cal ∞ as a structural miscalibration that is dataset-dependent but bounded.
Assumption A.20 (Label marginal on OOD). The OOD label marginal is bounded away from a point mass: max c p Y ∣ p 1 ( c ) < 1 \max_c p_{Y\mid p_1}(c)<1 max c p Y ∣ p 1 ( c ) < 1 .
Mixture model for partial shifts. To state the theorem, we model partial shifts as two-component mixtures. Let p 1 = ( 1 − α ) p 0 + α p ⋆ p_1=(1-\alpha)p_0+\alpha p_\star p 1 = ( 1 − α ) p 0 + α p ⋆ , where α ∈ [ 0 , 1 ] \alpha\in[0,1] α ∈ [ 0 , 1 ] is the OOD fraction and p ⋆ p_\star p ⋆ is an auxiliary far-OOD distribution satisfying Assumption A.14 . Pure ID is α = 0 \alpha=0 α = 0 , pure OOD is α = 1 \alpha=1 α = 1 , and partial shifts are α ∈ ( 0 , 1 ) \alpha\in(0,1) α ∈ ( 0 , 1 ) . This parametrization captures a large class of distribution shifts and is convenient for tracking linear dependence on shift magnitude.
Proposition A.21 (Harm characterization). Under Assumptions A.14–A.20 and the mixture model p 1 = ( 1 − α ) p 0 + α p ⋆ p_1=(1-\alpha)p_0+\alpha p_\star p 1 = ( 1 − α ) p 0 + α p ⋆ , the mean confidence drop tracks the accuracy gap:
μ = Δ ( q W 0 , p 0 , p 1 ) + O ( α cal ∞ + cal 0 + cal 0 ′ + o ( 1 ) ) . (41) \mu=\Delta(q_{W_0},p_0,p_1)+O\left(\alpha\operatorname{cal}_\infty+\operatorname{cal}_0+\operatorname{cal}'_0+o(1)\right). \tag*{(41)} μ = Δ ( q W 0 , p 0 , p 1 ) + O ( α cal ∞ + cal 0 + cal 0 ′ + o ( 1 ) ) . (41) In particular, if cal 0 , cal 0 ′ , cal ∞ → 0 \operatorname{cal}_0,\operatorname{cal}'_0,\operatorname{cal}_\infty\to0 cal 0 , cal 0 ′ , cal ∞ → 0 , then μ → Δ \mu\to\Delta μ → Δ .
Proof. We compute μ \mu μ and Δ \Delta Δ separately for the mixture and compare.
Step 1 (anchor term of μ \mu μ ). By Assumption A.18 (first inequality),
E ( x , y ) ∼ p 0 [ p x ( y ) ] = acc q W 0 ( p 0 ) + O ( cal 0 ) . (42) \mathbb{E}_{(x,y)\sim p_0}[p_x(y)]=\operatorname{acc}_{q_{W_0}}(p_0)+O(\operatorname{cal}_0). \tag*{(42)} E ( x , y ) ∼ p 0 [ p x ( y )] = acc q W 0 ( p 0 ) + O ( cal 0 ) . (42)
Step 2 (eval term of μ \mu μ , ID component). Since p x ( y ^ ( x ) ) = max c p x ( c ) p_x(\hat{y}(x))=\max_c p_x(c) p x ( y ^ ( x )) = max c p x ( c ) , the mixture gives
E x ∼ p 1 [ max c p x ( c ) ] = ( 1 − α ) E x ∼ p 0 [ max c p x ( c ) ] + α E x ∼ p ⋆ [ max c p x ( c ) ] . \mathbb{E}_{x\sim p_1}\left[\max_c p_x(c)\right]=(1-\alpha)\mathbb{E}_{x\sim p_0}\left[\max_c p_x(c)\right]+\alpha\mathbb{E}_{x\sim p_\star}\left[\max_c p_x(c)\right]. E x ∼ p 1 [ c max p x ( c ) ] = ( 1 − α ) E x ∼ p 0 [ c max p x ( c ) ] + α E x ∼ p ⋆ [ c max p x ( c ) ] .
By Assumption A.18 (second inequality),
E x ∼ p 0 [ max c p x ( c ) ] = acc q W 0 ( p 0 ) + O ( cal 0 ′ ) . (43) \mathbb{E}_{x\sim p_0}\left[\max_c p_x(c)\right]=\operatorname{acc}_{q_{W_0}}(p_0)+O(\operatorname{cal}'_0). \tag*{(43)} E x ∼ p 0 [ c max p x ( c ) ] = acc q W 0 ( p 0 ) + O ( cal 0 ′ ) . (43)
Step 3 (eval term of μ \mu μ , OOD component). Under Assumption A.14 , Proposition A.15 gives q W 0 ( ⋅ ∣ x ) → q ∞ q_{W_0}(\cdot\mid x)\to q_\infty q W 0 ( ⋅ ∣ x ) → q ∞ in total variation for p ⋆ p_\star p ⋆ -a.e. x x x , so max c q W 0 ( c ∣ x ) → q ∞ ( y ^ ∞ ) \max_c q_{W_0}(c\mid x)\to q_\infty(\hat{y}_\infty) max c q W 0 ( c ∣ x ) → q ∞ ( y ^ ∞ ) . Since max c q W 0 ( c ∣ x ) ∈ [ 0 , 1 ] \max_c q_{W_0}(c\mid x)\in[0,1] max c q W 0 ( c ∣ x ) ∈ [ 0 , 1 ] is uniformly bounded, dominated convergence yields
E x ∼ p ⋆ [ max c p x ( c ) ] = q ∞ ( y ^ ∞ ) + o ( 1 ) . (44) \mathbb{E}_{x\sim p_\star}\left[\max_c p_x(c)\right]=q_\infty(\hat{y}_\infty)+o(1). \tag*{(44)} E x ∼ p ⋆ [ c max p x ( c ) ] = q ∞ ( y ^ ∞ ) + o ( 1 ) . (44)
Step 4 (combine eval terms). Substituting (43) and (44),
E x ∼ p 1 [ max c p x ( c ) ] = ( 1 − α ) [ acc ( p 0 ) + O ( c a l 0 ′ ) ] + α [ q ∞ ( y ^ ∞ ) + o ( 1 ) ] . \mathbb{E}_{x\sim p_1}\left[\max_c p_x(c)\right] = (1-\alpha)\left[\operatorname{acc}(p_0)+O(\mathrm{cal}'_0)\right]+\alpha\left[q_\infty(\hat{y}_\infty)+o(1)\right]. E x ∼ p 1 [ c max p x ( c ) ] = ( 1 − α ) [ acc ( p 0 ) + O ( cal 0 ′ ) ] + α [ q ∞ ( y ^ ∞ ) + o ( 1 ) ] .
Step 5 (compute μ \mu μ ). Subtracting from (42),
μ = E p 0 [ p x ( y ) ] − E p 1 [ max c p x ( c ) ] = [ acc ( p 0 ) + O ( c a l 0 ) ] − [ ( 1 − α ) ( acc ( p 0 ) + O ( c a l 0 ′ ) ) + α ( q ∞ ( y ^ ∞ ) + o ( 1 ) ) ] = α ( acc ( p 0 ) − q ∞ ( y ^ ∞ ) ) + O ( c a l 0 + c a l 0 ′ ) + α o ( 1 ) . (45) \begin{aligned}
\mu&= \mathbb{E}_{p_0}[p_x(y)]-\mathbb{E}_{p_1}\left[\max_c p_x(c)\right]\\
&=\left[\operatorname{acc}(p_0)+O(\mathrm{cal}_0)\right]-\left[(1-\alpha)\left(\operatorname{acc}(p_0)+O(\mathrm{cal}'_0)\right)+\alpha\left(q_\infty(\hat{y}_\infty)+o(1)\right)\right]\\
&=\alpha\left(\operatorname{acc}(p_0)-q_\infty(\hat{y}_\infty)\right)+O(\mathrm{cal}_0+\mathrm{cal}'_0)+\alpha o(1). \tag*{(45)}
\end{aligned} μ = E p 0 [ p x ( y )] − E p 1 [ c max p x ( c ) ] = [ acc ( p 0 ) + O ( cal 0 ) ] − [ ( 1 − α ) ( acc ( p 0 ) + O ( cal 0 ′ ) ) + α ( q ∞ ( y ^ ∞ ) + o ( 1 ) ) ] = α ( acc ( p 0 ) − q ∞ ( y ^ ∞ ) ) + O ( cal 0 + cal 0 ′ ) + α o ( 1 ) . (45)
Step 6 (compute Δ \Delta Δ ). Corollary A.16 applied to p ⋆ p_\star p ⋆ gives acc q W 0 ( p ⋆ ) = p Y ∣ p ⋆ ( y ^ ∞ ) + o ( 1 ) \operatorname{acc}_{q_{W_0}}(p_\star)=p_{Y\mid p_\star}(\hat{y}_\infty)+o(1) acc q W 0 ( p ⋆ ) = p Y ∣ p ⋆ ( y ^ ∞ ) + o ( 1 ) . For the mixture,
acc q W 0 ( p 1 ) = ( 1 − α ) acc q W 0 ( p 0 ) + α acc q W 0 ( p ⋆ ) = ( 1 − α ) acc ( p 0 ) + α p Y ∣ p ⋆ ( y ^ ∞ ) + o ( 1 ) , \operatorname{acc}_{q_{W_0}}(p_1)=(1-\alpha)\operatorname{acc}_{q_{W_0}}(p_0)+\alpha\operatorname{acc}_{q_{W_0}}(p_\star)=(1-\alpha)\operatorname{acc}(p_0)+\alpha p_{Y\mid p_\star}(\hat{y}_\infty)+o(1), acc q W 0 ( p 1 ) = ( 1 − α ) acc q W 0 ( p 0 ) + α acc q W 0 ( p ⋆ ) = ( 1 − α ) acc ( p 0 ) + α p Y ∣ p ⋆ ( y ^ ∞ ) + o ( 1 ) ,
hence
Δ = acc ( p 0 ) − acc q W 0 ( p 1 ) = α ( acc ( p 0 ) − p Y ∣ p ⋆ ( y ^ ∞ ) ) + o ( 1 ) . (46) \Delta=\operatorname{acc}(p_0)-\operatorname{acc}_{q_{W_0}}(p_1)=\alpha\left(\operatorname{acc}(p_0)-p_{Y\mid p_\star}(\hat{y}_\infty)\right)+o(1). \tag*{(46)} Δ = acc ( p 0 ) − acc q W 0 ( p 1 ) = α ( acc ( p 0 ) − p Y ∣ p ⋆ ( y ^ ∞ ) ) + o ( 1 ) . (46)
Step 7 (compare). Subtract (46) from (45):
μ − Δ = α ( p Y ∣ p ⋆ ( y ^ ∞ ) − q ∞ ( y ^ ∞ ) ) + O ( c a l 0 + c a l 0 ′ ) + o ( 1 ) . \mu-\Delta=\alpha\left(p_{Y\mid p_\star}(\hat{y}_\infty)-q_\infty(\hat{y}_\infty)\right)+O(\mathrm{cal}_0+\mathrm{cal}'_0)+o(1). μ − Δ = α ( p Y ∣ p ⋆ ( y ^ ∞ ) − q ∞ ( y ^ ∞ ) ) + O ( cal 0 + cal 0 ′ ) + o ( 1 ) .
By Assumption A.19 applied to p ⋆ p_\star p ⋆ , ∣ p Y ∣ p ⋆ ( y ^ ∞ ) − q ∞ ( y ^ ∞ ) ∣ ≤ c a l ∞ \left|p_{Y\mid p_\star}(\hat{y}_\infty)-q_\infty(\hat{y}_\infty)\right|\leq\mathrm{cal}_\infty p Y ∣ p ⋆ ( y ^ ∞ ) − q ∞ ( y ^ ∞ ) ≤ cal ∞ , so
∣ μ − Δ ∣ ≤ α c a l ∞ + O ( c a l 0 + c a l 0 ′ ) + o ( 1 ) , |\mu-\Delta|\leq\alpha\mathrm{cal}_\infty+O(\mathrm{cal}_0+\mathrm{cal}'_0)+o(1), ∣ μ − Δ∣ ≤ α cal ∞ + O ( cal 0 + cal 0 ′ ) + o ( 1 ) ,
which is (41).
Sample-version corollary. The sample estimator μ ^ \hat{\mu} μ ^ differs from the population μ \mu μ by a Hoeffding-style concentration term (both summands take values in [ 0 , 1 ] [0,1] [ 0 , 1 ] ):
∣ μ ^ − μ ∣ = O ( 1 / n a + 1 / n e ) |\hat{\mu}-\mu|=O\left(1/\sqrt{n_a}+1/\sqrt{n_e}\right) ∣ μ ^ − μ ∣ = O ( 1/ n a + 1/ n e )
with high probability. Combining with Proposition A.21,
μ ^ = Δ + O ( α c a l ∞ + c a l 0 + c a l 0 ′ + 1 / n ) , (47) \hat{\mu}=\Delta+O\left(\alpha\mathrm{cal}_\infty+\mathrm{cal}_0+\mathrm{cal}'_0+1/\sqrt{n}\right), \tag*{(47)} μ ^ = Δ + O ( α cal ∞ + cal 0 + cal 0 ′ + 1/ n ) , (47)
where n = min ( n a , n e ) n=\min(n_a,n_e) n = min ( n a , n e ) .
The role of λ ^ \hat{\lambda} λ ^ . Proposition A.21 establishes that μ ^ \hat{\mu} μ ^ alone estimates Δ \Delta Δ up to calibration and sampling errors. The anchor-loss signal λ ^ \hat{\lambda} λ ^ does not appear in the statement. Its role in the paper is auxiliary but practically important:
Robustness gate. When μ ^ \hat{\mu} μ ^ is small, it could mean either no harm (Δ ≈ 0 \Delta\approx0 Δ ≈ 0 ) or severe miscalibration (the confidence-based estimator is unreliable). Checking λ ^ > τ λ \hat{\lambda}>\tau_\lambda λ ^ > τ λ confirms that a distributional shift is present and therefore that μ ^ \hat{\mu} μ ^ is being estimated in a non-trivial regime.
Calibration-free fallback. λ ^ \hat{\lambda} λ ^ requires no calibration assumptions; it fires under Assumption A.3 alone. If Assumptions A.18–A.19 are violated, λ ^ \hat{\lambda} λ ^ can still detect distributional shift, though not necessarily harm.
Two-signal operating point. A practical harm detector declares “harmful shift” when both λ ^ > τ λ \hat{\lambda}>\tau_\lambda λ ^ > τ λ and μ ^ > τ μ \hat{\mu}>\tau_\mu μ ^ > τ μ (Figure 9). The upper-right quadrant of the ( λ ^ , μ ^ ) (\hat{\lambda},\hat{\mu}) ( λ ^ , μ ^ ) plane is the high-precision region; the lower-right contains benign shifts; the upper-left corresponds to miscalibrated estimators or rare silent-harm cases.
Definition A.22 (Composed two-signal detector). The composed detector alerts if and only if the conformal λ \lambda λ -test of Proposition A.11 rejects and μ ^ > τ μ \hat{\mu}>\tau_\mu μ ^ > τ μ .
We evaluate the composed detector in Appendix § 11 .§ 16.2 ; λ \lambda λ remains the primary, conformally certified statistic.
Visualizing the two-signal plane. Proposition A.21 predicts that μ ^ ≈ Δ \hat{\mu} \approx\Delta μ ^ ≈ Δ up to calibration and sampling errors, and that harmful shifts populate a specific region of the ( λ ^ , μ ^ ) (\hat{\lambda},\hat{\mu}) ( λ ^ , μ ^ ) plane (Figure 9 ).
Figure 9. Two-signal detector space. Each dataset is a point in the ( λ ^ , μ ^ ) (\hat{\lambda},\hat{\mu}) ( λ ^ , μ ^ ) plane. The current λ ^ \hat{\lambda} λ ^ -only detector uses only the horizontal axis and cannot distinguish benign shifts (right-lower) from harmful shifts (upper-right). By Proposition A.21 , μ ^ \hat{\mu} μ ^ alone estimates Δ \Delta Δ up to calibration errors, so the vertical axis is the harm-magnitude estimator. Gating on λ ^ > τ λ \hat{\lambda} > \tau_{\lambda} λ ^ > τ λ ensures that a distributional shift is actually present before trusting μ ^ \hat{\mu} μ ^ (robustness gate); the conjunction λ ^ > τ λ ∧ μ ^ > τ μ \hat{\lambda} > \tau_{\lambda} \land\hat{\mu} > \tau_{\mu} λ ^ > τ λ ∧ μ ^ > τ μ selects the upper-right region (red box). The upper-left “silent harm” quadrant is theoretically possible but rare in practice, because Nagler’s tilting links feature shift to prediction confusion.
Summary of Assumptions
Table 2 collects all assumptions used in the appendix. Of the ten, only Assumption A.3 and Assumption A.19 are genuinely empirical (i.e., not provable from the setup alone). The remainder are design choices, standard regularity, or consequences derived from Nagler’s tilting.
Key assumptions. Two assumptions are inherently empirical:
Assumption A.3 (feature orthogonality) is the scope boundary of the separation argument (Theorem A.9 ). Where it fails, when OOD features retain substantial ID-like structure along the directions relevant for classification, the theorem does not guarantee E [ λ O O D ] < E [ λ I D ] \mathbb{E}[\lambda_{\mathrm{OOD}}] < \mathbb{E}[\lambda_{\mathrm{ID}}] E [ λ OOD ] < E [ λ ID ] .
Assumption A.19 (OOD calibration at the collapse point) is the scope boundary of the harm argument (Proposition A.21). Where it fails, μ ^ \hat{\mu} μ ^ no longer tracks Δ \Delta Δ and can systematically over- or under-estimate harm. It is also the most delicate assumption: it is the only one that constrains behavior on the shifted distribution, and without OOD labels we cannot directly verify it.
Plausibility of the remaining harm-specific assumptions. Beyond the key pair, four further conditions are relevant to the harm theorem (Proposition A.21):
Assumption A.14 (far-OOD regime) is an idealized limit. For near-OOD, Proposition A.15 holds only approximately, so Proposition A.21 degrades correspondingly; a formal near-OOD rate is left to future work.
The mixture model p 1 = ( 1 − α ) p 0 + α p ∗ p_1=(1-\alpha)p_0+\alpha p_\ast p 1 = ( 1 − α ) p 0 + α p ∗ used to state Proposition A.21 is a modeling choice. Real shifts may not decompose this way, but for general p 1 p_1 p 1 the same argument applies with α \alpha α interpreted as the effective OOD mass ∫ 1 { x is far-OOD } d p 1 \int\mathbf{1}\{x\text{ is far-OOD}\}\,dp_1 ∫ 1 { x is far-OOD } d p 1 .
What holds unconditionally. The density-ratio decomposition of Lemma A.12 and the TV upper bound of Corollary A.13 are both exact and require no assumptions. They already suffice to rebut the framing “λ ^ \hat{\lambda} λ ^ measures harm” and to motivate the need for a second signal beyond λ ^ \hat{\lambda} λ ^ .
Scope and failure modes
Catalog of failure modes
A PFN at deployment can exhibit many distinct kinds of failure, and CALD is targeted at a specific subset of them. We describe the failure modes a PFN may encounter, and indicate for each one whether CALD is empirically evaluated against it and whether the theory of Appendix A covers it. The space decomposes along three axes (see Table 3 ):
Table 3. Scope of CALD. Failure modes a PFN may encounter at deployment, with whether CALD is empirically evaluated against it and whether the theory of Appendix A covers it. ✓ indicates full empirical coverage; partial indicates a heuristic check (e.g., a severity sweep without a formal guarantee); × indicates absence.
Distribution shift can be covariate (p 0 ( x ) ≠ p 1 ( x ) p_0(x) \ne p_1(x) p 0 ( x ) = p 1 ( x ) with p ( y ∣ x ) p(y \mid x) p ( y ∣ x ) unchanged), label (p 0 ( y ) ≠ p 1 ( y ) p_0(y) \ne p_1(y) p 0 ( y ) = p 1 ( y ) with p ( x ∣ y ) p(x \mid y) p ( x ∣ y ) unchanged), concept (p ( y ∣ x ) p(y \mid x) p ( y ∣ x ) itself changes), or structured variants such as subpopulation (minority group reweighted) and open-set (novel classes appear at test time).
Within distribution shift, the shift may be harmful (predictive accuracy drops) or benign (accuracy preserved or improved). CALD is calibrated to harm rather than to distance .
Non-distributional failure modes sit outside the i.i.d. framing of conformal calibration entirely: schema mismatch (different feature columns or dtypes), adversarial inputs, insufficient support set, numerical issues (NaNs, out-of-range values), and miscalibration without distributional change.
Empirical investigation: covariate shift without an accuracy drop
The benign-by-accuracy row of Table 3 deserves a closer look. Among the seven benign datasets of Table 1 (below the Hoeffding harm threshold Δ ∗ ≈ 4.84 \Delta^* \approx4.84 Δ ∗ ≈ 4.84 pp at δ = 0.05 \delta= 0.05 δ = 0.05 , N e x p 2 = 1280 N_{\mathrm{exp2}} = 1280 N exp2 = 1280 , defined in Appendix C.3), four deserve a closer look:
D b e n i g n = { diabetes_readmission , bank_marketing , credit_default , folktables } . \mathcal{D}_{\mathrm{benign}} = \{\text{diabetes\_readmission},\ \text{bank\_marketing},\ \text{credit\_default},\ \text{folktables}\}. D benign = { diabetes_readmission , bank_marketing , credit_default , folktables } .
On these four datasets, the post-finetune anchor-loss test of CALD nevertheless rejects H 0 : X e v a l ∗ ∼ p 0 H_0 : X_{\mathrm{eval}}^* \sim p_0 H 0 : X eval ∗ ∼ p 0 at high power for at least one of the two methods (cald-tabpfn, cald-tabicl) on every dataset. The full numbers are reproduced in Table 4 .
Table 4. CALD and standalone shift detectors on the four datasets where Δ < Δ ⋆ \Delta< \Delta^\star Δ < Δ ⋆ . AUROC computed on the same calibration protocol as Table 10 (10 seeds, 50 calibration rounds, support and anchor sets fixed within each seed). Every distribution-shift detector that does not condition on harm (KNN, MMD, Mahalanobis, Energy, MSP) also fires on these datasets at AUROC ≥ 0.9 \ge0.9 ≥ 0.9 , indicating real distributional shift in feature space. Δ a c c : = acc ( p 0 ) − acc ( p 1 ) \Delta_{\mathrm{acc}} := \operatorname{acc}(p_0)-\operatorname{acc}(p_1) Δ acc := acc ( p 0 ) − acc ( p 1 ) (positive = OOD accuracy drop). † ^\dagger † The LR-stability heuristic (Algorithm 1) flags this cell as unstable and falls back to η = 10 − 4 \eta=10^{-4} η = 1 0 − 4 , where the signal collapses; see §B.6.
Reading the table. The AUROC values for KNN, MMD, Mahalanobis, Energy, and MSP show that the four datasets are not edge cases: their ID and OOD distributions are easily distinguishable in feature space by every standalone shift detector we evaluate. The benign label is purely a property of the predictive accuracy gap Δ ( q , p 0 , p 1 ) \Delta(q, p_0, p_1) Δ ( q , p 0 , p 1 ) as decomposed in Lemma A.12: it places strong constraints on how mass moves on the mistake region M = { ( x , y ) : ⟦ y ≠ arg max c q W 0 ( c ∣ x ) ⟧ = 1 } M = \{(x, y) : \llbracket y \ne\operatorname*{arg\,max}_c q_{W_0}(c \mid x) \rrbracket= 1\} M = {( x , y ) : [ [ y = arg max c q W 0 ( c ∣ x ) ] ] = 1 } , but no constraints whatsoever on how mass moves on M c M^c M c . In all four datasets we have observed heavy reweighting of M c M^c M c (which is most of the input domain when the pretrained classifier q W 0 q_{W_0} q W 0 is accurate on p 0 p_0 p 0 ): CALD , like every shift detector that uses information about M c M^c M c , picks this up.
Two sub-mechanisms within Theorem A.9
The above empirical observation is consistent with, and indeed predicted by, the multi-step main separation theorem. Recall the central inequality (Theorem A.9 ):
E [ λ I D ] − E [ λ O O D ] ≥ T η ( γ − ϵ B ϕ 2 B C ) − O ( T 2 η 2 L B g 2 ) . (48) \mathbb{E}[\lambda_{\mathrm{ID}}]-\mathbb{E}[\lambda_{\mathrm{OOD}}]\ge T\eta\left(\gamma-\epsilon B_{\phi}^{2}B_C\right)-O\left(T^{2}\eta^{2}LB_g^{2}\right). \tag*{(48)} E [ λ ID ] − E [ λ OOD ] ≥ T η ( γ − ϵ B ϕ 2 B C ) − O ( T 2 η 2 L B g 2 ) . (48)
where γ : = − E p 0 ⊗ p 0 [ C i j K i j ] > 0 \gamma:=-\mathbb{E}_{p_0\otimes p_0}[C_{ij}K_{ij}]>0 γ := − E p 0 ⊗ p 0 [ C ij K ij ] > 0 is the ID interference strength (Proposition A.6) and ϵ \epsilon ϵ is the OOD feature-orthogonality parameter (Assumption A.3 and Corollary A.4). The detector fires when the right-hand side is positive, i.e. when
γ − ϵ B ϕ 2 B C > 0. (49) \gamma-\epsilon B_{\phi}^{2}B_C>0. \tag*{(49)} γ − ϵ B ϕ 2 B C > 0. (49)
The proof of Theorem A.9 (Appendix § 8 .§ 16.3 ) makes the firing condition slightly richer than (49) suggests. Specializing equation (34) to the T T T -step regime and decomposing the cross-term in polar form ⟨ g ˉ a , g ˉ e ⟩ F = ∥ g ˉ a ∥ F ∥ g ˉ e ∥ F cos θ \langle\bar{g}_a,\bar{g}_e\rangle_F=\|\bar{g}_a\|_F\|\bar{g}_e\|_F\cos\theta ⟨ g ˉ a , g ˉ e ⟩ F = ∥ g ˉ a ∥ F ∥ g ˉ e ∥ F cos θ , where θ \theta θ is the angle between the time-averaged anchor and disagree gradients, yields
E [ λ I D − λ O O D ] = T η [ E ( ∥ g ˉ a ∥ F ∥ g ˉ e I D ∥ F cos θ I D ) − E ( ∥ g ˉ a ∥ F ∥ g ˉ e O O D ∥ F cos θ O O D ) ] + O ( T 2 η 2 L B g 2 ) . (50) \mathbb{E}[\lambda_{\mathrm{ID}}-\lambda_{\mathrm{OOD}}]=T\eta\left[\mathbb{E}\left(\|\bar{g}_a\|_F\|\bar{g}_e^{\mathrm{ID}}\|_F\cos\theta_{\mathrm{ID}}\right)-\mathbb{E}\left(\|\bar{g}_a\|_F\|\bar{g}_e^{\mathrm{OOD}}\|_F\cos\theta_{\mathrm{OOD}}\right)\right]+O\left(T^{2}\eta^{2}LB_g^{2}\right). \tag*{(50)} E [ λ ID − λ OOD ] = T η [ E ( ∥ g ˉ a ∥ F ∥ g ˉ e ID ∥ F cos θ ID ) − E ( ∥ g ˉ a ∥ F ∥ g ˉ e OOD ∥ F cos θ OOD ) ] + O ( T 2 η 2 L B g 2 ) . (50)
under the leading-order identification g ˉ a I D ≈ g ˉ a O O D = : g ˉ a \bar{g}_a^{\mathrm{ID}}\approx\bar{g}_a^{\mathrm{OOD}}=:\bar{g}_a g ˉ a ID ≈ g ˉ a OOD =: g ˉ a established in the theorem’s proof. The integrated separation is therefore positive whenever
E ( ∥ g ˉ a ∥ F ∥ g ˉ e I D ∥ F cos θ I D ) < E ( ∥ g ˉ a ∥ F ∥ g ˉ e O O D ∥ F cos θ O O D ) . (51) \mathbb{E}\left(\|\bar{g}_a\|_F\|\bar{g}_e^{\mathrm{ID}}\|_F\cos\theta_{\mathrm{ID}}\right)<\mathbb{E}\left(\|\bar{g}_a\|_F\|\bar{g}_e^{\mathrm{OOD}}\|_F\cos\theta_{\mathrm{OOD}}\right). \tag*{(51)} E ( ∥ g ˉ a ∥ F ∥ g ˉ e ID ∥ F cos θ ID ) < E ( ∥ g ˉ a ∥ F ∥ g ˉ e OOD ∥ F cos θ OOD ) . (51)
The right-hand side can be made larger than the left-hand side by either of the following two mutually compatible mechanisms:
(M1) Cosine shift toward less conflict. cos θ O O D > cos θ I D \cos\theta_{\mathrm{OOD}}>\cos\theta_{\mathrm{ID}} cos θ OOD > cos θ ID with ∥ g ˉ e O O D ∥ F ≈ ∥ g ˉ e I D ∥ F \|\bar{g}_e^{\mathrm{OOD}}\|_F\approx\|\bar{g}_e^{\mathrm{ID}}\|_F ∥ g ˉ e OOD ∥ F ≈ ∥ g ˉ e ID ∥ F . Even a small positive shift Δ cos : = cos θ O O D − cos θ I D \Delta\cos:=\cos\theta_{\mathrm{OOD}}-\cos\theta_{\mathrm{ID}} Δ cos := cos θ OOD − cos θ ID is enough to make (51) positive when θ I D \theta_{\mathrm{ID}} θ ID is in a strongly-conflicting regime (cos θ I D → − 1 \cos\theta_{\mathrm{ID}}\to-1 cos θ ID → − 1 ).
(M2) Eval-gradient magnitude shrinkage. ∥ g ˉ e O O D ∥ F < ∥ g ˉ e I D ∥ F \|\bar{g}_e^{\mathrm{OOD}}\|_F<\|\bar{g}_e^{\mathrm{ID}}\|_F ∥ g ˉ e OOD ∥ F < ∥ g ˉ e ID ∥ F with cos θ O O D ≈ cos θ I D \cos\theta_{\mathrm{OOD}}\approx\cos\theta_{\mathrm{ID}} cos θ OOD ≈ cos θ ID (or even cos θ O O D < cos θ I D \cos\theta_{\mathrm{OOD}}<\cos\theta_{\mathrm{ID}} cos θ OOD < cos θ ID , provided the magnitude attenuation dominates). This is the canonical Nagler-tilting picture of Appendix § 8 .§ 16.1 : under far-OOD inputs the prediction collapses, the disagree loss saturates, and ∥ g ˉ e ∥ F → 0 \|\bar{g}_e\|_F\to0 ∥ g ˉ e ∥ F → 0 .
The original informal argument in the body of the paper (§ 4.1 ) emphasized M2; it presented OOD as a regime where “the PFN is uncertain on its own pseudolabels, ∇ L e v a l \nabla\mathcal{L}_{\mathrm{eval}} ∇ L eval is small in magnitude and approximately orthogonal to ∇ L a n c \nabla\mathcal{L}_{\mathrm{anc}} ∇ L anc .” Theorem A.9 ’s actual statement is more permissive: the firing condition (51) holds whenever either mechanism produces enough integrated effect. M1 is sufficient on its own. M2 is sufficient on its own. The two can also reinforce or partially cancel.
Why benign datasets satisfy (51). On the benign-by-accuracy datasets, q W 0 q_{W_0} q W 0 classifies the OOD batch with accuracy comparable to or better than ID, so the prediction-collapse picture of Proposition A.15 does not apply: the model is confident on OOD, and ∥ g ˉ e O O D ∥ F \lVert\bar{g}_e^{\mathrm{OOD}}\rVert_F ∥ g ˉ e OOD ∥ F is comparable to ∥ g ˉ e I D ∥ F \lVert\bar{g}_e^{\mathrm{ID}}\rVert_F ∥ g ˉ e ID ∥ F . M2 is muted. But the geometry of the OOD batch in feature space is still different: a non-trivial fraction of OOD points fall in regions where the kernel K i j = ⟨ ϕ ~ ( x i a ) , ϕ ~ ( x j e ) ⟩ K_{ij}=\langle\tilde{\phi}(x_i^a),\tilde{\phi}(x_j^e)\rangle K ij = ⟨ ϕ ~ ( x i a ) , ϕ ~ ( x j e )⟩ has a distribution that is no longer centered exactly where it sits under p 0 p_0 p 0 . This perturbs cos θ \cos\theta cos θ by a small amount, which integrated over T T T steps suffices for (51) to hold.
The benign-firing cells therefore correspond to the γ \gamma γ -driven branch of (49): γ \gamma γ remains close to its ID value (p 0 p_0 p 0 is unchanged on the anchor side) and ϵ B ϕ 2 B C \epsilon B_\phi^2 B_C ϵ B ϕ 2 B C does not need to vanish for the bound to be active: a small Δ cos \Delta\cos Δ cos produced by partial feature reorganization is enough.
Gradient-probe diagnostics
To verify the M1/M2 picture empirically, we instrument the inner finetune loop of CALD to log the per-step gradient quantities of equation (50) . For each of the four benign datasets and two harmful controls (camelyon17, covertype), and for each of the two methods (cald-tabpfn, cald-tabicl), we run n r o u n d s = 10 n_{\mathrm{rounds}}=10 n rounds = 10 probe rounds at three seeds with the LR selected by the same heuristic as in Table 10 . At every step t = 1 , … , T = 50 t=1,\ldots,T=50 t = 1 , … , T = 50 within every round we record ∥ g a ( t ) ∥ F 2 \lVert g_a^{(t)}\rVert_F^2 ∥ g a ( t ) ∥ F 2 , ∥ g e ( t ) ∥ F 2 \lVert g_e^{(t)}\rVert_F^2 ∥ g e ( t ) ∥ F 2 , ⟨ g a ( t ) , g e ( t ) ⟩ F \langle g_a^{(t)},g_e^{(t)}\rangle_F ⟨ g a ( t ) , g e ( t ) ⟩ F , and Λ a n c ( W t ) \Lambda_{\mathrm{anc}}(W_t) Λ anc ( W t ) . We additionally log the pre-finetune cosine similarity cos θ 0 = ⟨ g a ( 0 ) , g e ( 0 ) ⟩ F / ( ∥ g a ( 0 ) ∥ F ∥ g e ( 0 ) ∥ F ) \cos\theta_0=\langle g_a^{(0)},g_e^{(0)}\rangle_F/(\lVert g_a^{(0)}\rVert_F\lVert g_e^{(0)}\rVert_F) cos θ 0 = ⟨ g a ( 0 ) , g e ( 0 ) ⟩ F / (∥ g a ( 0 ) ∥ F ∥ g e ( 0 ) ∥ F ) on each round.
The probe code (detection/viz/cald_gradient_probe.py) calls into the reference implementation detection/core/finetune.py:run_one_iteration for the cald-tabpfn arm and uses a self-contained instrumented loop for cald-tabicl. Aggregating across seeds and rounds for each (dataset, method) cell, we report:
λ g a p : = E [ λ I D ] − E [ λ O O D ] \lambda_{\mathrm{gap}}:=\mathbb{E}[\lambda_{\mathrm{ID}}]-\mathbb{E}[\lambda_{\mathrm{OOD}}] λ gap := E [ λ ID ] − E [ λ OOD ] , the directly observed integrand of the conformal test (Appendix § 8 .§ 16.4 );
ρ e ( 50 ) : = E ∥ g ˉ e O O D ∥ F 2 / E ∥ g ˉ e I D ∥ F 2 \rho_e^{(50)}:=\mathbb{E}\lVert\bar{g}_e^{\mathrm{OOD}}\rVert_F^2/\mathbb{E}\lVert\bar{g}_e^{\mathrm{ID}}\rVert_F^2 ρ e ( 50 ) := E ∥ g ˉ e OOD ∥ F 2 / E ∥ g ˉ e ID ∥ F 2 , averaged over all 50 finetune steps and across rounds and seeds;
Δ cos : = E [ cos θ 0 O O D ] − E [ cos θ 0 I D ] \Delta\cos:=\mathbb{E}[\cos\theta_0^{\mathrm{OOD}}]-\mathbb{E}[\cos\theta_0^{\mathrm{ID}}] Δ cos := E [ cos θ 0 OOD ] − E [ cos θ 0 ID ] , the pre-finetune cosine shift;
H I D , H O O D H_{\mathrm{ID}},H_{\mathrm{OOD}} H ID , H OOD , the mean entropy of q W 0 ( ⋅ ∣ x e ) q_{W_0}(\cdot\mid x_e) q W 0 ( ⋅ ∣ x e ) on the eval batch (a check on whether the prediction-collapse picture of Proposition A.15 is active).
Table 5 reports these four quantities together with the conformal AUROC for the (dataset, method) cell.
Table 5. Gradient-probe summary across the eight benign cells and four harmful-control cells. ρ e ( 50 ) < 1 \rho_e^{(50)}<1 ρ e ( 50 ) < 1 indicates eval-gradient magnitude shrinkage on OOD (mechanism M2). Δ cos > 0 \Delta\cos>0 Δ cos > 0 indicates a cosine shift toward less conflict on OOD (mechanism M1). Cells with AUROC ≥ 0.99 \ge0.99 ≥ 0.99 exhibit at least one of M1, M2 with the correct sign (and often both); cells with AUROC < 0.7 <0.7 < 0.7 exhibit neither.
Reading Table 5 . The eight benign cells fall into a consistent pattern with respect to mechanism M1: in five of eight cells, Δ cos > 0 \Delta_{\cos} > 0 Δ c o s > 0 at magnitudes between + 0.001 +0.001 + 0.001 and + 0.036 +0.036 + 0.036 . The exceptions are folktables (both methods, Δ cos \Delta_{\cos} Δ c o s negative or zero) and credit_default/cald-tabicl (Δ cos = − 0.002 \Delta_{\cos} = -0.002 Δ c o s = − 0.002 ). On those exception cells, M2 carries the signal: ρ e ( 50 ) \rho_{\mathrm{e}}^{(50)} ρ e ( 50 ) is well below 1, indicating the magnitude attenuation. The only cell where neither mechanism is active is folktables/cald-tabpfn at the unstable LR, with ρ e ( 50 ) = 0.878 \rho_{\mathrm{e}}^{(50)} = 0.878 ρ e ( 50 ) = 0.878 and Δ cos = − 0.002 \Delta_{\cos} = -0.002 Δ c o s = − 0.002 both close to neutral; the λ g a p \lambda_{\mathrm{gap}} λ gap is correspondingly − 0.004 -0.004 − 0.004 , and the conformal test does not reject (§B.6).
The four harmful controls are consistent with M2 being the dominant mechanism: ρ e ( 50 ) \rho_{\mathrm{e}}^{(50)} ρ e ( 50 ) ranges from 0.060 to 0.719, all well below 1, while Δ cos \Delta_{\cos} Δ c o s takes both signs depending on dataset. The covertype/cald-tabpfn cell is the cleanest example of M1 and M2 firing together, with the cosine flipping sign (cos θ 0 I D = − 0.697 → cos θ 0 O O D = + 0.240 \cos\theta_0^{\mathrm{ID}} = -0.697 \to\cos\theta_0^{\mathrm{OOD}} = +0.240 cos θ 0 ID = − 0.697 → cos θ 0 OOD = + 0.240 , Δ cos = + 0.937 \Delta_{\cos} = +0.937 Δ c o s = + 0.937 ) and the magnitude collapsing by a factor of ρ e ( 50 ) = 0.27 \rho_{\mathrm{e}}^{(50)} = 0.27 ρ e ( 50 ) = 0.27 .
Per-seed consistency. The aggregate Δ cos \Delta_{\cos} Δ c o s values reported above are seed-means; the underlying distribution of cos θ 0 \cos\theta_0 cos θ 0 is sensitive to the random init of the decoder, which can flip its sign across seeds. To guard against the pathology of two seeds with opposite signs averaging to zero, we also computed Δ cos \Delta_{\cos} Δ c o s per-seed for the eight benign cells (24 seed–cell pairs). On diabetes_readmission and bank_marketing, Δ cos \Delta_{\cos} Δ c o s is positive in all six seeds for both methods; on credit_default/cald-tabpfn, two of three seeds have Δ cos > 0 \Delta_{\cos} > 0 Δ c o s > 0 and the third is small negative (− 0.020 -0.020 − 0.020 ). On folktables/cald-tabpfn, Δ cos \Delta_{\cos} Δ c o s is essentially zero in all three seeds. The aggregate signs in Table 5 are not seed-mean artifacts.
Case studies
We highlight three (dataset, method) cells that span the qualitative regimes.
Case 1: diabetes_readmission/cald-tabpfn (M1, benign). Despite Δ a c c = − 2.34 \Delta_{\mathrm{acc}} = -2.34 Δ acc = − 2.34 pp (model is more accurate on OOD than ID), the gradient probe records a λ g a p \lambda_{\mathrm{gap}} λ gap of + 0.352 +0.352 + 0.352 , larger than every harmful control except covertype/cald-tabicl. The mechanism is purely M1: ρ e ( 50 ) = 0.42 \rho_{\mathrm{e}}^{(50)} = 0.42 ρ e ( 50 ) = 0.42 shows mild magnitude attenuation but cos θ 0 I D = − 1.000 \cos\theta_0^{\mathrm{ID}} = -1.000 cos θ 0 ID = − 1.000 vs cos θ 0 O O D = − 0.973 \cos\theta_0^{\mathrm{OOD}} = -0.973 cos θ 0 OOD = − 0.973 shows the cosine moving very slightly out of the strict-conflict regime. Integrated over T = 50 T = 50 T = 50 steps with η = 10 − 2 \eta= 10^{-2} η = 1 0 − 2 , this Δ cos = + 0.027 \Delta_{\cos} = +0.027 Δ c o s = + 0.027 is enough to satisfy (51). The pre-finetune entropy H O O D = 0.297 H_{\mathrm{OOD}} = 0.297 H OOD = 0.297 is in fact slightly below H I D = 0.318 H_{\mathrm{ID}} = 0.318 H ID = 0.318 , ruling out the prediction-collapse picture for this dataset.
Figure 10 plots ∥ g e ( t ) ∥ F 2 \lVert g_{\mathrm{e}}^{(t)} \rVert_F^2 ∥ g e ( t ) ∥ F 2 , ⟨ g a ( t ) , g e ( t ) ⟩ F \langle g_{\mathrm{a}}^{(t)}, g_{\mathrm{e}}^{(t)} \rangle_F ⟨ g a ( t ) , g e ( t ) ⟩ F , and L a n c ( W t ) \mathcal{L}_{\mathrm{anc}}(W_t) L anc ( W t ) versus t t t for ID and OOD on this cell. The middle panel is the diagnostic visual: the cross-term on ID descends to ≈ − 80 \approx-80 ≈ − 80 over the trajectory while the cross-term on OOD plateaus near − 10 -10 − 10 . Anchor descent on OOD therefore proceeds with five-fold less integrated interference than on ID, and the right panel shows the consequence: L a n c ( W T ) \mathcal{L}_{\mathrm{anc}}(W_T) L anc ( W T ) on OOD reaches ≈ 0.4 \approx0.4 ≈ 0.4 while on ID it stays around 0.75.
Figure 10. Mechanism M1 on a benign dataset (diabetes_readmission/cald-tabpfn). Per-step trajectories of ∥ g e ( t ) ∥ F 2 \lVert g_{\mathrm{e}}^{(t)} \rVert_F^2 ∥ g e ( t ) ∥ F 2 (left), ⟨ g a , g e ⟩ F \langle g_{\mathrm{a}}, g_{\mathrm{e}} \rangle_F ⟨ g a , g e ⟩ F (middle), and L a n c ( W t ) \mathcal{L}_{\mathrm{anc}}(W_t) L anc ( W t ) (right), median across rounds and seeds with interquartile shading. The cross-term diverges between ID (more negative) and OOD (less negative), driving the integrated λ g a p = + 0.352 \lambda_{\mathrm{gap}} = +0.352 λ gap = + 0.352 even though Δ a c c = − 2.34 \Delta_{\mathrm{acc}} = -2.34 Δ acc = − 2.34 pp.
Case 2: covertype/cald-tabpfn (M1+M2, harmful). The two mechanisms both fire and reinforce each other. ρ e ( 50 ) = 0.269 \rho_{\mathrm{e}}^{(50)} = 0.269 ρ e ( 50 ) = 0.269 shows strong magnitude collapse (M2): the OOD prediction is near-uniform on 7 classes (consistent with H O O D = 1.479 H_{\mathrm{OOD}} = 1.479 H OOD = 1.479 approaching the maximal entropy log 7 ≈ 1.95 \log7 \approx1.95 log 7 ≈ 1.95 ), and the disagree loss saturates. Simultaneously, Δ cos = + 0.937 \Delta_{\cos} = +0.937 Δ c o s = + 0.937 (M1): the cosine flips from anti-aligned (cos θ 0 I D = − 0.697 \cos\theta^{\mathrm{ID}}_0 = -0.697 cos θ 0 ID = − 0.697 ) to mildly aligned (cos θ 0 O O D = + 0.240 \cos\theta^{\mathrm{OOD}}_0 = +0.240 cos θ 0 OOD = + 0.240 ). The per-step trajectories (Figure 11 ) are textbook for both mechanisms.
Figure 11. Mechanisms M1+M2 firing together on a harmful dataset (covertype/cald-tabpfn). The OOD eval-gradient magnitude is uniformly an order of magnitude smaller than ID throughout the trajectory (left), the cross-term sign on OOD is much closer to zero than on ID (middle), and the anchor loss on OOD descends to a clearly distinct level (right).
Case 3: camelyon17/cald-tabicl (M2 only, harmful). The cosine on this cell moves further into the conflict regime (Δ cos = − 0.422 \Delta\cos= -0.422 Δ cos = − 0.422 ) but the AUROC is 1.000. The mechanism is pure M2: ρ e ( 50 ) = 0.719 \rho_e^{(50)} = 0.719 ρ e ( 50 ) = 0.719 (eval gradient ∼ 30 % \sim30\% ∼ 30% smaller on OOD). Mechanism M1’s contribution to (51) is negative on this cell, but the integrated M2 contribution dominates: the magnitude attenuation reduces the absolute size of the OOD cross-term in (50) below the ID cross-term, even though the OOD angle is more anti-aligned.
Case 4: diabetes_readmission/cald-tabpfn vs. covertype/cald-tabpfn (head-to-head). Figure 12 places the cleanest M1 example side-by-side with the cleanest M1+M2 example. Both produce λ O O D < λ I D \lambda_{\mathrm{OOD}} < \lambda_{\mathrm{ID}} λ OOD < λ ID with high confidence; the gradient signatures are visibly distinct.
Figure 12. Same detector outcome (λ O O D < λ I D \lambda_{\mathrm{OOD}} < \lambda_{\mathrm{ID}} λ OOD < λ ID ), two different mechanisms. Left column: diabetes_readmission (benign, Δ a c c = − 2.34 \Delta_{\mathrm{acc}} = -2.34 Δ acc = − 2.34 pp, AUROC 0.976) fires via cosine shift (M1). Right column: covertype (harmful, Δ a c c = + 83.5 \Delta_{\mathrm{acc}} = +83.5 Δ acc = + 83.5 pp, AUROC 1.000) fires via the combined M1+M2 mechanism, with a much cleaner log-scale separation in ∥ g e ∥ F 2 \lVert g_e \rVert_F^2 ∥ g e ∥ F 2 .
Figure 13 plots λ g a p \lambda_{\mathrm{gap}} λ gap against Δ a c c \Delta_{\mathrm{acc}} Δ acc for all twelve cells in Table 5 . The visualization makes the central claim concrete: the largest λ g a p \lambda_{\mathrm{gap}} λ gap in the benign region is +0.352 (diabetes_readmission/cald-tabpfn), which exceeds the λ g a p \lambda_{\mathrm{gap}} λ gap of the harmful camelyon17 (both methods). The two axes are not monotonically related on this 12-cell sample.
Figure 13. λ g a p \lambda_{\mathrm{gap}} λ gap versus Δ a c c \Delta_{\mathrm{acc}} Δ acc across the twelve probe cells. Marker size scales with ∣ Δ c o s ∣ \lvert\Delta_{\mathrm{cos}}\rvert ∣ Δ cos ∣ . The dashed vertical line is the Hoeffding harm threshold Δ ⋆ ≈ 4.84 \Delta^{\star} \approx4.84 Δ ⋆ ≈ 4.84 pp. Points to the left of the threshold are benign; points to the right are harmful. Both regions contain cells with λ g a p ≥ 0.05 \lambda_{\mathrm{gap}} \ge0.05 λ gap ≥ 0.05 , confirming that the conformal test fires on both kinds of distributional shift.
Fallback behavior of the LR-stability rule
The single benign cell in Table 5 where the conformal test does not reject is folktables/cald-tabpfn, with AUROC 0.624, λ g a p = − 0.004 \lambda_{\mathrm{gap}} = -0.004 λ gap = − 0.004 , ρ e ( 50 ) = 0.878 \rho_e^{(50)} = 0.878 ρ e ( 50 ) = 0.878 , and Δ cos = − 0.002 \Delta\cos= -0.002 Δ cos = − 0.002 . Both mechanisms M1 and M2 are dormant here: the gradient signature of equation (51) is essentially neutral, and the detector’s reported AUROC is the only one below 0.7 across the eight benign cells.
The low AUROC and the fallback have a common cause. Algorithm 1 selects a finetuning learning rate per (dataset, method) cell with a tail-stability rule: it checks the per-step direction indicator 1 { E λ O O D ( t ) < E λ I D ( t ) } \mathbb{1}\{E_{\lambda_{\mathrm{OOD}}}^{(t)} < E_{\lambda_{\mathrm{ID}}}^{(t)}\} 1 { E λ OOD ( t ) < E λ ID ( t ) } for t ∈ [ 30 , 50 ] t \in[30, 50] t ∈ [ 30 , 50 ] across calibration rounds, and rejects a candidate η \eta η if the indicator flips more than twice or has tail-mean below 0.5. On folktables/cald-tabpfn the rule rejects η = 10 − 2 \eta= 10^{-2} η = 1 0 − 2 and falls back to η = 10 − 4 \eta= 10^{-4} η = 1 0 − 4 , flagging the cell unstable; by (49) , when neither M1 nor M2 produces a coherent integrated effect, g ˉ a \bar{g}_a g ˉ a and g ˉ e \bar{g}_e g ˉ e are too noisy to define a reliable post-finetune λ \lambda λ , and the rule registers this as tail oscillation. We report the modest AUROC on this cell as a measured limitation of the detector in this regime: the stability rule localizes the unreliable cell, but it does not repair it.
A census over all 30 method × \times × dataset cells shows the fallback is rare and confined to benign shifts: four cells fall back to η = 10 − 4 \eta= 10^{-4} η = 1 0 − 4 (adult_income on both models, at AUROC 1.000 despite the fallback; celeba/cald-tabicl at 0.845; and folktables/cald-tabpfn at 0.624), while every severely shifted dataset selects its learning rate stably. The selection is also insensitive to the choice of tail window: re-running the rule with windows 25–45, 30–50, and 35–50 changes the selected rate in 1 of 60 cell–window comparisons (folktables/cald-tabpfn under 25–45, Δ \Delta Δ AUROC − 0.052 -0.052 − 0.052 ). Appendix D.5 reports the full census together with the frozen-configuration comparison.
Implications for the calibration-to-harm claim
Section 4.3 and §5.3 of the main text present the empirical observation that AUROC scales monotonically with shift severity (calibration to harm). The probe data above show that this monotonicity does not hold on the four-dataset benign group; in particular, the diabetes_readmission/cald-tabpfn cell has λ g a p = + 0.352 \lambda_{\mathrm{gap}} = +0.352 λ gap = + 0.352 at Δ a c c = − 2.34 \Delta_{\mathrm{acc}} = -2.34 Δ acc = − 2.34 pp, while camelyon17/cald-tabpfn has λ g a p = + 0.069 \lambda_{\mathrm{gap}} = +0.069 λ gap = + 0.069 at Δ a c c = + 8.91 \Delta_{\mathrm{acc}} = +8.91 Δ acc = + 8.91 pp.
The right interpretation, supported by Lemma A.12, is that λ g a p \lambda_{\mathrm{gap}} λ gap and Δ a c c \Delta_{\mathrm{acc}} Δ acc measure formally different objects:
Δ a c c \Delta_{\mathrm{acc}} Δ acc depends only on how the shift moves mass on the mistake region M M M (Lemma A.12). In particular, Δ a c c \Delta_{\mathrm{acc}} Δ acc is invariant under any reweighting of M c M^c M c that preserves the marginal on M M M .
λ g a p \lambda_{\mathrm{gap}} λ gap depends on the integrated cross-term (50) , which is a feature-space quantity. Reweighting that occurs entirely on M c M^c M c still perturbs the geometry of g ˉ a , g ˉ e \bar{g}_a, \bar{g}_e g ˉ a , g ˉ e and therefore still affects λ g a p \lambda_{\mathrm{gap}} λ gap .
Two shifts with the same ∣ Δ a c c ∣ |\Delta_{\mathrm{acc}}| ∣ Δ acc ∣ can therefore produce very different λ g a p \lambda_{\mathrm{gap}} λ gap values. The four benign-by-accuracy datasets are the regime where ∣ Δ a c c ∣ |\Delta_{\mathrm{acc}}| ∣ Δ acc ∣ is small but feature-space reweighting on M c M^c M c is large; the harm decomposition of Lemma A.12 predicts exactly this kind of dissociation.
The accuracy-sensitive auxiliary signal μ ^ \hat{\mu} μ ^ proposed in Proposition A.21 is the formal vehicle for restoring calibration to harm: μ ^ \hat{\mu} μ ^ is constructed to track the density-ratio integral of Lemma A.12 directly, rather than the unsigned TV distance that drives λ \lambda λ . A natural reading of the present appendix’s empirical findings is that λ ^ \hat{\lambda} λ ^ and μ ^ \hat{\mu} μ ^ should be reported jointly: λ ^ \hat{\lambda} λ ^ confirms shift, μ ^ \hat{\mu} μ ^ adjudicates whether the shift is harmful. The dissociation observed on the four benign datasets is then not a defect of
CALD but a quantitative reading of the same λ ^ / μ ^ \hat{\lambda}/\hat{\mu} λ ^ / μ ^ separation that the harm theorem (Proposition A.21 ) makes formal.
Experimental Details
This appendix collects dataset-, baseline-, and protocol-level details deferred from Section 5, together with a survey of TabPFN/TabICL accuracy under the shifts considered. §C.1 describes the 14 datasets and their ID/OOD splits; §C.2 catalogs the 15 post-hoc baselines we compare against; §C.3 surveys the per-dataset accuracy drops and applies a Hoeffding bound to classify each shift as benign or harmful; and §C.4 reports our main TPR@5% FPR results with confidence intervals and explains the LR-stability protocol used for CALD.
Dataset Description
We evaluate on 14 datasets covering tabular, vision-foundation-model, and text-foundation-model representations. For each dataset we describe the modality and the criterion that splits in-distribution (ID) from out-of-distribution (OOD); in many cases the OOD pool corresponds to the dataset’s own test split, with the criterion baked in by the dataset designers. Sample-size and protocol details are deferred to §C.4.
UCI Heart Disease. Tabular medical features (13 covariates: age, sex, chest-pain type, cholesterol, ECG measurements, exercise-induced angina, etc.). ID/OOD: Cleveland Clinic patients are ID, Hungarian Institute of Cardiology patients are OOD. Split is site shift : different hospital, different population, different measurement conventions, with non-trivial covariate redistribution across the 13 fields.
Diabetes Readmission (UCI #296). Tabular hospital records (49 covariates: demographics, admission codes, lab counts, medication lists, length of stay). ID/OOD: admission_type = Emergency is ID, Elective is OOD. Split is patient-acuity shift : emergency admissions skew toward acute conditions and shorter stays, elective toward planned procedures and longer stays, redistributing nearly every covariate.
Adult Income (UCI #2). Tabular 1994 US Census records (14 covariates: age, work class, education, occupation, hours-per-week, etc.). ID/OOD: sex = Male is ID, Female is OOD. Split is demographic shift : in 1994 the labor-force composition for men and women differs sharply on hours, occupation, and capital gains, so the covariate distributions are far from identical.
Bank Marketing (UCI #222). Tabular Portuguese-bank telemarketing call records (20 covariates including age, job, balance, contact channel, prior-campaign outcome, and macroeconomic indicators). ID/OOD: calls in May–August 2008 are ID, calls in October–November 2008 are OOD. Split is temporal/macroeconomic shift bracketing the September 2008 Lehman collapse, after which euro-zone interest rates and consumer-confidence indicators in the dataset shift abruptly.
Credit Default (UCI #350). Tabular Taiwanese credit-card client records (23 covariates: limit balance, sex, age, education, six months of bill amounts and payment statuses). ID/OOD: EDUCATION = University is ID, Graduate school is OOD. Split is education-stratum shift : graduate-degree holders systematically have higher credit limits and different payment patterns.
Covertype (sklearn fetch_covtype). Tabular forest-cover records from Roosevelt National Forest (54 covariates: 10 quantitative including elevation/slope/aspect/distances, 4 binary wilderness areas, 40 binary soil types). ID/OOD: 2,000–2,500 m elevation is ID, >3,000 m is OOD. Split is ecological-zone shift : above 3,000 m the forest transitions from mixed broadleaf–conifer to pure subalpine conifer, redistributing soil type and slope.
Folktables ACS Income. Tabular American Community Survey records (10 covariates: age, work class, education, marital status, occupation, etc.). ID/OOD: we use a state-pair split following the Folktables release. Split is geographic shift : different states have different industrial mixes and educational distributions.
Camelyon17 (Bandi et al. 4, Koh et al. 27). Whole-slide histopathology image patches encoded by a frozen DINOv2 ViT-B/14 to 768-dim representations. ID/OOD: patches from three of the five WILDS hospitals are ID, the held-out OOD hospital is OOD. Split is hospital/staining shift : different scanners and H&E staining protocols produce systematic color and texture differences.
CIFAR-10 → \to → CIFAR-10.1 (Recht et al. 50, 51). Natural-image patches encoded by an ImageNet-pretrained ResNet-18 to 512-dim representations. ID/OOD: CIFAR-10 test set is ID, CIFAR-10.1
v6 is OOD. Split is benchmark-replication shift: Recht et al. [51 ] re-collected CIFAR-10 following the original protocol; the resulting class marginals match but the covariate distributions diverge enough to drop most classifiers’ accuracy by 6–10 pp.
PACS (Li et al. 29). Object images from four artistic domains, encoded by frozen DINOv2 ViT-B/14 to 768-dim representations. ID/OOD: Photo is ID, Art-painting / Cartoon / Sketch are OOD. Split is style/domain shift, classically used as a domain-generalization benchmark.
Waterbirds (WILDS, Koh et al. 27). Bird photographs encoded by frozen DINOv2 ViT-B/14 to 768-dim representations. ID/OOD: the majority groups (waterbird-on-water, landbird-on-land) are ID; the minority groups (waterbird-on-land, landbird-on-water) are OOD. Split is spurious-correlation shift: the background–label correlation in the training distribution is broken at test time, and the OOD test set is a known failure mode for ERM-trained classifiers.
CelebA (WILDS subpopulation, Koh et al. 27, Sagawa et al. 55). Face photographs encoded by frozen DINOv2 ViT-B/14 to 768-dim representations. ID/OOD: with target y = blond hair y = \text{blond hair} y = blond hair and attribute a = male a = \text{male} a = male , the groups with y = a y = a y = a (non-blond female / blond male ) are ID and the groups with y ≠ a y \ne a y = a (non-blond male / blond female ) are OOD. Split is a group-composition shift that reverses the hair-color–gender pairing between ID and OOD; it is not the WILDS majority/minority split.
CivilComments (WILDS, Koh et al. 27). Online-comment text encoded by Jina-v3 to 1024-dim representations. ID/OOD: comments with no demographic-identity mention (LGBTQ, Muslim, Black, etc.) are ID; comments with at least one identity mention are OOD. Split is topic-stratum shift: identity-mentioning comments are systematically more toxic in the training distribution, making the topic–toxicity correlation a known shortcut.
Amazon Reviews (WILDS, Koh et al. 27). Customer-review text encoded by Jina-v3 to 1024-dim representations, 5-class star rating. ID/OOD: a held-out 20% of training-set reviewers are ID; the WILDS test set, drawn from a disjoint reviewer pool, is OOD. Split is reviewer/domain shift: different reviewers favor different vocabulary, sentence length, and star-distribution profiles.
Baselines
The goal of every baseline below is the same as CALD ’s: given the unlabeled OOD pool described in §C.1, decide whether the eval batch is drawn from the support distribution. Each baseline computes a scalar score per round; we calibrate a 5%-FPR threshold on the ID-round scores and report TPR on the OOD-round scores. Notation: X a n c X_{\mathrm{anc}} X anc and y a n c y_{\mathrm{anc}} y anc denote the labeled anchor batch with PFN softmax outputs p a ∈ Δ C − 1 p_a \in\Delta^{C-1} p a ∈ Δ C − 1 , X e v a l X_{\mathrm{eval}} X eval denotes the eval batch with softmax outputs p p p , and h ( x ) ∈ R d h(x) \in\mathbb{R}^d h ( x ) ∈ R d denotes the PFN’s pre-decoder representation. We adapt the conventional “low score = OOD” direction so that AUROC is reported in [ 0.5 , 1 ] [0.5,1] [ 0.5 , 1 ] ; baseline implementations live at detection/baselines/posthoc.py.
MSP [19 ] . Maximum softmax probability, s M S P ( x ) = max c p ( c ∣ x ) s_{\mathrm{MSP}}(x) = \max_c p(c \mid x) s MSP ( x ) = max c p ( c ∣ x ) . Confident ID predictions score high; uncertain OOD predictions score low.
Entropy [44 ] . Predictive entropy, s E n t ( x ) = − ∑ c p ( c ∣ x ) log p ( c ∣ x ) s_{\mathrm{Ent}}(x) = - \sum_c p(c \mid x) \log p(c \mid x) s Ent ( x ) = − ∑ c p ( c ∣ x ) log p ( c ∣ x ) . Higher entropy is taken as more OOD.
Energy [34 ] . Negative log-sum-exp of the logits, s E n ( x ) = − log ∑ c e z c ( x ) s_{\mathrm{En}}(x) = - \log\sum_c e^{z_c(x)} s En ( x ) = − log ∑ c e z c ( x ) , the softmax-free analogue of MSP. ID samples produce a peakier logit distribution and therefore a more negative energy.
Mahalanobis [28 ] . With a class-conditional Gaussian fit on the support representations, s M H ( x ) = min c ( h ( x ) − μ c ) ⊤ Σ − 1 ( h ( x ) − μ c ) s_{\mathrm{MH}}(x) = \min_c (h(x) - \mu_c)^\top\Sigma^{-1}(h(x) - \mu_c) s MH ( x ) = min c ( h ( x ) − μ c ) ⊤ Σ − 1 ( h ( x ) − μ c ) . OOD samples lie far from every class cluster.
Relative Mahalanobis (RMD, Ren et al. 52). RMD subtracts a class-agnostic background term, s R M D ( x ) = min c M D c ( x ) − M D b g ( x ) s_{\mathrm{RMD}}(x) = \min_c \mathrm{MD}_c(x) - \mathrm{MD}_{\mathrm{bg}}(x) s RMD ( x ) = min c MD c ( x ) − MD bg ( x ) with M D b g ( x ) = ( h ( x ) − μ ) ⊤ Σ − 1 ( h ( x ) − μ ) \mathrm{MD}_{\mathrm{bg}}(x) = (h(x) - \mu)^\top\Sigma^{-1}(h(x) - \mu) MD bg ( x ) = ( h ( x ) − μ ) ⊤ Σ − 1 ( h ( x ) − μ ) . Cancelling population-level density isolates the discriminative signal and improves near-OOD detection where standard MD saturates.
KNN [57 ] . Average ℓ 2 \ell_2 ℓ 2 distance from the eval representation to its k = 5 k = 5 k = 5 nearest neighbors among the support representations, s K N N ( x ) = 1 k ∑ i ∈ N k ( x ) ∥ h ( x ) − h ( x i ) ∥ 2 s_{\mathrm{KNN}}(x) = \frac{1}{k} \sum_{i \in\mathcal{N}_k(x)} \lVert h(x) - h(x_i) \rVert_2 s KNN ( x ) = k 1 ∑ i ∈ N k ( x ) ∥ h ( x ) − h ( x i ) ∥ 2 . A non-parametric distance-to-feature-cloud measure.
ViM [64 ] . Virtual-Logit Matching decomposes pre-head representations into a classifier-subspace component and a null-space residual; the OOD score combines residual norm with energy, s V i M ( x ) = α ∥ Π ⊥ ( h ( x ) − u ) ∥ 2 − log ∑ c e z c ( x ) s_{\mathrm{ViM}}(x)=\alpha\lVert\Pi^{\perp}(h(x)-u)\rVert_{2}-\log\sum_{c}e^{z_{c}(x)} s ViM ( x ) = α ∥ Π ⊥ ( h ( x ) − u ) ∥ 2 − log ∑ c e z c ( x ) , where Π ⊥ \Pi^{\perp} Π ⊥ projects onto the bottom eigendirections of the ID covariance and u = − W + b u=-W^{+}b u = − W + b is the virtual origin. ID samples lie within the classifier’s principal subspace; OOD samples carry significant null-space mass.
BBSD-Softmax [32 , 49 ] . Black-Box Shift Detection on softmax probabilities: per-class two-sample Kolmogorov–Smirnov tests between anchor and eval, take the minimum p p p -value, apply Bonferroni correction, return 1 − p c o r r 1-p_{\mathrm{corr}} 1 − p corr . Sensitive to label-marginal shifts.
BBSD-Embed (BBSD-E). Same procedure as BBSD-Softmax but applied per-dimension on the pre-decoder embeddings h ( x ) h(x) h ( x ) instead of the softmax. Sensitive to feature-distribution shifts that may not propagate to the labels.
D-MMD [14 , 33 ] . Maximum Mean Discrepancy between support and eval feature distributions,
MMD 2 ( P , Q ) = 1 n 2 ∑ i , j k ( x i , x j ) + 1 m 2 ∑ i , j k ( y i , y j ) − 2 n m ∑ i , j k ( x i , y j ) , \operatorname{MMD}^{2}(P,Q)=\frac{1}{n^{2}}\sum_{i,j}k(x_i,x_j)+\frac{1}{m^{2}}\sum_{i,j}k(y_i,y_j)-\frac{2}{nm}\sum_{i,j}k(x_i,y_j), MMD 2 ( P , Q ) = n 2 1 i , j ∑ k ( x i , x j ) + m 2 1 i , j ∑ k ( y i , y j ) − nm 2 i , j ∑ k ( x i , y j ) ,
with an RBF kernel at the median pairwise-distance bandwidth. The classical batch-level two-sample test.
H-Divergence (H-Div, Ben-David et al. [6 ] , Lopez-Paz and Oquab [35 ] ). Trains a logistic-regression domain classifier to distinguish support representations from eval representations; the held-out classification accuracy serves as the OOD score. An accuracy near 0.5 indicates indistinguishable distributions.
GradNorm [23 ] . Gradient norm of the KL divergence to uniform, s G N ( x ) = ∥ ∇ W KL ( u ∥ p θ ( ⋅ ∣ x ) ) ∥ F s_{\mathrm{GN}}(x)=\lVert\nabla_{W}\operatorname{KL}(u\mathbin{\|}p_{\theta}(\cdot\mid x))\rVert_{F} s GN ( x ) = ∥ ∇ W KL ( u ∥ p θ ( ⋅ ∣ x )) ∥ F . Confident ID samples produce large gradients toward uniform; near-uniform OOD predictions produce small gradients.
GradOrth [5 ] . At the last linear layer ∇ W L = error ⊗ h \nabla_{W}L=\operatorname{error}\otimes h ∇ W L = error ⊗ h , so the gradient lives in the row span of the representations; GradOrth projects h ( x ) h(x) h ( x ) onto the top-k k k singular subspace of the ID-representation matrix and uses the projection norm as an ID-likelihood score (low projection ⇒ \Rightarrow ⇒ OOD).
GAIA-Z [8 ] . Activity of the gradient of the maximum logit at an internal hidden activation, s G A I A ( x ) = E [ ∣ ∂ max c z c ( x ) / ∂ h ( x ) ∣ ] s_{\mathrm{GAIA}}(x)=\mathbb{E}[\lvert\partial\max_{c}z_{c}(x)/\partial h(x)\rvert] s GAIA ( x ) = E [∣ ∂ max c z c ( x ) / ∂ h ( x )∣] . Originally counts exact-zero gradient channels under ReLU; we adapt to the GELU decoder by reporting mean absolute gradient magnitude. ID samples activate more channels and yield larger mean activity.
WeiPer [13 ] . Mean MSP under random weight perturbations: for r r r samples of unit-direction noise Δ r \Delta_r Δ r scaled to δ ∥ w c ∥ \delta\lVert w_c\rVert δ ∥ w c ∥ added to each row of the classifier head, s W e i P e r ( x ) = 1 r ∑ r max c softmax ( W + Δ r ) h ( x ) s_{\mathrm{WeiPer}}(x)=\frac{1}{r}\sum_{r}\max_{c}\operatorname{softmax}(W+\Delta_r)h(x) s WeiPer ( x ) = r 1 ∑ r max c softmax ( W + Δ r ) h ( x ) . ID predictions are stable under perturbation and retain a high max-softmax; OOD predictions collapse.
Performance Deterioration
A deterioration detector is only meaningful when shift is genuinely harmful. Table 6 reports TabPFN accuracy on ID and OOD splits for all 14 datasets (10 rounds, eval size 128, N = 1,280 N=1{,}280 N = 1 , 280 pooled samples per dataset). To classify each shift as benign or harmful we use a principled threshold derived from Hoeffding’s inequality: for a fixed classifier evaluated on N N N i.i.d. samples,
Table 6. TabPFN accuracy under distribution shift, ordered by severity. Δ = a c c I D − a c c O O D \Delta= \mathrm{acc}_{\mathrm{ID}} - \mathrm{acc}_{\mathrm{OOD}} Δ = acc ID − acc OOD (positive = harmful drop). Δ ∗ ( N ) = ln ( 1 / δ ) / N \Delta^{*}(N) = \sqrt{\ln(1/\delta)/N} Δ ∗ ( N ) = ln ( 1/ δ ) / N is the Hoeffding 95%-confidence noise floor (Eq. 52, δ = 0.05 \delta= 0.05 δ = 0.05 , N = 1,280 N = 1{,}280 N = 1 , 280 ); shifts with ∣ Δ ∣ ≤ Δ ∗ |\Delta| \le\Delta^{*} ∣Δ∣ ≤ Δ ∗ are labeled benign († \dagger † ). Accuracy estimated over 10 rounds of 128 eval samples each.
Pr [ a ^ I D − a ^ O O D > Δ ∗ ∣ no shift ] ≤ e − N ( Δ ∗ ) 2 , (52) \Pr\left[\hat{a}_{\mathrm{ID}}-\hat{a}_{\mathrm{OOD}}>\Delta^{*}\mid\text{no shift}\right]\leq e^{-N(\Delta^{*})^{2}}, \tag*{(52)} Pr [ a ^ ID − a ^ OOD > Δ ∗ ∣ no shift ] ≤ e − N ( Δ ∗ ) 2 , (52)
which is distribution-free and applies to any non-adaptive classifier. Setting the right-hand side to δ = 0.05 \delta=0.05 δ = 0.05 gives
Δ ∗ ( N ) = ln ( 1 / δ ) N . (53) \Delta^{*}(N)=\sqrt{\frac{\ln(1/\delta)}{N}}. \tag*{(53)} Δ ∗ ( N ) = N ln ( 1/ δ ) . (53)
For N = 1,280 N=1{,}280 N = 1 , 280 this yields Δ ∗ ≈ 4.8 % \Delta^{*}\approx4.8\% Δ ∗ ≈ 4.8% : any observed accuracy drop exceeding this threshold is statistically distinguishable from sampling noise at 95% confidence under the null of no shift, and we therefore label the dataset as harmful . Datasets whose accuracy gap falls below Δ ∗ \Delta^{*} Δ ∗ in absolute value (including those where OOD accuracy is higher than ID) are labeled benign : the model’s predictive integrity is preserved up to sampling noise, and a label-blind detector that fires on these datasets is incurring an unnecessary false alarm. The Hoeffding threshold is intentionally conservative: it makes no parametric assumption about the accuracy distribution, only bounded support, and is a per-dataset quantity (Δ ∗ \Delta^{*} Δ ∗ scales as 1 / N 1/\sqrt{N} 1/ N ). Our benchmark spans the full severity spectrum, from catastrophic (Covertype , Δ = 83.5 % \Delta=83.5\% Δ = 83.5% ) through moderate (Camelyon17 , Δ = 8.9 % \Delta=8.9\% Δ = 8.9% ) to negligible-or-benign (Amazon , Δ = + 1.5 % \Delta=+1.5\% Δ = + 1.5% ; Adult Income , Δ = − 9.5 % \Delta=-9.5\% Δ = − 9.5% where OOD accuracy is higher than ID), providing a demanding testbed for both correct alarm and correct silence.
Adult Income deserves a remark. It is the only dataset in our benchmark where OOD accuracy is substantially higher than ID (+9.5 pp); this is consistent with the underlying covariate shift (ID = Male, OOD = Female) being structurally easier under the 1994 Census labels (the female labor-force composition of that era leaves a sharper income decision boundary). Adult Income is therefore a particularly stringent benign test: a label-blind detector will register the substantial covariate redistribution, but the predictive harm is not just absent; it is reversed. A well-calibrated harm detector should remain silent here.
Main Results with Confidence Intervals
For completeness we report each cell of the main-paper Table 1 as means t d _{\mathrm{std}} std over 10 seeds, split into the benign (Table 7 ) and harmful (Table 8 ) halves. Bolding marks the best mean in each column.
Table 7. Full TPR@5% FPR results across 7 benign shifts (Δ ≤ 4.8 % \Delta\le4.8\% Δ ≤ 4.8% , Hoeffding bound at N = 1,280 N = 1{,}280 N = 1 , 280 , Appendix § 10 .3; TPR = correct silence rate). Each cell is means t d _{\mathrm{std}} std across 10 seeds (seeds 42–51); std is the spread of per-seed TPR (each seed’s threshold is its own 5th-percentile ID-score). Means match Table 1 exactly. Bold = best mean in column.
Table 8. Full TPR@5% FPR results across 7 harmful shifts (Δ > 4.8 % \Delta> 4.8\% Δ > 4.8% , Hoeffding bound at N = 1,280 N = 1{,}280 N = 1 , 280 , Appendix § 10 .3; TPR = correct alarm rate). Each cell is means t d _{\mathrm{std}} std across 10 seeds (seeds 42–51); std is the spread of per-seed TPR (each seed’s threshold is its own 5th-percentile ID-score). Means match Table 1 exactly. Bold = best mean in column.
Protocol. For each (dataset, method) cell we run 10 independent seeds (seeds 42–51); within each seed we run 50 calibration rounds and 50 deployment rounds of Algorithm 1. Each round draws a fresh ID anchor / eval pair (calibration) or a fresh OOD eval batch (deployment) of size ∣ X e v a l ∣ = 128 |X_{\mathrm{eval}}| = 128 ∣ X eval ∣ = 128 , with the support set D s u p \mathcal{D}^{\mathrm{sup}} D sup (size n = 1024 n = 1024 n = 1024 ) and the labeled anchor ( X a n c , y a n c ) (X_{\mathrm{anc}}, y_{\mathrm{anc}}) ( X anc , y anc ) (∣ X a n c ∣ = 128 |X_{\mathrm{anc}}| = 128 ∣ X anc ∣ = 128 ) held fixed within the seed. The detection threshold is set per seed at the empirical 5th percentile of that seed’s 50 calibration anchor-loss values, and the per-seed TPR is the fraction of the 50 deployment anchor-losses that fall below it. The reported cell is the mean and standard deviation of the 10 per-seed TPRs and, crucially, not a pooled estimate across seeds, because different seeds draw different supports and thus have anchor losses on different scales. Baselines (§C.2) follow the same per-seed thresholding protocol on their own scalar score, again calibrated at the seed’s own 5th-percentile ID-side cutoff. AUROC, when reported, is computed on the union of the seed’s 50 ID and 50 OOD scores and then averaged across the 10 seeds.
LR-stability protocol for CALD. For each (dataset, method) cell we sweep CALD’s finetune learning rate over η ∈ { 10 − 2 , 10 − 3 , 10 − 4 } \eta\in\{10^{-2}, 10^{-3}, 10^{-4}\} η ∈ { 1 0 − 2 , 1 0 − 3 , 1 0 − 4 } and select the largest η \eta η that produces a stable signal , where stability is defined on the per-step direction indicator
d t : = I { λ ‾ t O O D < λ ‾ t I D } , t = 1 , … , T , (54) d_t := \mathbb{I}\left\{\overline{\lambda}^{\mathrm{OOD}}_t < \overline{\lambda}^{\mathrm{ID}}_t\right\}, \qquad t = 1,\ldots,T, \tag*{(54)} d t := I { λ t OOD < λ t ID } , t = 1 , … , T , (54)
where λ ‾ t I D \overline{\lambda}^{\mathrm{ID}}_t λ t ID and λ ‾ t O O D \overline{\lambda}^{\mathrm{OOD}}_t λ t OOD are the round-averaged anchor losses at step t t t . We accept the candidate η \eta η if and only if d t d_t d t flips at most twice over t ∈ [ 30 , 50 ] t \in[30, 50] t ∈ [ 30 , 50 ] (i.e. the trajectory has settled into a single direction in the second half of finetuning), regardless of which direction it has settled into . If no LR in the sweep is stable we mark the cell unstable (flagged ‘!’ in the direction column of Table 10 ); otherwise we report the AUROC and TPR at the largest stable η \eta η .
The stability criterion is not a post-hoc filter for direction. CALD only fires when λ O O D < λ I D \lambda_{\mathrm{OOD}} < \lambda_{\mathrm{ID}} λ OOD < λ ID (Eq. (6) ); a stable settled-into-λ O O D > λ I D \lambda_{\mathrm{OOD}} > \lambda_{\mathrm{ID}} λ OOD > λ ID trajectory simply produces a low TPR, which is what we report. The reason we filter on stability rather than direction is that an unstable trajectory, one whose d t d_t d t oscillates between 0 and 1 across the second-half steps, contains no reliable signal. Reading off λ \lambda λ at any single step in such a trajectory is essentially a coin flip on transient gradient noise: stop one step earlier or later and the test verdict reverses. In particular, at high learning rates the ID/OOD trajectories cross each other multiple times before t = T t = T t = T , so the value of λ T = L a n c ( θ T ) \lambda_T = \mathcal{L}_{\mathrm{anc}}(\theta_T) λ T = L anc ( θ T ) depends on whether T T T happens to land in a momentary alignment of the gradient cross-term. Reporting that single sample without checking for oscillation would be reading a randomly-timed slice of a chaotic curve, effectively “getting lucky” that the finetune horizon ends inside a brief favorable window. The stability criterion ensures that whatever direction we report, the trajectory has stopped flipping by step 30 and the value of λ T \lambda_T λ T reflects a converged regime rather than an arbitrary point in an oscillating one.
In practice, η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 is the modal choice across the 14 datasets: η = 10 − 2 \eta= 10^{-2} η = 1 0 − 2 is rejected on the more sensitive datasets (notably CelebA and CivilComments under TabPFN, where the joint loss oscillates across iterations 30–50) and η = 10 − 4 \eta= 10^{-4} η = 1 0 − 4 is the fallback on four cells (Adult Income under both models, CelebA-TabICL, and Folktables-TabPFN), where neither 10 − 2 10^{-2} 1 0 − 2 nor 10 − 3 10^{-3} 1 0 − 3 stabilizes; Appendix D.5 reports the census. The dataset-by-dataset selected LRs and the stability margins are produced by detection/viz/cache_results.py and consumed by the main-paper table builder.
Comparison to Drift-Resilient TabPFN
A natural alternative to detecting distribution shift is to adapt the model so that shift no longer harms predictions. Drift-Resilient TabPFN [17 ] pursues this route: it retrains the PFN prior on synthetic data sampled from evolving structural causal models , producing a tabular foundation model whose predictions are intended to be robust under covariate shift. If this adaptation were sufficient on the benchmark of §C.3, the failure mode that motivates CALD would not arise, and a detector would be redundant. We therefore evaluate whether Drift-Resilient TabPFN closes the ID/OOD accuracy gap on our benchmark; closing the gap is a necessary condition for the claim that adaptation removes the need for a detector.
Table 9 repeats the deterioration survey of Table 6 using Drift-Resilient TabPFN (single-estimator configuration, matching standard TabPFN) on the same ID/OOD splits, support sizes, and round structure. The right-most column reports δ O O D = a c c O O D d r i f t − a c c O O D s t d \delta_{\mathrm{OOD}} = \mathrm{acc}_{\mathrm{OOD}}^{\mathrm{drift}} - \mathrm{acc}_{\mathrm{OOD}}^{\mathrm{std}} δ OOD = acc OOD drift − acc OOD std , which isolates the effect of drift adaptation on OOD accuracy. Across all 15 datasets of Table 9 (including the Camelyon17 ResNet18 variant) the mean δ O O D \delta_{\mathrm{OOD}} δ OOD is − 1.4 -1.4 − 1.4 pp; on the eight datasets classified as harmful in Table 6 the mean is − 2.2 -2.2 − 2.2 pp. Drift adaptation strictly improves OOD accuracy on only two harmful datasets (Covertype, + 3.8 +3.8 + 3.8 pp; Camelyon17 ResNet18, + 3.0 +3.0 + 3.0 pp), and degrades OOD accuracy by more than the Hoeffding noise floor (Δ ∗ ≈ 4.8 \Delta^{*} \approx4.8 Δ ∗ ≈ 4.8 pp, Eq. (52) ) on three (PACS − 8.0 -8.0 − 8.0 pp, CIFAR-10 − 7.8 -7.8 − 7.8 pp, Waterbirds − 4.8 -4.8 − 4.8 pp). The dataset with the largest standard-TabPFN deterioration after Covertype, PACS at Δ = + 27.9 \Delta= +27.9 Δ = + 27.9 pp, is made measurably worse by adaptation rather than better, and ID accuracy is also slightly degraded on a majority of datasets (mean − 1.0 -1.0 − 1.0 pp). The harm classification of Table 6 is essentially unchanged: every dataset that was harmful under standard TabPFN remains harmful under Drift-Resilient TabPFN by the same Hoeffding criterion. The headline finding is thus that drift adaptation does not eliminate the deterioration that CALD is designed to detect; on the present benchmark it slightly aggravates it on average.
Table 9. TabPFN vs. Drift-Resilient TabPFN accuracy under distribution shift. Standard TabPFN (left) and Drift-Resilient TabPFN [17 ] (right) on the same ID/OOD splits. Δ = a c c I D − a c c O O D \Delta= \mathrm{acc}_{\mathrm{ID}} - \mathrm{acc}_{\mathrm{OOD}} Δ = acc ID − acc OOD (positive = harmful drop). δ O O D = a c c O O D d r i f t − a c c O O D s t d \delta_{\mathrm{OOD}} = \mathrm{acc}^{\mathrm{drift}}_{\mathrm{OOD}} - \mathrm{acc}^{\mathrm{std}}_{\mathrm{OOD}} δ OOD = acc OOD drift − acc OOD std (positive = drift model improves OOD accuracy). Harm threshold Δ ∗ ≈ 4.8 % \Delta^* \approx4.8\% Δ ∗ ≈ 4.8% (Hoeffding, δ = 0.05 \delta= 0.05 δ = 0.05 , N = 1,280 N = 1{,}280 N = 1 , 280 ); benign datasets marked † \dagger † .
The result is consistent with, and indeed predicted by, the design of Drift-Resilient TabPFN. Its prior is constructed by sampling structural causal models and then perturbing their parameters along a temporal axis to simulate gradual evolution of the data-generating process. The resulting model is therefore tuned to a specific, structured family of shifts (smoothly drifting SCMs, of the kind found in the Wild-Time benchmarks for which the method was developed) and not to the heterogeneous covariate shifts in our benchmark, which include image-domain transfer (Camelyon17, Waterbirds, PACS), feature-space stratification (Covertype’s elevation cut, UCI Heart’s hospital split), and large textual-distribution gaps (CivilComments). On several datasets (PACS, CIFAR-10, Waterbirds) the perturbed prior actively misallocates predictive mass, assuming the wrong drift mechanism, which manifests directly as degraded OOD accuracy. More fundamentally, no fixed-prior model can be uniformly robust to arbitrary covariate shift: by a no-free-lunch argument, any inductive bias added to handle one family of shifts must be paid for on another. This is the structural reason adaptation cannot replace detection: a deployed practitioner has no way to verify, a priori, that the shift at hand falls within the family the adapted prior was trained for. CALD and Drift-Resilient TabPFN are therefore complementary in their roles, with the detector indicating whether a shift has occurred while the adapter (when applicable) indicates how to respond. The empirical evidence in Table 9 suggests that on a heterogeneous covariate-shift benchmark, detection is the more dependable of the two.
Per-Dataset Detection Performance of λ ^ \hat{\lambda} λ ^
Table 10 reports AUROC and TPR@5% FPR for the post-finetune anchor-loss statistic λ ^ \hat{\lambda} λ ^ alone (without baselines) across all datasets and both models, complementing the baseline comparison in the main paper. The protocol matches Table 1 : seeds 42–51, K = 50 K = 50 K = 50 calibration rounds, per-seed 5%-quantile thresholds, learning rate selected per cell by the tail-stability rule.
Ablations
This appendix collects the hyperparameter sweeps, design-choice ablations, and the further ablations deferred from §5: the disagreement weight, the finetuning budget and its deployment cost, the frozen deployment configuration, anchor robustness, feature collapse, the theorem’s condition and premise, the two-signal detector, and detectability across shift types.
Hyperparameter Sweeps
We sweep four hyperparameters of CALD on three representative datasets covering catastrophic, moderate, and structured-image shift: Covertype, Credit Default, and CIFAR-10. The point of the sweeps is twofold: to check that the detector is not living on a knife-edge of its compute budget, and to verify that the operating regime under which the theory applies (small-step finetuning, modest support window) is the regime under which the practical detector actually performs well.
Number of finetune steps T T T . The natural worry is that we have tuned T T T to a sweet spot beyond which the signal collapses; if so, the theorem’s first-order analysis would be tracking a transient that the deployed detector exits at T = T d e p l o y T = T_{\mathrm{deploy}} T = T deploy . AUROC is in fact largely insensitive to T T T on strong shifts (Covertype, Credit Default: 1.000 at every T ∈ { 1 , 3 , 5 , 10 , 20 , 50 } T \in\{1, 3, 5, 10, 20, 50\} T ∈ { 1 , 3 , 5 , 10 , 20 , 50 } ). On the subtler CIFAR-10 shift more steps help, with AUROC rising from 0.522 at T = 1 T = 1 T = 1 to 0.992 at T = 50 T = 50 T = 50 . The default T = 50 T = 50 T = 50 sits well within the small-step regime that Theorem 4.1’s first-order bound requires, and the ID/OOD separation does not depend on a finely tuned step count.
Learning rate η \eta η . Theorem 4.1 gives a first-order guarantee that becomes vacuous if the second-order remainder O ( T 2 η 2 ) O(T^2\eta^2) O ( T 2 η 2 ) catches up with the leading T η T\eta T η term; in plain words, the analysis only applies when η \eta η is small. Sweeping over a three-decade range η ∈ { 10 − 4 , 10 − 3 , 5 × 10 − 3 , 10 − 2 , 5 × 10 − 2 , 10 − 1 } \eta\in\{10^{-4}, 10^{-3}, 5 \times10^{-3}, 10^{-2}, 5 \times10^{-2}, 10^{-1}\} η ∈ { 1 0 − 4 , 1 0 − 3 , 5 × 1 0 − 3 , 1 0 − 2 , 5 × 1 0 − 2 , 1 0 − 1 } , Credit Default and Covertype keep AUROC at 1.000 throughout, and CIFAR-10 degrades only at very low η \eta η (< 5 × 10 − 3 < 5 \times10^{-3} < 5 × 1 0 − 3 ) where the steps are too small to move the decoder into the disagreement regime at all. The detector therefore inhabits the small-step regime under which the theory applies, and the Algorithm 1 LR-stability heuristic can pick within that regime with substantial slack.
Support size n n n . The PFN’s in-context support set is the conditioning information the entire detector reads against, and using more of it costs both quadratic attention compute and a longer prompt. We sweep n n n to see how small the in-context window can be before the detection signal degrades. Performance falls gracefully at n = 100 n = 100 n = 100 (AUROC 0.762–0.914) but recovers fully by n = 250 n = 250 n = 250 , so a modest in-context window suffices to anchor the detector. This rules out the alternative that CALD’s separation is a side-effect of the PFN being asked to solve a particularly large in-context task.
Anchor size ∣ X a n c ∣ |X_{\mathrm{anc}}| ∣ X anc ∣ . The anchor batch is the calibration substrate against which the post-finetune λ \lambda λ is scored, so its size enters the variance of the calibration record and the conformal threshold from Proposition 4.2 . CALD is robust to anchor size across ∣ X a n c ∣ ∈ { 16 , 32 , 64 , 128 , 256 } |X_{\mathrm{anc}}| \in\{16, 32, 64, 128, 256\} ∣ X anc ∣ ∈ { 16 , 32 , 64 , 128 , 256 } , with AUROC > 0.99 > 0.99 > 0.99 in all but one cell. The anchor set therefore does not need to be large to serve as a reliable ID reference, and the calibration cost of the method is bounded by the eval-batch geometry rather than by the held-out anchor.
Figure 14. Ablation: number of gradient steps T T T . Detection AUROC vs. T T T on three representative datasets. Covertype and Credit Default saturate immediately; CIFAR-10 improves with more steps.
Design-Choice Ablations
Pseudolabel choice. CALD’s disagree term pushes the eval predictions away from the model’s own pseudolabels y ^ = arg max q θ 0 ( y ∣ X e v a l , D s u p ) \hat{y} = \arg\max q_{\theta_0}(y \mid X_{\mathrm{eval}}, D_{\mathrm{sup}}) y ^ = arg max q θ 0 ( y ∣ X eval , D sup ) . Why use the model’s pseudolabels rather than any other arbitrary target? If any target produced the same ID/OOD separation, the signal would be coming from the disagreement objective in general rather than from the specific direction in label space that a confident model points to. Replacing y ^ \hat{y} y ^ with random labels drawn uniformly over the C C C classes (Figure 15 ) leaves AUROC unchanged on the datasets with large covariate shift (Covertype, UCI Heart, Adult, Diabetes Readmission), where any non-degenerate target is far enough from the posterior to drive the disagree gradient. On the moderate-shift datasets where the pretrained PFN is less confident on its own pseudolabels (Waterbirds and Folktables), random pseudolabels cost 9–10 AUROC points. The theoretical residual r e = p − u y ^ r_e = p - u_{\hat{y}} r e = p − u y ^ depends on y ^ \hat{y} y ^ matching the modal class prediction; the degradation is therefore concentrated in exactly the regime where the modal-class structure is the key component of the signal, consistent with the gradient form derived in § 4.2 .
Figure 15. Detection AUROC with model-pseudolabels vs. random pseudolabels. Harm-adjusted; dotted line marks chance (0.5). Random pseudolabels leave detection unchanged on strong-shift datasets but cost ∼10 points of AUROC on moderate-shift datasets (Waterbirds, Folktables) where the PFN is less confident on its own pseudolabels.
Pseudolabel scope. A natural alternative to freezing y ^ \hat{y} y ^ at θ 0 \theta_0 θ 0 is to recompute pseudolabels each step, so the disagree term always points away from the current model’s predictions. The theoretical analysis in § 4.2 assumes y ^ \hat{y} y ^ is fixed; if recomputing it preserved or improved the signal, the assumption would be a pure analytical convenience. We ablate per-batch vs. per-sample pseudolabels and frozen-at-θ 0 \theta_0 θ 0 vs. recomputed-at-step. Freezing at θ 0 \theta_0 θ 0 is necessary: recomputing destabilizes the target and the anchor-loss signal becomes noisy. The fixed-y ^ \hat{y} y ^ choice is therefore both an analytical and an operational requirement, not a tractability shortcut.
Last-layer-only finetuning. Theorem 4.1 proves a clean rank-one form for the per-sample gradients g a g_a g a and g e g_e g e only when updates are restricted to the final linear layer: with the full two-layer GELU decoder unfrozen, the gradient mixes contributions across layers and the feature-orthogonality argument in Corollary A.4 no longer applies. The deployed detector finetunes the whole decoder, so the theory could in principle be analyzing a regime that has nothing to do with how CALD is actually run. Re-running with only the last linear layer trainable matches full-decoder AUROC to within 0.01 on every dataset (Figure 16 ). The two regimes are therefore empirically indistinguishable, which means the analytical restriction is not a tractability tax: the theory describes the regime under which the detector operates, and a practitioner who wants the cheaper last-layer-only protocol pays nothing in detection power.
Figure 16. Last-layer-only vs. full-decoder finetuning. Detection AUROC matches to within 0.01 on every dataset, confirming that Theorem 4.1 ’s last-layer assumption is benign in practice.
Table 11. Ablation of the disagreement weight β \beta β . Mean detection AUROC (TabPFN, fixed η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 , 30 rounds, 3 seeds). Within-configuration results under a reduced protocol; absolute values are not comparable to Table 10 , which selects the learning rate per cell. “–”: not run.
Disagreement Weight
The joint objective weights the disagreement term by a coefficient β \beta β that the main experiments fix at 1, and a natural concern is that this choice is key: if detection degraded away from β = 1 \beta= 1 β = 1 , the reported results would hinge on an untuned constant, and if detection survived β = 0 \beta= 0 β = 0 , the disagreement term would not be the mechanism at all. We are therefore interested in ablating β \beta β across several orders of magnitude, including the degenerate β = 0 \beta= 0 β = 0 . At first order the question is already constrained: the separation gap obeys Δ λ ≈ η β ( E I D ⟨ g a , g e ⟩ − E O O D ⟨ g a , g e ⟩ ) \Delta\lambda\approx\eta\beta\left(\mathbb{E}_{\mathrm{ID}}\langle g_a,g_e\rangle- \mathbb{E}_{\mathrm{OOD}}\langle g_a,g_e\rangle\right) Δ λ ≈ η β ( E ID ⟨ g a , g e ⟩ − E OOD ⟨ g a , g e ⟩ ) , so η \eta η and β \beta β enter only through their product and the learning-rate sweep of Appendix D.1 already spans this axis at β = 1 \beta= 1 β = 1 ; the sweep below tests whether the first-order picture survives beyond it.
We set up the experiment as follows: TabPFN with fixed η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 , 30 calibration rounds, and 3 seeds, sweeping β ∈ { 0 , 0.25 , 0.5 , 1 , 2 , 4 } \beta\in\{0, 0.25, 0.5, 1, 2, 4\} β ∈ { 0 , 0.25 , 0.5 , 1 , 2 , 4 } on five datasets spanning far-OOD, moderate tabular, and subpopulation shift, extended to β ∈ { 8 , 16 } \beta\in\{8, 16\} β ∈ { 8 , 16 } on three of them. Figure 17 plots mean detection AUROC with per-seed spread; the table reports the values.
Figure 17. Ablation of the disagreement weight β \beta β . Mean detection AUROC over 3 seeds (error bars: ± 1 \pm1 ± 1 std; TabPFN, fixed η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 , 30 rounds; dotted line: chance). At β = 0 \beta= 0 β = 0 every dataset collapses exactly to chance; detection is flat across β ∈ [ 0.25 , 4 ] \beta\in[0.25, 4] β ∈ [ 0.25 , 4 ] and the first-order picture degrades only at very large η β \eta\beta η β .
These results show two things. First, at β = 0 \beta= 0 β = 0 the AUROC collapses to exactly 0.500 on every run of every dataset: with the disagreement term removed, the post-finetune anchor loss carries no ID/OOD information whatsoever, confirming that the eval-batch disagreement gradient is the mechanism rather than an auxiliary regularizer. Second, detection is flat across β ∈ [ 0.25 , 4 ] \beta\in[0.25, 4] β ∈ [ 0.25 , 4 ] , a sixteen-fold range around the default, so β = 1 \beta= 1 β = 1 sits on a wide plateau rather than a peak. At very large β \beta β the product η β \eta\beta η β exits the small-step regime of Assumption A.7 and the first-order picture no longer applies: Adult Income becomes unstable at β = 8 \beta= 8 β = 8 before recovering at 16, while UCI Heart, the dataset with the weakest first-order signal (cf. Table 18 ), actually benefits from the stronger push. β = 1 \beta= 1 β = 1 is principled at first order, where only the product η β \eta\beta η β matters, and empirically non-critical over two orders of magnitude.
Deployment Cost and the Finetuning Budget T T T
Unlike post-hoc scores, CALD must run T T T gradient steps on every monitored batch, so its deployment cost is a practical concern: a detector that is accurate but orders of magnitude more expensive than the alternatives needs to state exactly what the budget buys. We seek to determine (i) the wall-clock cost per monitored batch and (ii) how detection accuracy depends on the finetuning budget T T T , i.e. how much of the paper’s T = 50 T = 50 T = 50 budget is actually needed.
We set up the experiment as follows. We time one finetuning step per monitored batch of 128 points on an NVIDIA H100: 0.168 s for TabPFN and 0.056 s for TabICL, so the full T = 50 T = 50 T = 50 budget costs 8.4 s and 2.8 s per batch respectively, against 0.0003–0.67 s total for the 15 post-hoc baselines. We then truncate the detector at T ∈ { 5 , 10 , 20 , 50 } T \in\{5, 10, 20, 50\} T ∈ { 5 , 10 , 20 , 50 } on all 15 datasets and both models (10 seeds, per-cell selected learning rate as in Table 10 ) and record T 95 T_{95} T 95 , the smallest T T T whose mean AUROC reaches 95% of the T = 50 T = 50 T = 50 value. Table 12 reports the full per-dataset cost–accuracy profile.
Table 12. Detection AUROC as a function of the finetuning budget T T T . Mean over 10 seeds at the per-cell selected learning rate (same protocol as Table 10 ). T 95 T_{95} T 95 is the smallest T T T reaching 95% of the T = 50 T=50 T = 50 AUROC; s @ T 95 s@T_{95} s @ T 95 is the corresponding wall-clock per monitored batch (H100, batch 128). Aggregates: TabPFN reaches 0.845 ± \pm ± 0.159 at T = 10 T=10 T = 10 vs. 0.904 ± \pm ± 0.154 at T = 50 T=50 T = 50 with median T 95 = 1 T_{95}=1 T 95 = 1 ; TabICL reaches 0.851 ± \pm ± 0.161 vs. 0.930 ± \pm ± 0.124 with median T 95 = 2 T_{95}=2 T 95 = 2 .
The timing results show a trade-off. In raw wall-clock terms CALD is one to four orders of magnitude more expensive than any post-hoc baseline, and no amount of truncation closes that gap. But the budget needed to reach the reported accuracy is a small fraction of T = 50 T = 50 T = 50 : the median T 95 T_{95} T 95 is 1 step for TabPFN and 2 for TabICL, and T ≤ 10 T \le10 T ≤ 10 (about 1.7 s and 0.6 s per monitored batch) recovers 95% of the final AUROC on 14 of 15 datasets for TabPFN and 12 of 15 for TabICL. The exceptions are the slow-converging cells (Folktables/TabPFN at T 95 = 38 T_{95} = 38 T 95 = 38 ; CelebA, UCI Heart, and Diabetes Readmission under TabICL at 36, 21, and 14), which are also among the weaker cells at full budget. One cell is non-monotone: Camelyon17 (DINOv2) under TabPFN peaks early (0.992 at T = 5 T=5 T = 5 ) and degrades with further finetuning, which is the budget-resolved view of its weak full-budget value in Table 10 . T = 10 T = 10 T = 10 is the practical operating point for deployment, with T = 50 T = 50 T = 50 retained in the main results as the conservative budget at which the theory’s small-step premises were validated.
Frozen Deployment Configuration and Stability of the Learning-Rate Selection
Proposition 4.2 bounds the false-alarm rate only when the anchor, support, and finetuning hyperparameters are fixed before deployment, yet Table 10 selects the learning rate per dataset–model cell with the tail-stability rule, i.e. with a procedure that looks at the trajectories being certified. The guarantee therefore covers a fixed configuration, not the selection protocol, and two questions follow: what does it cost to actually deploy the fixed configuration the guarantee speaks about, and how fragile is the selection rule that produces the headline numbers? We measure three things: the accuracy cost of freezing η = 10 − 3 \eta=10^{-3} η = 1 0 − 3 everywhere, a census of the selection rule’s fallback behavior across all cells and tail windows, and the empirical false-positive rate of the frozen configuration under stress.
We set up the experiment as follows. (a) We recompute all 30 method× \times × dataset cells with the single frozen configuration η = 10 − 3 \eta=10^{-3} η = 1 0 − 3 (no selection of any kind) and compare against the selected-LR pipeline of Table 10 . (b) We re-run the tail-stability selection over all 30 cells and three tail windows (steps 25–45, 30–50, 35–50). (c) We estimate the false-positive rate of the frozen configuration under the no-shift null over 240 calibration/deployment rounds on six datasets, in four stress regimes: deterministic replay, nondeterministic GPU kernels, re-drawing the anchor every round, and time-correlated eval streams.
The certified configuration is deployable at essentially no average cost: freezing η = 10 − 3 \eta=10^{-3} η = 1 0 − 3 changes AUROC by − 0.005 -0.005 − 0.005 on average over the 30 cells. The average hides real per-cell movement in both directions, which we disclose rather than average away: CIFAR-10 is the worst case ($-0.103 TabPFN, −0.227 TabICL; it needs η = 10 − 2 \eta= 10^{-2} η = 1 0 − 2 ), while Camelyon17 (DINOv2)/TabPFN improves by +0.324, meaning the selection rule itself mis-serves that cell. The census in (b) shows the selection rule is otherwise stable: 4 of 30 cells trigger the fallback to η = 10 − 4 \eta= 10^{-4} η = 1 0 − 4 (Adult Income on both models at AUROC 1.000 despite the fallback, CelebA/TabICL at 0.845, and Folktables/TabPFN at 0.624), all four on benign shifts, while every severely shifted dataset selects its learning rate stably; across the three tail windows the selected rate changes in 1 of 60 comparisons (Folktables/TabPFN under the 25–45 window, Δ \Delta Δ AUROC −0.052). Finally, Table 14 shows the frozen configuration’s false-alarm rate stays controlled under all four stress regimes. The fixed η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 configuration is the certified deployment mode of CALD — the mode Proposition 4.2 actually speaks about — and per-cell selection is a reporting-time diagnostic that requires labeled OOD trajectories and should be read as such in Table 10 .
Table 14. Empirical false-positive rate of the frozen configuration under the no-shift null. Six datasets × \times × 240 null rounds per regime; conformal bound α + 1 / ( K + 1 ) = 0.070 \alpha+ 1/(K+1) = 0.070 α + 1/ ( K + 1 ) = 0.070 . Regime means sit at or below the bound; four individual dataset–regime cells marginally exceed it (max 0.075), consistent with finite-sample fluctuation at n = 240 n = 240 n = 240 .
Anchor Construction Robustness
The anchor set is the reference that every statistic in the method is scored against, so the entire pipeline could in principle hinge on drawing a lucky, perfectly clean anchor — a serious concern in deployment, where held-out labels may be scarce, noisy, or quietly contaminated by the very shift being monitored. Appendix D.1 already varies the anchor’s size ; here we seek to determine the sensitivity to its quality , stressing the anchor along the remaining axes: label noise, contamination by OOD points, and re-drawing the anchor itself.
We set up the experiment as follows: TabPFN, 3 seeds per cell. For label noise we flip a fraction ρ ∈ { 0 , 0.05 , 0.1 , 0.2 } \rho\in\{0, 0.05, 0.1, 0.2\} ρ ∈ { 0 , 0.05 , 0.1 , 0.2 } of anchor labels uniformly at random; for contamination we replace a fraction ρ ∈ { 0 , 0.05 , 0.1 , 0.25 } \rho\in\{0, 0.05, 0.1, 0.25\} ρ ∈ { 0 , 0.05 , 0.1 , 0.25 } of anchor points with OOD samples; for re-drawing we resample the anchor from the held-out ID pool at every calibration round and measure the false-positive rate under the
Table 13. Frozen configuration (η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 , no selection) vs. the per-cell selected learning rate of Table 10. Detection AUROC; Δ \Delta Δ = frozen − selected. Mean Δ \Delta Δ over all 30 cells is −0.005 (AUROC) and +0.008 (TPR@5%, not shown). The frozen column is the configuration covered by the conformal guarantee.
no-shift null (the “anchor re-drawn every round” regime of Table 14 ). Table 15 reports detection AUROC on the datasets with complete stress grids.
Anchor quality is a low-sensitivity component of the method. Under up to 20% label noise, no dataset shows a movement exceeding its own per-seed standard deviation: the largest swings (PACS, about ± 0.1 \pm0.1 ± 0.1 across noise levels against a per-seed std of up to ± 0.18 \pm0.18 ± 0.18 , and CIFAR-10’s dip at ρ = 0.05 \rho= 0.05 ρ = 0.05 against a std of ± 0.16 \pm0.16 ± 0.16 ) are seed noise, not trends, and neither is monotone in ρ \rho ρ as genuine degradation would be. OOD contamination up to 25% moves no dataset by more than 0.03. Re-drawing the anchor every round keeps the false-positive rate at 0.052–0.069, within the 0.070 bound. This robustness is also what the theory predicts: in Theorem 4.1 , γ \gamma γ is a population-level constant in which the anchor sample never appears (conditioning the proof on a fixed anchor merely replaces γ \gamma γ by γ ( X a n c ) \gamma(X_{\mathrm{anc}}) γ ( X anc ) ), and in Proposition 4.2 the exchangeable unit of the rank argument is the calibration round, not the anchor point, so anchor size and composition never enter either guarantee. Empirically the anchor contributes little even to the variance of the statistic: the spread of the per-round calibration scores is essentially flat from anchor size 16 to 256 (median std ratio 0.97), because round-to-round eval-batch resampling, not anchor averaging, dominates the variance of λ \lambda λ . The anchor needs to be a modest, roughly clean sample of ID data and nothing more.
Feature Collapse in Deployed Multi-Layer PFNs
The feature-orthogonality assumption behind Theorem 4.1 is motivated by Nagler’s tilting argument (Appendix A.8), which is proven for single-layer attention, while the deployed TabPFN and TabICL are multi-layer transformers — so the assumption could in principle describe a model class that experiments never touch. The multi-layer extension is a hard open problem, but the argument’s central prediction is directly measurable: as an evaluation batch becomes more OOD, its features should collapse toward a common representation, becoming more orthogonal to the ID anchor features. We seek to determine whether this predicted collapse actually occurs in the deployed multi-layer models, under both far-OOD and near-OOD conditions.
We set up the experiment as follows. On Covertype (far-OOD) and Waterbirds (near-OOD) we construct evaluation batches containing a fraction α ∈ { 0 , 0.25 , 0.5 , 0.75 , 1 } \alpha\in\{0, 0.25, 0.5, 0.75, 1\} α ∈ { 0 , 0.25 , 0.5 , 0.75 , 1 } of OOD examples and 1 − α 1-\alpha 1 − α ID examples. For each α \alpha α we extract the anchor and evaluation features of the deployed models with no finetuning (TabPFN: the pre-decoder representation; TabICL: the input to the ICL predictor’s decoder, i.e. the post-LayerNorm output of the dataset-wise ICL transformer) and measure two statistics: the 95th percentile of the absolute cosine similarity across all anchor–evaluation feature pairs, after centering by the pooled α = 1 \alpha= 1 α = 1 evaluation mean as a proxy for the collapse direction ϕ ∞ \phi_{\infty} ϕ ∞ (this is the empirical proxy for ϵ \epsilon ϵ in Assumption A.3, and should decrease under tilting), and the evaluation-feature dispersion, the mean Euclidean distance of each evaluation feature to the mean evaluation feature (which should also decrease under collapse). We additionally report detection
AUROC of the mixed batch against the α = 0 \alpha=0 α = 0 reference. Figure 18 plots the two collapse statistics; Table 16 reports all values.
Figure 18. Feature collapse under controlled OOD mixing. 95th-percentile absolute anchor–eval cosine (left; the empirical proxy for ϵ \epsilon ϵ ) and evaluation-feature dispersion (right) as the OOD fraction α \alpha α of the evaluation batch grows; solid lines are TabPFN, dashed are TabICL. Both collapse statistics fall sharply on the far-OOD Covertype and mildly on the near-OOD Waterbirds, as the tilting argument predicts.
Table 16. Feature collapse under controlled OOD mixing. 95th-percentile absolute anchor–eval cosine (the empirical proxy for ϵ \epsilon ϵ ), evaluation-feature dispersion, and detection AUROC vs. the α = 0 \alpha=0 α = 0 reference, as the OOD fraction α \alpha α of the evaluation batch grows. Both statistics decrease with α \alpha α , strongly on the far-OOD Covertype and mildly on the near-OOD Waterbirds. AUROC here is within the mixing protocol and not comparable to Table 10 .
The tilting prediction holds in the deployed multi-layer models, with exactly the severity profile the theory assigns it. On Covertype, both collapse statistics fall sharply and monotonically with the OOD fraction: the cosine proxy drops from 0.939 to 0.537 (TabPFN) and from 0.859 to 0.544 (TabICL), and dispersion contracts by factors of 2.1 and 1.5. On Waterbirds the same decreases appear but are mild (cosine ratios 0.99 and 0.96), consistent with Theorem 4.1 ’s scope: the collapse is a far-OOD limit phenomenon, and a near-OOD subpopulation shift should, and does, produce only a weak echo of it. Detection AUROC rises with α \alpha α in step with the collapse statistics in both models. Although the tilting argument is unproven for general transformer stacks, its measurable prediction is what the deployed multi-layer models actually do, precisely where Theorem 4.1 invokes it; the multi-layer proof itself remains open (Appendix § 8 .§ 16.1 ).
Theorem 4.1’s Condition and Premise at Finite Severity
Section 5.4 of the main paper gives an abridged version of this analysis (Figure 3 b); the full estimates and the per-dataset λ \lambda λ -gap are collected here.
Theorem 4.1 certifies the signed separation only when ϵ < γ B ϕ 2 B C \epsilon< \frac{\gamma}{B_{\phi}^{2}B_C} ϵ < B ϕ 2 B C γ , a condition stated in worst-case constants, and the question is whether it is ever satisfied on the benchmark at finite shift severity—or whether the theory certifies a regime the experiments never visit. We seek to determine, per dataset, (i) whether the theorem’s condition holds as stated, and (ii) when it does not, whether the gradient mechanism the proof is built on is nonetheless present, by measuring the proof’s premise directly instead of routing it through the worst-case constants.
We set up the experiment as follows. On ten datasets (TabPFN) we estimate every quantity in the condition from the factorization of Lemma A.1 : ϵ ^ \hat{\epsilon} ϵ ^ is the 95th percentile of the absolute anchor–eval feature cosines (centered by the pooled-OOD-mean proxy for ϕ ∞ \phi_{\infty} ϕ ∞ ; the 95th percentile is a lenient estimate, since the assumption formally requires a uniform bound), and γ ^ \hat{\gamma} γ ^ , B ^ ϕ \hat{B}_{\phi} B ^ ϕ , B ^ C \hat{B}_{C} B ^ C are the empirical versions of the ID-interference and boundedness constants. Separately, we measure the proof’s premise on the finetuning trajectories themselves: Δ t r a j : = E O O D [ ⟨ g ˉ a , g ˉ e ⟩ ] − E I D [ ⟨ g ˉ a , g ˉ e ⟩ ] \Delta_{\mathrm{traj}} := \mathbb{E}_{\mathrm{OOD}}[\langle\bar{g}_{a},\bar{g}_{e}\rangle] - \mathbb{E}_{\mathrm{ID}}[\langle\bar{g}_{a},\bar{g}_{e}\rangle] Δ traj := E OOD [⟨ g ˉ a , g ˉ e ⟩] − E ID [⟨ g ˉ a , g ˉ e ⟩] , the gap in the time-averaged anchor–eval gradient alignment of the full-decoder autopgrad, together with the λ \lambda λ -gap E [ λ ∣ I D ] − E [ λ ∣ O O D ] \mathbb{E}[\lambda\mid\mathrm{ID}] - \mathbb{E}[\lambda\mid\mathrm{OOD}] E [ λ ∣ ID ] − E [ λ ∣ OOD ] , the raw separation available to the detector (here and below we write E [ λ ∣ I D ] \mathbb{E}[\lambda\mid\mathrm{ID}] E [ λ ∣ ID ] for the main paper’s E [ λ I D ] \mathbb{E}[\lambda_{\mathrm{ID}}] E [ λ ID ] , and likewise for OOD). The proof’s mechanism operates iff Δ t r a j > 0 \Delta_{\mathrm{traj}} > 0 Δ traj > 0 : the disagreement gradient interferes with anchor descent more strongly under OOD inputs.
These results show a sharp split between the condition and the mechanism. The condition fails everywhere: ϵ ^ ≥ 0.497 \hat{\epsilon} \ge0.497 ϵ ^ ≥ 0.497 on every dataset while the right-hand side never exceeds + 0.0083 +0.0083 + 0.0083 and is negative on eight of ten, so at finite severity every benchmark is near-OOD in the theorem’s sense and the formal guarantee certifies none of them (Covertype, the most separated, comes closest). The failure, however, lives in the worst-case constants, not in the mechanism: the premise Δ t r a j > 0 \Delta_{\mathrm{traj}} > 0 Δ traj > 0 holds on nine of ten datasets, including the moderate-overlap benchmarks where the static condition is vacuous. More tellingly, the two datasets where the premise is weakest or fails—CIFAR-10 ( + 0.11 ) (+0.11) ( + 0.11 ) and UCI Heart ( − 4.4 ) (-4.4) ( − 4.4 ) — are exactly the two with near-zero λ \lambda λ -gap ( + 0.006 , + 0.008 ) (+0.006, +0.008) ( + 0.006 , + 0.008 ) : the measurement predicts the detector’s weakest cells in advance rather than rationalizing its successes after the fact. We conclude that Theorem 4.1 certifies detection in the far-OOD regime only, that the gradient-interference mechanism it is built on is empirically present across the near-OOD benchmarks, and that a finite-ϵ \epsilon ϵ bound with measurable constants in place of worst-case ones is the right target for future theory.
Two-Signal Harm Detection: Empirical Evaluation
The deployed statistic λ \lambda λ detects distributional difference, not harm: Lemma A.12 shows the accuracy gap depends only on mass moved onto the model’s mistake region, which no label-free statistic can see, and empirically λ \lambda λ false-alarms on the benign Bank Marketing, Diabetes Readmission, Credit Default, and CelebA shifts. Appendix A.13 proposes the confidence-drop statistic μ ^ \hat{\mu} μ ^ (Proposition A.21 ) as a harm-magnitude estimator, with λ \lambda λ as a shift-confirmation gate; here we are interested in whether the composed detector actually restores benign-shift silence, and at what cost in harmful-shift detection.
Two properties hold before any measurement: the conjunction fires only when both tests fire, so its false-alarm rate under the null is at most the smaller of the two individual rates, under arbitrary dependence and with no Bonferroni correction (the conformal bound α + 1 / ( K + 1 ) \alpha+ 1/(K+1) α + 1/ ( K + 1 ) carries over unchanged); and under any shifted distribution the μ ^ \hat{\mu} μ ^ gate can only remove alerts produced by the λ \lambda λ -test, never add them, so it cannot increase benign false alarms.
We set up the experiment as follows: all 15 datasets, TabPFN, fixed η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 , with μ ^ = E ^ I D [ p x ( y ) ] − E ^ e v a l [ max c p x ( c ) ] \hat{\mu} = \widehat{\mathbb{E}}_{\mathrm{ID}}[p_x(y)] - \widehat{\mathbb{E}}_{\mathrm{eval}}[\max_c p_x(c)] μ ^ = E ID [ p x ( y )] − E eval [ max c p x ( c )] estimated per Definition A.17. The composed detector fires iff the λ \lambda λ -test fires and μ ^ \hat{\mu} μ ^ exceeds its threshold. Figure 19 shows the per-dataset movement from λ \lambda λ alone to the conjunction; Table 19 reports the correct-decision rate of each configuration: the silence rate on benign datasets and the fire rate on harmful ones.
Figure 19. Two-signal detector vs. λ \lambda λ alone. Correct-decision rate per dataset (benign: silence; harmful: detection), TabPFN with fixed η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 . A diamond to the right of its circle is an improvement from the μ ^ \hat{\mu} μ ^ gate. The gate removes the benign false alarms on CelebA, Credit Default, and Diabetes Readmission, cannot help Bank Marketing (whose confidence collapses), and costs little on harmful shifts.
Table 19. Two-signal detector: correct-decision rates. Benign rows report the silence rate (correct = no alarm); harmful rows report the detection rate (correct = alarm). All 15 datasets, TabPFN, fixed η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 (within-configuration; not comparable to Table 10). Means: benign silence 0.50 → 0.83, harmful detection 0.80 → 0.77.
The gate works where the theory says it should. Mean benign silence rises from 0.50 to 0.83: the gate removes the false alarms on three of the four problematic benign datasets (CelebA 0.42 → \to → 0.97, Credit Default 0.00 → \to → 0.62, Diabetes Readmission 0.00 → \to → 1.00). Bank Marketing remains a failure (0.23 → \to → 0.23) because the model’s confidence collapses under that benign shift, so both signals fire — the one benign case where the gate’s own premise is violated. On harmful shifts the mean detection rate drops only from 0.80 to 0.77, with the losses concentrated where the λ \lambda λ -test is already weak under this fixed configuration (PACS, UCI Heart) rather than created by the gate. The construction has a real limitation that bounds how far it should be trusted: μ ^ \hat{\mu} μ ^ reads the model’s own confidence, so an overconfident or poorly calibrated model would silence true alarms, and Proposition A.21 ’s error terms are exactly calibration gaps. A formal treatment of when the confidence signal can be trusted is beyond the scope of this work. The two-signal construction is an evaluated proposal that demonstrably recovers benign-shift silence at modest cost, while λ \lambda λ remains the primary, conformally certified statistic of CALD .
Detectability Across Shift Types
CALD monitors unlabeled covariates, so its reach is bounded by a structural fact: a shift is visible only insofar as it changes the covariate marginal p ( X ) p(X) p ( X ) . The PFN’s pretraining prior suggests organizing shifts by where they enter the data-generating process — TabPFN’s synthetic tasks are drawn from randomly sampled structural causal models, so one can ask which interventions on the SCM a label-free monitor can see. A shift in the label prior p ( y ) p(y) p ( y ) changes the mixture of class-conditional covariate distributions and therefore moves p ( X ) p(X) p ( X ) ; a concept shift that rewrites p ( y ∣ X ) p(y \mid X) p ( y ∣ X ) while leaving p ( X ) p(X) p ( X ) fixed is invisible in principle, however harmful. We seek to determine whether the deployed detector respects this taxonomy, using controlled shift injections where the benchmark’s natural shifts cannot separate the two.
We set up the experiment as follows: TabPFN, fixed η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 , 2 seeds. For label-prior shift we resample the evaluation batch’s class proportions toward a skewed target prior at full strength, keeping each class-conditional covariate distribution intact; for concept shift we relabel the evaluation batch through a permuted class map at full strength, changing p ( y ∣ X ) p(y \mid X) p ( y ∣ X ) while leaving the covariates untouched. Figure 20 plots detection against the harm each injected shift inflicts; Table 20 reports detection AUROC at full shift strength against the no-shift baseline, alongside the accuracy drop the concept shift inflicts.
Figure 20. Label-prior vs. concept shift at full strength. Each point is one dataset under one injected shift (TabPFN, fixed η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 , 2 seeds; dotted line: chance). Concept shifts (triangles) destroy accuracy yet sit at their no-shift detection baseline; label-prior shifts (circles) barely move accuracy yet are detected wherever they move p ( X ) p(X) p ( X ) . The annotated points are the exceptions discussed in the text.
Label-prior vs. concept shift at full strength. Detection AUROC (TabPFN, fixed η = 10 − 3 \eta= 10^{-3} η = 1 0 − 3 , 2 seeds; within-configuration, not comparable to Table 10 ). The no-shift column is the same protocol at strength 0 and marks each dataset’s chance baseline. Concept shift destroys accuracy while leaving the covariates untouched, and detection stays at its baseline; label-prior shift moves the covariate marginal and is detected wherever that movement is substantial.
Table 20.
The detector obeys the taxonomy almost exactly. Concept shift is invisible: on nine of ten datasets, AUROC under a full-strength concept shift stays within 0.03 of the no-shift baseline even as accuracy falls by 52 to 98 percentage points — this is the impossibility of Lemma A.12 realized in its purest form, since no label-free monitor of any kind could detect these shifts. Covertype’s 0.79 is the one visible exception, and it is instructive: its class-stratified evaluation sampling slightly perturbs the covariate distribution as a side effect of the relabeling, and the detector picks up precisely that covariate residue, not the concept change itself. Label-prior shift, by contrast, is detected strongly wherever the resampled prior substantially moves the covariate mixture (seven of ten datasets at 0.92–1.00); it is missed on Bank Marketing and Diabetes Readmission, whose class-conditional covariate distributions overlap heavily, so that even a full prior swap barely moves p ( X ) p(X) p ( X ) — consistent with the mechanism, since the detector sees only the covariate marginal. UCI Heart is confounded in both directions: a residual covariate quirk of its ID split elevates its no-shift baseline to 0.88, and neither injected shift moves the detector far from that baseline. CALD detects exactly the SCM interventions that reach p ( X ) p(X) p ( X ) and is structurally blind to those that do not; shifts expressible as re-sampling the SCM’s exogenous inputs are the detector’s natural domain, while mechanism changes with fixed covariates require labels and are out of scope (Appendix § 9 ).
NeurIPS Paper Checklist
Claims
Question: Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
Answer: [Yes]
Justification: Each claim in the abstract and introduction is substantiated: the algorithm (Section 4), calibration-to-harm and benchmark results (Section 5, Table 1 ), and the theoretical guarantees (Theorem 4.1 , Proposition 4.2 ).
Guidelines:
The answer [N/A] means that the abstract and introduction do not include the claims made in the paper.
The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A [No] or [N/A] answer to this question will not be perceived well by the reviewers.
The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.
It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.
Limitations
Question: Does the paper discuss the limitations of the work performed by the authors?
Answer: [Yes]
Justification: Appendix § 9 catalogues out-of-scope failure modes (label shift, concept shift, adversarial inputs) and the regimes where Theorem A.9 ’s guarantee becomes vacuous (near-OOD with overlapping supports).
Guidelines:
The answer [N/A] means that the paper has no limitation while the answer [No] means that the paper has limitations, but those are not discussed in the paper.
The authors are encouraged to create a separate “Limitations” section in their paper.
The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.
The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.
The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.
The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.
If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.
While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren’t acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.
Theory assumptions and proofs
Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?
Answer: [Yes]
Justification: § 4.2 presents simplified statements of the main results; complete assumptions and proofs are in Appendix § 8 , with all assumptions consolidated in Appendix § 8 .14.
Guidelines:
The answer [N/A] means that the paper does not include theoretical results.
All the theorems, formulas, and proofs in the paper should be numbered and cross-referenced.
All assumptions should be clearly stated or referenced in the statement of any theorems.
The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition.
Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.
Theorems and Lemmas that the proof relies upon should be properly referenced.
Experimental result reproducibility
Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?
Answer: [Yes]
Justification: Algorithm 1 gives the full pseudocode; § 5.1 and Appendix § 10 list all datasets, baselines, hyperparameters, and per-dataset preprocessing.
Guidelines:
The answer [N/A] means that the paper does not include experiments.
If the paper includes experiments, a [No] answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.
If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.
Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general, releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.
While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example (a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm. (b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully. (c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset). (d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.
Open access to data and code
Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?
Answer: [Yes]
Justification: Code with reproduction scripts is released at https://github.com/teivng/cald; all datasets are publicly available and their sources are described in Appendix § 10 .1.
Guidelines:
The answer [N/A] means that paper does not include experiments requiring code.
Please see the NeurIPS code and data submission guidelines (https://neurips.cc/public/guides/CodeSubmissionPolicy) for more details.
While we encourage the release of code and data, we understand that this might not be possible, so [No] is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark).
The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines (https://neurips.cc/public/guides/CodeSubmissionPolicy) for more details.
The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.
The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why.
At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).
Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.
Experimental setting/details
Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer) necessary to understand the results?
Answer: [Yes]
Justification: § 5.1 specifies the setup; Appendix § 10 lists all hyperparameter values (T = 50 T = 50 T = 50 , η ∈ { 10 − 2 , 10 − 3 , 10 − 4 } \eta\in\{10^{-2}, 10^{-3}, 10^{-4}\} η ∈ { 1 0 − 2 , 1 0 − 3 , 1 0 − 4 } selected per cell by the tail-stability rule, K = 50 K = 50 K = 50 , α = 0.05 \alpha= 0.05 α = 0.05 ) and per-dataset configurations.
Guidelines:
The answer [N/A] means that the paper does not include experiments.
The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.
The full details can be provided either with the code, in appendix, or as supplemental material.
Experiment statistical significance
Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?
Answer: [Yes]
Justification: Results are reported as means with standard deviations across 10 seeds (Appendix C.4); Type-I error is closed-form-bounded by α + 1 / ( K + 1 ) \alpha+ 1/(K + 1) α + 1/ ( K + 1 ) via Proposition 4.2 .
Guidelines:
The answer [N/A] means that the paper does not include experiments.
The authors should answer [Yes] if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.
The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).
The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)
The assumptions made should be given (e.g., Normally distributed errors).
It should be clear whether the error bar is the standard deviation or the standard error of the mean.
It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.
For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g., negative error rates).
If error bars are reported in tables or plots, the authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.
Experiments compute resources
Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?
Answer: [Yes]
Justification: All experiments run on a single NVIDIA H100 GPU; total compute is on the order of tens of GPU-hours, with per-step runtimes in Appendix D.4.
Guidelines:
The answer [N/A] means that the paper does not include experiments.
The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.
The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.
The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn’t make it into the paper).
Code of ethics
Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines ?
Answer: [Yes]
Justification: We have reviewed and adhered to the NeurIPS Code of Ethics; the work involves no human subjects or scraped personal data.
Guidelines:
The answer [N/A] means that the authors have not reviewed the NeurIPS Code of Ethics.
If the authors answer [No], they should explain the special circumstances that require a deviation from the Code of Ethics.
The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).
Broader impacts
Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
Answer: [Yes]
Justification: Positive impact is safer deployment of tabular foundation models in high-stakes domains; the main risk is over-trusting the test outside its proven scope, which Appendix B explicitly catalogues to mitigate. Guidelines:
The answer [N/A] means that there is no societal impact of the work performed.
If the authors answer [N/A] or [No], they should explain why their work has no societal impact or why the paper does not address societal impact.
Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate Deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.
If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).
Safeguards
Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pre-trained language models, image generators, or scraped datasets)?
Answer: [N/A]
Justification: The paper releases no high-misuse-risk artifacts; CALD is a deployment-time monitor over existing pretrained PFNs.
Guidelines:
The answer [N/A] means that the paper poses no such risks.
Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.
Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.
Licenses for existing assets
Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?
Answer: [Yes]
Justification: All models (TabPFN, TabICL) and datasets are cited and used under their original licenses; dataset sources are described in Appendix C.1.
Guidelines:
The answer [N/A] means that the paper does not use existing assets.
The authors should cite the original paper that produced the code package or dataset.
The authors should state which version of the asset is used and, if possible, include a URL.
The name of the license (e.g., CC-BY 4.0) should be included for each asset.
For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.
If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.
For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.
If this information is not available online, the authors are encouraged to reach out to the asset’s creators.
13. New assets
Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
Answer: [Yes]
Justification: The CALD implementation is released at https://github.com/teivng/cald with a README documenting the API and run commands.
Guidelines:
The answer [N/A] means that the paper does not release new assets.
Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.
The paper should discuss whether and how consent was obtained from people whose asset is used.
At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.
14. Crowdsourcing and research with human subjects
Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?
Answer: [N/A]
Justification: The paper does not involve crowdsourcing or research with human subjects.
Guidelines:
The answer [N/A] means that the paper does not involve crowdsourcing nor research with human subjects.
Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.
According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.
15. Institutional review board (IRB) approvals or equivalent for research with human subjects
Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?
Answer: [N/A]
Justification: The paper does not involve human subjects, so IRB approval is not applicable.
Guidelines:
Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.
For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.
Declaration of LLM usage
Question: Does the paper describe the usage of LLMs if it is an important, original, or non-standard component of the core methods in this research? Note that if the LLM is used only for writing, editing, or formatting purposes and does not impact the core methodology, scientific rigor, or originality of the research, declaration is not required.
Answer: [N/A]
Justification: LLMs are not used as any component of the core methodology. The PFNs studied (TabPFN, TabICL) are tabular in-context learners, not LLMs.
Guidelines:
The answer [N/A] means that the core method development in this research does not involve LLMs as any important, original, or non-standard components.
Please refer to our LLM policy in the NeurIPS handbook for what should or should not be described.