atlas

Research map / Architectures and efficiency / Attention and transformers

Attention as a Hypernetwork

ICLR 2025 · Architectures and efficiency › Attention and transformers · approach: Attention head mechanisms · 0 citations (OpenAlex)

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.

Reformulates multi-head attention as a hypernetwork whose head-indexed attention scores form a latent code, and proposes HYLA (nonlinear value network with RMSHead normalization) that improves compositional generalization on fuzzy logic and the new symbolic Raven task (SRAVEN).

Problem

How transformers achieve compositional generalization in-context to unseen combinations of known constituents, and what internal mechanism supports it.

Approach

Multi-head attention is mathematically equivalent to a linear hypernetwork: per key-query pair, the head-indexed attention scores act as a latent code that linearly combines shared head matrices into a key-query-specific value network. Making this value network nonlinear (HYLA, with RMSHead normalization across heads) without extra parameters strengthens compositional generalization.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use HYLA instead of softmax or linear attentionTransformer attention · Fuzzy logic OOD tasksOOD R2: 63.28 ± 2.31 -> 81.13 ± 7.77; 59.89 ± 5.22 -> 81.13 ± 7.77Helped
Use HYLA instead of softmax or linear attentionTransformer attention · SRaven OOD tasksOOD accuracy: 56.56 ± 1.05 -> 69.13 ± 1.90; 56.30 ± 1.11 -> 69.13 ± 1.90Helped
Add RMSHead normalization to linear attention (ablation)Linear attention · Fuzzy logic OOD tasksOOD R2: 59.89 ± 5.22 -> 68.93 ± 5.10Helped
Add RMSHead normalization to linear attention (ablation)Linear attention · SRaven OOD tasksOOD accuracy: 56.30 ± 1.11 -> 59.01 ± 2.50Helped
Add a nonlinear value network to Linear attention + RMSHead (ablation)Linear attention · Fuzzy logic OOD tasksOOD R2: 68.93 ± 5.10 -> 56.91 ± 4.25Hurt
Add a nonlinear value network to Linear attention + RMSHead (ablation)Linear attention · SRaven OOD tasksOOD accuracy: 59.01 ± 2.50 -> 55.38 ± 0.32Hurt
Add RMSHead normalization (ablation)HYLA · SRaven OOD tasksOOD accuracy: 62.53 ± 5.73 -> 69.13 ± 1.90Helped
Add the value-network nonlinearity (ablation)HYLA · Fuzzy logic OOD tasksOOD R2: 81.13 ± 7.77 -> 84.54 ± 5.32Hurt
Add the value-network nonlinearity (ablation)HYLA · SRaven OOD tasksOOD accuracy: 56.54 ± 0.21 -> 69.13 ± 1.90Helped
Replace RMSHead normalization with softmax (ablation)HYLA · SRaven OOD tasksOOD accuracy: 69.13 ± 1.90 -> 38.21 ± 2.98Hurt
Add an additional value-network layer (ablation)HYLA · Fuzzy logic OOD tasksOOD R2: 81.13 ± 7.77 -> 87.65 ± 4.54Helped
Add an additional value-network layer (ablation)HYLA · SRaven OOD tasksOOD accuracy: 69.13 ± 1.90 -> 66.59 ± 0.08Hurt

Surprising findings

Limitations

Experimental setup

Datasets: SRAVEN (generated) fuzzy logic functions (generated) C4

Benchmarks: SRAVEN fuzzy logic compositional split C4 language modeling

Metrics: OOD accuracy OOD R^2 perplexity / language modeling loss F1 of logistic regression probes on latent codes

Baselines: softmax attention linear attention Linear attention + RMSHead HYLA deep value network Mixture of experts

Builds on: hypernetworks linear attention as fast weight programmer Raven's Progressive Matrices T5 relative positional embeddings

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