---
title: 'Post-hoc L2D: Density-Ratio Deferral Framework'
url: https://www.emergentmind.com/topics/post-hoc-learning-to-defer-l2d
type: topic
---

# Post-hoc L2D: Density-Ratio Deferral Framework

Post-hoc Learning to Defer (L2D) is a human–AI decision framework in which a predictor is fixed first and a separate post-processing mechanism is then used to decide whether the predictor should act or defer to an expert on a given input. In the density-ratio formulation of post-hoc L2D, deferral is defined by comparing divergence-regularized “ideal distributions” for the model and the expert, and the comparison is operationalized through a learned scalar scorer whose threshold can be adjusted at test time without retraining [2605.19557]. This formulation places post-hoc deferral in direct relation to Chow-style reject rules, expert-aware posterior reweighting, and density-ratio estimation, while adjacent post-hoc lines of work study training-free multiple-expert routing, partial deferral for sequence outputs, and constrained post-processing under fairness or budget requirements [2509.12573].

## 1. Formal setting and scope

In the framework developed for density-ratio-based post-hoc L2D, the starting point is a data distribution
\[
P \in \Delta(\X\times\Y), \qquad Y\in\{1,\dots,L\},
\]
with decomposition
\[
P(x,y)=P_{\rm x}(x)\,\eta_y(x), \qquad \eta_y(x)=P[Y=y\mid X=x].
\]
A model–loss pair \((h,\ell)\) is compared against an expert–loss pair \((h^{(E)},\ell)\). The deferral decision is not built into the predictor itself; instead, a post-hoc scorer is trained after the predictor has been fixed, and deferral is produced by thresholding that scorer [2605.19557].

This post-hoc separation between prediction and deferral also appears in other variants of L2D. For sequences, a frozen autoregressive predictor \(f\) is paired with either a token-level rejector or a one-time rejector learned afterward, rather than retraining the underlying sequence model [2502.01459]. In constrained L2D, the post-hoc object can be a simplex-valued decision rule estimated from hold-out data to satisfy constraints such as expert-budget or demographic-parity requirements [2407.12710]. A training-free variant goes further by eliminating rejector training entirely and calibrating deferral from conformal prediction sets and expert confusion data [2509.12573].

The central scope of post-hoc L2D is therefore narrower than generic abstention and broader than a single reject-rule family. It includes learned scorers, calibrated set-based routing, and plug-in post-processing rules, provided the predictor itself is treated as fixed and the defer decision is imposed afterward.

## 2. Ideal distributions and deferral by density ratio

The density-ratio approach defines deferral through two divergence-regularized reweightings of the data distribution: one for the model and one for the expert. For a convex divergence \(D\) and temperature \(\gamma>0\), the model’s marginal ideal distribution on \(\X\) is
\[
Q_{\mtype}
=
\arg\min_{Q\in\Delta(\X)}
\Bigl\{
\E_{X\sim Q}\bigl[\E_{Y\sim\eta(X)}[\ell(X,Y,h(X))]\bigr]
+\gamma\,D(Q\Vert P_{\rm x})
\Bigr\},
\]
while the joint ideal distribution is first defined on \(\X\times\Y\),
\[
\bar Q_{\jtype}
=
\arg\min_{\bar Q\in\Delta(\X\times\Y)}
\Bigl\{
\E_{(X,Y)\sim\bar Q}\bigl[\ell(X,Y,h(X))\bigr]
+\gamma\,D(\bar Q\Vert P)
\Bigr\},
\]
and then marginalized as
\[
Q_{\jtype}(x)=\sum_y \bar Q_{\jtype}(x,y).
\]
Exactly analogous distributions \(Q_{\mtype}^{(E)}\) and \(Q_{\jtype}^{(E)}\) are defined for the expert [2605.19557].

Deferral is then encoded by the density ratio between the model’s and the expert’s ideals:
\[
r_{\itype}(x;\tau,\gamma,\gamma^{(E)})
=
\bigl[\,\tfrac{dQ_{\itype}(x;\gamma)}{dQ_{\itype}^{(E)}(x;\gamma^{(E)})}\le \tau\,\bigr],
\qquad \itype\in\{\mtype,\jtype\}.
\]
Under this construction, an input is deferred when it is sufficiently more compatible with the expert’s ideal distribution than with the model’s.

For \(D=\mathrm{KL}\), the joint ideals admit closed-form multiplicative weights. In particular,
\[
Q_{\jtype}(x;\gamma)\propto
\E_{Y\sim\eta(x)}\bigl[e^{-\ell(x,Y,h(x))/\gamma}\bigr],
\qquad
Q_{\jtype}^{(E)}(x;\gamma^{(E)})\propto
\E_{Y\sim\eta(x)}\bigl[e^{-\ell(x,Y,h^{(E)}(x))/\gamma^{(E)}}\bigr].
\]
This makes the model–expert comparison a comparison of reweighted local loss profiles rather than raw predictive confidence [2605.19557].

A common simplification is to treat post-hoc deferral as nothing more than thresholding confidence scores. The ideal-distribution formulation is stricter: the threshold is applied to a density ratio induced by low-loss reweightings of the original distribution, so the rule is explicitly relative to both model and expert performance.

