Transformer Dissection: An Unified Understanding for Transformer’s Attention via the Lens of Kernel

By Yao-Hung Hubert Tsai, Shaojie Bai, Makoto Yamada, Louis-philippe Morency, Ruslan Salakhutdinov. 2019

333 citations recorded by the source corpus.

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.

Subfields: Artificial Intelligence, Computer Vision and Pattern Recognition, Model Architectures

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Noah A. Smith
  2. Quoc V. Le
  3. Mohit Bansal
  4. Graham Neubig
  5. Jianfeng Gao
  6. Percy Liang
  7. Luke S. Zettlemoyer
  8. Yejin Choi

In Computer Vision and Pattern Recognition

  1. Luc Van Gool
  2. Dacheng Tao
  3. Xiaogang Wang
  4. Trevor Darrell
  5. Ming-Hsuan Yang
  6. Alan L. Yuille
  7. Steven C. H. Hoi
  8. Jitendra Malik

In Model Architectures

  1. Mingxing Tan
  2. Shuhao Cao
  3. Noah A. Smith
  4. Xipeng Qiu
  5. Junjie Yan
  6. Quoc V. Le
  7. Hanxiao Liu
  8. Zihang Dai

Citations in the corpus