TL;DR
ModelDiff is a new framework that identifies the functional differences between learning algorithms by pinpointing the specific features one algorithm uses that another ignores. By leveraging "datamodels" to trace model behavior back to individual training examples, it allows researchers to discover how design choices—like data augmentation or pre-training—fundamentally shift a model's underlying biases.
The Challenge of Comparing Algorithms
In machine learning, we often compare models using aggregate metrics like top-1 accuracy. However, accuracy is a blunt instrument. Two models can achieve 90% accuracy but arrive at their predictions using entirely different logic—one might rely on robust object shapes, while the other latches onto spurious background textures.
The challenge is that comparing learning algorithms (the entire pipeline of architecture, optimization, and data processing) is much harder than comparing two specific sets of weights. Existing tools like saliency maps or representation similarity (e.g., CKA) often fail to capture these "functional" differences or are difficult to interpret across different architectures. The authors of ModelDiff set out to create a precise, quantitative way to answer: "What features does Algorithm A use that Algorithm B does not?"
The ModelDiff Framework
The core of ModelDiff is a clever application of datamodels. A datamodel is a surrogate linear model that predicts a specific model's output (like the margin of a "cat" prediction) based on which training examples were present in its training set.
The ModelDiff pipeline follows four main steps:
- Compute Datamodels: For two algorithms ($A_1$ and $A_2$), the framework estimates how every training point influences every test prediction.
- Residual Analysis: For every test example, the authors compute a residual datamodel. They take the influence vector from $A_1$ and project it onto the null space of the influence vector from $A_2$. This effectively "subtracts" the training influences that both algorithms share, leaving only what is unique to $A_1$.
- Identify Subpopulations: They run Principal Component Analysis (PCA) on these residuals. The top components highlight "distinguishing subpopulations"—groups of test images where the two algorithms behave most differently.
- Counterfactual Verification: Once a subpopulation is identified, researchers design a "distinguishing transformation" (e.g., adding a synthetic spider web to an image) to verify that it actually changes the predictions of one algorithm significantly more than the other.
Datasets
The authors validated ModelDiff across three distinct settings:
- LIVING17: A subset of ImageNet containing 17 classes of living organisms, used to study the effects of data augmentation.
- WATERBIRDS: A dataset designed to test spurious correlations (e.g., birds usually appearing on water vs. land), used to study ImageNet pre-training.
- CIFAR-10: The classic image benchmark, used to study the impact of SGD hyperparameters (learning rate and batch size).
Key Insights and Results
By applying ModelDiff, the authors uncovered several surprising ways that standard design choices alter model behavior:
- Data Augmentation Amplifies Spurious Biases: Surprisingly, standard augmentations (like random crops) can make models more sensitive to background features. In the LIVING17 study, adding a spider web pattern increased the "spider" confidence of augmented models by 11%, while non-augmented models only saw a 1% increase.
- Pre-training Shifts Bias: Fine-tuning an ImageNet-pretrained model on Waterbirds reduced the "yellow bird" spurious correlation (where the model thinks anything yellow is a landbird; adding a yellow patch increased landbird confidence by 12% for models trained from scratch, but decreased it for pre-trained models). However, it introduced a new bias: human faces. Because ImageNet contains many faces, the pre-trained model learned to associate human faces in the background with certain bird classes.
- SGD Noise as a Feature Filter: High-noise SGD (high learning rate, small batch size) acts as a regularizer. It prevents models from memorizing low-level, easy-to-fit features like specific rectangular shapes or fine textures, which low-noise models readily adopt.
- Finer-grained than Predictions: ModelDiff can find these differences even on test examples where both algorithms produce the exact same predicted label, proving it captures internal logic rather than just output errors.
- Automated Hypothesis Generation: While the framework often requires a human to look at a subpopulation and guess the feature, the authors showed they could use CLIP to automatically surface descriptive captions (like "yellow," "lemon," or "faces") for the distinguishing groups.
Limitations and Future Work
- Computational Overhead: Building datamodels requires training hundreds or thousands of models on different subsets of data. While the authors show they can speed up the process using 10x fewer models, it remains a heavy lift for very large-scale tasks.
- Linearity Assumption: The framework relies on the assumption that training influences are roughly linear/additive. While this holds surprisingly well in practice, it may miss complex, non-linear interactions between training examples.
- The "Interpreter" Gap: While CLIP helps, the final step of turning a subpopulation into a "transformation" still requires some creative intuition. Future work could involve more automated ways to synthesize these distinguishing features.
Summary updated