A Sea of Words: An In-Depth Analysis of Anchors for Text Data

Gianluigi Lopardo, Frederic Precioso, Damien Garreau
Proceedings of The 26th International Conference on Artificial Intelligence and Statistics, PMLR 206:4848-4879, 2023.

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.

Cite this Paper


BibTeX
@InProceedings{pmlr-v206-lopardo23a, title = {A Sea of Words: An In-Depth Analysis of Anchors for Text Data}, author = {Lopardo, Gianluigi and Precioso, Frederic and Garreau, Damien}, booktitle = {Proceedings of The 26th International Conference on Artificial Intelligence and Statistics}, pages = {4848--4879}, year = {2023}, editor = {Ruiz, Francisco and Dy, Jennifer and van de Meent, Jan-Willem}, volume = {206}, series = {Proceedings of Machine Learning Research}, month = {25--27 Apr}, publisher = {PMLR}, pdf = {https://proceedings.mlr.press/v206/lopardo23a/lopardo23a.pdf}, url = {https://proceedings.mlr.press/v206/lopardo23a.html}, 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.} }
Endnote
%0 Conference Paper %T A Sea of Words: An In-Depth Analysis of Anchors for Text Data %A Gianluigi Lopardo %A Frederic Precioso %A Damien Garreau %B Proceedings of The 26th International Conference on Artificial Intelligence and Statistics %C Proceedings of Machine Learning Research %D 2023 %E Francisco Ruiz %E Jennifer Dy %E Jan-Willem van de Meent %F pmlr-v206-lopardo23a %I PMLR %P 4848--4879 %U https://proceedings.mlr.press/v206/lopardo23a.html %V 206 %X 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.
APA
Lopardo, G., Precioso, F. & Garreau, D.. (2023). A Sea of Words: An In-Depth Analysis of Anchors for Text Data. Proceedings of The 26th International Conference on Artificial Intelligence and Statistics, in Proceedings of Machine Learning Research 206:4848-4879 Available from https://proceedings.mlr.press/v206/lopardo23a.html.

Related Material