Understanding Generalization through Decision Pattern Shift

Huiqi Deng, Yibo Li, Quanshi Zhang, Peng Zhang, Hongbin Pei, Xia Hu

TL;DR

Why do deep neural networks fail to generalize to unseen data? This paper introduces Decision Pattern Shift (DPS), a novel internal metric that quantifies generalization failure by measuring how much a model's channel-level decision logic drifts between training and testing. The authors demonstrate that this internal drift correlates linearly with the generalization gap and unifies diverse failure modes—from domain shift to shortcut learning—into a single continuous spectrum.

What Problem Does This Paper Address?

When a deep neural network (DNN) fails on a test set, what actually went wrong inside its hidden layers? Traditional approaches to understanding generalization typically look at external factors: data distribution shifts, geometric properties of the loss landscape, or representation geometry.

However, these methods offer limited insight into the evolution of a model's internal decision mechanism. We know that the model fails, but we don't clearly see how its internal reasoning logic degrades. This paper addresses this gap by shifting the focus from where a model looks or what features it extracts to how it weighs and combines internal feature channels to make a final prediction.

Methods

The authors propose a framework based on Decision Pattern Shift (DPS), which relies on two key components:

  1. Decision Pattern Characterization: To capture a model's internal logic for a specific sample, the authors define a "decision pattern" as a channel-contribution vector. Inspired by Grad-CAM, this vector aggregates spatial activations across a convolutional layer to quantify how much the model relies on each individual feature channel. Unlike standard Grad-CAM, which creates a spatial saliency map showing where a model looks, this method captures what internal features the model relies on.
Decision pattern vs. Grad-CAM
  1. Measuring the Shift (DPS Metric): By calculating the average decision pattern for each class during training, the authors establish a baseline of "healthy" decision logic. The DPS metric is simply the cosine dissimilarity between an unseen test sample's decision pattern and its corresponding class-average training pattern. This can be aggregated hierarchically at the sample, class, and dataset levels.

Datasets

The authors validated their approach across a wide variety of standard benchmarks and generalization stress-tests:

  • Standard Benchmarks: CIFAR-10, CIFAR-100, TinyImageNet, and ImageNet (evaluated on a 50-class subset).
  • Domain Shift: CIFAR-10-C (applying corruptions like snow, gaussian blur, and contrast at various severities).
  • Out-of-Distribution (OOD): STL-10 (resized to 32x32).
  • Shortcut Learning: Colored MNIST (where color is strongly correlated with the label during training but decorrelated during testing).

Key Insights and Ideas

  • Internal Logic is Highly Structured: Within the same class, decision patterns are remarkably consistent (cosine similarity > 0.9), even if the input images look completely different. Conversely, they are highly distinct across different classes (similarity < 0.5). This confirms that networks do develop stable, class-specific internal "reasoning pathways."
  • The Linearity of Failure: The generalization gap is not a chaotic, unpredictable breakdown. The authors prove theoretically and empirically that the magnitude of the internal decision pattern shift correlates linearly with the increase in test loss.
  • A Unified Failure Spectrum: Instead of treating in-distribution degradation, domain shift, OOD generalization, and shortcut learning as completely separate phenomena, the DPS Spectrum maps them onto a single continuous trajectory of degrading stability.
Overview of Decision Pattern Shift, Linearity, and the DPS Spectrum

Key Results

  • Strong Linear Correlations: Across multiple architectures (VGG16, ResNet-32/34, GoogLeNet), the magnitude of DPS exhibits a powerful linear correlation with the generalization gap. Pearson correlation coefficients ($r$) are consistently above 0.8, and often exceed 0.9 at the sample and class levels.
Linear correlation between DPS and generalization gap
  • Anatomy of a Shortcut: Under shortcut learning (Colored MNIST), the DPS spectrum uniquely undergoes a "structural collapse," splitting into multiple distinct peaks. This happens because the model activates entirely different internal pathways depending on the spurious feature (color) rather than the core semantic feature (digit shape).
  • Superiority over Activation Patterns: The authors compared DPS against raw activation patterns. While raw activations capture class-agnostic features and suffer from high inter-class overlap, DPS isolates decision-relevant drift, providing a much cleaner diagnostic tool for generalization risk.

Limitations and Future Work

The primary limitation of DPS is its dependence on clean training labels. Because the metric uses the class-average training pattern as a reference baseline, corrupted or noisy training labels cause the baseline to become unstable or multi-modal. Experimentally, introducing 20% label noise to CIFAR-100 caused the sample-level Pearson correlation to drop from 0.930 to 0.855.

Future Directions: The current work focuses on convolutional neural networks (CNNs). The authors note that a natural next step is extending this framework to modern architectures like Vision Transformers (ViTs) and adapting it to dense prediction tasks like object detection and semantic segmentation.

Summary updated

BibTeX
@inproceedings{deng2026understanding,
  author = {Huiqi Deng and Yibo Li and Quanshi Zhang and Peng Zhang and Hongbin Pei and Xia Hu},
  title = {{Understanding Generalization through Decision Pattern Shift}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=bNwHDu1zwM},
}
Figure