Pith. sign in

REVIEW 6 major objections 6 minor 33 references

Does Self-Attention Need Separate Weights in Transformers?

T0 review · 6 major / 6 minor · reviewed 2026-08-12 · deepseek-v4-flash

Pith's one-line read A single shared weight matrix can replace the three Query, Key, and Value matrices in a transformer's self-attention, cutting attention-block parameters by two-thirds while keeping BERT-level accuracy.

desk verdict A genuinely simpler attention factorization with correct parameter arithmetic, but the empirical claims are internally contradictory and uncontrolled. read the letter →

arxiv 2412.00359 v2 pith:XKSBDUDN submitted 2024-11-30 cs.CL

classification cs.CL
keywords sharedweightself-attentionBERTparameterreductionGLUEbenchmarktransformerefficiencynoiserobustnessattentionfactorization
verification ladder T0 review T1 audit T2 compute T3 formal

The pith

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The reading

This paper asks whether the three separate weight matrices that transformers use to compute Queries, Keys, and Values are actually necessary. It argues they are not: a single learned matrix Ws followed by three diagonal scaling matrices Dq, Dk, and Dv can play the same role. In a BERT-base model, this factorization cuts self-attention parameters by 66.53% and total model parameters by 12.94%, while keeping GLUE accuracy within 0.05 points of the standard BERT baseline and improving robustness to noisy and out-of-domain inputs. The reason a curious reader should care is that it points to a simple drop-in change that makes transformer encoders cheaper to train, store, and deploy without sacrificing language-understanding performance.

What carries the argument

The load-bearing object is the shared transformation S(X) = XWs with diagonal role matrices Dq, Dk, and Dv; the parameter count falls from $3d^{2}$ to $d^{2}$ + 3d. Each attention head computes softmax((SDq)(SDk)^T / $\sqrt$(d))(SDv), so queries and keys are scaled versions of the same representation rather than independent projections. The diagonal matrices are what let one matrix act as all three while preserving the asymmetry between the query and key roles.

What would settle it

Pretrain standard BERT and the shared-weight BERT from the same corpora with identical hyperparameters and step counts, fine-tune both on the same GLUE splits, and compare average accuracy; if the shared model falls more than roughly one point behind standard BERT, the claim that two-thirds fewer attention parameters preserve accuracy would be refuted.

Watch

Extended reading notes

Core claim

The paper's central claim is that standard self-attention's Wq, Wk, Wv can be factored as Wq = WsDq, Wk = WsDk, and Wv = WsDv, with a single learned d x d matrix Ws and three diagonal d x d matrices Dq, Dk, Dv. This keeps the roles of query, key, and value distinct through element-wise scaling while replacing $3d^{2}$ attention parameters with $d^{2}$ + 3d, a 66.53 percent reduction. Pretrained on the same BooksCorpus and Wikipedia data as BERT-base and fine-tuned on GLUE, the shared-weight model is reported to stay essentially at parity (average GLUE 79.92 versus 79.97 for standard BERT) while using 95.3 million total parameters instead of 109.5 million, and to degrade more slowly than standard attention when Gaussian noise is added to input embeddings. The authors take this as evidence that the expressive burden carried by separate projection matrices is largely redundant.

Load-bearing premise

The accuracy comparisons assume the standard, symmetric, and pairwise BERT baselines were pretrained and fine-tuned under the same data, steps, and hyperparameters as the shared-weight model, and the paper never explicitly states that these conditions were matched.

Editorial extensions

If this is right

  • Attention-block parameters fall by about two-thirds, and total BERT-base parameters fall from 109.5 million to 95.3 million, making the encoder cheaper to store and fine-tune.
  • Reported GLUE fine-tuning times drop by 11 to 30 percent per task at one epoch, so training budgets shrink under the same hardware.
  • Average GLUE accuracy stays within 0.05 points of standard BERT, with the largest relative gains on MRPC, CoLA, and STS-B against the symmetric and pairwise baselines.
  • Under 0 to 40 percent added input noise, the shared model loses accuracy more slowly than standard attention on MNLI, QQP, and SST-2, suggesting more robust representations.
  • Cross-domain transfer improves in several settings, such as an MNLI-trained model scoring higher on QNLI and MRPC, consistent with the shared matrix acting as a regularizer.

Reading between the lines

