Using Shapley interactions to understand how models use structure

Divyansh Singhvi, Diganta Misra, Andrej Erkelens, Raghav Jain, Isabel Papadimitriou +1 more
3/19/2024
cs.LGcs.AIcs.CL

No official code found. Best implementation: divyanshsinghvi/ShapleyInteraction4Structure (1 star, last commit 2025-12-31).

Abstract

Language is an intricately structured system, and a key goal of NLP interpretability is to provide methodological insights for understanding how language models represent this structure internally. In this paper, we use Shapley Taylor interaction indices (STII) in order to examine how language and speech models internally relate and structure their inputs. Pairwise Shapley interactions measure how much two inputs work together to influence model outputs beyond if we linearly added their independent influences, providing a view into how models encode structural interactions between inputs. We relate the interaction patterns in models to three underlying linguistic structures: syntactic structure, non-compositional semantics, and phonetic coarticulation. We find that autoregressive text models encode interactions that correlate with the syntactic proximity of inputs, and that both autoregressive and masked models encode nonlinear interactions in idiomatic phrases with non-compositional semantics. Our speech results show that inputs are more entangled for pairs where a neighboring consonant is likely to influence a vowel or approximant, showing that models encode the phonetic interaction needed for extracting discrete phonemic representations.

View on arXivView PDF

Code Implementations(1)

This repository provides code and scripts to reproduce experiments from the paper: Using Shapley Interactions to Understand How Models Use Structure

10HTML, ShellJun 18, 20239 months ago

Similar Papers

Cite this paper

@article{singhvi2024using,
  title  = {Using Shapley interactions to understand how models use structure},
  author = {Divyansh Singhvi and Diganta Misra and Andrej Erkelens and Raghav Jain and Isabel Papadimitriou and Naomi Saphra},
  year   = {2024},
  eprint = {2403.13106},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2403.13106v2}
}

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/2403.13106.svg)](https://codeofpaper.com/paper/2403.13106)

Discussion