TensorLens: End-to-End Transformer Analysis via High-Order Attention Tensors
Ido Andrew Atad, Itamar Zimerman, Shahar Katz, Lior Wolf

TL;DR
TensorLens introduces a comprehensive high-order tensor representation of transformer models, capturing all components and enabling advanced interpretability and analysis beyond traditional attention head methods.
Contribution
It provides the first unified, input-dependent linear operator formulation of transformers using a high-order attention tensor, integrating all model components.
Findings
Richer representations than previous attention-aggregation methods
Effective for interpretability and model understanding
Empirically validated on transformer models
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMachine Learning in Materials Science · Generative Adversarial Networks and Image Synthesis · Advanced Neural Network Applications
