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

Ido Andrew Atad, Itamar Zimerman, Shahar Katz, Lior Wolf


Abstract
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.
Anthology ID:
2026.acl-long.156
Volume:
Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Month:
July
Year:
2026
Address:
San Diego, California, United States
Editors:
Maria Liakata, Viviane P. Moreira, Jiajun Zhang, David Jurgens
Venue:
ACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
3452–3468
Language:
URL:
https://preview.aclanthology.org/ingest-acl/2026.acl-long.156/
DOI:
Bibkey:
Cite (ACL):
Ido Andrew Atad, Itamar Zimerman, Shahar Katz, and Lior Wolf. 2026. TensorLens: End-to-End Transformer Analysis via High-Order Attention Tensors. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3452–3468, San Diego, California, United States. Association for Computational Linguistics.
Cite (Informal):
TensorLens: End-to-End Transformer Analysis via High-Order Attention Tensors (Atad et al., ACL 2026)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-acl/2026.acl-long.156.pdf
Checklist:
 2026.acl-long.156.checklist.pdf