Introduction
Deep learning models for Natural Language Understanding (NLU), such as BERT, frequently exhibit systematic "blind spots." For instance, a sentiment analysis model might consistently fail on sentences involving negation with neutral words, or a natural language inference (NLI) model might rely on simplistic word-overlap heuristics rather than true semantic understanding.
Traditionally, addressing these bugs required the labor-intensive collection of thousands of new examples followed by full model retraining—a process that is computationally expensive and slow. Conversely, simple fine-tuning on a few "debugging" examples often leads to catastrophic forgetting, where the model fixes the specific bug but loses general accuracy on its original task. This paper proposes a "fast few-shot debugging" method that balances the speed of fine-tuning with the stability of full retraining.
Methodology: "In-danger" Sampling
The authors introduce a novel sampling strategy to mitigate catastrophic forgetting during rapid updates. While standard intensive fine-tuning repeatedly updates the model on a small set of debugging examples ($X'$) until they are mastered, the proposed method identifies and protects vulnerable knowledge:
- Dry Run: Perform a temporary update on the debugging examples.
- Identify "In-danger" Examples: Scan the original training set to find examples ($W$) that the model correctly classified before the update but failed after the dry run.
- Surgical Fine-tuning: Restart from the original model and fine-tune on the combined set of debugging examples and these specific "in-danger" samples ($X' \cup W$).
This approach ensures that the model retains the specific original knowledge most threatened by the new information.
Experimental Setup
The method was evaluated using two primary NLU test suites:
- HANS (Heuristic Analysis for NLI Systems): Targets linguistic traps in MNLI models, such as lexical overlap heuristics.
- CheckList: Probes sentiment analysis (SST-2) and duplicate question detection (QQP) for capabilities like handling passive voice or taxonomies.
For each phenomenon, only 10 examples were used for debugging, with approximately 990 unseen examples used to test generalization.
Results and Discussion
Performance and Stability
The proposed method achieved a superior balance between fixing bugs and maintaining original task performance. As shown in Figure 1, the method is sensitive to the number of shots; while 5 examples are often insufficient for reliable debugging, 10 to 20 examples provide a stable and effective fix.
In the HANS "Passive" suite, the model's accuracy jumped from a baseline of 0.4% to 99.4% after 10-shot debugging. Crucially, the original MNLI accuracy only experienced a marginal decline from 83.8% to 83.2%, outperforming other fast constraint-based methods (see Table 1).
Efficiency
The primary advantage of this approach is its operational speed. The "in-danger" sampling method typically finishes in about 25 seconds. Compared to "slow" methods like oversampling or full retraining, which can take between 3.5 and 7 hours, this represents a 60x to 720x speedup.
Conclusion and Future Work
Fast few-shot debugging proves that models can learn underlying linguistic rules from very few examples without memorizing specific shots. While highly effective, the authors note that future work should explore non-template-based test suites to ensure these fixes generalize to natural linguistic variety. Additionally, scaling the method to handle dozens of simultaneous phenomena remains a key challenge for production environments.
Summary updated