## 3. DR CPE losses and the learned scorer

The operational step in the density-ratio framework is a reduction from density-ratio estimation (DRE) to class-probability estimation (CPE). Given distributions \(\mu\) and \(\nu\), a binary CPE problem is defined using a strictly proper composite loss \(\ell_{\rm dr}(v,r)\) with link \(\psi\):
\[
\min_{s:\X\to\R}
\Bigl\{
\pi\,\E_{X\sim\mu}\bigl[\ell_{\rm dr}(s(X),+1)\bigr]
+(1-\pi)\,\E_{X\sim\nu}\bigl[\ell_{\rm dr}(s(X),-1)\bigr]
\Bigr\}.
\]
At optimum,
\[
\hat p(x)=\psi^{-1}(s^*(x))
\approx P[R=+1\mid X=x]
=
\frac{\pi\,\frac{d\mu}{d\nu}(x)}{1-\pi+\pi\,\frac{d\mu}{d\nu}(x)},
\]
which yields
\[
\frac{d\mu}{d\nu}(x)
\approx
\frac{1-\pi}{\pi}\,\frac{\hat p(x)}{1-\hat p(x)}.
\]
Since deferral only requires thresholding the density ratio, it is sufficient to threshold the scorer:
\[
\bigl[\,\tfrac{d\mu}{d\nu}(x)\le\tau\,\bigr]
=
\bigl[\,s^*(x)\le \psi\!\bigl(\tfrac{\pi\tau}{1-\pi+\pi\tau}\bigr)\,\bigr].
\]
In post-hoc L2D, \(\mu\) and \(\nu\) are specialized to the model and expert ideal distributions \(Q_{\itype}(\cdot;\gamma)\) and \(Q_{\itype}^{(E)}(\cdot;\gamma^{(E)})\) [2605.19557].

By choosing
\[
\pi = \tfrac{Z_{\itype,\gamma}}{Z_{\itype,\gamma}+Z_{\itype,\gamma^{(E)}}^{(E)}},
\]
the normalizers cancel, which yields the joint-ideal DR CPE loss
\[
\L_{\jtype}(s;\gamma,\gamma^{(E)})
=
\E_{(X,Y)\sim P}\!\Bigl[
e^{-\ell(X,Y,h(X))/\gamma}\,\ell_{\rm dr}(s(X),+1)
+
e^{-\ell(X,Y,h^{(E)}(X))/\gamma^{(E)}}\,\ell_{\rm dr}(s(X),-1)
\Bigr].
\]
A corresponding marginal loss \(\L_{\mtype}(s)\) can also be derived, although it is described as harder to estimate. By Jensen’s inequality,
\[
\L_{\mtype}(s)\le \L_{\jtype}(s),
\]
and under mild bounded-loss conditions their difference scales like the label-conditional loss-variance (Theorem 4.6) [2605.19557].

Once trained, the scorer is turned into a deferral policy by simple thresholding:
\[
r_{\itype}(x)=[\,s(x)\le \tau_s\,].
\]
The threshold \(\tau_s\) can be chosen on a validation split to hit a desired deferral rate. This modularity is a defining property of the post-hoc approach: a single scalar scorer is learned once, and operating points are changed by varying the threshold rather than retraining.

## 4. Recovery of Chow’s rule and expert-tilted conservatism

For KL-based ideal distributions with equal temperatures, the marginal density-ratio rule recovers the classical Chow rule exactly. Specifically, when \(D=\mathrm{KL}\) and \(\gamma^{(E)}=\gamma\),
\[
\frac{Q_{\mtype}(x;\gamma)}{Q_{\mtype}^{(E)}(x;\gamma)}
=
\exp\!\Bigl(
\tfrac{\E[\ell(x,Y,h^{(E)}(x))]-\E[\ell(x,Y,h(x))]}{\gamma}
\Bigr).
\]
Thresholding at \(\tau\) is then equivalent to a threshold on the expected loss difference, and choosing \(\gamma\ln\tau=c\) gives
\[
r^*(x;c)=
\bigl[
\E[\ell(X,Y,h^{(E)}(x))-\ell(X,Y,h(x))]\le c
\bigr],
\]
which is exactly the Chow rule [2605.19557].

The joint rule behaves differently. Its rejection region is contained in that of Chow’s rule under a reweighted distribution \(\widetilde P_{\gamma}\) with posterior
\[
\tilde\eta_y(x)\propto
\eta_y(x)\,
\exp\!\Bigl(-\tfrac{\ell(x,y,h^{(E)}(x))}{\gamma}\Bigr).
\]
Joint-ideal thresholding at \(\tau\) implies
\[
\E_{Y\sim\tilde\eta(x)}[\ell(h^{(E)})-\ell(h)]\le \gamma\ln\tau,
\]
so deferral occurs whenever Chow’s rule under the expert-tilted distribution would defer. The paper characterizes this joint rule as more conservative, because it incorporates the expert’s per-label loss via tilting rather than only comparing expected losses under the original posterior [2605.19557].