Editorial extensions of the paper, not claims the author makes directly.

  • If the factorization is as interchangeable as claimed, the same Ws plus Dq, Dk, Dv decomposition should transfer to decoder self-attention and cross-attention; the paper explicitly leaves that untested, and a small translation or generation experiment would separate the architecture's benefit from encoder-specific effects.
  • The diagonal scales in the paper are single matrices rather than per-head or per-layer parameters; a natural variant that learns separate diagonal scales per head could recover any lost expressiveness on harder NLU tasks while keeping most of the parameter savings.
  • The noise-robustness results suggest the shared matrix behaves like parameter-sharing regularization; if that is the mechanism, tying the shared matrix across layers should preserve or amplify the gains, which is a testable extension the paper does not run.
  • The paper itself flags that its efficiency findings were observed on a roughly 100-million-parameter BERT, so a matched-budget replication on a model an order of magnitude larger would determine whether the 12.94 percent total-parameter saving survives scaling.
Share X Bluesky LinkedIn Reddit HN

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, and a circularity audit.

Referee Report

6 major / 6 minor

Summary. The paper proposes replacing the three separate projection matrices Wq, Wk, Wv in BERT self-attention with a single shared matrix Ws followed by three diagonal scaling matrices Dq, Dk, Dv. The authors claim this reduces attention-block parameters from 3d^2 to d^2+3d (a 66.53% reduction) and total BERT-base parameters by 12.94%, while maintaining or improving GLUE accuracy, improving robustness to noisy inputs, and reducing training time. The parameter arithmetic is straightforward and largely correct, but the empirical claims are not yet supported as written because of internal contradictions, unmatched baselines, and apparent arithmetic errors in the reported averages.

Significance. If the accuracy-parity and efficiency claims could be substantiated under controlled conditions, the shared-weight factorization would be a simple, useful drop-in modification for parameter-efficient Transformer encoders. The parameter counting in Section 3 and Table 4 is a strength: the reduction is derived directly from the equations and is machine-checkable. The public release of model and code is also a positive feature. However, the empirical half of the central claim currently rests on comparisons whose validity is undermined by the issues detailed below; the headline numbers in the abstract and abstract-adjacent text do not match the paper's own tables.

major comments (6)
  1. [Abstract and Section 2.6] The abstract's accuracy claims contradict the body: the abstract reports improvements of 0.38%, 5.81%, and 1.06% over standard, symmetric, and pairwise BERT, but Section 2.6 and Table 1 show -0.05%, +3.55%, and +0.89%. The Table 1 averages (79.92 vs 79.97) actually show the shared model 0.05% below standard. These are load-bearing discrepancies in the central claim and must be resolved before the paper can be evaluated.
  2. [Abstract, Figure 3, and Table 7] The abstract's claim of training time reduction by 'around one-tenth' is inconsistent with Figure 3, which reports reductions of 11% to 43%, and with Table 7, which says '15-20% faster'. A 90% reduction is very different from an 11-43% reduction, and the paper does not provide any experiment supporting a tenfold speedup.
  3. [Sections 2.4, 2.5, and 2.6] The baselines are not matched. Section 2.5 describes pretraining only for the shared model, while Section 2.4 lists standard, symmetric, and pairwise BERT by citation. The text never states that these baselines were pretrained and fine-tuned with the same data, number of steps/epochs, batch size, sequence length, and hyperparameters as the shared model. Without such control, the deltas in Table 1 (and in Tables 2 and 5) cannot be attributed to the attention architecture rather than to training budget or hyperparameter differences.
  4. [Table 2] The SQuAD averages are arithmetically wrong for the standard model: the average EM should be (82.18+79.35)/2 = 80.77, not 80.10, and the average F1 should be (90.01+83.65)/2 = 86.83, not 81.47. With corrected numbers, the shared model is worse than standard in both EM (80.20 vs 80.77) and F1 (86.30 vs 86.83), reversing the favorable comparison implied by the table. The column header 'SQuAD v1.2' also does not match the text's SQuAD v2.0.
  5. [Tables 1, 2, and 5] No error bars, confidence intervals, or multiple-seed results are reported. Differences of the magnitude claimed in the GLUE table (e.g., 0.05% overall and task-level differences below 1 point) are within the typical run-to-run variance of BERT fine-tuning, so the accuracy-parity claim is not statistically supported as presented. At minimum, the authors should report the mean and variance over several fine-tuning seeds for every configuration.
  6. [Section 3, Table 6] The cross-domain experiment is not described. Table 6 purports to show performance of standard and shared models on MNLI, QNLI, QQP, and MRPC, but neither Section 3 nor Appendix A explains whether each row corresponds to a model fine-tuned on that row's domain and evaluated on the other domains, what the fine-tuning protocol was, or how the off-diagonal entries were obtained. Without this protocol, the claimed 'cross-domain performance' advantage is not verifiable.
