Introduction
Modern Natural Language Processing (NLP) models, despite their state-of-the-art performance, frequently exhibit systematic errors stemming from dataset biases or model misspecification. Identifying these failure modes is critical for model debugging and reliability. However, existing "local" explanation methods, such as LIME or SHAP, focus on individual predictions and fail to provide a global perspective on a model's systematic weaknesses.
The challenge of discovering global error patterns is compounded by two factors: redundancy and scale. Traditional pattern mining often yields thousands of overlapping results, overwhelming human analysts. Furthermore, the search space for token combinations across large vocabularies is mathematically "twice exponential," making exhaustive search computationally infeasible.
Methodology: The PREMISE Framework
To address these challenges, we introduce PREMISE, an algorithm designed to discover a succinct, non-redundant set of interpretable token patterns that explain classifier failures. PREMISE is built upon three core components:
- Minimum Description Length (MDL) Principle: Rather than simply identifying frequent patterns, PREMISE utilizes the MDL principle to select a set of patterns that best "compresses" the error data. This ensures the resulting model describes the relationship between features and errors most succinctly, minimizing redundancy.
- Rich Pattern Language: PREMISE employs a logic-based language capable of identifying conjunctions (AND), mutual exclusivity (XOR), and nested combinations. This allows for the discovery of complex failure modes, such as patterns involving synonyms or related concepts.
- Heuristic Search with Embeddings: To navigate the vast search space, the algorithm uses a heuristic search guided by classifier-independent word embeddings. This enables the efficient grouping of semantically related tokens.
Experimental Evaluation
The effectiveness of PREMISE was evaluated across several domains:
- Synthetic Data: Verified the algorithm's ability to recover ground truth error patterns in controlled settings.
- Visual Question Answering (VQA): Utilizing the Visual7W and LXMERT datasets, PREMISE identified why models struggle to link visual information with textual queries.
- Named Entity Recognition (NER): A case study on "in the wild" deployment revealed errors caused by preprocessing discrepancies or label conventions.
Key Insights and Results
Our analysis revealed several significant findings regarding model behavior:
- Counting Weaknesses: In VQA models, the pattern
(how, many)consistently indicated failure, confirming that even sophisticated models struggle with fundamental counting tasks. - Dataset Shortcuts: PREMISE identified instances where models were "right for the wrong reasons." For example, questions starting with "who took the photo" were often answered correctly simply because "photographer" was the dominant answer in the training set—a clear case of dataset bias.
- Actionable Debugging: In NER tasks, discovered patterns highlighted specific issues with spatial reasoning (e.g., "left/right") and the handling of unknown (
UNK) tokens. - Pattern-Guided Fine-tuning: By using discovered patterns to select "hard" examples for fine-tuning, we achieved significant performance improvements compared to random data augmentation.
In comparative evaluations, PREMISE outperformed over ten baseline approaches. While many baselines failed to scale or produced redundant outputs, PREMISE consistently recovered ground truth patterns in noisy, imbalanced data.
Conclusion and Future Work
PREMISE provides a scalable and interpretable diagnostic tool for NLP pipelines. While the current implementation is token-centric and relies on heuristics, it offers actionable insights for model improvement. Future work will explore expanding the pattern language to include syntactic structures and multi-modal features. The authors have released PyPremise, an open-source Python library, to facilitate the application of these tools by the broader research community.
Summary updated