Transformers with CoT Discover Heavy-Ball Acceleration Through Training

Yuxuan Cai, Yuan Cao
10/22/2026
cs.LGstat.ML
transformer-attention

No confident code implementation found for this paper.

Abstract

Modern transformers often solve complex tasks by generating and refining intermediate reasoning steps. To develop a theoretical understanding of chain-of-thought (CoT) reasoning, a notable recent study by Huang et al. (2025) viewed transformers as algorithm executors, and showed that when transformers' CoT steps are supervised by a gradient-descent teacher, they can learn to implement gradient descent for in-context weight prediction in linear regression.

Show full abstract

In this paper, we study the same in-context weight prediction task but ask whether CoT reasoning can go beyond merely imitating the teacher algorithm. We show that, after initial supervision from a gradient-descent teacher, further trajectory-level supervision using the true regression weights leads the model to implement the Heavy-Ball method, thereby achieving acceleration over the original teacher. Notably, this accelerated algorithm emerges without supervision from any Heavy-Ball teacher. Our results provide a concrete theoretical example in which transformer reasoning can discover new algorithms through training, rather than merely imitate the algorithm used for supervision.

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{cai2026transformers,
  title  = {Transformers with CoT Discover Heavy-Ball Acceleration Through Training},
  author = {Yuxuan Cai and Yuan Cao},
  year   = {2026},
  eprint = {2610.31089},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.31089v1}
}

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/2610.31089.svg)](https://codeofpaper.com/paper/2610.31089)

Discussion