Shortcut Learning Through the Lens of Early Training Dynamics

Nihal Murali, Aahlad Manas Puli, Ke Yu, Rajesh Ranganath, kayhan Batmanghelich

TL;DR

Deep neural networks do not latch onto all spurious correlations—only those that are easier to learn than the core task features. By tracking an instance difficulty metric called Prediction Depth (PD) during the first two epochs of training, practitioners can detect shortcut learning before looking at out-of-distribution test sets.

What Problem Does This Paper Address?

Shortcut learning occurs when a deep neural network (DNN) achieves high benchmark performance by exploiting spurious correlations that collapse under real-world distribution shifts (e.g., diagnosing COVID-19 by spotting hospital-specific scan tags or classifying pneumonia by detecting chest drain tubes).

While existing literature often treats shortcuts as synonymous with spurious correlations and frames the problem strictly around distribution shifts, this framing misses a crucial reality: deep networks encounter many spurious correlations during training, yet only rely on some of them. Furthermore, standard machine learning pipelines rely on training loss and validation accuracy curves—metrics that remain blissfully high even when a model is heavily cheating on shortcuts.

Methods

The authors formalize shortcuts around task difficulty: a spurious feature $s$ acts as a shortcut only if predicting $s$ is easier for model class $\mathcal{M}$ than predicting the true label $y$ ($\Psi_{\mathcal{M}}(X \to s) < \Psi_{\mathcal{M}}(X \to y)$).

To quantify "easiness" throughout training, the authors employ:

  • Prediction Depth (PD): Originally proposed by Baldock et al. (2021), PD measures the earliest layer in a network whose $k$-nearest-neighbor ($k$-NN) readout matches the final classification. Easy samples resolve at early layers (low PD); difficult samples require deep representations (high PD).
  • Early-Training PD Adaptation: Because untrained networks have noisy features, the authors introduce an undefined PD state when layer predictions hover near chance ($|f_{\text{knn}}(x) - 0.5| < 0.1$). This lets them profile representations within the first 1–2 epochs.
  • Soft $k$-NN Grad-CAM: To interpret what features are captured by low-PD layers, they attach a differentiable $k$-NN probe and run Grad-CAM to visualize model attention.
  • Theoretical Link to $\mathcal{V}$-Usable Information: The authors prove that a significant gap in mean PD between datasets with and without shortcuts directly implies that shortcuts provide more computationally accessible information ($\mathcal{V}_{\text{cnn}}$-usable information) to bounded CNNs.

Datasets

  • Dominoes (Synthetic): Vertically stacked image pairs combining datasets of varying difficulty (MNIST, SVHN, Fashion-MNIST, Kuzushiji-MNIST / KMNpatch, and CIFAR-10) to test easy vs. hard spurious features.
  • Kuzushiji-MNIST (KMNIST): Augmented with synthetic class-specific white pixel patches.
  • ChestX-ray14 / GitHub-COVID & Chex-MIMIC: Semi-synthetic medical benchmarks where labels correlate spuriously with image sources.
  • NIH ChestX-ray14: Real-world clinical dataset evaluating Pneumothorax detection under the presence of chest drains (annotated via MIMIC-CXR and the RadGraph NLP pipeline).
  • NICO++: Real-world non-IID computer vision benchmark (e.g., Cow vs. Bird on grass vs. water, Dog vs. Lizard on rocks).

Key Insights and Ideas

  • Difficulty Governs Shortcut Selection: Spurious correlations do not automatically degrade models. If a spurious feature is harder to extract than the core signal (e.g., classifying prime vs. composite numbers as a confounder), the network ignores it.
  • Early Layers Reveal Shortcuts: Deep networks extract simple spatial/texture cues in initial layers and complex semantic structures in deeper layers. A distribution peak at low PD indicates the network is making definitive predictions using trivial surface cues.
  • Detection by Epoch 1–2: Spurious shortcut representations converge almost immediately. While difficult examples remain undefined or settle in late layers over many epochs, low-PD shortcut peaks appear within the first two epochs and remain static.
  • Accuracy is a Poor Canary: Loss and accuracy trajectories look identical whether a model learns genuine features or cheats, underscoring the necessity of internal training dynamic metrics.

Key Results

  • Dominoes Validation: When spurious features were harder than core features, core-only test accuracy remained high ($>98\%$). When spurious features were easier, core-only accuracy collapsed to chance ($\sim 50\%$).
  • KMNIST Shortcut: Adding a 1-pixel patch shifted the mean PD from $5.25$ down to $1.06$, dropping clean test accuracy from $98\%$ to just $8\%$.
  • Real-World Medical Imaging (NIH): DenseNet-121 displayed two distinct abnormal peaks: layer 4 (image artifacts) and layer 40 (chest drain tubes). Diseased patients with chest drains scored an AUC of $0.94$, plummeting to $0.74$ when chest drains were absent.
  • Early Detection: Across all evaluated datasets (NICO++, Chex-MIMIC, NIH), characteristic shortcut peaks were identifiable at Epoch 1 or Epoch 2.

Limitations and Future Work

  • Diagnostic, Not Curative: The method diagnoses shortcut learning early, but the authors do not propose an automated training intervention to steer the model away from the shortcut once discovered.
  • Subjective Baselines: Flagging a low-PD peak as "suspicious" requires prior domain knowledge that the target task should be inherently challenging (e.g., knowing radiologists require deep visual reasoning to diagnose pneumothorax).
  • Computational Overhead: Running $k$-NN across multiple intermediate representations during training adds overhead, though the authors partially mitigate this by downsampling spatial feature maps to $8 \times 8$.

Summary updated

BibTeX
@article{murali2023shortcut,
  author = {Nihal Murali and Aahlad Manas Puli and Ke Yu and Rajesh Ranganath and kayhan Batmanghelich},
  title = {{Shortcut Learning Through the Lens of Early Training Dynamics}},
  journal = {Accepted by TMLR},
  year = {2023},
  url = {https://openreview.net/forum?id=Tkvmt9nDmB},
}
Figure