프로그램 합성으로 설명 가능한 어텐션
Explaining Attention with Program Synthesis
해석 가능 심층 학습 연구의 오랜 목표는 불투명한 신경망 계산을 인간이 이해할 수 있는 기호적 표현으로 대체하는 것입니다. 본 논문에서는 심층 신경망의 구성 요소를 실행 가능한 프로그램으로 근사화하는 접근 방식을 제안합니다. 우리는 트랜스포머 언어 모델의 어텐션 헤드에 중점을 둡니다. 주어진 어텐션 헤드의 경우, 먼저 무작위로 선택된 학습 예제 집합에 대한 해당 어텐션 행렬을 계산합니다. 그런 다음, 사전 훈련된 언어 모델에 이러한 행렬의 요약 정보를 제공하고, 입력 문장의 텍스트만으로 관련 어텐션 패턴을 재현할 수 있는 Python 프로그램 세트를 생성하도록 지시합니다. 마지막으로, 생성된 프로그램 세트가 보류된 입력에서의 동작을 얼마나 잘 예측하는지에 따라 프로그램을 다시 순위화합니다. 우리는 1,000개 미만의 생성된 프로그램 세트로 GPT-2, TinyLlama-1.1B 및 Llama-3B 모델의 어텐션 헤드 패턴을 재현할 수 있으며, TinyStories 데이터셋에서 평균 IoU(Intersection-over-Union) 유사도가 75% 이상임을 보여줍니다. 또한, 가장 적합한 프로그램은 신경망 어텐션 헤드를 대체하여 모델 동작에 큰 영향을 미치지 않습니다. 세 가지 모델 모두에서 25%의 어텐션 헤드를 프로그래밍 방식으로 대체하는 경우 평균 퍼플렉시티가 16% 증가하지만 다양한 질의 응답 벤치마크에서의 성능은 유지됩니다. 본 연구는 인간이 읽을 수 있는 실행 가능한 코드를 사용하여 트랜스포머 모델의 어텐션 헤드를 역공학하는 확장 가능한 파이프라인을 제시하며, 이는 신경망 모델의 기호적 투명성을 향상시키는 방향으로 나아가는 중요한 단계입니다.
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.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.