Abstract
The success of neural networks comes hand in hand with a desire for more interpretability. We focus on text classifiers and make them more interpretable by having them provide a justification–a rationale–for their predictions. We approach this problem by jointly training two neural network models: a latent model that selects a rationale (i.e. a short and informative part of the input text), and a classifier that learns from the words in the rationale alone. Previous work proposed to assign binary latent masks to input positions and to promote short selections via sparsity-inducing penalties such as L0 regularisation. We propose a latent model that mixes discrete and continuous behaviour allowing at the same time for binary selections and gradient-based training without REINFORCE. In our formulation, we can tractably compute the expected value of penalties such as L0, which allows us to directly optimise the model towards a pre-specified text selection rate. We show that our approach is competitive with previous work on rationale extraction, and explore further uses in attention mechanisms.
Introduction: The Need for Rationales
While deep learning models excel at text classification, they are often "black boxes." To build trust and understanding, we want models to provide a rationale: a short, sufficient snippet of the input text that explains why a certain prediction was made.
Technically, this is a "subset selection" problem. Previous approaches assigned a binary variable (0 or 1) to every word. However, because discrete choices are non-differentiable, these models typically relied on REINFORCE, a reinforcement learning algorithm known for being unstable, high-variance, and sensitive to hyperparameters. The challenge is to create a model that can pick "hard" zeros and ones while remaining trainable via standard gradient descent.
Methodology: The Hard Kumaraswamy Distribution
The core innovation of this work is the Hard Kumaraswamy (HardKuma) distribution. This novel probability distribution allows neural networks to make hard binary choices while remaining fully differentiable through the reparameterization trick.
The Recipe for Differentiable Sparsity
- Kumaraswamy Base: The model starts with the Kumaraswamy distribution, a continuous distribution similar to the Beta distribution. Unlike the Beta distribution, its cumulative distribution function (CDF) and inverse CDF have simple closed-form equations, making it ideal for the reparameterization trick.
- Stretch and Rectify: The distribution's support is "stretched" slightly beyond the [0, 1] interval (e.g., to [-0.1, 1.1]). It is then "rectified" using a hard-sigmoid function. Any value sampled below 0 becomes exactly 0, and any value above 1 becomes exactly 1.
- Gradient Flow: Because the underlying distribution is continuous, gradients can flow through the "stretched" values during training. However, the final output contains exact zeros (ignored words) and ones (selected words), providing the desired hard sparsity.
- Lagrangian Relaxation: To avoid manual tuning of sparsity penalties, the authors use a constrained optimization technique to automatically target a pre-specified selection rate (e.g., "extract exactly 10% of the text").
Experimental Evaluation
The model was evaluated across three distinct tasks to test its robustness and interpretability:
- BeerAdvocate: A multi-aspect sentiment dataset (predicting ratings for "look," "smell," and "taste"). This dataset is unique because it includes human-annotated rationales for evaluation.
- Stanford Sentiment Treebank (SST): A standard 5-way sentiment classification task.
- Stanford Natural Language Inference (SNLI): A task determining the logical relationship (entailment, contradiction, or neutral) between a premise and a hypothesis.
Key Results and Insights
- Superior Precision: On the BeerAdvocate "look" aspect, HardKuma achieved 98.1% precision in matching human rationales, outperforming the Bernoulli/REINFORCE baseline (96.3%).
- Efficient Sentiment Analysis: In the SST task, HardKuma reached full-text performance levels using only about 40% of the input text, successfully identifying the "emotional core" of sentences while discarding neutral noise.
- Sparse Attention: On the SNLI task, the model achieved 85.5% accuracy with only 8.5% non-zero attention. This proves that dense attention mechanisms are often redundant and that sparse, interpretable attention can maintain high performance.
Conclusion and Future Work
HardKuma offers a mathematically elegant alternative to REINFORCE for rationale extraction. By moving beyond the independence assumption—where the choice to pick one word is independent of the next—future work could explore contiguous phrase selection. Additionally, the authors suggest applying HardKuma to more complex structures, such as sparse graph neural networks or Transformers, to further enhance model transparency without sacrificing accuracy.
Summary updated