ChatPaper.aiChatPaper

TensorLens: 고차원 어텐션 텐서를 통한 엔드투엔드 트랜스포머 분석

TensorLens: End-to-End Transformer Analysis via High-Order Attention Tensors

January 25, 2026
저자: Ido Andrew Atad, Itamar Zimerman, Shahar Katz, Lior Wolf
cs.AI

초록

어텐션 행렬은 해석 가능성, 시각화, 조작, 증류 등 광범위한 응용 분야를 지원하며 트랜스포머 연구의 기초를 이룹니다. 그러나 기존 분석 대부분은 개별 어텐션 헤드나 계층에 집중하여 모델의 전역적 동작을 설명하지 못합니다. 여러 헤드 간 어텐션 공식을 평균화 및 행렬 곱셈으로 확장하거나 정규화 및 FFN과 같은 구성 요소를 통합한 선행 연구들이 있음에도, 모든 트랜스포머 블록을 포괄하는 통일되고 완전한 표현은 여전히 부재합니다. 우리는 이러한 격차를 해소하기 위해 전체 트랜스포머를 고차원 어텐션-상호작용 텐서로 표현된 단일 입력 종속 선형 연산자로 포착하는 새로운 공식인 TensorLens를 제안합니다. 이 텐서는 어텐션, FFN, 활성화 함수, 정규화, 잔차 연결을 함께 인코딩하여 이론적으로 일관되고 표현력丰富的한 모델 계산의 선형 표현을 제공합니다. TensorLens는 이론적으로 근거를 가지며, 우리의 실증 검증을 통해 기존 어텐션 집계 방법보다 더 풍부한 표현을 생성함을 보여줍니다. 우리의 실험은 어텐션 텐서가 해석 가능성 및 모델 이해를 목표로 하는 도구 개발의 강력한 기반으로 활용될 수 있음을 입증합니다. 우리의 코드는 부록으로 첨부됩니다.
English
Attention matrices are fundamental to transformer research, supporting a broad range of applications including interpretability, visualization, manipulation, and distillation. Yet, most existing analyses focus on individual attention heads or layers, failing to account for the model's global behavior. While prior efforts have extended attention formulations across multiple heads via averaging and matrix multiplications or incorporated components such as normalization and FFNs, a unified and complete representation that encapsulates all transformer blocks is still lacking. We address this gap by introducing TensorLens, a novel formulation that captures the entire transformer as a single, input-dependent linear operator expressed through a high-order attention-interaction tensor. This tensor jointly encodes attention, FFNs, activations, normalizations, and residual connections, offering a theoretically coherent and expressive linear representation of the model's computation. TensorLens is theoretically grounded and our empirical validation shows that it yields richer representations than previous attention-aggregation methods. Our experiments demonstrate that the attention tensor can serve as a powerful foundation for developing tools aimed at interpretability and model understanding. Our code is attached as a supplementary.
PDF11January 28, 2026