REVIEW 3 major objections 4 minor 11 cited by
Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernel
T0 review · 3 major / 4 minor · reviewed 2026-08-14 · deepseek-v4-flash
Pith's one-line read Transformer attention can be rewritten as a kernel smoother, and a symmetric product kernel matches leading relative-position attention with a third fewer parameters.
desk verdict The kernel reformulation is genuinely useful and the symmetric product kernel is a neat parameter-efficient variant, but the empirical comparison needs a cleaner baseline and proper variance reporting. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The object that carries the argument is Eq. (2), the kernel-smoother form of attention: it makes the kernel $k$ the design variable, since after choosing a non-negative similarity function one normalizes it over the visible keys and averages the corresponding values. The paper's example mechanism is the product kernel of Eq. (9), $k(x_q,x_k)=k_F(f_q,f_k)k_T(t_q,t_k)$, where $k_F(f_q,f_k)=\exp(\langle f_qW_F,f_kW_F\rangle/\sqrt{d_k})$ and $k_T(t_q,t_k)=\exp(\langle t_qW_T,t_kW_T\rangle/\sqrt{d_k})$. Both factors are symmetric exponential kernels, and the positional factor uses fixed sinusoidal absolute positions. Because symmetry lets the two factors share one projection each instead of the three matrices used by the asymmetric relative-position kernel, the product kernel is the concrete place where the paper's parameter saving comes from.
What would settle it
Hold the positional encoding fixed and re-run the comparison: use the same absolute sinusoidal positions inside both the asymmetric relative-position kernel and the symmetric product kernel, or use the same relative-position features inside both, and measure both on IWSLT'14 and WikiText-103. If the asymmetric version wins by a clear margin on both tasks, the paper's claim that symmetric kernels are nearly free would be refuted.
Extended reading notes
Core claim
The paper's central claim is that the Transformer's attention is a kernel smoother: for a non-negative kernel $k$, a set-filtering function $M$ that encodes visibility, and a value function $v$, $$\mathrm{Attention}(x_q; M(x_q,S_{x_k}))=\sum_{x_k\in M(x_q,S_{x_k})}\frac{k(x_q,x_k)}{\sum_{x_k'\in M(x_q,S_{x_k})}k(x_q,x_{k'})}v(x_k).$$ The original scaled dot-product attention is the special case $k(x_q,x_k)=\exp(\langle x_qW_q,x_kW_k\rangle/\sqrt{d_k})$ and $v(x_k)=x_kW_v$, so the familiar query/key projection is an asymmetric exponential kernel. The reformulation divides attention into four components—kernel feature space, kernel construction, value function, and set filtering—and the paper argues that prior attention variants differ only through these choices. Its constructive proposal is a product of two symmetric exponential kernels, $k(x_q,x_k)=k_F(f_q,f_k)k_T(t_q,t_k)$, one on non-positional features and one on positional features. In the paper's experiments on IWSLT'14 German–English translation and WikiText-103 sequence prediction, this symmetric product kernel is competitive with the relative-position kernel used in Transformer-XL's attention while needing two weight matrices instead of three.
Load-bearing premise
The empirical conclusion that Eq. (9) is competitive with Eq. (5) depends on the two being compared fairly; if the performance gap actually comes from the different positional encoding schemes—relative coefficients inferred by the query in Eq. (5) versus fixed absolute sinusoidal positions in Eq. (9)—rather than from kernel symmetry, then the parameter-saving claim for symmetric kernels is not supported.
Editorial extensions
If this is right
- In the kernel view, the kernel becomes the design object, so new attention mechanisms can be introduced by choosing any non-negative similarity function rather than only dot-product similarities.
- Positional information is best integrated as a separate multiplicative position kernel, which explains and generalizes the advantage of relative-position attention over adding positional vectors to the inputs.
- Symmetric kernels can replace asymmetric query/key kernels with little or no performance loss, cutting the number of learned attention weights by about a third in the settings tested.
- Kernel choice matters: exponential and radial-basis kernels outperform polynomial kernels, while the linear kernel fails to train because its scores can be negative, which violates the positivity assumption of the kernel smoother.
- Masked decoder self-attention is not permutation equivariant, and removing positional embedding from it alone costs only a little on neural machine translation, whereas removing positional embedding from the whole model destroys performance.
Reading between the lines
- This suggests a testable program the paper does not pursue: let kernel-learning machinery, such as learned bandwidths or combinations of base kernels, select the attention kernel automatically.
- Because Eq. (9) uses fixed sinusoidal positions, its parameter saving should transfer to other Transformer-style architectures with absolute positional encodings; a natural extension is to evaluate it in a large-scale pretraining setting.
- The proof that masked causal attention is not permutation equivariant implies the mask itself carries order information, which could justify lighter positional embeddings for causal decoders in other tasks beyond translation and sequence prediction.
- A cleaner control than the one run in the paper would be a symmetric look-up-table positional kernel, which would separate the effect of symmetry from the effect of relative versus absolute positional features.
Signed reviews
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper proposes a reformulation of Transformer attention as a kernel smoother, defining attention as a normalized weighted sum of value vectors with a non-negative kernel (Eq. 2). It decomposes attention into four components—kernel feature space, kernel construction, value function, and set filtering—and uses this lens to categorize existing attention variants (Vaswani et al., Shaw et al., Transformer-XL, Sparse Transformer, etc.). As a concrete new design, the paper introduces a product of symmetric kernels for non-positional and positional features (Eq. 9), claiming it achieves competitive performance with 33% fewer attention parameters than Transformer-XL's relative-position kernel (Eq. 5). Experiments on IWSLT'14 German-English NMT and WikiText-103 sequence prediction compare PE integration strategies (Tables 1), kernel forms (Table 2), decoder order-invariance (Table 3), and the need for PE in the value function (Table 4). The paper also proves that decoder self-attention is not permutation-equivariant due to masking (Proposition 1).
Significance. The kernel formulation is a clean conceptual contribution: it provides a unified notation for a wide range of attention mechanisms and naturally suggests new attention designs by composing kernels. The proposed product-symmetric kernel (Eq. 9) is a simple, parameter-efficient variant that matches or slightly exceeds the paper's implementation of Transformer-XL's relative attention on NMT and is close on sequence prediction. If the empirical claims are robust, the kernel view could serve as a practical guide for attention architecture design. The order-invariance observation (Proposition 1) is correct, and the experimental study systematically addresses several design questions. The authors provide a GitHub repository with code, which aids reproducibility. However, the central empirical claim—that the symmetric product kernel is competitive with the state of the art—is weakened by the use of a reduced relative-attention baseline and by the absence of error bars or significance measures.
major comments (3)
- [§2.2.2, Eq. (5), Table 1] The baseline attributed to Dai et al. (2019) is not the full Transformer-XL relative-attention logit. In Transformer-XL, the logit for query i and key j includes content-based and position-based bias terms that are independent of the query, typically written as u^T k_j and v^T R_{i-j}. Eq. (5) of this paper only contains the query-dependent position term f_q W_q W_R r_{t_q-t_k} multiplied by the content kernel, omitting those biases. Consequently, the results labeled "Dai et al. (2019) (Eq. (5))" in Table 1 are for a reduced model, not the published state-of-the-art model. Because the abstract claims "competitive performance to the current state of the art model," this is a load-bearing issue. The authors should either implement the complete Transformer-XL attention as the baseline, or explicitly state that the comparison is against a kernel-restricted relative-position variant and soften the claims about state-of-the-art competitiveness.
- [§3, reporting protocol ("train five random initializations and report test accuracy with the highest validation score")] All numerical results in Tables 1-4 are reported as the best of five random seeds, with no variance, confidence intervals, or significance tests. Differences such as 0.18 PPL in Table 1 (SP: 24.10 vs. 24.28) and 0.07 BLEU in Table 2 (RBF: 34.26 vs. 34.14) are well within typical seed-to-seed variance for these models. As a result, the conclusions that the symmetric product kernel (Eq. 9) is "competitive" with the relative-position kernel and that symmetric kernels "barely sacrifice" performance (Section 3.2) are not statistically supported. The authors should report mean and standard deviation across seeds, or otherwise provide evidence that the differences are not noise.
- [§3.2, Table 2] The kernel-type comparison fixes the Vaswani et al. (2017) configuration for NMT but the Dai et al. (2019) configuration for SP, as stated in the table caption. These base configurations differ in attention design, positional embedding, and training recipe. Therefore, observed differences in kernel ranking between tasks (e.g., exponential best for SP vs. RBF best for NMT) may be confounded by the base configuration rather than reflect intrinsic kernel properties. The paper should either use a common base configuration for both tasks or explicitly acknowledge and justify this confound.
minor comments (4)
- [Abstract] The claim of "less computation" is imprecise. The proposed variant reduces the number of attention projection matrices from three to two (33% parameter reduction), but the dominant O(n^2 d) attention matrix multiplication cost is unchanged. Suggest rephrasing to "fewer parameters" or clarifying the computational savings.
- [§2.2.2, Eq. (5)] Eq. (5) is labeled as the Transformer-XL relative positional embedding, but it only includes the query-dependent portion. Adding a remark that this is a kernel approximation of Transformer-XL's logit (and not the full logit) would prevent readers from mistaking it for the exact model, especially since Table 1 uses this as the comparative baseline.
- [§3.3, Table 3] The layout of Table 3 is confusing: the "No Positional Embedding" row appears to be a separate approach but is listed under the same column as the methods, and for NMT it reports a very low BLEU (14.47) that likely reflects the removal of all PE in the entire model. Clarifying the experimental conditions for each row would improve readability.
- [Full text] The manuscript contains numerous OCR/encoding artifacts (e.g., "slash.l⟩ftk", "q/slash.l⟩ftk") that make some equations unreadable. The authors should ensure a clean version of the PDF is submitted.
Circularity Check
No significant circularity: the kernel formulation is a definition, Eq. (9) is a new construction, and all comparisons are held-out empirical evaluations against external benchmarks.
full rationale
The paper's central move is Definition 1, re-expressing attention as a kernel smoother; this is an equivalence by definition and is not used to force the empirical results. The proposed symmetric product kernel in Eq. (9) is a new architectural variant, not a fitted quantity: its parameters WF and WT are trained and evaluated on held-out IWSLT'14 De-En and WikiText-103, and the 33% parameter saving is a direct count of weight matrices (Eq. (5) uses WQ, WK, WR; Eq. (9) uses WF, WT), not a prediction derived from the reformulation. The categorization of prior attention variants (Eqs. (4)-(6)) is a post hoc organization, but the paper does not rename a known result as a new derivation; it additionally tests new kernel forms (linear, polynomial, RBF, symmetric) and the new product-kernel attention. Citations to Dai et al. (2019) and Wilson et al. (2016) include overlapping authors, but the comparisons are run in this paper against standard public tasks, and the cited kernel forms are explicit in the text rather than assumed from the citations. I find no step where an output is equivalent to an input by construction, no fitted parameter renamed as a prediction, and no load-bearing self-citation chain. The reported best-of-five choice and the possible incompleteness of Eq. (5) as a stand-in for Transformer-XL are validity concerns for the empirical comparison, not circularity.
Assumptions & free parameters
assumptions (4)
- standard math Kernel smoothing requires a non-negative kernel function.
- standard math The product of two symmetric positive semi-definite kernels is a valid kernel.
- domain assumption The fixed sinusoidal positional embeddings from Vaswani et al. (2017) are appropriate and are treated as the temporal feature space T.
- domain assumption The configurations from Vaswani et al. (2017) for NMT and Dai et al. (2019) for SP are fixed and appropriate for comparing kernel types.
Cite this review
Pith. "Pith review of Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernel." pith.science (2026). https://pith.science/paper/ZHAK3FRW
@misc{pith2026190811775,
author = {Pith},
title = {Pith review of: Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernel},
year = {2026},
howpublished = {\url{https://pith.science/paper/ZHAK3FRW}},
note = {Machine review of arXiv:1908.11775}
}
read the original 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.
Forward citations
Cited by 11 Pith papers
-
Curse of Attention: A Kernel-Based Perspective for Why Transformers Fail to Generalize on Time Series Forecasting and Beyond
A theoretical analysis claims attention networks fail to learn residual features when time series steps have opposite signs, giving a possible explanation for the known advantage of linear residual models.
-
LLM as Effective Streaming Processor: Bridging Streaming-Batch Mismatches with Group Position Encoding
Streaming LLMs need only fix the input-attention mismatch; group position encoding (source and target positions numbered separately) removes the need for re-encoding and outperforms specialized streaming baselines.
-
Quantifying Memory Utilization with Effective State-Size
Effective state-size, the rank of a causal operator submatrix, is proposed and empirically validated as a memory-utilization proxy that beats cache size at predicting recall-task accuracy and reveals how LLMs reset co...
-
Understanding and Mitigating Bottlenecks of State Space Models through the Lens of Recency and Over-smoothing
State space models have an inherent recency bias and over-smoothing in deep stacks, and a two-channel polarization fix improves long-range associative recall.
-
An Attention-based Framework for Fair Contrastive Learning
Attention-weighted negative sampling with LSH sparsification improves bias removal in contrastive representation learning while approximately preserving accuracy.
-
Integrating Fourier Neural Operator with Diffusion Model for Autoregressive Predictions of Three-dimensional Turbulence
DiAFNO, an implicit adaptive Fourier neural operator used as the denoiser inside an EDM diffusion model, gives more accurate autoregressive predictions of 3D turbulence than EDM or dynamic Smagorinsky LES.
-
Fast RoPE Attention: Combining the Polynomial Method and Fast Fourier Transform
A new algorithm computes RoPE attention in n^{1+o(1)} time under bounded entries by decomposing the attention matrix into a small sum of rescaled Toeplitz matrices, then using FFT.
-
A Reproduction Study: The Kernel PCA Interpretation of Self-Attention Fails Under Scrutiny
The paper reports that learned value matrices do not align with KPCA quantities, the projection-loss decrease is dominated by output-norm collapse, and the reported Gram eigenvalue statistics cannot be reproduced with...
-
Only Large Weights (And Not Skip Connections) Can Prevent the Perils of Rank Collapse
A residual self-attention network with all weight entries bounded by a small η can be approximated by one layer to error O(η)‖X‖∞, so skip connections do not prevent layer collapse.
-
HyLiFormer: Hyperbolic Linear Attention for Skeleton-based Human Action Recognition
HyLiFormer applies hyperbolic embedding and a reordered linear attention to skeleton action recognition, achieving linear complexity with accuracy slightly below the best transformer baselines.
-
Video Latent Flow Matching: Optimal Polynomial Projections for Video Interpolation and Extrapolation
VLFM models video latent patches as a HiPPO-LegS polynomial flow and trains a flow matching model to generate frames, claiming bounded interpolation and extrapolation error.
Reference graph
Works this paper leans on
-
[1]
URL: " 'urlintro :=
ENTRY address author booktitle chapter edition editor howpublished institution journal key month note number organization pages publisher school series title type volume year eprint doi pubmed url lastchecked label extra.label sort.label short.list INTEGERS output.state before.all mid.sentence after.sentence after.block STRINGS urlintro eprinturl eprintpr...
-
[2]
write newline
" write newline "" before.all 'output.state := FUNCTION n.dashify 't := "" t empty not t #1 #1 substring "-" = t #1 #2 substring "--" = not "--" * t #2 global.max substring 't := t #1 #1 substring "-" = "-" * t #2 global.max substring 't := while if t #1 #1 substring * t #2 global.max substring 't := if while FUNCTION word.in bbl.in capitalize " " * FUNCT...
-
[3]
Shaojie Bai, J Zico Kolter, and Vladlen Koltun. 2018. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271
arXiv 2018
-
[4]
Antoni Buades, Bartomeu Coll, and J-M Morel. 2005. A non-local algorithm for image denoising. In 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'05), volume 2, pages 60--65. IEEE
work page 2005
-
[5]
Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. 2019. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509
arXiv 2019
-
[6]
Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. 2019. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860
arXiv 2019
-
[7]
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805
arXiv 2018
-
[8]
Sergey Edunov, Myle Ott, Michael Auli, David Grangier, and Marc'Aurelio Ranzato. 2017. Classical structured prediction losses for sequence to sequence learning. arXiv preprint arXiv:1711.04956
work page Pith review arXiv 2017
Show all 28 references
-
[9]
Cheng-Zhi Anna Huang, Ashish Vaswani, Jakob Uszkoreit, Noam Shazeer, Curtis Hawthorne, Andrew M Dai, Matthew D Hoffman, and Douglas Eck. 2018 a . An improved relative self-attention mechanism for transformer with application to music generation. arXiv preprint arXiv:1809.04281
2018 arXiv
-
[10]
Cheng-Zhi Anna Huang, Ashish Vaswani, Jakob Uszkoreit, Ian Simon, Curtis Hawthorne, Noam Shazeer, Andrew M Dai, Matthew D Hoffman, Monica Dinculescu, and Douglas Eck. 2018 b . Music transformer: Generating music with long-term structure
2018
-
[11]
Brian Kulis, Kate Saenko, and Trevor Darrell. 2011. What you saw is not what you get: Domain adaptation using asymmetric kernel transforms. In CVPR 2011, pages 1785--1792. IEEE
2011
-
[12]
Juho Lee, Yoonho Lee, Jungtaek Kim, Adam R Kosiorek, Seungjin Choi, and Yee Whye Teh. 2018. Set transformer. arXiv preprint arXiv:1810.00825
2018 arXiv
-
[13]
Chun-Liang Li, Wei-Cheng Chang, Yu Cheng, Yiming Yang, and Barnab \'a s P \'o czos. 2017. Mmd gan: Towards deeper understanding of moment matching network. In Advances in Neural Information Processing Systems, pages 2203--2213
2017
-
[14]
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. 2016. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843
2016 arXiv
-
[15]
Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. 2019. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019: Demonstrations
2019
-
[16]
Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, ukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. 2018. Image transformer. arXiv preprint arXiv:1802.05751
2018 arXiv
-
[17]
Jorge P \'e rez, Javier Marinkovi \'c , and Pablo Barcel \'o . 2019. On the turing completeness of modern neural network architectures. arXiv preprint arXiv:1901.03429
2019 arXiv
-
[18]
Bernhard Scholkopf and Alexander J Smola. 2001. Learning with kernels: support vector machines, regularization, optimization, and beyond. MIT press
2001
-
[19]
Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. 2018. Self-attention with relative position representations. arXiv preprint arXiv:1803.02155
2018 arXiv
-
[20]
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. 2014. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pages 3104--3112
2014
-
[21]
Yao-Hung Hubert Tsai, Shaojie Bai, Paul Pu Liang, Louis-Philippe Morency, and Ruslan Salakhutdinov. 2019 a . Multimodal transformer for unaligned multimodal language sequences. ACL
2019
-
[22]
Yao-Hung Hubert Tsai, Santosh Divvala, Louis-Philippe Morency, Ruslan Salakhutdinov, and Ali Farhadi. 2019 b . Video relationship reasoning using gated spatio-temporal energy graph. CVPR
2019
-
[23]
Koji Tsuda. 1999. Support vector classifier with asymmetric kernel functions. In in European Symposium on Artificial Neural Networks (ESANN. Citeseer
1999
-
[24]
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, ukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems, pages 5998--6008
2017
-
[25]
Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. 2018. Non-local neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7794--7803
2018
-
[26]
Larry Wasserman. 2006. All of nonparametric statistics. Springer Science & Business Media
2006
-
[27]
Andrew Gordon Wilson, Zhiting Hu, Ruslan Salakhutdinov, and Eric P Xing. 2016. Deep kernel learning. In Artificial Intelligence and Statistics, pages 370--378
2016
-
[28]
Alper Yilmaz. 2007. Object tracking by asymmetric kernel mean shift with automatic scale and orientation selection. In 2007 IEEE Conference on Computer Vision and Pattern Recognition, pages 1--6. IEEE
2007
Reviewed August 14, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.