SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.17086 · NeurIPS · 2024

Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regression

Deqing Fu, Tian-Qi Chen, Robin Vatsal

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2310.17086.json · badge: /api/ran/2310.17086.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
DeqingFu/transformers-icl-second-order canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; our contract draft was wrong, not the code
DeqingFu/transformers-icl-second-order/src/tasks.py
pointer only (licence: NONE); the stored copy get_code serves, from sehyunkwon/task-diversity-icl, is pointer only (licence: NONE) · get_code("d7ae3e05768f422d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DeqingFu/transformers-icl-second-order when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

basic_plot Ran
ran; our contract draft was wrong, not the code
DeqingFu/transformers-icl-second-order/src/plot_utils.py
pointer only (licence: NONE) · get_code("b25e1cafdb9ebe37")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DeqingFu/transformers-icl-second-order when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_data_sampler Ran
ran; our contract draft was wrong, not the code
DeqingFu/transformers-icl-second-order/src/samplers.py
pointer only (licence: NONE) · get_code("5e0c28dc433111b9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DeqingFu/transformers-icl-second-order when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_final_var Ran
ran, honoured the contract we drafted
DeqingFu/transformers-icl-second-order/src/curriculum.py
pointer only (licence: NONE) · get_code("3c24ac252fef0868")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DeqingFu/transformers-icl-second-order when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

mean_squared_error Ran
ran; our contract draft was wrong, not the code
DeqingFu/transformers-icl-second-order/src/tasks.py
pointer only (licence: NONE) · get_code("fc94f27a0973e093")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DeqingFu/transformers-icl-second-order when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

sample_transformation Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
DeqingFu/transformers-icl-second-order/src/samplers.py
pointer only (licence: NONE) · get_code("44a629abef84e7c0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DeqingFu/transformers-icl-second-order when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

squared_error Ran
ran; our contract draft was wrong, not the code
DeqingFu/transformers-icl-second-order/src/tasks.py
pointer only (licence: NONE) · get_code("348d63a78eb4cb94")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DeqingFu/transformers-icl-second-order when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

train_step Ran
ran; our contract draft was wrong, not the code
DeqingFu/transformers-icl-second-order/src/train_linear.py
pointer only (licence: NONE) · get_code("dcdff2706acbf855")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DeqingFu/transformers-icl-second-order when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

build_model Not yet run
unverified (harvested, no recorded run)
DeqingFu/transformers-icl-second-order/src/models.py
pointer only (licence: NONE) · get_code("c07e8759bc056638")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DeqingFu/transformers-icl-second-order when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

sample_seeds Not yet run
unverified (harvested, no recorded run)
DeqingFu/transformers-icl-second-order/src/train_linear.py
pointer only (licence: NONE) · get_code("4d49c710f74c99c4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DeqingFu/transformers-icl-second-order when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 5 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 5 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
get_final_var 8 other papers
1 dated earlier, 7 later
2306.04891 (2023-06)
In-Context Learning through the Bayesian Prism
2402.03170 (2024-02)
Is Mamba Capable of In-Context Learning?
2402.04248 (2024-02)
Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Tasks
and 5 more not named here
mean_squared_error 5 other papers
5 later
2402.04248 (2024-02)
Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Tasks
2404.18191 (2024-04)
Published at ICLR 2024 Workshop on Reliable and Responsible Foundation Models EXPLORING THE ROBUSTNESS OF IN-CONTEXT LEARNING WITH NOISY LABELS
2407.19346 (2024-07)
Polynomial Regression as a Task for Understanding In-context Learning Through Finetuning and Alignment
and 2 more not named here
squared_error 5 other papers
5 later
2402.04248 (2024-02)
Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Tasks
2404.18191 (2024-04)
Published at ICLR 2024 Workshop on Reliable and Responsible Foundation Models EXPLORING THE ROBUSTNESS OF IN-CONTEXT LEARNING WITH NOISY LABELS
2407.19346 (2024-07)
Polynomial Regression as a Task for Understanding In-context Learning Through Finetuning and Alignment
and 2 more not named here
accuracy 2 other papers
2 later
2404.18191 (2024-04)
Published at ICLR 2024 Workshop on Reliable and Responsible Foundation Models EXPLORING THE ROBUSTNESS OF IN-CONTEXT LEARNING WITH NOISY LABELS
2410.05448 (2024-10)
Task Diversity Shortens the ICL Plateau
sample_seeds 2 other papers
2 later
2402.04248 (2024-02)
Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Tasks
2509.07963 (2025-09)
Customizing the Inductive Biases of Softmax Attention using Structured Matrices

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Transformers excel at in-context learning (ICL)-learning from demonstrations without parameter updates-but how they do so remains a mystery. Recent work suggests that Transformers may internally run Gradient Descent (GD), a first-order optimization method, to perform ICL. In this paper, we instead demonstrate that Transformers learn to approximate second-order optimization methods for ICL. For in-context linear regression, Transformers share a similar convergence rate as Iterative Newton's Method; both are exponentially faster than GD. Empirically, predictions from successive Transformer layers closely match different iterations of Newton's Method linearly, with each middle layer roughly computing 3 iterations; thus, Transformers and Newton's method converge at roughly the same rate. In contrast, Gradient Descent converges exponentially more slowly. We also show that Transformers can learn in-context on ill-conditioned data, a setting where Gradient Descent struggles but Iterative Newton succeeds. Finally, to corroborate our empirical findings, we prove that Transformers can implement k iterations of Newton's method with k + O(1) layers.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2310.17086")
get_code_for_paper("2310.17086")
have("2310.17086")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2310.17086.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2310.17086.svg)](https://syntology.ai/paper/2310.17086)

Connect an agent — have() is free.