Distilling What the Teacher Ignores: Random-Occlusion Distillation for Shortcut-Free Students

A model trained on the Waterbirds benchmark can learn to call any bird on a lake a "waterbird" and still score well on average, because in the training data birds and backgrounds usually agree. This habit of predicting from an easy side cue instead of the real object is called shortcut learning, or reliance on a spurious correlation. It fails badly on the rare cases where the cue and the label disagree. Knowledge distillation trains a small "student" model to imitate a large "teacher" model's output probabilities. Distillation should be a way to pass a robust teacher's good habits to a cheap model. Instead, it often passes on or even amplifies shortcuts: Do Students Debias Like Teachers? finds that standard distillation does not preserve a teacher's debiasing and widens the gap between in-distribution and out-of-distribution accuracy.

We argue the failure is structural, and that the fix uses a capability only a teacher has. On ordinary training images, the object and the background both predict the teacher's output, so matching those outputs cannot tell the student which one the teacher actually uses. A student with a bias toward simple features picks the background. A teacher, unlike a label, can be queried on inputs that have no ground-truth label: an image with the bird blacked out, or with half the lake blacked out. We propose training the student to match the teacher on randomly occluded copies of each training image. In expectation, this transfers the teacher's map of which regions it relies on, which clean-input distillation leaves undetermined. The cost is a few extra forward passes, no gradient computations with respect to the input, and no group labels.

Core Claim

The claim has three parts. First, matching a robust teacher's outputs on random occlusions of training inputs transfers the teacher's spatial reliance, not just its predictions. Second, this recovers most of the worst-group robustness that the expensive input-gradient ("Jacobian") matching of What Mechanisms Does Knowledge Distillation Distill? delivers. Third, the benefit comes specifically from the teacher's labels on occluded inputs. Occlusion paired with ground-truth labels should do nothing or harm, because a background-only crop labeled "waterbird" teaches the shortcut directly.

The objective for a student $f_S$ and teacher $f_T$, both producing class probabilities, on a training pair $(x, y)$ is

$$ \mathcal{L} = \mathrm{CE}(y, f_S(x)) + \lambda\,\mathrm{KL}\big(f_T(x)\,\|\,f_S(x)\big) + \mu\,\mathbb{E}_{m}\,\mathrm{KL}\big(f_T(m\odot x)\,\|\,f_S(m\odot x)\big). $$

Here CE is cross-entropy against the label, KL is Kullback–Leibler divergence, and $m$ is a random binary block mask applied pixelwise ($\odot$), with occluded pixels filled by a blurred copy. $\lambda$ and $\mu$ weight the clean and occluded distillation terms.

The reason to expect reliance transfer is as follows. The teacher's occlusion-sensitivity map, meaning its average output over masks that keep a given pixel visible, is a linear function of its outputs on masked inputs. A student that matches $f_T(m\odot x)$ across masks therefore matches that map in expectation, without anyone computing it. This also answers the argument of Overparameterization hurts worst-group accuracy with spurious correlations. That paper shows reweighting fails in large models because it leaves the set of zero-training-loss solutions unchanged, so the model still fits the majority with the shortcut and memorizes exceptions. The occluded term does change that set. A background-only rule cannot reach zero loss once "background visible, bird hidden" inputs carry an uncertain teacher target.

Relation to Prior Work

Several papers motivate the proposal by documenting the gap. Do Students Debias Like Teachers? shows shortcut amplification under distillation on Waterbirds, CelebA and MNLI/HANS. Its remedies are external: data augmentation (up to 4.5 points on the spurious gap), chains of intermediate-size models, and initialization from teacher weights. It does not identify which teacher signal is missing. Robustness Challenges in Model Distillation and Pruning finds the same pattern for compressed BERT models. It patches the problem with label smoothing on "easy" samples found through an expensive multi-sparsity pruning sweep. We instead add teacher supervision on new inputs, with no per-sample difficulty estimate.

One line of work supplies the mechanism we build on and a hard constraint. What Mechanisms Does Knowledge Distillation Distill? shows on synthetic Dominoes data that plain output matching falls to the simple cue, while Jacobian matching and contrastive representation distillation transfer the teacher's mechanism. It never measured worst-group accuracy on standard benchmarks, and Jacobian matching needs a second backward pass through the input. Our term is a large-perturbation, forward-only counterpart of that idea, and we test it head to head on real benchmarks.

Three nearby methods constrain the design by showing what does not generalize. Preventing Shortcut Learning in Medical Image Analysis distills intermediate-layer probe outputs, but only from a teacher trained on a hand-curated clean subset of 5–20% of the data, and only for CNNs. Shortcut-Resistant CAM Distillation transfers class activation maps from head classes to tail classes within one model. Its compactness heuristics break for sprawling or multi-part objects, such as flocks of birds. Random occlusion imposes no shape prior on the object. Mitigating Shortcuts in Language Models with Soft Label Encoding edits labels using a biased teacher's confidence, and LaViD regularizes vision students with a text-only LLM. Neither transfers a vision teacher's own spatial reliance.

Two further papers need explicit treatment. Robust Distillation for Worst-class Performance reports that a well-calibrated standard teacher can yield a student exceeding its worst-class accuracy (75.56% vs. 68.52% on CIFAR-10-LT). This appears to contradict the "teachers pass on bias" view. That result concerns class imbalance, where the groups are the labels themselves, and the authors leave spurious within-class groups open. We test this directly by distilling from a biased ERM teacher (a model trained only to minimize average training loss). Our prediction is that occlusion distillation faithfully transfers whatever reliance the teacher has, so it makes the student more biased. That outcome would sharpen the tension, not dissolve it. Finally, Decoupled Knowledge Distillation separates target-class and non-target-class terms in the distillation loss. On binary benchmarks like Waterbirds and CelebA the non-target distribution is a single point, so the decoupling carries no information. That is why we do not build on it.

