vix.ing · top · new · best · stats

Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernel

2019/08/30 by Yao-Hung Hubert Tsai, Tsai, Yao-Hung Hubert, Shaojie Bai +8 · 31 citations
Computer Science · Mathematics · #FOS: Computer and information sciences #Machine Learning (cs.LG) #Machine Learning (stat.ML) #Natural Language Processing Techniques #Speech Recognition and Synthesis #Topic Modeling #cs.LG #stat.ML

paper · pdf · doi:10.48550/arxiv.1908.11775

EMNLP 2019

openalex publication_date 2019/08/30 · arxiv created 2019/11/11 · arxiv updated 2019/11/13 · openalex created_date 2025/10/10 · openalex updated_date 2026/07/28

Abstract

Transformer is a powerful architecture that achieves superior performance on various sequence learning tasks, including neural machine translation, language understanding, and sequence prediction. At the core of the Transformer is the attention mechanism, which concurrently processes all inputs in the streams. In this paper, we present a new formulation of attention via the lens of the kernel. To be more precise, we realize that the attention can be seen as applying kernel smoother over the inputs with the kernel scores being the similarities between inputs. This new formulation gives us a better way to understand individual components of the Transformer's attention, such as the better way to integrate the positional embedding. Another important advantage of our kernel-based formulation is that it paves the way to a larger space of composing Transformer's attention. As an example, we propose a new variant of Transformer's attention which models the input as a product of symmetric kernels. This approach achieves competitive performance to the current state of the art model with less computation. In our experiments, we empirically study different kernel construction strategies on two widely used tasks: neural machine translation and sequence prediction.

Cited by

Related