paper-with-me

홈 › Papers

Explaining Attention with Program Synthesis

2026-06-17 · Amiri Hayes, Belinda Z Li, Jacob Andreas arxiv

A longstanding goal of research on interpretable deep learning is to replace opaque neural computations with human-meaningful symbolic descriptions. In this paper, we propose an approach for approximating the behavior of components of deep networks with executable programs. We focus on attention heads in transformer language models. For a given head, we first compute its associated attention matrices on a collection of randomly selected training examples. Next, we prompt a pre-trained language model with a summary of these matrices, and instruct it to generate a set of Python programs that can reproduce the associated attention patterns given only text from the input sentence. Finally, we re-rank programs according to how well our final set of programs predict behavior on held-out inputs. We demonstrate that a set of fewer than 1,000 such generated programs can reproduce the attention patterns of heads in GPT-2, TinyLlama-1.1B, and Llama-3B, achieving an average Intersection-over-Union similarity above 75% on TinyStories. Moreover, the best-fit programs can replace neural attention heads without substantially affecting model behavior: replacing 25% of attention heads with programmatic surrogates across the three models incurs only a 16% average perplexity increase, while maintaining performance on a variety of downstream question answering benchmarks. This work contributes a scalable pipeline for reverse-engineering attention heads in transformer models using human-readable, executable code, advancing a path toward symbolic transparency in neural models.

📄 PDF Abstract BibTeX arXiv:2606.19317

Code (0)

등록된 구현이 없습니다.

Tasks

Question AnsweringProgram Synthesis

Similar Papers 제목 키워드 기반

"Why did you do that?": Explaining black box models with Inductive Synthesis

2019-04-17 · Görkem Paçacı, David Johnson, Steve McKeever, Andreas Hamfelt

By their nature, the composition of black box models is opaque. This makes the ability to generate explanations for the response to stimuli challenging. The importance of explaining black box models has become increasing…

Program Synthesis

Searching Latent Program Spaces

2024-11-13 · Clément Bonnet, Matthew V Macfarlane

Program synthesis methods aim to automatically generate programs restricted to a language that can explain a given specification of input-output pairs. While purely symbolic approaches suffer from a combinatorial search …

ARCProgram inductionProgram SynthesisTest-time Adaptation

RobustFill: Neural Program Learning under Noisy I/O

2017-03-21 · ICML 2017 8 · Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh 외

The problem of automatically generating a computer program from some specification has been studied since the early days of AI. Recently, two competing approaches for automatic program learning have received significant …

Program inductionProgram Synthesis

The Challenges in Specifying and Explaining Synthesized Implementations of Reactive Systems

2019-01-03 · Hadas Kress-Gazit, Hazem Torfah

In formal synthesis of reactive systems an implementation of a system is automatically constructed from its formal specification. The great advantage of synthesis is that the resulting implementation is correct by constr…

Explaining Transition Systems through Program Induction

2017-05-23 · Svetlin Penkov, Subramanian Ramamoorthy

Explaining and reasoning about processes which underlie observed black-box phenomena enables the discovery of causal mechanisms, derivation of suitable abstract representations and the formulation of more robust predicti…

Program induction