atlas

Research map / Architectures and efficiency / Attention and transformers

Transformer Meets Twicing: Harnessing Unattended Residual Information

ICLR 2025 · Architectures and efficiency › Attention and transformers · approach: Attention head and block redesign

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes Twicing Attention, which replaces softmax self-attention with (2A - A^2)V via a kernel twicing procedure, slowing representation collapse and improving accuracy and robustness on ImageNet, ADE20K, and WikiText-103.

Problem

Transformer self-attention representations degrade (representation collapse / over-smoothing) across layers, reducing token diversity and performance.

Approach

Interpret self-attention as a low-pass NLM smoothing filter (Nadaraya-Watson kernel) and replace the attention operator A with the twicing operator 2A - A^2, which slows eigenvalue decay and reuses smoothed residual information; implemented as A V + A(V - A V) at O(N^2 D) cost.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace standard self-attention with Twicing AttentionDeiT · ImageNet-1KTop-1 accuracy: 72.00 -> 72.60Helped
Replace standard self-attention with Twicing AttentionDeiT · ImageNet PGD, FGSM, and SPSATop-1 accuracy: 8.16 -> 9.15; 29.88 -> 32.28; 66.41 -> 67.12Helped
Replace standard self-attention with Twicing AttentionDeiT · ImageNet-R, ImageNet-A, ImageNet-C, ImageNet-C (Extra)Robustness metric (Top-1 accuracy or mCE): 32.22 -> 32.74; 6.97 -> 7.66; 72.21 -> 70.33; 63.68 -> 62.46Mixed
Replace standard self-attention with Twicing AttentionFAN · ImageNet-1K clean and adversarial testsTop-1 accuracy: 77.09 -> 77.18; 11.91 -> 12.80; 33.81 -> 35.52; 67.15 -> 68.89Helped
Replace standard self-attention with Twicing AttentionDeiT segmentation model · ADE20KMean IoU: 34.73 -> 35.12Helped
Replace standard self-attention with Twicing AttentionTransformer (small) · WikiText-103 testPerplexity: 37.51 -> 36.69Helped
Replace standard self-attention with Twicing AttentionTransformer · WikiText-103 attacked testPerplexity: 55.17 -> 54.46Helped
Use Twicing Attention during fine-tuningSwitch Transformer · SST-2Test accuracy: 77.78 -> 78.34Helped
Apply Twicing Attention in layers 1-12 rather than standard attention throughout (ablation)DeiT · ImageNet-1KTop-1 accuracy: 72.00 -> 72.60Helped
Apply Twicing Attention in layers 7-12 rather than standard attention throughout (ablation)DeiT · ImageNet-1KTop-1 accuracy: 72.00 -> 72.45Helped
Apply Twicing Attention only in layers 10-12 rather than standard attention throughout (ablation)DeiT · ImageNet-1KTop-1 accuracy: 72.00 -> 72.31Helped

Surprising findings

Limitations

Experimental setup

Datasets: ImageNet-1K ADE20K WikiText-103 SST-2 ImageNet-A ImageNet-R ImageNet-C

Benchmarks: ImageNet-1K ImageNet-A ImageNet-R ImageNet-C ADE20K WikiText-103 SST-2

Metrics: top-1 accuracy top-5 accuracy mCE pixel accuracy mean IoU perplexity cosine similarity between tokens GFLOPs ms/it

Baselines: DeiT NeuTRENO FAN FeatScale Transformer (WikiText-103 baseline) Linear Transformer

Builds on: Transformer DeiT Fully Attentional Network nonlocal means denoising twicing kernels

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy