TL;DR
This paper introduces MiMu, a novel method to combat "shortcut learning" in Transformer models, where models exploit spurious correlations in data for quick wins but fail on unseen data. MiMu uses a two-stage approach: self-calibration to make models less overconfident and self-improvement to encourage broader feature learning, significantly boosting robustness and generalization across NLP and CV tasks.
What Problem Does This Paper Address?
Deep learning models, particularly those trained with Empirical Risk Minimization (ERM), often learn to exploit "shortcuts" – spurious correlations between features and labels – to achieve high accuracy on training data. While effective on IID (Independent and Identically Distributed) data, this shortcut learning severely degrades performance on Out-of-Distribution (OOD) data, hindering real-world applicability. Existing methods often focus on identifying and mitigating a single shortcut, but real-world data presents a complex and diverse set of unknown shortcuts. Furthermore, models can exhibit varying degrees of reliance on different shortcuts, with stronger shortcuts leading to poorer generalization. This paper addresses the challenge of mitigating multiple and unknown shortcuts in Transformer-based models.
Methods
MiMu employs a two-stage strategy using Transformer-based ERM models:
- Source Model (Fs) - Self-Calibration Strategy: This stage aims to prevent the model from becoming overconfident on shortcuts. It aligns the model's predictions with its confidence levels, effectively penalizing high-confidence but incorrect predictions. This is achieved by minimizing a calibration loss that combines mean squared difference and cross-entropy.
- Target Model (Ft) - Self-Improvement Strategy: This stage focuses on reducing reliance on multiple shortcuts. It incorporates:
- Distillation Loss: Ensures the softened output distribution of Ft mirrors that of the calibrated source model Fs.
- Random Mask Strategy: Randomly masks partial attention positions in the target model to diversify its focus and prevent it from concentrating on fixed shortcut-prone regions.
- Adaptive Attention Alignment Module: Aligns the attention weights of Ft with those of the calibrated Fs, leveraging Fs's stable attention patterns without requiring external supervision. This helps the model learn more robust representations.
- Post-hoc Calibration: Synchronizes Ft's output probabilities with its confidence levels to prevent the learning process from shifting towards new shortcuts.
Datasets
The authors evaluate MiMu on a variety of datasets across NLP and Computer Vision:
NLP: * MNLI (Multi-Genre Natural Language Inference): Used for NLI tasks, with "match" and "mismatch" subsets for IID evaluation. * Hans: An adversarial dataset for NLI, used to assess robustness against lexical overlap, subsequence, and constituent shortcuts. * QQP (Quora Question Pairs): Used for Paraphrase Identification (PI) tasks. * PAWS: Used as an OOD test set for QQP to evaluate performance on lexical overlap shortcuts.
Computer Vision: * ImageNet-9 (IN-9-W): Enhanced with watermarks related to copyright protection for training. * Mixed-Rand variants (Rand-B, Rand-W, Rand-B+W): OOD test sets derived from ImageNet-9 to evaluate reliance on background, watermark, and dual-shortcuts. * ImageNet-200 (IN-200-W): Enhanced with web URL watermarks simulating real-world scenarios for training. * IN-B, IN-R, IN-R+W: OOD test sets for IN-200-W to assess impact of background, texture, and watermarks.
Key Insights and Ideas
- Diverse Reliance on Shortcuts: Models don't rely on all shortcuts equally; they exhibit stronger reliance on "strong shortcuts," which leads to poorer generalization.
- Interaction of Multiple Shortcuts: When multiple shortcuts are present, the model's performance often falls between the performance observed with individual shortcuts, suggesting a complex interplay.
- Mitigation, Not Elimination: The paper posits that completely eliminating shortcuts is theoretically impossible, and the goal is to mitigate their influence.
- Self-Calibration for Confidence: Making models less overconfident on shortcuts is a crucial first step before attempting to improve generalization.
- Self-Improvement for Broader Focus: Techniques like random masking and attention alignment are effective in forcing models to consider a wider range of features, moving beyond fixed shortcut regions.
Key Results
- NLP Performance: MiMu significantly improves OOD generalization on datasets like Hans (9.2% boost) and QQP (PAWS dataset) while maintaining or even slightly increasing IID accuracy. It outperforms baselines like Sample Re-weighting (SR), Product Of Experts (POE), and Confidence Regularization (CR).
- CV Performance: MiMu consistently outperforms all baselines on various OOD CV datasets (IN-9-W, IN-200-W, Rand-B, Rand-W, Rand-B+W), demonstrating its effectiveness in mitigating background, texture, and watermark shortcuts.
- Calibration: MiMu shows better calibration than standard ERM models, with the source model (Fs) exhibiting excellent calibration on IID datasets and the target model (Ft) showing stronger calibration on OOD datasets.
- Ablation Studies: Both self-calibration and self-improvement strategies are crucial for MiMu's performance, with their removal leading to a decline in OOD generalization.
Limitations and Future Work
- Unknown Shortcuts: The paper acknowledges that the full spectrum of shortcuts in complex data (especially in LLMs) is vast and requires further investigation.
- Coarse-grained vs. Fine-grained Shortcuts: Current research often treats shortcuts at a coarse level. More fine-grained analysis of factors like size, complexity, and style of shortcuts is needed.
- Interaction of Multiple Shortcuts: While MiMu shows improvement, its performance on multiple shortcuts is not as effective as on single shortcuts. The paper speculates that this might be due to tokens containing information from multiple shortcuts. The interaction between shortcuts themselves is a complex phenomenon that warrants further study.
- Parameter Tuning: The optimal value for the random masking parameter 'N' was found to be task-dependent (20% for NLP tokens, 10% for CV patches), suggesting a need for careful tuning.
Summary updated