SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2607.16261 · ICML · 2026

Reducing Per-Sample Interference in Stochastic Optimization

Apostolos Avranas

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 1 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/2607.16261.json · badge: /api/ran/2607.16261.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
avranasa/sample-harm-reduction community
Papers with Code archive
3 ran · 1 no recorded run
FunctionStatusWhere it lives
ChambollePock_hinge Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
avranasa/sample-harm-reduction/harm_reduction_core.py
code served (permissive licence) · get_code("f4d84339aa748eb3")
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 tuple. 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
import numpy as np

torch.manual_seed(0)

# Create small positive semi-definite matrices for Q1 and Q2
# Q1 is used in lanczos_extremal and in the optimization
# Q2 is used for the ellipsoid constraint
B = 4

# Create a small SPD matrix Q1 by Q1 = A^T A
A1 = torch.randn(B, B)
Q1 = A1.T @ A1 + 0.1 * torch.eye(B)

# Create a small SPD matrix Q2
A2 = torch.randn(B, B)
Q2 = A2.T @ A2 + 0.1 * torch.eye(B)

# Create linear term q
q = torch.randn(B)

# Set up parameters
max_energy = 10.0
max_w = 5.0
constraint = 'both'
allow_neg_weights = False
warm_start_iter = 0
reg = 0.01
max_iter = 50
tol = 0.001
norm_Q1 = None
use_wandb = False

ARGS = {
    'Q1': Q1,
    'Q2': Q2,
    'q': q,
    'constraint': constraint,
    'max_energy': max_energy,
    'max_w': max_w,
    'allow_neg_weights': allow_neg_weights,
    'warm_start_iter': warm_start_iter,
    'reg': reg,
    'max_iter': max_iter,
    'tol': tol,
    'norm_Q1': norm_Q1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, wandb — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple 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
lanczos_extremal Ran
ran; our contract draft was wrong, not the code
avranasa/sample-harm-reduction/harm_reduction_core.py
code served (permissive licence) · get_code("b9434bf2badd67b8")
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 tuple, ndim 1, 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

torch.manual_seed(0)

# Create a small positive semi-definite matrix (symmetric)
# The function expects q to be a matrix that supports:
# - .shape[0] to get dimension
# - .device and .dtype attributes
# - matrix multiplication with @ operator
# - torch.linalg.eigvalsh() for eigenvalue computation
# Make it small (4x4) and symmetric positive semi-definite

q = torch.randn(4, 4)
q = q @ q.T  # Make it symmetric positive semi-definite

ARGS = {
    "q": q,
    "use_wandb": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, wandb — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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
projection_ellipsoid_box Ran
ran; our contract draft was wrong, not the code
avranasa/sample-harm-reduction/harm_reduction_core.py
code served (permissive licence) · get_code("37af1265b7c51d38")
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 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 torch
import numpy as np

torch.manual_seed(0)

# x0: a tensor that will be clamped and used in dot product
x0 = torch.randn(4)

# Q: a matrix that will be multiplied with x (used as Q @ x)
# Should be square matrix compatible with x dimensions
Q = torch.randn(4, 4)

# max_r: a scalar threshold for the ellipsoid constraint
max_r = torch.tensor(2.0)

# a: lower bound for clamping (or None)
a = torch.tensor([-1.0, -1.0, -1.0, -1.0])

# b: upper bound for clamping (or None)
b = torch.tensor([1.0, 1.0, 1.0, 1.0])

ARGS = {
    "x0": x0,
    "Q": Q,
    "max_r": max_r,
    "a": a,
    "b": b,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 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
get_sample_scales Not yet run
unverified (harvested, no recorded run)
avranasa/sample-harm-reduction/harm_reduction_core.py
code served (permissive licence) · get_code("c89422e149175f12")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 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 4 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

Modern optimizers combine gradients from the current mini-batch with historical optimization state, such as momentum or adaptive moments. While effective, this standard practice can produce parameter updates that actively increase the loss of individual samples. We term this phenomenon per-sample interference and propose redefining the parameter update as an optimization problem that explicitly minimizes it. Because the exact formulation of the problem is computationally prohibitive, we introduce a highly efficient surrogate. By reducing the problem's dimensionality to the batch size and restricting the optimization to the last linear layer, we overcome memory and speed bottlenecks. This strategy hinges on our unexpected finding that this layer alone can reliably capture core secondorder statistics of the full network. The resulting surrogate problem integrates readily into standard optimizers like SGD and AdamW, and can be solved using a small number of GPU-friendly iterations. Crucially, the method exhibits favorable scaling properties, as the relative computational overhead shrinks as the model size or input grows. Experiments on image classification benchmarks confirm reduced per-sample interference and improved generalization. We open-source our associated code. 1

For agents

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

get_harvested_code_for_paper("2607.16261")
get_code_for_paper("2607.16261")
have("2607.16261")

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

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

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

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

Connect an agent — have() is free.