NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Laplacian Heads Improve Transformers by Smoothing Token Representations

Yuchong Zhang, Vardan PapyanNeurIPS 2026

TL;DR

What if you could improve Vision Transformers and GPT-style language models without adding a single learnable parameter? By simply subtracting the standard attention matrix from the identity matrix ($I - P$) in a subset of heads, models gain direct control over how much tokens vary within a sequence. Counterintuitively, this modification makes token representations smoother across layers—challenging the long-held dogma that "oversmoothing" in deep networks is always a bad thing.

What Problem Does This Paper Address?

In both Graph Neural Networks (GNNs) and Transformers, tokens pass messages to one another layer after layer. A notorious failure mode in these deep architectures is oversmoothing (or rank collapse): as information mixes repeatedly, all token representations start looking identical, washing out expressive details. Because of this, researchers usually treat token smoothing as a bug to be engineered away.

At the same time, look closely at how a standard Transformer updates its tokens. A softmax attention matrix $P$ is row-stochastic (its rows sum to 1), meaning multiplying by $P$ computes an attention-weighted average of token values. Adding this back via the residual stream shifts the overall mean of the sequence, but gives the Transformer no explicit, direct mechanism to shrink or expand how spread out the tokens are around that mean (their within-sequence variance). The authors ask: what happens if we give Transformers an explicit knob to control variance and induce smoothing?

Methods

In a standard multi-head attention layer, each head computes a softmax probability matrix $P^{(i)}$ to weight projected token values before adding them back to the residual stream $X$.

The authors propose a zero-parameter tweak: take a fixed number of heads in every layer and replace $P^{(i)}$ with $I - P^{(i)}$, where $I$ is the identity matrix. They call these Laplacian heads, leaving the rest as standard attention heads.

Figure 2: Combining attention and Laplacian heads lets the model directly control the mean and within-sequence variance of token representations in each head’s subspace.

Why does this work? There are two intuitive ways to look at $(I - P^{(i)})$:

  1. Mean vs. Variance Control: While $P^{(i)}X$ calculates the local average of tokens, $(I - P^{(i)})X = X - P^{(i)}X$ calculates each token's deviation from that average. When combined with learned value and output projections, standard heads shift the sequence mean, while Laplacian heads directly expand or contract the spread of tokens around that mean.
  2. Heat Diffusion on Graphs: Imagine tokens in a sequence as nodes on a graph connected by attention weights $P^{(i)}$. In graph theory, $I - P^{(i)}$ is the random-walk normalized graph Laplacian—the exact operator that governs heat flow. Updating tokens with this operator acts like a step of heat diffusion, smoothly blending representations of strongly connected tokens in learned subspaces.

Datasets

No new benchmarks were introduced; the authors evaluated standard benchmarks across three distinct paradigms:

  • Supervised Image Classification: CIFAR-10, CIFAR-100, and ImageNet-1k.
  • Causal Language Modeling: Pre-trained on ClimbMix (up to 16.68B tokens) and evaluated on validation data plus the CORE benchmark (22 downstream tasks).
  • Vision Self-Supervised Learning (DINO): Trained on ImageNet-1k, evaluated via ImageNet linear probing and ADE20K semantic segmentation.

Key Insights and Ideas

  • Smoothing isn't the enemy—unstructured smoothing is: Prior literature treats token collapse as universally harmful. Here, Laplacian heads actively increase token cosine similarity and speed up spectral decay (concentrating token variance into fewer principal directions), yet performance goes up everywhere. Smoothing acts like a helpful denoising mechanism that sculpts representations into task-optimal shapes.
  • Driving "Neural Collapse" in Vision: In supervised classification, all patches of an image share one label. Laplacian heads collapse tokens within the same image together while pushing different classes apart into a clean geometric structure known as a simplex Equiangular Tight Frame (Neural Collapse).
Figure 1: The proposed modification cleanly separates token representations into distinct clusters by their classes. Each color corresponds to a specific class.
  • Stronger "Linguistic Collapse" in LLMs: In language modeling, tokens in a sequence predict different next words, so full sequence collapse wouldn't make sense. Instead, Laplacian heads concentrate sequence representations into lower-dimensional subspaces while making tokens across the dataset that share the same next-token target much more separable.
  • Crisper Unsupervised Boundaries: In self-supervised vision (DINO), concentrating within-image variance into fewer dimensions forces the top three principal components of patch representations to capture noticeably sharper object boundaries and segmentation details.

Key Results

Across all tasks, swapping in Laplacian heads consistently beat the standard Transformer baseline—and surprisingly, converting all heads to Laplacian heads often worked best in supervised vision and language modeling:

  • Image Classification (DeiT-3 ViT-B): Improved top-1 accuracy across all datasets and drop-path rates, boosting CIFAR-100 from 75.12% to 77.04% (12 Laplacian heads) and ImageNet from 81.45% to 82.73% (3 Laplacian heads).
  • Language Modeling (GPT-2 style, 135M to 1.45B parameters): Validation Bits-Per-Byte (BPB, lower is better) improved nearly monotonically with more Laplacian heads. For the 1.45B model, converting all 15 heads dropped BPB from 0.6850 to 0.6790 while boosting downstream CORE accuracy.
  • Self-Supervised Vision (DINO ViT-S): Using 3 out of 6 heads as Laplacian heads improved ImageNet linear-probing accuracy by +1.26% (to 73.34%) and ADE20K segmentation mIoU by +1.84 points (to 32.11%).

Limitations and Future Work

  • Naive head allocation: The authors used a rigid, uniform rule—setting the exact same number of Laplacian heads in every single layer. Since early layers and deep layers play very different roles in feature extraction, layer-specific schedules could unlock further gains.
  • Theoretical gaps in SSL and LLMs: While supervised classification has a known theoretical ideal (Neural Collapse), we still lack a complete mathematical picture of what the "ideal" target geometry looks like for self-supervised learning and causal language modeling.

Summary updated

BibTeX
@inproceedings{zhang2026laplacian,
  author = {Yuchong Zhang and Vardan Papyan},
  title = {{Laplacian Heads Improve Transformers by Smoothing Token Representations}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=o6wVXdc2L1},
}
Figure