Research Program

The main setting is compression under subpopulation shift. The teacher is a large backbone (ResNet-50 and a ViT) trained with Group DRO (Distributionally Robust Neural Networks) using group labels. The student (ResNet-18 and MobileNet) never sees group labels. This reflects deployment practice, where one well-resourced robust model is compressed many times.

We will build the occlusion distillation loss with multi-scale block masks at 25–75% occlusion and blurred fill. Precomputing teacher outputs, following the region-level soft-label storage of FKD, keeps training cost near that of vanilla distillation. The mask ratio, number of masks per image, and $\mu$ will be selected without group labels. The selection criterion is teacher–student agreement on occluded validation images, which addresses the dependence of JTT-style methods on a group-annotated validation split. We also report results under group-labeled tuning so the selection rule itself is tested.

A second setting reverses the teacher. We use a biased ERM teacher, and a Group DRO teacher of the same size as the student, to separate reliance transfer from capacity effects. The distillability paper reports that teacher–student size disparity governs transfer. A text extension replaces block masks with random token deletion on MNLI→HANS and QQP→PAWS. It checks whether the argument depends on images.

Baselines

The naive reference point is the student architecture trained with ERM on the full data. The file reports ERM worst-group accuracy of 60.0% on Waterbirds and 41.1% on CelebA (Distributionally Robust Neural Networks), though for larger backbones than our students. We rerun it on our student architectures.

The direct competitor inside distillation is vanilla output distillation from the same robust teacher. It is run on identical data, epochs and temperature search. No reported result was found on Lacuna for vanilla-distilled worst-group accuracy on Waterbirds or CelebA, so we measure it. Our method must beat it on worst-group accuracy by more than seed variance, with average accuracy within about one point.

The strongest method-level competitor is training the student directly with a robustness method, skipping the teacher. The reported figures are Group DRO at 84.6% (Waterbirds) and 86.7% (CelebA) worst-group accuracy with oracle labels (Distributionally Robust Neural Networks). Without training group labels, JTT reports 81.1% and CNC 88.8% on CelebA (Just Train Twice; Correct-N-Contrast). DKT reports 92.56% on Waterbirds and 92.34% on CelebA (Dynamic Knowledge Transfer). These numbers come from those papers' own backbones. We rerun JTT and CNC on our student architectures with the same tuning budget. Beating label-free JTT and CNC on the same student, while using no group labels for the student, is the bar for a useful result. Matching Group DRO trained on the student is the bar for a strong one.

The mechanistic baseline is Jacobian matching from What Mechanisms Does Knowledge Distillation Distill?, run at equal total compute as well as at equal epochs. We count success as reaching at least most of its worst-group gain at a fraction of its wall-clock cost.

Three further baselines isolate the key ingredient. Crop-level distillation in the FKD style is standard regional relabeling. Generic augmentation distillation uses MixUp and RandAugment inputs labeled by the teacher, approximating the intervention in the distillability paper. The decisive ablation keeps the occluded inputs but labels them with ground truth instead of teacher outputs, which should not help.

Why not just…?

Why not just train the small model directly with JTT, CNC or Group DRO and skip the teacher? This is the most serious threat. Both CNC and DKT report strong CelebA numbers without distillation, and Overparameterization hurts worst-group accuracy with spurious correlations shows smaller models can be less prone to memorizing minority exceptions. If a directly trained JTT or CNC student matches ours, the value of distillation here is only convenience, and we will report that. Our case rests on two advantages. We need no group-labeled validation split, and the teacher's robustness is paid for once and reused across many students. The same-student comparison above settles the question.

Why not just use Jacobian matching, which is already known to transfer mechanisms? We will include it rather than argue against it. Its evidence is on synthetic data only, and it needs double backpropagation through the input at every step. If it clearly beats occlusion distillation at equal compute, the conclusion is that the fine-grained gradient signal matters and the forward-only approximation loses it. That result would still be informative.

Why not just augment the data during distillation, as the distillability paper already did? Generic augmentation perturbs style and mixes images, but it does not create inputs where the object is absent and the cue remains. Those are the inputs where the teacher's target contradicts the shortcut. The MixUp/RandAugment distillation baseline and the FKD crop baseline test this. If they match occlusion distillation, the "reliance transfer" explanation is wrong and the gain is simply more teacher-labeled inputs.

Why not just subsample the majority group? Subsampling works, reaching 15.1% worst-group error on CelebA in Overparameterization hurts worst-group accuracy. But it uses 3.4% of the data and needs group labels for every training point. We include it as an oracle reference on the student, not as a label-free competitor.

Decisive Checks

We evaluate on Waterbirds and CelebA (Blond_Hair with Male as the spurious attribute), reporting worst-group accuracy, average accuracy and the spurious gap over five seeds. MNLI→HANS and QQP→PAWS serve as the text extension.

The central mechanistic check uses the CUB segmentation masks underlying Waterbirds, at evaluation time only, to build bird-removed and background-neutralized test images. On these, the occlusion-distilled student's outputs should track the teacher's much more closely than a vanilla-distilled student's outputs do. We also measure the correlation between student and teacher occlusion-sensitivity maps on held-out images.

Three predictions could falsify the account. Ground-truth-labeled occlusion should not improve worst-group accuracy. With a biased ERM teacher, occlusion distillation should raise background reliance relative to vanilla distillation. The gain over vanilla distillation should persist when teacher and student are the same size, which would show it is not merely a capacity effect.

A known risk is that the teacher's outputs on heavily occluded images are unreliable, because it never saw such inputs. We check this first by confirming that the teacher's occlusion maps concentrate on the bird. We also report results with a teacher lightly fine-tuned on occluded inputs.