minor comments (6)
  1. [Sections 3 and 5, Table 7] The parameter reduction is reported as 66.53% in the abstract and Table 3, but as 66.67% in Table 7 and Section 5. The exact percentage depends on d (for d=768 it is about 66.54%), so the paper should use one consistent rounded value and state the formula.
  2. [Section 2.7 and Table 2] The dataset is called 'SQuAD v1.2' in Table 2 but 'SQuAD v2.0' in the text and Appendix A.2; please standardize to the correct version name.
  3. [Table 6] The row label 'QNL' appears to be a typo for 'QNLI'.
  4. [Section 2.5] The pretraining description says '20 epochs' but the loss curves are described as stabilizing at 'approximately 200,000 steps.' The relationship between these numbers is unclear; please report the total number of training steps and the effective token budget.
  5. [Appendix A.1] The limitation statement says 'Our models were benchmarked with GLUE and the newer SuperGLUE,' but no SuperGLUE experiments appear anywhere in the paper; this sentence should be removed or the experiments added.
  6. [Table 1] The GLUE average appears to treat MNLI matched and mismatched as two separate scores (nine scores total). Please state this averaging convention explicitly, since it affects the reported averages.

Circularity Check

0 steps flagged · score 0.0 of 10

No significant circularity: the parameter-reduction claim is arithmetic from the paper's own definitions, and the empirical accuracy claims are external measurements.

full rationale

The central derivation is the parameter-count reduction. Section 2.3 defines Q = XWsDq, K = XWsDk, V = XWsDv, and Section 3 computes the total parameters as d^2 + 3d versus 3d^2 for standard attention; the claimed 66.53% reduction is the direct arithmetic (1 - (d^2 + 3d)/(3d^2)) with d = 768, and the 12.94% total-model reduction is the same count applied to the BERT-base operator table (Table 4). No fitted constant, external benchmark number, or self-citation enters this arithmetic, and no 'prediction' is recycled from the training data. The GLUE/SQuAD performance statements are empirical comparisons to external baselines; their validity depends on whether the baselines were pretrained under matched conditions (Section 2.5 describes the pretraining only of the shared model), which is a correctness and experimental-control concern, not a circularity. The paper does contain internal inconsistencies: the abstract's '0.38% improvement' over standard contradicts Table 1's averages (79.92 vs 79.97) and the paper's own Section 2.6 figure of -0.05%, and Tables 3 and 7 differ on the reduction percentage (66.53% vs 66.67%). These are accuracy and reporting issues, not circular reasoning. Self-citations (Kowsher et al. 2022, 2024) appear only in the introduction and related-work context and are not load-bearing. There is no self-definitional step, no fitted-input-called-prediction step, and no imported uniqueness theorem. Therefore no significant circularity is present.

Assumptions & free parameters 5 free parameters · 5 assumptions · 0 invented entities

The core idea rests on standard linear algebra plus a strong architectural bet that diagonal scaling can recover the role of separate full matrices. The biggest non-standard inputs are the comparability of external baselines and the sufficiency of Dq, Dk, and Dv; both are assumed rather than established. No new physical entities are introduced.

free parameters (5)
  • Ws shared weight matrix = d x d learned matrix, d=768
    The single shared projection matrix is learned during pretraining and is the central new parameter of the method.
  • Dq, Dk, Dv diagonal scaling matrices = three learned diagonal matrices, 3d parameters total
    These element-wise scaling factors are the only source of differentiation between queries, keys, and values in the proposed architecture.
  • Pretraining epochs and steps = 20 epochs, about 200k steps, batch size 132 per H100 GPU
    Chosen by the authors and not ablated; the training budget materially affects whether the model is comparable to baseline BERT.
  • GLUE fine-tuning schedule = 10 epochs, learning rates 1e-4 then 2e-5 and 2e-6
    Used uniformly across GLUE tasks; no sweep is reported, so small-task gains could be sensitive to this schedule.
  • Noise level in robustness test = Gaussian standard deviation 1, described as roughly 0-40% of embedding norm
    A fixed choice in the robustness experiment with no sensitivity analysis or multiple seeds.
