Source-linked AI summary

Interpretable Neural Predictions with Differentiable Binary Variables

Jasmijn Bastings, Wilker Aziz, Ivan Titov

arXiv:1905.08160v2cs.CL

TL;DR

Neural text classifiers need interpretable justifications, but binary rationale selection makes gradient-based training difficult. The paper introduces HardKuma, a reparameterizable distribution for binary selections and rate-targeted sparsity, and reports competitive rationale extraction with further attention applications.

  • Problem

    The paper addresses the need to justify text-classification predictions with short, sufficient rationales while avoiding the optimization difficulty of discrete latent selectors.

  • Method

    HardKuma uses a distribution with continuous and discrete behavior to enable reparameterized gradients, relaxed L0 penalties, and a target selection rate.

  • Results

    The approach is competitive with previous rationale-extraction methods and has further applications in attention mechanisms.

  • Takeaways & Limitations

    HardKuma provides differentiable extractive rationales while allowing the amount of selected text to be specified.

  • Takeaways & Limitations

    The latent-rationale objective can require marginalization over O(2^n) binary sequences, and the reparameterization includes discontinuity points at 0 and 1.

Abstract

from arXiv · show

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.

1 Introduction

The paper seeks interpretable text classifiers that justify predictions with short, sufficient rationales. It introduces HardKuma to select binary rationales differentiably and target a specified text-selection rate.

  • Motivation: Rationales are short, sufficient input passages that justify predictions while allowing classification from the rationale alone.The approach jointly trains a rationale extractor and a classifier operating only on selected words.
  • Contribution: The objective specifies how much text to extract, using relaxed L0 regularization and Lagrangian relaxation to target a selection rate.The penalty is based on the expected proportion of selected text.
  • Contribution: HardKuma supports binary rationale selections while enabling reparameterized gradient estimates without REINFORCE.It mixes discrete and continuous behavior to make gradient-based optimization tractable.
  • Empirical scope: HardKuma is reported as competitive with previous rationale-extraction work and applicable to attention mechanisms.The paper demonstrates the additional attention application empirically.

2 Latent Rationale

The latent-rationale model uses binary gates to select input positions for an encoder, while sparsity penalties encourage compact selections. Prior optimization is difficult because exact marginalization over binary sequences is intractable and relies on REINFORCE estimates.

  • Latent rationale model: A latent sequence z gates which input positions are available to the classifier, forming the rationale x⊙z.A neural network predicts one Bernoulli parameter per input position.
  • Latent rationale model: The classifier maximizes a lower bound on the data loglikelihood after rationale selection.The bound is derived using Jensen’s inequality.
  • Sparsity regularization: L0 and fused-lasso penalties discourage selecting too many words and too many transitions between selected and unselected positions.These penalties promote compact rationales rather than allowing the selector to retain the whole input.
  • Optimization challenge: The lower bound requires marginalization over O(2^n) binary sequences, making the objective intractable to compute directly.Prior work therefore samples latent assignments and uses REINFORCE for gradient estimates.
  • Proposed solution: The proposed replacement uses rectified continuous random variables that retain discrete behavior, support reparameterization, and enable a differentiable objective.The formulation also uses Lagrangian relaxation to target a pre-specified selection rate.

3 Hard Kumaraswamy Distribution

HardKuma combines continuous sampling with exact binary outcomes by stretching a Kumaraswamy distribution beyond [0,1] and rectifying its tails to 0 or 1. Its reparameterization enables gradient-based sampling through this construction.

  • Construction: HardKuma starts from a Kumaraswamy distribution and stretches its support from l < 0 to r > 1.The Kumaraswamy base distribution is defined over (0,1), with shape parameters controlling its form.
  • Properties: HardKuma therefore exhibits both continuous behavior in (0,1) and discrete behavior at exactly 0 and 1.The construction assigns non-negligible probability to the two boundary outcomes.
  • Construction: A hard-sigmoid maps stretched samples below 0 to 0 and samples above 1 to 1, producing support on [0,1].Mass in the intervals (l,0] and [1,r) becomes point mass at the corresponding boundary.
  • Reparameterization: Samples can be reparameterized from a uniform variable by inverse-CDF transformation, support stretching, and final rectification.The resulting sample lies in the closed interval [0,1].

4 Controlled Sparsity

The model relaxes sparsity penalties by evaluating their expectations under the latent distribution, making them tractable and differentiable. Lagrangian relaxation then targets specific selection rates or regularizer values.

  • Expected regularization: Expected L0 is available in closed form through the tractable Kumaraswamy CDF.This expected penalty is differentiable with respect to the latent model parameters φ.
  • Expected regularization: Expected fused lasso is approximated by counting expected zero-to-nonzero and nonzero-to-zero transitions.This provides a relaxation of the transition penalty for latent selectors.
  • Assumption: The regularizer calculations assume latent variables are independent given x.The paper discusses prefix-conditioned HardKuma assignments separately in Appendix B.1.2.
  • Targeting sparsity: Lagrangian relaxation targets specified penalty values because directly solving the constrained optimization problem is challenging.The vector of multipliers λ weights a vector of regularizers such as expected L0 and expected fused lasso.

5 Sentiment Classification

