SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.19346 · ICML · 2024

Polynomial Regression as a Task for Understanding In-context Learning Through Finetuning and Alignment

Anant Sahai, Max Wilcoxson, Morten Svendgård, Ria Doshi, Dylan Davis, Reya Vir

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 2 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/2407.19346.json · badge: /api/ran/2407.19346.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
dtsip/in-context-learning unrelated (classifier label)
classifier basis: classifier_2025
4 ran · 1 no recorded run
MSNetrom/in-context-poly-playground marked official in Papers with Code
Papers with Code archive
2 ran · 1 no recorded run
in-context-learning-2024/in-context application (classifier label)
classifier basis: classifier_2025
1 ran · 3 no recorded run
FunctionStatusWhere it lives
LinearRegression Ran
ran on a synthesized input · constructed an object; no result was computed
MSNetrom/in-context-poly-playground/src/function_classes/linear.py
pointer only (licence: NONE) · get_code("3eb106cd7a7e9cc1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, MSNetrom/in-context-poly-playground 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.

LinearRegression Ran
ran on a synthesized input
dtsip/in-context-learning/src/tasks.py
code served (permissive licence) · get_code("926e7dbb8fa5faf9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# INIT_ARGS for LinearRegression.__init__
INIT_ARGS = {
    'n_dims': 5,
    'batch_size': 3,
    'pool_dict': None,
    'seeds': None,
    'scale': 1.5
}

# ARGS for LinearRegression.evaluate
# xs_b should have shape (batch_size, num_points, n_dims)
ARGS = {
    'xs_b': torch.randn(3, 7, 5)  # batch_size=3, num_points=7, n_dims=5
}

METHOD = 'evaluate'
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
QuadraticRegression Ran
ran on a synthesized input · constructed an object; no result was computed
MSNetrom/in-context-poly-playground/src/function_classes/linear.py
pointer only (licence: NONE) · get_code("d368898a33daca4b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, MSNetrom/in-context-poly-playground 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.

QuadraticRegression Ran
ran on a synthesized input
dtsip/in-context-learning/src/tasks.py
code served (permissive licence) · get_code("0aee68a20552f9dd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math

INIT_ARGS = {
    'n_dims': 4,
    'batch_size': 2,
    'pool_dict': None,
    'seeds': None,
    'scale': 1.0,
}

ARGS = {
    'xs_b': torch.randn(2, 4),
}

METHOD = 'evaluate'
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 2) — shape (2, 2) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
generate_chebyshev_coefficients Ran
ran, honoured the contract we drafted
in-context-learning-2024/in-context/src/function_classes/chebyshev.py
pointer only (licence: NONE) · get_code("e2972d7794b7ddbc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, in-context-learning-2024/in-context 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
dtsip/in-context-learning/src/tasks.py
code served (permissive licence) · get_code("fc94f27a0973e093")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function mean_squared_error takes two parameters:
# - ys_pred: predicted values (tensor)
# - ys: ground truth values (tensor)
# Both should be tensors that support .square() and .mean() operations

ys_pred = torch.randn(2, 4)
ys = torch.randn(2, 4)

ARGS = {
    "ys_pred": ys_pred,
    "ys": ys,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
squared_error Ran
ran; our contract draft was wrong, not the code
dtsip/in-context-learning/src/tasks.py
code served (permissive licence) · get_code("348d63a78eb4cb94")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create small tensors for predicted and actual values
# batch_size=2, output_dim=4
ys_pred = torch.randn(2, 4)
ys = torch.randn(2, 4)

ARGS = {
    "ys_pred": ys_pred,
    "ys": ys,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
AbstractionError Not yet run
unverified (harvested, no recorded run)
in-context-learning-2024/in-context/src/function_classes/chebyshev.py
pointer only (licence: NONE) · get_code("160b660cf85ae216")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, in-context-learning-2024/in-context 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.

ChebyshevKernelLinearRegression Not yet run
unverified (harvested, no recorded run)
in-context-learning-2024/in-context/src/function_classes/chebyshev.py
pointer only (licence: NONE) · get_code("f0b437535684e5a1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, in-context-learning-2024/in-context 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.

FunctionClass Not yet run
unverified (harvested, no recorded run)
MSNetrom/in-context-poly-playground/src/function_classes/linear.py
pointer only (licence: NONE) · get_code("5896b81a520fc291")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, MSNetrom/in-context-poly-playground 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.

FunctionClass Not yet run
unverified (harvested, no recorded run)
in-context-learning-2024/in-context/src/function_classes/chebyshev.py
pointer only (licence: NONE) · get_code("38900f51ceeb94d5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, in-context-learning-2024/in-context 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.

Task Not yet run
unverified (harvested, no recorded run)
dtsip/in-context-learning/src/tasks.py
code served (permissive licence) · get_code("3e016983bf585f29")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 10 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
mean_squared_error
brick of this paper's assembly: helper
5 other papers
3 dated earlier, 2 later
2310.17086 (2023-10)
Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regression
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
and 2 more not named here
squared_error
brick of this paper's assembly: helper
5 other papers
3 dated earlier, 2 later
2310.17086 (2023-10)
Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regression
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
and 2 more not named here

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-22.

Repositories linked to this paper

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

Abstract

Simple function classes have emerged as toy problems to better understand in-context-learning in transformer-based architectures used for large language models. But previously proposed simple function classes like linear regression or multi-layer-perceptrons lack the structure required to explore things like prompting and alignment within models capable of in-contextlearning. We propose univariate polynomial regression as a function class that is just rich enough to study prompting and alignment, while allowing us to visualize and understand what is going on clearly. Code can be found at https://github.com/MSNetrom/ in-context-poly-playground.

For agents

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

get_harvested_code_for_paper("2407.19346")
get_code_for_paper("2407.19346")
have("2407.19346")

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

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

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

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

Connect an agent — have() is free.