Can BERT eat RuCoLA? Topological Data Analysis to Explain

Irina Proskurina, Irina Piontkovskaya, Ekaterina Artemova
4/4/2023
cs.CL

No official code found. Best implementation: upunaprosk/la-tda (7 stars, last commit 2023-10-25).

Abstract

This paper investigates how Transformer language models (LMs) fine-tuned for acceptability classification capture linguistic features. Our approach uses the best practices of topological data analysis (TDA) in NLP: we construct directed attention graphs from attention matrices, derive topological features from them, and feed them to linear classifiers. We introduce two novel features, chordality, and the matching number, and show that TDA-based classifiers outperform fine-tuning baselines. We experiment with two datasets, CoLA and RuCoLA in English and Russian, typologically different languages. On top of that, we propose several black-box introspection techniques aimed at detecting changes in the attention mode of the LMs during fine-tuning, defining the LM's prediction confidences, and associating individual heads with fine-grained grammar phenomena. Our results contribute to understanding the behavior of monolingual LMs in the acceptability classification task, provide insights into the functional roles of attention heads, and highlight the advantages of TDA-based approaches for analyzing LMs. We release the code and the experimental results for further uptake.

View on arXivView PDF

Code Implementations(1)

upunaprosk/la-tdaCommunity100%

Code for EACL Workshop paper Can BERT eat RuCoLA? Topological Data Analysis to Explain

70Python, Jupyter NotebookSep 23, 20222 years ago
acceptability-judgementsbarcodes-featuresgluepersistent-homologyripser+3 more

Cite this paper

@article{proskurina2023bert,
  title  = {Can BERT eat RuCoLA? Topological Data Analysis to Explain},
  author = {Irina Proskurina and Irina Piontkovskaya and Ekaterina Artemova},
  year   = {2023},
  eprint = {2304.01680},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2304.01680v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2304.01680.svg)](https://codeofpaper.com/paper/2304.01680)

Discussion