On Measuring Localization of Shortcuts in Deep Networks

Nikita Tsoy, Nikola KonstantinovarXiv 2025 · DOI

Introduction

Deep neural networks are notorious for finding "shortcuts"—spurious correlations in training data that allow them to achieve high accuracy without learning the intended features. For example, a model might learn to identify a "cow" not by its physical characteristics, but by the presence of green grass in the background. While these rules work during training, they fail spectacularly in real-world applications where backgrounds change. This research investigates the "localization" of these shortcuts: where exactly do they live within a network's architecture?

Methodology: Counterfactual Training

The authors introduce a novel Counterfactual Training framework to isolate the impact of shortcuts. This method decomposes shortcut learning into two distinct metrics:

  1. Spurious Feature Encoding (SFE): Quantifies how much a specific layer incentivizes the model to rely on a shortcut.
  2. Core Feature Forgetting (CFF): Measures how much a layer disincentivizes the model from using the actual, clean features.

To measure these, the researchers use a simultaneous training algorithm. They train an "anchor" model on clean data and an "intervened" model where specific blocks are exposed to shortcut-heavy (skewed) data. By synchronizing shared blocks and measuring the accuracy gap on clean test data, they can quantify the exact contribution of each block to shortcut behavior.

Experimental Setup

The study evaluates four diverse vision architectures—VGG-11, ResNet-18, DeiT-Ti (Vision Transformer), and ConvNeXt-T—across three popular benchmarks for shortcut learning:

  • CIFAR-10 with Watermarks: MNIST digits are blended into images as a predictive but spurious signal.
  • Waterbirds: Bird images are placed on class-correlated backgrounds (e.g., water birds on water).
  • CelebA: A sampling skew where gender and hair color are artificially correlated.
Example of CIFAR-10 images with MNIST digit watermarks acting as spurious shortcuts.

The Shallow-to-Deep Pipeline

A central finding of the paper is that shortcut learning is not confined to a single "bad" layer but is a distributed process with a clear functional split. The authors identify a "Shallow-to-Deep" pipeline:

  • Shallow layers (early in the network) are primarily responsible for picking up and encoding spurious features.
  • Deep layers (near the output) are responsible for forgetting the core features that actually matter for generalization.

Essentially, the front of the network learns to see the "cheat," and the back of the network decides to stop looking at the "truth."

Block-wise localization of shortcut learning metrics across different architectures, showing the distribution of encoding and forgetting across layers.

Key Insights and Results

  • Architecture Matters for Encoding: For encoding spurious features, the specific dataset and model architecture explain a massive 83.8% of the variance. CNNs (like ResNet-18) tend to encode shortcuts later in the network compared to Vision Transformers (like DeiT-Ti).
  • Forgetting is Driven by Training Dynamics: While architecture drives encoding, the "forgetting" process is more influenced by the "strength" of the shortcut (skew frequency) and the choice of optimizer (AdamW vs. SGD).
  • No "Silver Bullet" Layer: In experiments on CIFAR-10, no single block accounted for 100% of shortcut learning. Layer interactions are non-linear and vital to the process.
  • Predictive Power: The authors found that their localization metrics can predict the success of mitigation strategies, such as layer-wise Learning Rate (LR) adjustments or layer freezing, with significant statistical power (R² up to 0.54).

Conclusion and Future Work

By mapping the internal geography of shortcuts, this research provides a foundation for designing targeted interventions. Rather than treating the network as a black box, developers can use these metrics to identify which layers to freeze or adjust to prevent models from taking the easy way out. Future work will explore whether these "encoding vs. forgetting" dynamics hold true in other modalities, such as Large Language Models (LLMs).

Summary updated

BibTeX
@misc{tsoy2025measuring,
  author = {Nikita Tsoy and Nikola Konstantinov},
  title = {{On Measuring Localization of Shortcuts in Deep Networks}},
  year = {2025},
  eprint = {2510.26560},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.26560},
}
Figure