assumptions (5)
  • standard math Standard linear algebra factorization with a shared matrix and diagonal scalers is valid.
    The derivation of Q equals X Ws Dq, K equals X Ws Dk, V equals X Ws Dv relies only on associativity of matrix multiplication.
  • domain assumption BooksCorpus plus English Wikipedia is a valid pretraining distribution for GLUE and SQuAD evaluation.
    Assumed in Section 2.5; if the distribution mismatch is large, downstream fine-tuning results do not cleanly reflect the architecture.
  • domain assumption Baseline numbers from Devlin et al. and Courtois et al. are comparable to the authors' own pretraining and fine-tuning.
    The paper never states that the standard, symmetric, and pairwise baselines were rerun under identical data, steps, hardware, and hyperparameters; Tables 1 and 2 treat external numbers as direct baselines.
  • ad hoc to paper Diagonal scaling suffices to retain the expressive role of three full projection matrices.
    Section 2.3 and Table 7 assert that expressiveness is retained via scaling, but no proof, rank analysis, or expressiveness ablation is provided.
  • ad hoc to paper Sharing weights acts as a regularizer that improves generalization on noisy and out-of-domain data.
    Sections 1 and 3 state this, but the paper gives no regularization theory and the cross-domain table is mixed rather than uniformly supportive.

how reviews work

0 comments
Cite this review

Pith. "Pith review of Does Self-Attention Need Separate Weights in Transformers?." pith.science (2026). https://pith.science/paper/XKSBDUDN

