paper-with-me

홈 › Papers

Superiority of Multi-Head Attention in In-Context Linear Regression

2024-01-30 · Yingqian Cui, Jie Ren, Pengfei He, Jiliang Tang, Yue Xing

We present a theoretical analysis of the performance of transformer with softmax attention in in-context learning with linear regression tasks. While the existing literature predominantly focuses on the convergence of transformers with single-/multi-head attention, our research centers on comparing their performance. We conduct an exact theoretical analysis to demonstrate that multi-head attention with a substantial embedding dimension performs better than single-head attention. When the number of in-context examples D increases, the prediction loss using single-/multi-head attention is in O(1/D), and the one for multi-head attention has a smaller multiplicative constant. In addition to the simplest data distribution setting, we consider more scenarios, e.g., noisy labels, local examples, correlated features, and prior knowledge. We observe that, in general, multi-head attention is preferred over single-head attention. Our results verify the effectiveness of the design of multi-head attention in the transformer architecture.

📄 PDF Abstract BibTeX arXiv:2401.17426

Code (0)

등록된 구현이 없습니다.

Tasks

In-Context Learningregression

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Linear Regression Linear Regression is a method for modelling a relationship between a dependent variable and independent variables. These models can be fit with numerous approaches. The most…
Multi-Head Attention 설명 없음
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…

Similar Papers 제목 키워드 기반

Information Aggregation for Multi-Head Attention with Routing-by-Agreement

2019-04-05 · NAACL 2019 6 · Jian Li, Baosong Yang, Zi-Yi Dou, Xing Wang 외

Multi-head attention is appealing for its ability to jointly extract different types of information from multiple representation subspaces. Concerning the information aggregation, a common practice is to use a concatenat…

Machine TranslationTranslation

In-Context Linear Regression Demystified: Training Dynamics and Mechanistic Interpretability of Multi-Head Softmax Attention

2025-03-17 · Jianliang He, Xintian Pan, Siyu Chen, Zhuoran Yang

We study how multi-head softmax attention models are trained to perform in-context learning on linear data. Through extensive empirical experiments and rigorous theoretical analysis, we demystify the emergence of elegant…

In-Context Learning

LaMemo: Language Modeling with Look-Ahead Memory

2022-04-15 · NAACL 2022 7 · Haozhe Ji, Rongsheng Zhang, Zhenyu Yang, Zhipeng Hu 외

Although Transformers with fully connected self-attentions are powerful to model long-term dependencies, they are struggling to scale to long texts with thousands of words in language modeling. One of the solutions is to…

Language ModelingLanguage Modelling

MHLA: Restoring Expressivity of Linear Attention via Token-Level Multi-Head

2026-01-12 · Kewei Zhang, Ye Huang, Yufan Deng, Jincheng Yu 외 arxiv

While the Transformer architecture dominates many fields, its quadratic self-attention complexity hinders its use in large-scale applications. Linear attention offers an efficient alternative, but its direct application …

Video GenerationImage Generation

HyTRec: A Hybrid Temporal-Aware Attention Architecture for Long Behavior Sequential Recommendation

2026-02-20 · Lei Xin, Yuhao Zheng, Ke Cheng, Changjiang Jiang 외 arxiv

Modeling long sequences of user behaviors has emerged as a critical frontier in generative recommendation. However, existing solutions face a dilemma: linear attention mechanisms achieve efficiency at the cost of retriev…

Sequential Recommendation