AttriBoT: A Bag of Tricks for Efficiently Approximating Leave-One-Out Context Attribution

Fengyuan Liu, Nikhil Kandpal, Colin Raffel
11/22/2024
cs.LG

No official code found. Best implementation: r-three/AttriBoT (15 stars, last commit 2025-04-21).

Abstract

The influence of contextual input on the behavior of large language models (LLMs) has prompted the development of context attribution methods that aim to quantify each context span's effect on an LLM's generations. The leave-one-out (LOO) error, which measures the change in the likelihood of the LLM's response when a given span of the context is removed, provides a principled way to perform context attribution, but can be prohibitively expensive to compute for large models. In this work, we introduce AttriBoT, a series of novel techniques for efficiently computing an approximation of the LOO error for context attribution. Specifically, AttriBoT uses cached activations to avoid redundant operations, performs hierarchical attribution to reduce computation, and emulates the behavior of large target models with smaller proxy models. Taken together, AttriBoT can provide a >300x speedup while remaining more faithful to a target model's LOO error than prior context attribution methods. This stark increase in performance makes computing context attributions for a given response 30x faster than generating the response itself, empowering real-world applications that require computing attributions at scale. We release a user-friendly and efficient implementation of AttriBoT to enable efficient LLM interpretability as well as encourage future development of efficient context attribution methods.

View on arXivView PDF

Code Implementations(1)

r-three/AttriBoTCommunity100%

Code for AttriBoT from "AttriBoT: A Bag of Tricks for Efficiently Approximating Leave-One-Out Context Attribution"

150PythonNov 22, 20241 years ago

Similar Papers

Cite this paper

@article{liu2024attribot,
  title  = {AttriBoT: A Bag of Tricks for Efficiently Approximating Leave-One-Out Context Attribution},
  author = {Fengyuan Liu and Nikhil Kandpal and Colin Raffel},
  year   = {2024},
  eprint = {2411.15102},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.15102v3},
  journal = {ICLR 2024 2024}
}

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

Discussion