The sentiment-classification model parameterizes latent selectors, uses sampled selectors to restrict classifier inputs, and estimates training objectives with reparameterized Monte Carlo gradients. At test time, predictions use the most likely selector assignments.

  • Task and architecture: The sentiment task predicts a 5-way sentiment class from very negative to very positive.The cited passage identifies the task's five-way label space.
  • Task and architecture: The extractor predicts HardKuma selector parameters, and sampled selectors determine which input features reach the classifier.The classifier uses recurrent processing and a softmax output; selector z_i modulates the available feature e_i.
  • Optimization: Training estimates the expected log-likelihood with Monte Carlo samples using the reparameterization z = s_φ(u,x).This reparameterization enables gradient estimation through the stochastic computation graph.
  • Inference: At test time, each selector uses its most likely assignment among 0, 1, or the continuous interval.When the continuous interval is most likely, the expected value of the underlying Kumaraswamy variable is used.

6 Experiments

Experiments evaluate HardKuma rationales across multi-aspect sentiment, sentiment classification, and natural language inference. HardKuma generally preserves predictive performance with shorter selections and supports sparse attention.

  • 6 Experiments: The experiments compare HardKuma with prior rationale extraction on multi-aspect sentiment and evaluate it on sentiment classification and natural language inference.The evaluation defines rationale precision using sentence-level annotations and measures rationale-based predictions with MSE.
  • 6.1 Multi-aspect Sentiment Analysis: HardKuma achieved higher rationale precision than the Bernoulli reimplementation while selecting a similar percentage of words across the first three aspects.Models were selected based on validation MSE and tuned for similar selection rates.
  • 6.1 Multi-aspect Sentiment Analysis: HardKuma obtained lower MSE than Bernoulli for similar extracted-text percentages, although the full-text baseline achieved the best MSE.The error difference became smaller as more text was selected.
  • 6.2 Sentiment Classification: 45.84 test accuracy at around 40% extracted text compared with 42.22 for Bernoulli and 47.4±0.8 for the full-text baseline.HardKuma outperformed Bernoulli at each tested selection percentage and reached full-text baseline performance around 40% extracted text on validation accuracy.
  • 6.2 Sentiment Classification: HardKuma dropped relatively more neutral-sentiment words than Bernoulli when selecting shorter text.A large portion of dropped words had neutral sentiment in the SST analysis.

7 Related Work

The paper situates its approach among interpretability, rationale learning, sparse attention, and rectified-distribution research, while distinguishing latent rationale modeling from post-hoc interpretation and rationale-augmented classification.

  • Interpretability: Interpretability work includes extracting simpler models, making word vectors sparse or semantically structured, and approximating classifiers locally or causally.These approaches include rules, decision trees, sparse word vectors, LIME, and input-output pairs with causal relations.
  • Learning from rationales: Rationale-learning methods jointly model text fragments and classifiers, but prior work used Gibbs sampling for stochastic masks and targeted opinion summarization.The paper instead focuses on rationalizing classifier predictions, with rationales treated as latent and annotated rationales used only for evaluation.
  • Sparse layers: Sparse attention methods produce exactly zero-valued components through deterministic convex-optimization layers, whereas this paper focuses on binary outcomes.The contrast is between sparse probability vectors and binary selections.
  • Gradient estimation: The paper distinguishes its unbiased-gradient focus from SPIGOT and straight-through estimators, which are described as biased approaches.SPIGOT additionally requires an arg max solver and is efficient for structured variables.
  • Rectified Distributions: Rectified-distribution work stretches and rectifies continuous random variables, providing the conceptual basis for the paper’s HardKuma construction.Louizos et al. apply this idea to BinaryConcrete samples, while the paper adopts a related rectified-variable strategy.

8 Conclusions

The paper concludes that differentiable extractive rationales can target a specified extraction amount through HardKuma, which supports binary outcomes and reparameterized gradients. It also demonstrates HardKuma’s potential in SNLI attention and identifies further exploration as future work.

  • 8 Conclusions: The paper presents a differentiable approach to extractive rationales with an objective that specifies how much text should be extracted.The conclusion frames extraction-rate control as part of the approach’s main contribution.
  • 8 Conclusions: HardKuma provides reparameterized gradient estimates while supporting binary outcomes.Its construction uses a rectified variable with both discrete and continuous behavior, enabling gradients without REINFORCE.
  • 8 Conclusions: HardKuma has potential beyond rationale extraction, demonstrated through premise-hypothesis attention in SNLI.The paper leaves further applications and explorations for future work.

A.4 HardKumaraswamy PDF and CDF

The paper illustrates HardKumaraswamy probability density and cumulative distribution functions across different shape-parameter settings.

  • A.4 HardKumaraswamy PDF and CDF: Figures 8 and 9 plot the HardKumaraswamy pdf and cdf, respectively, for various a and b parameters.The two figures provide complementary views of the distribution under different parameter choices.

B.1 Multi-aspect Sentiment Analysis

The experiments describe implementation choices for sentiment analysis and SNLI, including baseline regularization, HardKuma selection-rate targets, and model-training procedures. SNLI attention examples include correct and incorrect cases across entailment, contradiction, and neutral relations.

  • Experimental setup: The experiments use established hyperparameters, train for up to 100 epochs, and select models using validation loss.The multi-aspect sentiment experiments use a shorter maximum of 50 epochs for all-aspects MSE trade-offs.
  • Experimental setup: Bernoulli baselines vary the L0 weight λ1 over {0.0002, 0.0003, 0.0004} and set fused-lasso weight λ2 to 2 ∗λ1.These settings follow the original paper’s choices.
  • Model: The sentiment classifier and rationale extractor use bidirectional LSTMs, with concatenated final states followed by a linear layer and softmax prediction.The RCNN used in multi-aspect sentiment analysis is the bigram version with filter width n = 2.
  • SNLI attention: Figure 10 shows correct and incorrect HardKuma-attention examples for entailment, contradiction, and neutral relations in SNLI.The figure is organized by the three relation types rather than by a reported aggregate metric.
Loading 1905.08160v2…