Papers › Cascaded Head-colliding Attention

Cascaded Head-colliding Attention

31 May 2021ACL 2021 5arXiv:2105.14850archive 2025-07-28

Lin Zheng, Zhiyong Wu, Lingpeng Kong

Transformers have advanced the field of natural language processing (NLP) on a variety of important tasks. At the cornerstone of the Transformer architecture is the multi-head attention (MHA) mechanism which models pairwise interactions between the elements of the sequence. Despite its massive success, the current framework ignores interactions among different heads, leading to the problem that many of the heads are redundant in practice, which greatly wastes the capacity of the model. To improve parameter efficiency, we re-formulate the MHA as a latent variable model from a probabilistic perspective. We present cascaded head-colliding attention (CODA) which explicitly models the interactions between attention heads through a hierarchical variational distribution. We conduct extensive experiments and demonstrate that CODA outperforms the transformer baseline, by $0.6$ perplexity on \texttt{Wikitext-103} in language modeling, and by $0.6$ BLEU on \texttt{WMT14 EN-DE} in machine translation, due to its improvements on the parameter efficiency.\footnote{Our implementation is publicly available at \url{https://github.com/LZhengisme/CODA}.}

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2105.14850")

Code

Syntology Ran 9 of 10 code samples harvested from 2 repositories linked to this paper; 1 has no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · violated contract; 3 ran · our draft was wrong; 1 ran · fixture could not drive it; 3 ran with no contract checked.

By repository: official repository: 3 samples from 1 repository, 3 ran; found in paper text by Syntology: 5 samples from 1 repository, 4 ran; 2 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

LZhengisme/CODA officialmentioned in papermentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

10 samples harvested; 9 ran; 1 honoured the contract we drafted; 1 has no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
1ran · violated contract
3ran · our draft was wrong
1ran · fixture could not drive it
3ran
1unverified

Licence: 5 of the 10 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

Embedding LZhengisme/CODA/fairseq/models/coda_transformer.py official repository ran · our draft was wrong MIT recorded; this copy not marked cleared · pointer only · 96cbb5e9ca5b6be0 · report
Linear LZhengisme/CODA/fairseq/models/coda_transformer.py official repository ran · our draft was wrong MIT recorded; this copy not marked cleared · pointer only · 8cd8cb0d1e9e63e4 · report
safe_readline LZhengisme/CODA/fairseq/binarizer.py official repository ran MIT recorded; this copy not marked cleared · pointer only · 82bdf940665aeeb4 · report
Kmeans pytorch/fairseq/fairseq/modules/kmeans_attention.py found in paper text by Syntology ran MIT (permissive) · 9f73b0c0fce2870d · report
KmeansAttention pytorch/fairseq/fairseq/modules/kmeans_attention.py found in paper text by Syntology ran MIT (permissive) · 70d8f18adccf84c1 · report
ema pytorch/fairseq/fairseq/modules/kmeans_attention.py found in paper text by Syntology ran · honoured contract fingerprinted MIT (permissive) · 62b973828672478f · report
kmeans_iter pytorch/fairseq/fairseq/modules/kmeans_attention.py found in paper text by Syntology ran · fixture could not drive it MIT (permissive) · dfbee029313fac6a · report
ema_inplace pytorch/fairseq/fairseq/modules/kmeans_attention.py found in paper text by Syntology unverified MIT (permissive) · b46ee69b75929ac8 · report
default identical code first harvested elsewhere ran · violated contract fingerprinted licence of this copy not recorded · 27ab3e63c68fe18a · report
is_empty identical code first harvested elsewhere ran · our draft was wrong fingerprinted licence of this copy not recorded · a91aa4d3b29e189e · report

Tasks

Language ModelingLanguage ModellingMachine TranslationTranslation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections