SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2408.11804 · 2024

Approaching Deep Learning through the Spectral Dynamics of Weights

arXiv · PDF · Open in the Atlas

Code that ran

9 of 14 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, 1 violated it and 0 have no contract verdict; 7 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/2408.11804.json · badge: /api/ran/2408.11804.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
dyunis/spectral_dynamics canonical (classifier label)
classifier basis: census
9 ran · 5 no recorded run
FunctionStatusWhere it lives
conv2d_input_shapes Ran
ran; our contract draft was wrong, not the code
dyunis/spectral_dynamics/image_classification/model.py
code served (permissive licence) · get_code("49bb1128d25e4dc4")
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 dict. 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)

# Create a simple CNN module with Conv2d layers
class SimpleCNN(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = nn.Conv2d(3, 16, kernel_size=3, padding=1)
        self.conv2 = nn.Conv2d(16, 32, kernel_size=3, padding=1)
        self.conv3 = nn.Conv2d(32, 64, kernel_size=3, padding=1)
    
    def forward(self, x):
        x = self.conv1(x)
        x = self.conv2(x)
        x = self.conv3(x)
        return x

# Create module instance
module = SimpleCNN()

# Create input tensor: batch_size=2, channels=3, height=4, width=5
x = torch.randn(2, 3, 4, 5)

ARGS = {
    "module": module,
    "x": x,
    "key": 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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
evaluate Ran
ran; our contract draft was wrong, not the code
dyunis/spectral_dynamics/language_modeling/evaluate_run.py
code served (permissive licence) · get_code("1aad283571ee906a")
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 defaultdict. 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
from collections import defaultdict

torch.manual_seed(0)

# Define a minimal pl_module that satisfies the function's requirements
class MinimalPLModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def validation_step(self, batch, batch_idx):
        # batch is a tuple of tensors
        x, y = batch
        # Return a dict of outputs with scalar values
        outputs = {
            'loss': torch.tensor(0.5),
            'accuracy': torch.tensor(0.95)
        }
        return outputs
    
    def eval(self):
        super().eval()
    
    def train(self, mode=True):
        super().train(mode)

# Create a minimal dataloader (list of batches)
# Each batch is a tuple of tensors
dataloader = [
    (torch.randn(2, 4), torch.randn(2, 3)),
    (torch.randn(2, 4), torch.randn(2, 3)),
]

# Create the pl_module instance
pl_module = MinimalPLModule()

ARGS = {
    'dataloader': dataloader,
    'pl_module': pl_module
}
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 defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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_and_trim_cp_paths Ran
ran; our contract draft was wrong, not the code
dyunis/spectral_dynamics/language_modeling/make_branches_yaml.py
code served (permissive licence) · get_code("c2e0451207d436cd")
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 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 os
import tempfile
import shutil

# Create a temporary directory with mock checkpoint files
tmpdir = tempfile.mkdtemp()

# Create mock checkpoint files with the expected naming pattern
# Pattern: epoch=X-step=Y.ckpt
checkpoint_names = [
    'epoch=0-step=100.ckpt',
    'epoch=1-step=200.ckpt',
    'epoch=2-step=300.ckpt',
    'epoch=3-step=400.ckpt',
    'epoch=4-step=500.ckpt',
]

for ckpt_name in checkpoint_names:
    ckpt_path = os.path.join(tmpdir, ckpt_name)
    with open(ckpt_path, 'w') as f:
        f.write('')

# Create a config class with the required attributes
class Config:
    def __init__(self, num_even_splits=-1, num_early_splits=-1):
        self.num_even_splits = num_even_splits
        self.num_early_splits = num_early_splits

config = Config(num_even_splits=-1, num_early_splits=-1)

ARGS = {
    'expdir': tmpdir,
    'config': config,
}
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 1, 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
get_svd_dict Ran
ran; our contract draft was wrong, not the code
dyunis/spectral_dynamics/language_modeling/evaluate_lmc.py
code served (permissive licence) · get_code("d6f1b61e8dca7621")
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 dict. 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

torch.manual_seed(0)

# Create a state_dict with parameter tensors of various shapes
state_dict = {
    'param_2d': torch.randn(4, 3),  # 2D tensor (will be SVD'd directly)
    'param_3d': torch.randn(2, 4, 3),  # 3D tensor (will be flattened to 2D)
    'param_4d': torch.randn(2, 2, 4, 3),  # 4D tensor (will be flattened to 2D)
}

# Define which parameters to compute SVD for
param_keys = ['param_2d', 'param_3d', 'param_4d']

ARGS = {
    'state_dict': state_dict,
    'param_keys': param_keys,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
pl_ckpt_path_to_step Ran
ran, honoured the contract we drafted
dyunis/spectral_dynamics/language_modeling/make_branches_yaml.py
code served (permissive licence) · get_code("f284942528713b0e")
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 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 os

def pl_ckpt_path_to_step(ckpt_path):
    root, _ = os.path.splitext(os.path.basename(ckpt_path))
    step = int(root.split('-')[1].split('=')[1])
    return step

# Construct a valid checkpoint path that matches the expected format
# The function expects a path with basename like: "something-step=12345.ckpt"
# It extracts the filename, removes extension, splits by '-', takes [1],
# then splits by '=' and takes [1] to get the step number

ckpt_path = "/some/path/to/model-step=42.ckpt"

ARGS = {
    "ckpt_path": ckpt_path
}
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 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
preprocess_datasets Ran
ran; our contract draft was wrong, not the code
dyunis/spectral_dynamics/language_modeling/dataset.py
code served (permissive licence) · get_code("562e12a2970b7659")
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 Dataset. 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 datasets import Dataset

# Create a minimal tokenizer stand-in
class MinimalTokenizer:
    def __call__(self, texts):
        # Return a dict with 'input_ids' key containing tokenized text
        # Each text becomes a list of token ids
        result = {'input_ids': []}
        for text in texts:
            # Simple tokenization: convert each character to an id
            tokens = [ord(c) % 100 for c in text]
            result['input_ids'].append(tokens)
        return result

# Create sample data with 'text' column
sample_data = {
    'text': [
        'hello world this is a test',
        'another example with some text here',
        'more data for processing and testing',
        'final sample text for the dataset'
    ]
}

# Create a Hugging Face Dataset
dsets = Dataset.from_dict(sample_data)

# Create tokenizer instance
tokenizer = MinimalTokenizer()

# Define chunk size
chunk_size = 8

# Define number of processes
num_proc = 1

ARGS = {
    'dsets': dsets,
    'tokenizer': tokenizer,
    'chunk_size': chunk_size,
    'num_proc': num_proc
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Dataset — a Dataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Dataset output the recorded ndim 1 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
resnet_from_name Ran
ran; our contract draft was wrong, not the code
dyunis/spectral_dynamics/image_classification/model.py
code served (permissive licence) · get_code("3cf65ac55ede7d31")
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 ResNet. 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

torch.manual_seed(0)

# The function resnet_from_name takes:
# - model_name: str (required)
# - initializer: Optional[callable] (default None)
# - outputs: int (default 10)

# For model_name, it must pass valid_model_name check:
# - starts with 'cifar_resnet_'
# - has 3-4 parts when split by '_'
# - parts after 'cifar_resnet_' are positive digits
# - first digit (depth D) satisfies: (D - 2) % 6 == 0 and D > 2
# Valid depths: 8, 14, 20, 26, 32, ...
# Example: 'cifar_resnet_20' (depth 20, width 16 default)
# or 'cifar_resnet_20_32' (depth 20, width 32)

def dummy_initializer(module):
    """Simple initializer function that does nothing"""
    pass

ARGS = {
    'model_name': 'cifar_resnet_20',
    'initializer': dummy_initializer,
    'outputs': 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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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
sv_prune_model_ Ran
ran; our contract draft was wrong, not the code
dyunis/spectral_dynamics/language_modeling/evaluate_run.py
code served (permissive licence) · get_code("421c25a8e350f9cb")
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 SimpleModel. 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
import numpy as np

torch.manual_seed(0)

# Build a minimal model that has named_parameters with 2D+ shapes
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        # Create layers with distinct sizes for different dimensions
        self.linear1 = nn.Linear(4, 3)  # weight shape: (3, 4)
        self.linear2 = nn.Linear(3, 5)  # weight shape: (5, 3)
        self.conv1 = nn.Conv2d(2, 3, kernel_size=2)  # weight shape: (3, 2, 2, 2)
    
    def forward(self, x):
        return x

model = SimpleModel()

ARGS = {
    "model": model,
    "sparsity": 0.5,
    "keep_bottom": False
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
valid_model_name Ran
ran, violated the contract we drafted
dyunis/spectral_dynamics/image_classification/model.py
code served (permissive licence) · get_code("5b1648aecd7770b5")
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 bool, 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

# Analyze the function requirements:
# - model_name must start with 'cifar_resnet_'
# - model_name.split('_') must have length > 2 and < 5 (so 3 or 4 parts)
# - parts [2:5] must all be digits and positive integers
# - (int(model_name.split('_')[2]) - 2) % 6 == 0
# - int(model_name.split('_')[2]) > 2

# Let's work out valid model names:
# Split gives: ['cifar', 'resnet', X, Y, ...]
# We need 3 or 4 parts total, so: ['cifar', 'resnet', X] or ['cifar', 'resnet', X, Y]
# X must be a digit, positive, X > 2, and (X - 2) % 6 == 0
# (X - 2) % 6 == 0 means X - 2 in {0, 6, 12, 18, ...} so X in {2, 8, 14, 20, ...}
# But X > 2, so X in {8, 14, 20, ...}
# If we have 4 parts, Y must also be a digit and positive

# Valid examples:
# 'cifar_resnet_8' (3 parts: ['cifar', 'resnet', '8'])
# 'cifar_resnet_8_1' (4 parts: ['cifar', 'resnet', '8', '1'])
# 'cifar_resnet_14' (3 parts: ['cifar', 'resnet', '14'])
# 'cifar_resnet_14_2' (4 parts: ['cifar', 'resnet', '14', '2'])

# Let's use 'cifar_resnet_8' as it's simple and satisfies all constraints
model_name = 'cifar_resnet_8'

# Verify:
# - starts with 'cifar_resnet_': yes
# - split('_') = ['cifar', 'resnet', '8'], length = 3, 5 > 3 > 2: yes
# - parts [2:5] = ['8'], all digits and positive: yes
# - (8 - 2) % 6 = 6 % 6 = 0: yes
# - 8 > 2: yes

ARGS = {
    'model_name': model_name
}
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 bool, 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
evaluate Not yet run
unverified (harvested, no recorded run)
dyunis/spectral_dynamics/language_modeling/evaluate_lmc.py
code served (permissive licence) · get_code("73f3caf50cec419a")
How it ran

no invocation recorded.

evaluate_lmc Not yet run
unverified (harvested, no recorded run)
dyunis/spectral_dynamics/language_modeling/evaluate_lmc.py
code served (permissive licence) · get_code("2751b3274de1defd")
How it ran

no invocation recorded.

evaluate_run Not yet run
unverified (harvested, no recorded run)
dyunis/spectral_dynamics/language_modeling/evaluate_run.py
code served (permissive licence) · get_code("e9c261f899d592a9")
How it ran

no invocation recorded.

get_dataset Not yet run
unverified (harvested, no recorded run)
dyunis/spectral_dynamics/language_modeling/dataset.py
code served (permissive licence) · get_code("7c9887b6cb835a29")
How it ran

no invocation recorded.

setup_wandb Not yet run
unverified (harvested, no recorded run)
dyunis/spectral_dynamics/language_modeling/config.py
code served (permissive licence) · get_code("2c00218b3148eba4")
How it ran

no invocation recorded.

Also present in other papers' code

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

We propose an empirical approach centered on the spectral dynamics of weights -- the behavior of singular values and vectors during optimization -- to unify and clarify several phenomena in deep learning. We identify a consistent bias in optimization across various experiments, from small-scale ``grokking'' to large-scale tasks like image classification with ConvNets, image generation with UNets, speech recognition with LSTMs, and language modeling with Transformers. We also demonstrate that weight decay enhances this bias beyond its role as a norm regularizer, even in practical systems. Moreover, we show that these spectral dynamics distinguish memorizing networks from generalizing ones, offering a novel perspective on this longstanding conundrum. Additionally, we leverage spectral dynamics to explore the emergence of well-performing sparse subnetworks (lottery tickets) and the structure of the loss surface through linear mode connectivity. Our findings suggest that spectral dynamics provide a coherent framework to better understand the behavior of neural networks across diverse settings.

For agents

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

get_harvested_code_for_paper("2408.11804")
get_code_for_paper("2408.11804")
have("2408.11804")

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

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

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

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

Connect an agent — have() is free.