In-Context Learning in Linear vs. Quadratic Attention Models: An Empirical Study on Regression Tasks

Ayush Goel, Arjun Kohli, Sarvagya Somvanshi
2/19/2026
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

Recent work has demonstrated that transformers and linear attention models can perform in-context learning (ICL) on simple function classes, such as linear regression. In this paper, we empirically study how these two attention mechanisms differ in their ICL behavior on the canonical linear-regression task of Garg et al. We evaluate learning quality (MSE), convergence, and generalization behavior of each architecture. We also analyze how increasing model depth affects ICL performance. Our results illustrate both the similarities and limitations of linear attention relative to quadratic attention in this setting.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{goel2026incontext,
  title  = {In-Context Learning in Linear vs. Quadratic Attention Models: An Empirical Study on Regression Tasks},
  author = {Ayush Goel and Arjun Kohli and Sarvagya Somvanshi},
  year   = {2026},
  eprint = {2602.17171},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2602.17171v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2602.17171.svg)](https://codeofpaper.com/paper/2602.17171)

Discussion