TL;DR
This paper introduces Mixture of Attentions (MoA), a framework designed to boost machine learning performance on specific, difficult-to-model data subsets (or "slices") without sacrificing overall accuracy. By combining rule-based membership attention with feature-driven dot-product attention, the authors achieve significant performance gains—up to 12% F1 lift—on targeted slices in natural language understanding tasks.
What Problem Does This Paper Address?
Standard machine learning models are often judged by coarse metrics like overall accuracy. However, a model with 95% accuracy might consistently fail on specific, critical subsets—such as very short queries or sentences containing rare keywords.
Previous work introduced Slice-Based Learning (SBL) to address this by training specialized "experts" for these data slices. However, SBL has a major weakness: its attention mechanism (which decides which expert to listen to) relies heavily on "slice indicators"—often noisy, heuristic rules. In multi-class scenarios, this mechanism struggles to appropriately weight expert confidence, leading to suboptimal performance on the very slices it aims to improve.
Methods
The authors propose a "slice-aware" architecture that extends SBL with a Mixture of Attentions (MoA). The architecture consists of several key stages:
- Backbone Model: A pre-trained model (like BERT) extracts a general feature representation ($x$).
- Slice Functions & Indicators: Heuristic rules (e.g., "does this sentence contain the word 'email'?") define the slices. Indicators then learn to predict if a sample belongs to these slices.
- Slice Experts: Specialized layers learn representations ($r$) tailored to each specific slice.
- Mixture of Attentions (MoA): This is the core innovation. Instead of one attention head, it uses two:
- Membership Attention: Weights the experts based on the slice indicators' predictions (rule-based).
- Dot-Product Attention: Learns "slice prototypes" and weights them based on their similarity to the backbone features ($x$). This allows the model to capture latent semantic similarities that simple rules might miss.
The final representation ($s$) is a combination of these two attentive views, which is then used for the final prediction.
Datasets
The researchers evaluated their approach on two Natural Language Understanding (NLU) tasks:
- CoLA (Corpus of Linguistic Acceptability): A binary classification task to determine if a sentence is grammatically correct. Slices were defined for "Long" sentences and "Questions."
- Intent Detection: A multi-class task (64 intents) using a dataset of 25k user utterances. Slices were defined based on "Length" (short utterances) and keywords like "Time" and "Email."
Key Insights and Ideas
- Dual-Source Wisdom: The MoA approach recognizes that rules and features are both valuable. Membership attention captures explicit domain knowledge (the "rules"), while dot-product attention captures implicit semantic patterns (the "features").
- Addressing Multi-class Limitations: By moving beyond simple element-wise addition used in original SBL, MoA handles the "shape mismatch" issues that occur when scaling to many classes.
- Stochastic vs. Deterministic: The authors experimented with both deterministic (weighted sums) and stochastic (Gumbel-Softmax sampling) ways to compute slice distributions, finding that hard sampling (SBL-MoA-H) often provided the best performance for specific metrics like the Matthews Correlation Coefficient (MCC).
- Latent Similarity: As shown in Figure 2, the dot-product attention can sometimes identify a sample as belonging to a slice (like "Email") even if the explicit rule doesn't trigger, because the BERT backbone recognizes the semantic similarity to other "Email" samples.
Key Results
The MoA approach consistently outperformed both the baseline and the original SBL:
- Linguistic Acceptability (CoLA): The MoA variants achieved an average 9% F1 lift over the baseline and a 6% lift over vanilla SBL on monitored slices. The maximum lift reached 12%.
- Intent Detection: MoA variants outperformed SBL by an average of 1% in accuracy and 1.7% in F1 score on targeted slices.
- Stability: Crucially, these gains on specific slices did not degrade the model's overall performance on the entire dataset.
Limitations and Future Work
- Heuristic Dependency: The system still relies on manually defined slice functions. If these functions are poorly designed or too noisy, the "membership attention" component may be less effective.
- Overall Impact: As noted by the authors, if a targeted slice is very small relative to the total dataset, even a large "lift" on that slice might not significantly move the needle on the overall global accuracy metric.
- Future Directions: The authors suggest that MoA is a specific instance of multi-head attention and could be extended to include even more types of attention mechanisms to further refine slice distributions.
Summary updated