Image and text classifiers often learn shortcuts. A shortcut is an easy cue that happens to predict the label in training data but is not the real reason for it, such as the water behind a waterbird or a negation word in a contradiction sentence. A natural fix borrows from domain adaptation: attach a second network, called an adversary, that tries to recover the suspected shortcut from the model's internal features, and train the main model so the adversary fails. In practice this "make the cue unrecoverable" rule is too blunt. Adversarial alignment is known to crush the feature space and erase fine class distinctions. Removing a spurious feature entirely can also lower accuracy, and the minority groups lose the most. Finally, the label saying which examples carry the shortcut is usually guessed by a heuristic and is often wrong.
We propose to treat shortcut invariance as a soft constraint rather than a hard one. The model may let the adversary recover the suspected cue up to a stated tolerance, and only the excess is penalized. The penalty is weighted by how confident we are in each example's guessed shortcut label. Two quantities, the tolerance and the penalty variance, sit between two familiar extremes: ordinary training at one end and full adversarial removal at the other. The claim is that worst-group accuracy peaks strictly between them. The claim also says that this intermediate setting holds up when the shortcut labels are noisy, and even when the suspicion is simply wrong, where both full removal and group reweighting break.
Core Claim
This proposal draws on three lines of work, each in a different role.
Adversarial domain adaptation supplies the mechanism. A discriminator is trained to predict a nuisance variable from the features, and a gradient reversal layer flips its gradient into the feature extractor (Yu et al.). The same literature also supplies the warning. Chen et al. show that adversarial training makes one direction of the feature space dominate and wipes out the class-discriminative directions. Shi et al. and Lu et al. report that over-alignment merges categories.
Shortcut learning supplies the application regime and the second warning. Khani and Liang prove that, in overparameterized models, deleting spurious features can hurt accuracy and hurt minority groups disproportionately. Stromberg et al. show that methods depending on group annotations collapse toward plain empirical risk minimization (ERM, ordinary average-loss training) once the annotations are noisy.
Soft constraint integration supplies the remedy. Wu et al. write a constraint as a Gaussian pseudo-likelihood, in which a variance controls strictness and a variance of zero recovers a hard constraint. Continuous Structure Constraint Integration for Robust Causal Discovery shows that soft priors stay useful even when half the prior is false.
Concretely, let $z=f_\theta(x)$ be the features and $\hat a_i$ a guessed shortcut label with confidence $c_i\in[0,1]$. Let $\mathrm{Adv}(\theta)$ be the confidence-weighted, class-conditional advantage of the best discriminator: how far its accuracy at predicting $\hat a$ from $z$, within each true class $y$, exceeds the best guess that ignores $z$. We train
$$\min_\theta \; \mathcal{L}_{\text{task}}(\theta) + \frac{1}{2\sigma^2}\,\big[\max(0,\ \mathrm{Adv}(\theta)-\varepsilon)\big]^2 .$$
Here $\varepsilon$ is the tolerated amount of leftover shortcut information and $\sigma^2$ sets how sharply excess is punished. Setting $\varepsilon=0$ with small $\sigma^2$ gives the standard hard adversary. Large $\varepsilon$ gives ERM.
The class-conditional form is essential. It asks the model not to use the cue beyond what the label already explains, rather than to delete the cue everywhere. This is the distinction Khani and Liang's result calls for.
The guessed labels need no group annotation. As in Stromberg et al., they come from the errors and predictions of a deliberately shortcut-prone, strongly $\ell_1$-regularized linear probe. The probe's margin serves as $c_i$.
Research Program
The first deliverable is the training procedure above, applied to the full backbone rather than the last layer. The discriminator is attached at the penultimate layer through gradient reversal. Because the tolerance hinge often sits near zero, we implement the penalty with a Lagrange multiplier on the constraint $\mathrm{Adv}\le\varepsilon$. This avoids the oscillation of an always-on adversary.
The second deliverable is a diagnosis of why intermediate tolerance helps. Throughout training we track the singular value spectrum of the feature batch, using the sharpness measure of Chen et al.. We also track the per-group margins. The hypothesis is that hard removal produces the sharp-spectrum collapse that BSP (batch spectral penalization, a penalty on the largest singular values) targets, while the tolerance version avoids it without any spectral penalty. If that is not what happens, we learn that the benefit comes from somewhere else.
The third deliverable is a robustness analysis to imperfect priors, modeled on the prior-error-ratio protocol of the causal discovery work. We corrupt the guessed shortcut labels at controlled rates. We also deliberately point the constraint at a cue that is genuinely predictive rather than spurious. Graceful degradation under a wrong suspicion is the property that separates a soft prior from a hard one, and it has not been tested for shortcut mitigation.
Baselines
The naive reference point is ERM trained on the same backbone with the same augmentation and the same epoch budget. On CelebA, Just Train Twice reports ERM worst-group accuracy of 47.2%. Any method that does not clearly exceed this is not addressing the shortcut.
The strongest annotation-free competitor is RAD-UW from Stromberg et al.. It trains a strongly regularized linear probe to latch onto the shortcut, treats the probe's errors as the minority, and retrains the last layer with upweighting. It reports about 83.5% worst-group accuracy on CelebA that stays steady under annotation noise. This is the most dangerous comparison because it uses the same pseudo-labeling source as our method and needs no group labels. We give it the same backbone, the same pseudo-labels, and the same hyperparameter search budget. Our method counts as beating it only if it raises worst-group accuracy by a margin larger than seed variance on at least two of Waterbirds, CelebA, MultiNLI and CivilComments, with average accuracy within one point.
A second competitor is JTT (Liu et al.). JTT upweights the error set of an early-stopped model and retrains from scratch. It reports 81.1% worst-group accuracy on CelebA and an average gain of 15.9 points over ERM across the four language and vision datasets.
As an informative ceiling, we include SSA (Nam et al.), which uses 0.6% spurious-attribute labels and reaches 89.8% on CelebA. We also include fully supervised Group DRO (Sagawa et al.), which trains on the worst-off labeled group and reaches 88.5% on CelebA as reported by SSA. We do not expect to beat these ceilings, since they use true group labels.
On Waterbirds, majority subsampling from Sagawa et al. reports roughly 10–15% worst-group error in overparameterized models. We found no isolated reported Waterbirds worst-group accuracy for JTT or RAD-UW on Lacuna, so we rerun both. For MultiNLI and CivilComments we found no reported isolated results on Lacuna for any of these methods, and all are rerun.
The key ablation is the hard adversary: the same discriminator with $\varepsilon=0$ and unit confidences, with and without BSP. This isolates the tolerance and the confidence weighting as the ingredients that matter. We also ablate class-conditional versus marginal adversaries.
Hyperparameter selection uses one protocol for every method. Validation-set worst-group accuracy is computed with RAD-style pseudo-groups, never true group labels. Oracle-selected numbers are reported separately as an upper bound, because Just Train Twice itself depends on a group-annotated validation set.
Why not just…?
Why not just retrain the last layer, as RAD-UW does? This is the real threat. If the pretrained backbone already contains an uncontaminated core feature, reweighting the last layer may be enough, and a representation-level constraint adds cost for nothing. Our bet is that shortcuts become entangled in the backbone during full fine-tuning, and that last-layer methods cannot undo this. We test the bet directly by comparing the two under full fine-tuning and under frozen-backbone training. If RAD-UW matches us in both, we will report that representation-level soft invariance is unnecessary on these benchmarks.
Why not just subsample the majority group? Sagawa et al. show that subsampling breaks the memorization path, but it can discard about 96.6% of the data. It also needs reliable group membership, which Stromberg et al. show degrades under noise. Our noise sweep runs subsampling on the same corrupted pseudo-groups.
Why not just use a hard gradient-reversal adversary plus BSP? BSP repairs the spectral collapse, but it was evaluated only on average accuracy (Chen et al.). It does nothing about the separate harm of fully deleting a cue that is useful within some groups (Khani and Liang). The wrong-suspicion experiment separates the two effects. In that experiment, hard removal plus BSP should still lose accuracy, whereas a soft constraint should let the data override the prior.
Proposed Experiments
The main grid crosses three tolerances and three variances on Waterbirds, CelebA, MultiNLI and CivilComments-WILDS. The metrics are worst-group accuracy, average accuracy, and spectrum sharpness. ColoredMNIST, at 90% bias as in Revisiting Spurious Correlation in Domain Generalization, is used for controlled sweeps. Five seeds are run per configuration.
The first decisive check is the shape of the tolerance curve. If worst-group accuracy is monotone in $\varepsilon$, so that the best setting is either zero or infinity, the core claim is false.
The second check corrupts 5%, 20% and 40% of the guessed shortcut labels and compares the slope of degradation against RAD-UW, JTT and the hard adversary.
The third check is the wrong-suspicion test. On CelebA we aim the constraint at a label-relevant attribute instead of gender. A soft constraint should lose at most about a point of average accuracy, while hard removal should lose substantially more.
Finally, as a domain-adaptation transfer test, we apply the same tolerance-bounded class-conditional adversary to source–target alignment on Office-Home. There, BSP+CDAN reports 66.3% average accuracy (Chen et al.), and we also report per-class worst accuracy to see whether the same mechanism limits over-alignment.
References
- Fan-Net: Fourier-Based Adaptive Normalization for Cross-Domain Stroke Lesion Segmentation
- Transferability vs. Discriminability: Batch Spectral Penalization for Adversarial Domain Adaptation
- Information-Theoretical Learning of Discriminative Clusters for Unsupervised Domain Adaptation
- When Unsupervised Domain Adaptation Meets Tensor Representations
- Removing Spurious Features can Hurt Accuracy and Affect Groups Disproportionately
- For Robust Worst-Group Accuracy, Ignore Group Annotations
- Adding Constraints to Bayesian Inverse Problems.
- Continuous Structure Constraint Integration for Robust Causal Discovery
- Just Train Twice: Improving Group Robustness without Training Group Information
- Spread Spurious Attribute: Improving Worst-group Accuracy with Spurious Attribute Estimation
- Distributionally Robust Neural Networks
- Overparameterization hurts worst-group accuracy with spurious correlations
- Revisiting Spurious Correlation in Domain Generalization