This distinction is central to the interpretation of post-hoc L2D under distribution shift. The marginal construction matches Chow optimality in the unshifted KL setting; the joint construction modifies the effective posterior according to expert competence, which suggests a principled route to expert-aware conservatism when the label geometry of difficult examples matters.

## 5. Empirical methodology and observed behavior

The empirical study for density-ratio-based post-hoc L2D evaluates prediction accuracy versus deferral-rate curves and robustness across clean versus corrupted splits. The datasets and corruptions comprise CIFAR-100 model-cascade settings such as ResNet8→14, 14→56, and 8→32, together with PathMNIST and DermaMNIST variants featuring label noise on the first \(k\) classes, long-tail subsampling, and specialist-only subsampling such as melanocytic versus non-melanocytic cases [2605.19557].

The baselines are: confidence-thresholding without training; a two-stage surrogate with exp-loss from Mao et al. 2023; and expert-comparison regressions, namely Estimate-Diff01, which regresses \(\mathbb{I}\{h\text{ correct}\}-\mathbb{I}\{h^{(E)}\text{ correct}\}\), and Estimate-MaxProb, which regresses \(\max_y h^{(E)}_y(x)\). The key findings are that all methods compete on clean data, whereas under corruption DR CPE is consistently among the top two and degrades least; joint DR CPE recovers Chow optimality when there is no shift and yields an expert-aware tilt under shift; and DR CPE handles extreme specializations, including PathMNIST specialists, far more robustly than the two-stage surrogate or naive confidence thresholding [2605.19557].

These results position post-hoc density-ratio learning as a robustness-oriented alternative to baselines that either ignore expert structure or encode expert comparison through direct regression targets. A plausible implication is that the ideal-distribution reweighting acts as a regularized comparison mechanism across heterogeneous dataset conditions, especially when the expert is specialized or the data are corrupted.

## 6. Broader post-hoc L2D landscape

The density-ratio perspective explicitly connects post-hoc L2D to hypothesis testing and anomaly detection. Thresholding \(dQ/dQ^{(E)}\le\tau\) is a likelihood-ratio test between the model’s ideal and the expert’s ideal, in the spirit of Neyman–Pearson testing. The same paper notes that classical anomaly detection thresholds \(dP/d\mu\) against a nominal measure, so the distinction between “typical” and “anomalous” can be reinterpreted here as a distinction between the model’s ideal and the expert’s ideal [2605.19557]. It also identifies multi-expert deferral as a multi-source DRE/CPE problem and points to DRO/GVI-style regularized extensions involving fairness or budget constraints.

Other post-hoc lines of work make these adjacent directions concrete. A training-free multiple-expert framework based on conformal prediction constructs a prediction set
\[
S(x)=\{\,y\in\mathcal{Y}: s(x,y)\le\tau\},
\]
accepts singleton sets, and otherwise defers to the expert with highest segregativity score restricted to \(S(x)\). It provides the marginal coverage guarantee
\[
\mathbb{P}(y\in S(x))\ge 1-\alpha
\]
under exchangeability, requires no retraining when experts join or leave the pool, and reports \(99.57\pm0.10\%\) accuracy on CIFAR10-H and \(99.40\pm0.52\%\) on ImageNet16-H while reducing expert workload by up to a factor of \(11\) [2509.12573].

For structured prediction, post-hoc L2D has been generalized from whole-output rejection to partial deferral for sequences. In that setting, a frozen predictor is paired either with a token-level rejector \(z_t\in\{0,1\}\), which defers specific token predictions, or with a one-time rejector \(K\in\{1,\dots,T+1\}\), which defers the remainder of the sequence from a selected point onward. The paper proves Bayes consistency of surrogate objectives for both settings and reports better cost-accuracy tradeoffs than whole deferrals on Traveling Salesman solvers and News summarization models [2502.01459].

A separate post-processing framework addresses multi-objective L2D under constraints. Using a \(d\)-dimensional generalization to the fundamental lemma of Neyman and Pearson, it derives a Bayes-optimal simplex-valued rule
\[
f^*(x)=\tau\!\Bigl(\psi_0(x)-\sum_{i=1}^m k_i\psi_i(x),x\Bigr),
\]
which can encode expert-budget constraints, demographic parity, equality of opportunity, equalized odds, OOD deferral, long-tail coverage, and Type-\(k\) error bounds. On COMPAS, the reported accuracy/parity-gap/deferral-rate triple is \(0.75/0.02/0.21\), compared with \(0.73/0.08/0.20\) and \(0.74/0.04/0.22\) for the listed baselines [2407.12710].

Taken together, these works show that post-hoc L2D is not a single algorithmic recipe but a family of post-processing strategies with different invariances and optimization targets. Density-ratio scoring emphasizes model–expert comparison through ideal distributions; conformal routing emphasizes marginal coverage and plug-and-play expert sets; partial sequence deferral emphasizes granularity of intervention; and constrained post-processing emphasizes Bayes-optimality under side conditions. The common structure is that the predictor is treated as given, while the defer decision is learned, calibrated, or optimized afterward.

Source: https://www.emergentmind.com/topics/post-hoc-learning-to-defer-l2d