SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.31175 · ICML · 2026

Towards Efficient LLMs Annealing with Principled Sample Selection

Guang Zhang, Zhong Li, Wanbo Zhang, Yuanjian Xu, Jianing Hao

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 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; 2 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 5 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2605.31175.json · badge: /api/ran/2605.31175.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
xuyj233/Direct community
Papers with Code archive
8 ran · 3 no recorded run
FunctionStatusWhere it lives
_proj_box Ran
ran, honoured the contract we drafted
xuyj233/Direct/direct/selector.py
code served (permissive licence) · get_code("685a862255e8133f")
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) and returned ndarray, 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 numpy as np

# Create a small numpy array with values outside [0, 1] range
# to test the clipping functionality
w = np.array([[-0.5, 0.3, 1.2, 0.8],
              [0.1, -0.2, 0.9, 1.5]])

ARGS = {
    "w": w
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, 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
_proj_halfspace Ran
ran; our contract draft was wrong, not the code
xuyj233/Direct/direct/selector.py
code served (permissive licence) · get_code("a05a992c2d2b389c")
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) and returned ndarray, ndim 1, dtype family float, shape (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 numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create small numpy arrays for the function parameters
# w: the vector to project (dimension 4)
w = np.array([1.0, 2.0, 3.0, 4.0])

# a: the normal vector defining the halfspace constraint (dimension 4)
a = np.array([0.5, 0.5, 0.5, 0.5])

# tau: the threshold for the halfspace constraint
tau = 5.0

ARGS = {
    "w": w,
    "a": a,
    "tau": tau,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (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
_proj_sum Ran
ran, violated the contract we drafted
xuyj233/Direct/direct/selector.py
code served (permissive licence) · get_code("7bc6cbb8284d8b31")
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) and returned ndarray, ndim 1, dtype family float, shape (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 numpy as np

# Create a small weight vector
w = np.array([1.0, 2.0, 3.0, 4.0])

# Create a target sum value
K = 15.0

ARGS = {
    "w": w,
    "K": K,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (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
dykstra_projection Ran
ran; our contract draft was wrong, not the code
xuyj233/Direct/direct/selector.py
code served (permissive licence) · get_code("300a71c314db2a5f")
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) and returned ndarray, ndim 1, dtype family float, shape (5,) 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 numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Define arguments for dykstra_projection
N = 5  # dimension of the problem

# w: Point to project (1-D array of length N)
w = np.random.rand(N)

# a: Coefficients of the half-space (1-D array of length N)
a = np.random.rand(N)

# tau: Right-hand side of the half-space constraint
tau = 2.0

# K: Target cardinality; the returned vector satisfies sum(w) = K
K = 2.5

# max_iter: Maximum outer sweeps over the three constraints
max_iter = 200

# tol: Stopping tolerance on relative change of w
tol = 1e-6

ARGS = {
    "w": w,
    "a": a,
    "tau": tau,
    "K": K,
    "max_iter": max_iter,
    "tol": tol,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) 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
flat_grad Ran
ran, honoured the contract we drafted
xuyj233/Direct/direct/selector.py
code served (permissive licence) · get_code("fa5be0d1f9a7483c")
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) and returned Tensor, ndim 1, dtype family float, shape (19,) 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
from torch import nn

torch.manual_seed(0)

# Define a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 1)
    
    def forward(self, x):
        x = torch.relu(self.linear1(x))
        x = self.linear2(x)
        return x

# Create model instance
model = SimpleModel()

# Define a loss function
def loss_fn(model, sample):
    x, y = sample
    pred = model(x)
    loss = nn.functional.mse_loss(pred, y)
    return loss

# Create a sample (batch_size=2, input_dim=4)
sample = (
    torch.randn(2, 4),
    torch.randn(2, 1)
)

# Get all parameters from the model
params = list(model.parameters())

ARGS = {
    "model": model,
    "loss_fn": loss_fn,
    "sample": sample,
    "params": params
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 1, dtype family float, shape (19,) — shape (19,) 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
sca_solver Ran
ran; our contract draft was wrong, not the code
xuyj233/Direct/direct/selector.py
code served (permissive licence) · get_code("f30c597d52dd40b2")
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 ndarray, ndim 1, dtype family float, shape (5,) 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 numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Define small test dimensions
N = 5  # number of features
I_parallel = 3  # number of parallel components

# Create G matrix: (I_parallel x N)
# This is used to compute p_t = G @ w and c_t = 2.0 * (G.T @ p_t)
G = np.random.randn(I_parallel, N).astype(np.float64)

# Create a vector: length N
# This represents stiff-subspace costs
a = np.random.randn(N).astype(np.float64)

# Target cardinality
K = 3

# Budget on stiff subspace
tau_perp = 2.0

# Warm-start selection weights (optional, can be None)
w0 = np.full(N, K / N, dtype=np.float64)

# Maximum outer SCA iterations
max_iter = 5

# Stopping tolerance
tol = 1e-4

# Inner loop step size
inner_lr = 0.5

# Number of inner PGA steps
inner_iters = 10

# Verbose output
verbose = False

ARGS = {
    "G": G,
    "a": a,
    "K": K,
    "tau_perp": tau_perp,
    "w0": w0,
    "max_iter": max_iter,
    "tol": tol,
    "inner_lr": inner_lr,
    "inner_iters": inner_iters,
    "verbose": verbose,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) 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
select_trainable_params Ran
ran; our contract draft was wrong, not the code
xuyj233/Direct/direct/selector.py
code served (permissive licence) · get_code("2fdec40eae72d4ed")
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) and returned list. The image it ran in was not recorded. If your copy returns the same type 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
from torch import nn

torch.manual_seed(0)

# Create a simple model with trainable and non-trainable parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Linear(3, 2)
        # Make layer2 bias non-trainable
        self.layer2.bias.requires_grad = False
    
    def forward(self, x):
        x = self.layer1(x)
        x = self.layer2(x)
        return x

model = SimpleModel()

# Define a param_filter that selects only parameters with "layer1" in the name
def param_filter(name: str, param: nn.Parameter) -> bool:
    return "layer1" in name

ARGS = {
    "model": model,
    "param_filter": param_filter,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list output has no array shape of its own; none is stated
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
spectral_elbow Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xuyj233/Direct/direct/selector.py
code served (permissive licence) · get_code("0e6870174ea49905")
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) and returned int, ndim 0, dtype family int, 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 numpy as np

# Create a simple descending spectrum of eigenvalues
eigvals = np.array([10.0, 5.0, 2.0, 1.0, 0.5, 0.1], dtype=np.float64)

# Define the arguments dictionary
ARGS = {
    'eigvals': eigvals,
    'energy': 0.945
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
DiReCTConfig Not yet run
unverified (harvested, no recorded run)
xuyj233/Direct/direct/selector.py
code served (permissive licence) · get_code("64e5414f48575498")
How it ran

no invocation recorded.

GaussianSketcher Not yet run
unverified (harvested, no recorded run)
xuyj233/Direct/direct/selector.py
code served (permissive licence) · get_code("7d9cb3b2976d4978")
How it ran

no invocation recorded.

select_samples Not yet run
unverified (harvested, no recorded run)
xuyj233/Direct/direct/selector.py
code served (permissive licence) · get_code("efe3657c483ec21e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 11 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.

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

The annealing phase is a pivotal convergence stage in LLM pre-training that ultimately determines final model quality. However, effectively selecting training data during this phase remains a key challenge. Current strategies rely on empirical heuristics, such as domain filtering or context extension, which lack a principled grounding in optimization theory. In this work, we characterize the annealing phase through the lens of the loss landscape's spectral geometry. We argue that optimal convergence requires gradient updates to satisfy heterogeneous constraints across different eigen-directions. Building on this insight, we formulate data selection as a problem of satisfying these directional constraints. To this end, we propose DiReCT (Directionally-Restrained Constrained Training), a novel framework that reformulates sample selection in the annealing stage as a constrained optimization problem. By imposing explicit directional constraints on persample gradients based on the spectral properties of the Hessian, DiReCT identifies samples that align with the optimal curvature-aware descent path. Extensive experiments across various model scales demonstrate that DiReCT consistently achieves state-of-the-art performance. For future research, code is available at https: //github.com/xuyj233/Direct.

For agents

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

get_harvested_code_for_paper("2605.31175")
get_code_for_paper("2605.31175")
have("2605.31175")

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

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

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

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

Connect an agent — have() is free.