Learning to Attribute with Attention

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Cohen-Wang, Benjamin, Chuang, Yung-Sung, Madry, Aleksander
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916696279744512
author Cohen-Wang, Benjamin
Chuang, Yung-Sung
Madry, Aleksander
author_facet Cohen-Wang, Benjamin
Chuang, Yung-Sung
Madry, Aleksander
contents Given a sequence of tokens generated by a language model, we may want to identify the preceding tokens that influence the model to generate this sequence. Performing such token attribution is expensive; a common approach is to ablate preceding tokens and directly measure their effects. To reduce the cost of token attribution, we revisit attention weights as a heuristic for how a language model uses previous tokens. Naive approaches to attribute model behavior with attention (e.g., averaging attention weights across attention heads to estimate a token's influence) have been found to be unreliable. To attain faithful attributions, we propose treating the attention weights of different attention heads as features. This way, we can learn how to effectively leverage attention weights for attribution (using signal from ablations). Our resulting method, Attribution with Attention (AT2), reliably performs on par with approaches that involve many ablations, while being significantly more efficient. To showcase the utility of AT2, we use it to prune less important parts of a provided context in a question answering setting, improving answer quality. We provide code for AT2 at https://github.com/MadryLab/AT2 .
format Preprint
id arxiv_https___arxiv_org_abs_2504_13752
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Learning to Attribute with Attention
Cohen-Wang, Benjamin
Chuang, Yung-Sung
Madry, Aleksander
Machine Learning
Computation and Language
Given a sequence of tokens generated by a language model, we may want to identify the preceding tokens that influence the model to generate this sequence. Performing such token attribution is expensive; a common approach is to ablate preceding tokens and directly measure their effects. To reduce the cost of token attribution, we revisit attention weights as a heuristic for how a language model uses previous tokens. Naive approaches to attribute model behavior with attention (e.g., averaging attention weights across attention heads to estimate a token's influence) have been found to be unreliable. To attain faithful attributions, we propose treating the attention weights of different attention heads as features. This way, we can learn how to effectively leverage attention weights for attribution (using signal from ablations). Our resulting method, Attribution with Attention (AT2), reliably performs on par with approaches that involve many ablations, while being significantly more efficient. To showcase the utility of AT2, we use it to prune less important parts of a provided context in a question answering setting, improving answer quality. We provide code for AT2 at https://github.com/MadryLab/AT2 .
title Learning to Attribute with Attention
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2504.13752