SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.01029 · ICLR · 2021

Initialization and Regularization of Factorized Neural Layers

Mikhail Khodak, Lester Mackey, Nicolò Fusi, Neil Tenenholtz

arXiv · PDF · Open in the Atlas

Code that ran

2 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 1 failure of our instrument; 2 no recorded run), measured 2026-11-22; 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/2105.01029.json · badge: /api/ran/2105.01029.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
microsoft/fnl_paper canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
akamaster/pytorch_resnet_cifar10 canonical (classifier label)
classifier basis: plan_row
0 ran · 2 no recorded run
FunctionStatusWhere it lives
train Ran
ran, honoured the contract we drafted
microsoft/fnl_paper/pytorch_resnet_cifar10/trainer.py
code served (permissive licence) · get_code("d3cf977044db121a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple, ndim 1, dtype family float; 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
import torch.optim as optim
from collections import namedtuple

torch.manual_seed(0)

# Create a simple args object with required attributes
Args = namedtuple('Args', ['half', 'print_freq'])
args = Args(half=False, print_freq=1)

# Make args globally accessible as the function expects it
import sys
sys.modules[__name__].args = args

# Create a simple model with modules that have 'frobgrad' attribute
class DecomposedLinear(nn.Module):
    def __init__(self, in_features, out_features, rank):
        super().__init__()
        self.U = nn.Parameter(torch.randn(in_features, rank))
        self.VT = nn.Parameter(torch.randn(rank, out_features))
        self.frobgrad = True  # This attribute makes it discoverable by decomposed()
    
    def forward(self, x):
        return x @ self.U @ self.VT

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.decomp1 = DecomposedLinear(4, 3, 2)
        self.relu = nn.ReLU()
        self.decomp2 = DecomposedLinear(3, 5, 2)
    
    def forward(self, x):
        x = x.view(x.size(0), -1)
        x = self.decomp1(x)
        x = self.relu(x)
        x = self.decomp2(x)
        return x
    
    def cuda(self):
        # Override cuda to do nothing (stay on CPU)
        return self

model = SimpleModel()

# Create a simple train loader (list of (input, target) tuples)
train_loader = [
    (torch.randn(2, 4), torch.randint(0, 5, (2,))),
    (torch.randn(2, 4), torch.randint(0, 5, (2,))),
]

# Create criterion
criterion = nn.CrossEntropyLoss()

# Create optimizer
optimizer = optim.SGD(model.parameters(), lr=0.01)

# Epoch number
epoch = 0

# Frobnorms list (empty or with structure matching train_loader)
frobnorms = []

# Normalize (None or with structure matching train_loader)
normalize = None

# Define stub functions that might be called by frobdecay
def frobdecay(model, **kwargs):
    # Stub function that does nothing
    pass

def frobenius_norm(U, VT):
    # Compute Frobenius norm of U @ VT
    return torch.norm(U @ VT, p='fro').item()

# Make these functions available in the module
sys.modules[__name__].frobdecay = frobdecay
sys.modules[__name__].frobenius_norm = frobenius_norm

# Patch torch.Tensor.cuda to return self (stay on CPU)
original_cuda = torch.Tensor.cuda
def cuda_noop(self, *args, **kwargs):
    return self
torch.Tensor.cuda = cuda_noop

ARGS = {
    'train_loader': train_loader,
    'model': model,
    'criterion': criterion,
    'optimizer': optimizer,
    'epoch': epoch,
    'frobnorms': frobnorms,
    'normalize': normalize,
}
Setup block drafted by
a language model, Claude Sonnet 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 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
validate Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/fnl_paper/pytorch_resnet_cifar10/trainer.py
code served (permissive licence) · get_code("3043dac672377c96")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple, ndim 1, dtype family float; 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
import torch.utils.data

torch.manual_seed(0)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super(SimpleModel, self).__init__()
        self.fc = nn.Linear(12, 5)  # 5 classes
    
    def forward(self, x):
        # x shape: (batch, 3, 2, 2) -> flatten to (batch, 12)
        x = x.view(x.size(0), -1)
        return self.fc(x)
    
    def eval(self):
        self.training = False
        return self

model = SimpleModel()

# Create a simple criterion
criterion = nn.CrossEntropyLoss()

# Create a simple dataset and dataloader
class SimpleDataset(torch.utils.data.Dataset):
    def __init__(self):
        self.data = torch.randn(4, 3, 2, 2)  # 4 samples, 3 channels, 2x2
        self.targets = torch.randint(0, 5, (4,))  # 4 samples, 5 classes
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return self.data[idx], self.targets[idx]

dataset = SimpleDataset()
val_loader = torch.utils.data.DataLoader(dataset, batch_size=2, shuffle=False)

# Create args object with necessary attributes
class Args:
    def __init__(self):
        self.half = False
        self.print_freq = 10

args = Args()

ARGS = {
    'val_loader': val_loader,
    'model': model,
    'criterion': criterion
}
Setup block drafted by
a language model, Claude Sonnet 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 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
accuracy Not yet run
unverified (harvested, no recorded run)
akamaster/pytorch_resnet_cifar10/trainer.py
code served (permissive licence) · get_code("f0c9a29156911331")
How it ran

no invocation recorded.

validate Not yet run
unverified (harvested, no recorded run)
akamaster/pytorch_resnet_cifar10/trainer.py
code served (permissive licence) · get_code("abb8eb203bc21b75")
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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 1 later) and 3 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
accuracy 71 other papers
47 dated earlier, 1 the same month, 21 later, 2 same year, order not determinable · 2 only as an assembly brick
1505.05424 (2015-05)
Weight Uncertainty in Neural Networks
1705.07204 (2017-05)
Ensemble Adversarial Training: Attacks and Defenses
1802.10399 (2018-02)
Compressing Neural Networks using the Variational Information Bottleneck
and 68 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

Factorized layers-operations parameterized by products of two or more matrices-occur in a variety of deep learning contexts, including compressed model training, certain types of knowledge distillation, and multi-head selfattention architectures. We study how to initialize and regularize deep nets containing such layers, examining two simple, understudied schemes, spectral initialization and Frobenius decay, for improving their performance. The guiding insight is to design optimization routines for these networks that are as close as possible to that of their well-tuned, non-decomposed counterparts; we back this intuition with an analysis of how the initialization and regularization schemes impact training with gradient descent, drawing on modern attempts to understand the interplay of weight-decay and batch-normalization. Empirically, we highlight the benefits of spectral initialization and Frobenius decay across a variety of settings. In model compression, we show that they enable low-rank methods to significantly outperform both unstructured sparsity and tensor methods on the task of training low-memory residual networks; analogs of the schemes also improve the performance of tensor decomposition techniques. For knowledge distillation, Frobenius decay enables a simple, overcomplete baseline that yields a compact model from over-parameterized training without requiring retraining with or pruning a teacher network. Finally, we show how both schemes applied to multi-head attention lead to improved performance on both translation and unsupervised pre-training.

For agents

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

get_harvested_code_for_paper("2105.01029")
get_code_for_paper("2105.01029")
have("2105.01029")

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

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

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

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

Connect an agent — have() is free.