Skip to main content
QUICK REVIEW

[Paper Review] A Sea of Words: An In-Depth Analysis of Anchors for Text Data

Gianluigi Lopardo, Fŕed́eric Precioso|arXiv (Cornell University)|May 27, 2022
Explainable Artificial Intelligence (XAI)Computer Science32 references2 citations
TL;DR

This paper provides the first theoretical analysis of Anchors for text data, formalizing its mechanism under exhaustive search and TF-IDF vectorization. It proves that Anchors selects words with the highest positive coefficients reweighted by inverse document frequency in linear models, and empirically shows similar behavior in neural networks via partial derivatives, offering rigorous insight into the method's behavior on interpretable models.

ABSTRACT

Anchors (Ribeiro et al., 2018) is a post-hoc, rule-based interpretability method. For text data, it proposes to explain a decision by highlighting a small set of words (an anchor) such that the model to explain has similar outputs when they are present in a document. In this paper, we present the first theoretical analysis of Anchors, considering that the search for the best anchor is exhaustive. After formalizing the algorithm for text classification, we present explicit results on different classes of models when the vectorization step is TF-IDF, and words are replaced by a fixed out-of-dictionary token when removed. Our inquiry covers models such as elementary if-then rules and linear classifiers. We then leverage this analysis to gain insights on the behavior of Anchors for any differentiable classifiers. For neural networks, we empirically show that the words corresponding to the highest partial derivatives of the model with respect to the input, reweighted by the inverse document frequencies, are selected by Anchors.

Motivation & Objective

  • To provide a rigorous theoretical foundation for Anchors, a popular post-hoc interpretability method for text classification.
  • To analyze Anchors' behavior on simple, interpretable models such as linear classifiers and if-then rules, where ground-truth feature importance is known.
  • To extend theoretical insights to complex models like neural networks, where the mechanism is less understood.
  • To validate theoretical claims through numerical experiments and Monte Carlo simulations on real and synthetic data.
  • To establish conditions under which Anchors produces stable, meaningful, and predictable explanations.

Proposed method

  • Formalizes Anchors for text classification using an exhaustive search over word subsets, assuming TF-IDF vectorization and out-of-vocabulary token replacement.
  • Models the sampling process as i.i.d. Bernoulli removal of non-anchor words, enabling probabilistic analysis of precision and coverage.
  • Proves stability of the exhaustive Anchors algorithm under perturbations of the precision function, ensuring robustness.
  • Derives exact conditions under which Anchors selects words based on model coefficients, particularly for linear and rule-based classifiers.
  • Empirically validates that Anchors selects words with the highest positive partial derivatives scaled by inverse document frequency in neural networks.
  • Uses Monte Carlo simulations and cumulative distribution function comparisons to verify theoretical approximations across varying parameter settings.

Experimental results

Research questions

  • RQ1Under what conditions does Anchors reliably identify the most important words for a model's prediction in linear classifiers?
  • RQ2How does Anchors behave when the underlying model is an interpretable if-then rule system?
  • RQ3Can theoretical guarantees from simple models be extended to complex, differentiable models like neural networks?
  • RQ4What is the relationship between Anchors' selection and the gradient-based saliency of words in deep learning models?
  • RQ5How do inverse document frequency and word multiplicity affect the stability and accuracy of Anchors' explanations?

Key findings

  • For linear classifiers, Anchors provably selects the words with the highest positive coefficients reweighted by inverse document frequency, ensuring alignment with model logic.
  • In if-then rule models, Anchors produces meaningful explanations, though words with high multiplicity may be excluded if their frequency exceeds a threshold.
  • For neural networks, Anchors selects words corresponding to the highest positive partial derivatives scaled by inverse document frequency, linking it to gradient-based explanation methods.
  • The exhaustive Anchors algorithm is stable under perturbations of the precision function, justifying its use as a theoretical benchmark.
  • Empirical validation via Monte Carlo simulations confirms theoretical approximations, especially when anchor size is small relative to vocabulary size.
  • Figures 12–13 demonstrate that Anchors prefer shorter, more specific rules over longer ones with redundant words, even when both satisfy the prediction condition.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.