SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.01472 · 2026

The Newton-Muon Optimizer

Weijie Su, Zhehang Du

arXiv · PDF · Open in the Atlas

Code that ran

12 of 22 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, 0 violated it and 0 have no contract verdict; 10 failures of our instrument; 10 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/2604.01472.json · badge: /api/ran/2604.01472.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
KellerJordan/modded-nanogpt canonical (classifier label)
classifier basis: census
12 ran · 10 no recorded run
FunctionStatusWhere it lives
add_legend Ran
ran; our contract draft was wrong, not the code
KellerJordan/modded-nanogpt/records/track_3_optimization/make_figures.py
code served (permissive licence) · get_code("c3231dd5161304ae")
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 AnchoredOffsetbox. 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 matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from matplotlib.offsetbox import AnchoredOffsetbox, DrawingArea, HPacker, TextArea, VPacker

# Create a figure and axis
fig, ax = plt.subplots()

# Create legend entries with (label, evidence, color) tuples
legend_entries = [
    ("Label 1\nMultiline", "Evidence 1", "blue"),
    ("Very Long Label Text That Should Trigger Different Font Size", "Evidence 2", "red"),
    ("Short", "Evidence 3", "green"),
]

ARGS = {
    "ax": ax,
    "legend_entries": legend_entries,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type AnchoredOffsetbox — a AnchoredOffsetbox output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AnchoredOffsetbox output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
apply_rotary_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
KellerJordan/modded-nanogpt/records/track_1_short/2024-10-09_SOAP/train_gpt2.py
code served (permissive licence) · get_code("e00ba58b92a3a5b0")
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 4, dtype family float, shape (2, 3, 4, 8) 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

torch.manual_seed(0)

# The function expects:
# - x: 4D tensor (ndim == 4)
# - cos: tensor for rotation (used in multiplication with x slices)
# - sin: tensor for rotation (used in multiplication with x slices)

# Create a 4D tensor with shape (batch, seq_len, heads, dim)
# where dim must be even (it's split in half)
batch_size = 2
seq_len = 3
num_heads = 4
embedding_dim = 8  # Must be even

x = torch.randn(batch_size, seq_len, num_heads, embedding_dim)

# cos and sin should be broadcastable with x[..., :d] and x[..., d:]
# where d = embedding_dim // 2 = 4
# They need to work in element-wise operations
d = embedding_dim // 2
cos = torch.ones(batch_size, seq_len, num_heads, d)
sin = torch.ones(batch_size, seq_len, num_heads, d)

ARGS = {
    "x": x,
    "cos": cos,
    "sin": sin,
}
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 4, dtype family float, shape (2, 3, 4, 8) — shape (2, 3, 4, 8) 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
collect Ran
ran; our contract draft was wrong, not the code
KellerJordan/modded-nanogpt/records/track_1_short/2026-05-07_XSAGatedLayers/analyze_sweep.py
code served (permissive licence) · get_code("b5b22bb0a8c0ed23")
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 list, 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 tempfile
import os
from pathlib import Path

# Create a temporary directory with test log files
temp_dir = tempfile.mkdtemp()

# Create sample log files with the expected format
log_content_1 = """
some training output
step:100/200 val_loss:0.5432 train_time:1250ms
step:101/200 val_loss:0.5401 train_time:1260ms
"""

log_content_2 = """
other training output
step:50/100 val_loss:0.7123 train_time:950ms
step:51/100 val_loss:0.7089 train_time:960ms
"""

# Write test log files
Path(os.path.join(temp_dir, "log_1.txt")).write_text(log_content_1)
Path(os.path.join(temp_dir, "log_2.txt")).write_text(log_content_2)

ARGS = {
    "d": temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list 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
format_evidence Ran
ran; our contract draft was wrong, not the code
KellerJordan/modded-nanogpt/records/track_3_optimization/make_figures.py
code served (permissive licence) · get_code("c061af6669e19aa4")
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 str. 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 re

def format_evidence(evidence, steps_to_target):
    evidence = re.sub('[✓✔✅Ⓧ]', '', evidence).strip()
    return re.sub('\\((n=\\d+)\\)', f'in {steps_to_target} steps (\\1)', evidence)

# The function takes:
# 1. evidence: a string that may contain check marks and patterns like "(n=5)"
# 2. steps_to_target: an integer representing the number of steps

ARGS = {
    'evidence': 'The solution is correct ✓ with (n=3) iterations and ✔ verification (n=7) complete',
    'steps_to_target': 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
get_lr Ran
ran, honoured the contract we drafted
KellerJordan/modded-nanogpt/records/track_1_short/2024-10-09_SOAP/train_gpt2.py
code served (permissive licence) · get_code("16290ad6274808ff")
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 float, 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
from dataclasses import dataclass

@dataclass
class Hyperparameters:
    input_bin: str = 'data/fineweb10B/fineweb_train_*.bin'
    input_val_bin: str = 'data/fineweb10B/fineweb_val_*.bin'
    batch_size: int = 8 * 64
    device_batch_size: int = 64
    sequence_length: int = 1024
    num_iterations: int = 6000
    learning_rate: float = 0.0036
    warmup_iters: int = 250
    warmdown_iters: int = 1800
    val_loss_every: int = 125
    val_tokens: int = 10485760
    save_every: int = 0

args = Hyperparameters()

def get_lr(it):
    assert it <= args.num_iterations
    if it < args.warmup_iters:
        return (it + 1) / args.warmup_iters
    elif it < args.num_iterations - args.warmdown_iters:
        return 1.0
    else:
        decay_ratio = (args.num_iterations - it) / args.warmdown_iters
        return decay_ratio

ARGS = {
    'it': 100
}
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 float, 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
norm Ran
ran; our contract draft was wrong, not the code
KellerJordan/modded-nanogpt/records/track_1_short/2024-12-04_ValueEmbed/train_gpt2.py
code served (permissive licence) · get_code("4e63e6195b90a817")
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.functional as F

torch.manual_seed(0)

# The function norm takes a single parameter x
# It calls F.rms_norm(x, (x.size(-1),))
# So x must be a tensor with at least 1 dimension

# Create a small tensor with batch size 2 and feature dimension 4
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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
rmsnorm Ran
ran; our contract draft was wrong, not the code
KellerJordan/modded-nanogpt/records/track_1_short/2024-10-09_SOAP/train_gpt2.py
code served (permissive licence) · get_code("ea051f315b60d0e7")
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

torch.manual_seed(0)

# Create a small tensor with batch size 2 and feature dimension 4
x0 = torch.randn(2, 4)

ARGS = {
    "x0": x0,
    "eps": 1e-06
}
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
score_sequence Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
KellerJordan/modded-nanogpt/evals/hellaswag.py
code served (permissive licence) · get_code("960f9b8115e925ee")
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 int; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.nn as nn
from dataclasses import dataclass
from typing import Callable

torch.manual_seed(0)

@dataclass
class HellaswagTask:
    spans: tuple[tuple[int, int], tuple[int, int], tuple[int, int], tuple[int, int]]
    label: int

@dataclass
class PackedHellaswagSequence:
    inputs: torch.Tensor
    targets: torch.Tensor
    tasks: list
    doc_end_positions: torch.Tensor

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, input_seq, target_seq, seqlens, schedule_cfg, bigram_input_seq):
        batch_size = input_seq.shape[0]
        seq_len = input_seq.shape[1]
        loss_per_token = torch.rand(batch_size, seq_len)
        return loss_per_token

class MockScheduleConfig:
    def __init__(self):
        self.learning_rate = 0.001

def mock_get_bigram_hash(inputs: torch.Tensor) -> torch.Tensor:
    return torch.randint(0, 100, (inputs.shape[0], inputs.shape[1]))

model = MockModel()

schedule_cfg = MockScheduleConfig()

inputs = torch.randint(0, 256, (2, 16))
targets = torch.randint(0, 256, (2, 16))
doc_end_positions = torch.tensor([8, 16])

task1 = HellaswagTask(
    spans=((0, 2), (2, 4), (4, 6), (6, 8)),
    label=1
)
task2 = HellaswagTask(
    spans=((8, 10), (10, 12), (12, 14), (14, 16)),
    label=2
)
tasks = [task1, task2]

sequence = PackedHellaswagSequence(
    inputs=inputs,
    targets=targets,
    tasks=tasks,
    doc_end_positions=doc_end_positions
)

get_bigram_hash = mock_get_bigram_hash

ARGS = {
    "model": model,
    "schedule_cfg": schedule_cfg,
    "sequence": sequence,
    "get_bigram_hash": get_bigram_hash
}
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 tuple, ndim 1, dtype family int — 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
t_lower_p Ran
ran, honoured the contract we drafted
KellerJordan/modded-nanogpt/records/track_1_short/2026-05-07_XSAGatedLayers/analyze_sweep.py
code served (permissive licence) · get_code("644144f36200f8e0")
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 float, 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 math

torch_imported = False
try:
    import torch
    torch_imported = True
except:
    pass

# Analyze the function signature
# def t_lower_p(t, df):
# - t: numeric value (used in arithmetic: t * t, t < 0)
# - df: numeric value (used in arithmetic: df + t*t, df/2, etc.)

# Both parameters are simple numeric scalars used in mathematical operations

ARGS = {
    "t": 2.5,
    "df": 10
}
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 float, 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
welch Ran
ran; our contract draft was wrong, not the code
KellerJordan/modded-nanogpt/records/track_1_short/2026-05-07_XSAGatedLayers/analyze_sweep.py
code served (permissive licence) · get_code("a724304bec537d51")
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 math
import statistics

def t_lower_p(t, df):
    """One-sided P(T <= t) via regularized incomplete beta (no scipy)."""
    x = df / (df + t * t)
    a, b = (df / 2, 0.5)

    def betacf(a, b, x):
        MAXIT, EPS, FPMIN = (200, 3e-07, 1e-30)
        qab, qap, qam = (a + b, a + 1, a - 1)
        c, d = (1, 1 - qab * x / qap)
        if abs(d) < FPMIN:
            d = FPMIN
        d = 1 / d
        h = d
        for m in range(1, MAXIT + 1):
            m2 = 2 * m
            aa = m * (b - m) * x / ((qam + m2) * (a + m2))
            d = 1 + aa * d
            if abs(d) < FPMIN:
                d = FPMIN
            c = 1 + aa / c
            if abs(c) < FPMIN:
                c = FPMIN
            d = 1 / d
            h *= d * c
            aa = -(a + m) * (qab + m) * x / ((a + m2) * (qap + m2))
            d = 1 + aa * d
            if abs(d) < FPMIN:
                d = FPMIN
            c = 1 + aa / c
            if abs(c) < FPMIN:
                c = FPMIN
            d = 1 / d
            del_ = d * c
            h *= del_
            if abs(del_ - 1.0) < EPS:
                break
        return h
    bt = math.exp(math.lgamma(a + b) - math.lgamma(a) - math.lgamma(b) + a * math.log(x) + b * math.log(1 - x))
    if x < (a + 1) / (a + b + 2):
        I = bt * betacf(a, b, x) / a
    else:
        I = 1 - bt * betacf(b, a, 1 - x) / b
    upper_tail = I / 2
    return upper_tail if t < 0 else 1 - upper_tail

def welch(a, b):
    """Welch's t-test of mean(a) < mean(b). Returns (t, df, p_one_sided)."""
    na, nb = (len(a), len(b))
    ma, mb = (statistics.mean(a), statistics.mean(b))
    va, vb = (statistics.variance(a), statistics.variance(b))
    se = math.sqrt(va / na + vb / nb)
    t = (ma - mb) / se
    df = (va / na + vb / nb) ** 2 / ((va / na) ** 2 / (na - 1) + (vb / nb) ** 2 / (nb - 1))
    p = t_lower_p(t, df)
    return (t, df, p)

ARGS = {
    "a": [1.5, 2.3, 3.1, 2.8],
    "b": [4.2, 5.1, 4.9, 5.5]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
zeropower_via_newtonschulz5 Ran
ran; our contract draft was wrong, not the code
KellerJordan/modded-nanogpt/records/track_3_optimization/train_gpt_simple.py
code served (permissive licence) · get_code("f21c15e79f628ed4")
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. 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 torch.nn as nn

torch.manual_seed(0)

# Construct a small tensor for G
# The function expects G.ndim >= 2
# Let's create a 2D tensor with distinct dimensions: 4x3
G = torch.randn(4, 3, dtype=torch.float32)

ARGS = {
    "G": G,
}
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, shape (4, 3) — shape (4, 3) as a later run recorded it
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
zeropower_via_svd Ran
ran; our contract draft was wrong, not the code
KellerJordan/modded-nanogpt/records/track_1_short/2024-10-10_Muon/train_gpt2.py
code served (permissive licence) · get_code("0aa8c57b206bf7e2")
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 (4, 3) 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 calls G.svd(), so G must be a tensor with an svd() method
# svd() returns U, S, V where U @ V.T produces the zero-power result
# We need a matrix that can be SVD decomposed

# Create a small matrix for testing
# Use distinct dimensions: 4x3 matrix
G = torch.randn(4, 3)

ARGS = {
    "G": G,
    "steps": None,
}
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 (4, 3) — shape (4, 3) 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
apply_rotary_emb Not yet run
unverified (harvested, no recorded run)
KellerJordan/modded-nanogpt/records/track_1_short/2024-10-14_ModernArch/train_gpt2.py
code served (permissive licence) · get_code("0f4f2333e89a6c8c")
How it ran

no invocation recorded.

backward Not yet run
unverified (harvested, no recorded run)
KellerJordan/modded-nanogpt/train_gpt_medium.py
code served (permissive licence) · get_code("b144323a9c6e08cd")
How it ran

no invocation recorded.

backward_t Not yet run
unverified (harvested, no recorded run)
KellerJordan/modded-nanogpt/train_gpt.py
code served (permissive licence) · get_code("ada98d810430b292")
How it ran

no invocation recorded.

mm_backward_op Not yet run
unverified (harvested, no recorded run)
KellerJordan/modded-nanogpt/train_gpt_medium.py
code served (permissive licence) · get_code("2a9e445529f71938")
How it ran

no invocation recorded.

mm_op Not yet run
unverified (harvested, no recorded run)
KellerJordan/modded-nanogpt/train_gpt_medium.py
code served (permissive licence) · get_code("05ddce9e4507d60a")
How it ran

no invocation recorded.

mm_t_op Not yet run
unverified (harvested, no recorded run)
KellerJordan/modded-nanogpt/train_gpt.py
pointer only (licence: MIT); the stored copy get_code serves, from Xiaoran-Cheng/muon-randomized-svd, is pointer only (licence: NONE) · get_code("e4294370eb7980a3")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Xiaoran-Cheng/muon-randomized-svd, and GitHub detected no licence in that repository 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.

muon_update Not yet run
unverified (harvested, no recorded run)
KellerJordan/modded-nanogpt/records/track_3_optimization/train_gpt_simple.py
code served (permissive licence) · get_code("e2d7543a51c8ea15")
How it ran

no invocation recorded.

zeropower_via_newtonschulz5 Not yet run
unverified (harvested, no recorded run)
KellerJordan/modded-nanogpt/records/track_1_short/2024-10-10_Muon/train_gpt2.py
code served (permissive licence) · get_code("5728875012ffc26a")
How it ran

no invocation recorded.

zeropower_via_newtonschulz5 Not yet run
unverified (harvested, no recorded run)
KellerJordan/modded-nanogpt/records/track_1_short/2024-10-14_ModernArch/train_gpt2.py
code served (permissive licence) · get_code("063edbb4688922ba")
How it ran

no invocation recorded.

zeropower_via_newtonschulz5 Not yet run
unverified (harvested, no recorded run)
KellerJordan/modded-nanogpt/records/track_1_short/2024-12-04_ValueEmbed/train_gpt2.py
code served (permissive licence) · get_code("52f6a37650968e45")
How it ran

no invocation recorded.

Also present in other papers' code

Of 22 samples lifted from this paper's linked repositories, 22 carry a function identity and 0 do not. Of the 22 distinct functions with an identity, 6 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 3 later) and 16 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
apply_rotary_emb 2 other papers
1 dated earlier, 1 later
2501.06425 (2025-01)
Tensor Product Attention Is All You Need
2605.17109 (2026-05)
DynMuon: A Dynamic Spectral Shaping View of Muon
norm 2 other papers
2 later
2605.17842 (2026-05)
SNLP: Layer-Parallel Inference via Structured Newton Corrections
2606.00761 (2026-06)
Confidence-Adaptive SwiGLU for Mixture-of-Experts
backward 1 other paper
1 dated earlier
2411.16085 (2024-11)
Cautious Optimizers: Improving Training with One Line of Code
mm_backward_op 1 other paper
1 dated earlier
2411.16085 (2024-11)
Cautious Optimizers: Improving Training with One Line of Code
mm_op 1 other paper
1 dated earlier
2411.16085 (2024-11)
Cautious Optimizers: Improving Training with One Line of Code
mm_t_op 1 other paper
1 later
2605.06884 (2026-05)
Muon with Nesterov Momentum: Heavy-Tailed Noise and (Randomized) Inexact Polar Decomposition

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 Muon optimizer has received considerable attention for its strong performance in training large language models, yet the design principle behind its matrix-gradient orthogonalization remains largely elusive. In this paper, we introduce a surrogate model that not only sheds new light on the design of Muon, but more importantly leads to a new optimizer. In the same spirit as the derivation of Newton's method, the surrogate approximates the loss as a quadratic function of the perturbation to a weight matrix W using only three matrices: the gradient G, an output-space curvature matrix H, and the data matrix Z that stacks the layer inputs. By minimizing this surrogate in one step and adopting a certain isotropic assumption on the weights, we obtain the closed-form update rule (up to momentum and weight decay) where η is the learning rate and msgn(X) = U V ⊤ if X = U SV ⊤ is a compact singular value decomposition. This new optimization method, which we refer to as Newton-Muon, shows that standard Muon can be interpreted as an implicit Newton-type method that neglects the right preconditioning induced by the input second moment. Empirically, on a reproduction of the earliest publicly released Modded-NanoGPT speedrun configuration using Muon for GPT-2 pretraining, Newton-Muon reaches the target validation loss in 6% fewer iteration steps and reduces wall-clock training time by about 4%.

For agents

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

get_harvested_code_for_paper("2604.01472")
get_code_for_paper("2604.01472")
have("2604.01472")

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

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

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

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

Connect an agent — have() is free.