@misc{pith2026241200359,
  author       = {Pith},
  title        = {Pith review of: Does Self-Attention Need Separate Weights in Transformers?},
  year         = {2026},
  howpublished = {\url{https://pith.science/paper/XKSBDUDN}},
  note         = {Machine review of arXiv:2412.00359}
}
read the original abstract

The success of self-attention lies in its ability to capture long-range dependencies and enhance context understanding, but it is limited by its computational complexity and challenges in handling sequential data with inherent directionality. This work introduces a shared weight self-attention-based BERT model that only learns one weight matrix for (Key, Value, and Query) representations instead of three individual matrices for each of them. Our shared weight attention reduces the training parameter size by more than half and training time by around one-tenth. Furthermore, we demonstrate higher prediction accuracy on small tasks of GLUE over the BERT baseline and in particular a generalization power on noisy and out-of-domain data. Experimental results indicate that our shared self-attention method achieves a parameter size reduction of 66.53% in the attention block. In the GLUE dataset, the shared weight self-attention-based BERT model demonstrates accuracy improvements of 0.38%, 5.81%, and 1.06% over the standard, symmetric, and pairwise attention-based BERT models, respectively. The model and source code are available at Anonymous.

Figures

Figures reproduced from arXiv: 2412.00359 by the authors.

Figure 1
Figure 1. Comparison of traditional self-attention (left) and shared weight self-attention (right). [PITH_FULL_IMAGE:figures/full_fig_p003_1.png] view at source ↗
Figure 2
Figure 2. Pretraining loss curves for the shared weight [PITH_FULL_IMAGE:figures/full_fig_p003_2.png] view at source ↗
Figure 3
Figure 3. Training Time Comparison Between shared Weight and standard self-attention on GLUE tasks. CoLA, MRPC, and QQP are recorded in seconds, and Other tasks are presented in minutes. Cross-Domain Performance [PITH_FULL_IMAGE:figures/full_fig_p005_3.png] view at source ↗

Discussion (0). Continue with ORCID to comment.

Reference graph

Works this paper leans on

33 extracted references · 5 canonical work pages

  1. [1]

    Ali Mohamed Nabil Allam and Mohamed Hassan Haggag. 2012. The question answering systems: A survey. International Journal of Research and Reviews in Information Sciences (IJRRIS), 2(3)

  2. [2]

    Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2014. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473

  3. [3]

    Iz Beltagy, Matthew E Peters, and Arman Cohan. 2020. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150

  4. [4]

    Pavol Bielik and Martin Vechev. 2020. Adversarial robustness for code. In International Conference on Machine Learning, pages 896--907. PMLR

  5. [5]

    Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. 2019. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509

  6. [6]

    Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, et al. 2020. Rethinking attention with performers. arXiv preprint arXiv:2009.14794

  7. [7]

    Martin Courtois, Malte Ostendorff, Leonhard Hennig, and Georg Rehm. 2024. Symmetric dot-product attention for efficient training of bert language models. arXiv preprint arXiv:2406.06366

  8. [8]

    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

Show all 33 references
  1. [9]

    Andrea Galassi, Marco Lippi, and Paolo Torroni. 2020. Attention in natural language processing. IEEE transactions on neural networks and learning systems, 32(10):4291--4308

  2. [10]

    Anthony Gillioz, Jacky Casas, Elena Mugellini, and Omar Abou Khaled. 2020. Overview of the transformer-based models for nlp tasks. In 2020 15th Conference on computer science and information systems (FedCSIS), pages 179--183. IEEE

  3. [11]

    Meng-Hao Guo, Tian-Xing Xu, Jiang-Jiang Liu, Zheng-Ning Liu, Peng-Tao Jiang, Tai-Jiang Mu, Song-Hai Zhang, Ralph R Martin, Ming-Ming Cheng, and Shi-Min Hu. 2022. Attention mechanisms in computer vision: A survey. Computational visual media, 8(3):331--368

  4. [12]

    Bobby He and Thomas Hofmann. 2023. Simplifying transformer blocks. arXiv preprint arXiv:2311.01906

  5. [13]

    Mandar Joshi, Eunsol Choi, Daniel S Weld, and Luke Zettlemoyer. 2017. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. arXiv preprint arXiv:1705.03551

  6. [14]

    Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. 2016. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410

  7. [15]

    Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980

  8. [16]

    Nikita Kitaev, ukasz Kaiser, and Anselm Levskaya. 2020. Reformer: The efficient transformer. arXiv preprint arXiv:2001.04451

  9. [17]

    Md Kowsher, Ritesh Panditi, Nusrat Jahan Prottasha, Prakash Bhat, Anupam Kumar Bairagi, and Mohammad Shamsul Arefin. 2024. Token trails: Navigating contextual depths in conversational ai with chatllm. In International Conference on Applications of Natural Language to Informati...

  10. [18]

    Md Kowsher, Abdullah As Sami, Nusrat Jahan Prottasha, Mohammad Shamsul Arefin, Pranab Kumar Dhar, and Takeshi Koshiba. 2022. Bangla-bert: transformer-based efficient model for transfer learning and language understanding. IEEE Access, 10:91855--91870

  11. [19]

    Adam Lopez. 2008. Statistical machine translation. ACM Computing Surveys (CSUR), 40(3):1--49

  12. [20]

    Minh-Thang Luong, Hieu Pham, and Christopher D Manning. 2015. Effective approaches to attention-based neural machine translation. arXiv preprint arXiv:1508.04025

  13. [21]

    Zhaoyang Niu, Guoqiang Zhong, and Hui Yu. 2021. A review on the attention mechanism of deep learning. Neurocomputing, 452:48--62

  14. [22]

    Long Phan, Hieu Tran, Daniel Le, Hieu Nguyen, James Anibal, Alec Peltekian, and Yanfang Ye. 2021. Cotext: Multi-task learning with code-text transformer. arXiv preprint arXiv:2105.08645

  15. [23]

    Pranav Rajpurkar, Robin Jia, and Percy Liang. 2018. Know what you don't know: Unanswerable questions for squad. arXiv preprint arXiv:1806.03822

  16. [24]

    Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. Squad: 100,000+ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250

  17. [25]

    Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. 2018. Self-attention with relative position representations. arXiv preprint arXiv:1803.02155

  18. [26]

    Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, ukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems, 30

  19. [28]

    Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2019. https://arxiv.org/abs/1804.07461 Glue: A multi-task benchmark and analysis platform for natural language understanding . Preprint, arXiv:1804.07461

  20. [29]

    Shitao Xiao, Zheng Liu, Yingxia Shao, and Zhao Cao. 2022. Retromae: Pre-training retrieval-oriented language models via masked auto-encoder. arXiv preprint arXiv:2205.12035

  21. [30]

    Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. 2020. Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159

  22. [31]

    Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. 2015. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In The IEEE International Conference on Computer Vision (ICCV)

  23. [32]

    Bohan Zhuang, Jing Liu, Zizheng Pan, Haoyu He, Yuetian Weng, and Chunhua Shen. 2023. A survey on efficient training of transformers. arXiv preprint arXiv:2302.01107

  24. [33]

    online" 'onlinestring :=

    ENTRY address archivePrefix author booktitle chapter edition editor eid eprint eprinttype howpublished institution journal key month note number organization pages publisher school series title type volume year doi pubmed url lastchecked label extra.label sort.label short.list...

  25. [34]

    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 gl...

Pith tools

Reviewed August 12, 2026 · model on record in the stance chip above.