SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2102.08098 · NeurIPS · 2021

GradInit: Learning to Initialize Neural Networks for Stable and Efficient Training

Renkun Ni, Tom Goldstein, Chen Zhu, W Huang, Kezhi Kong, Zheng Xu

arXiv · PDF · Open in the Atlas

Code that ran

7 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 3 failures of our instrument; 6 no recorded run), measured 2026-11-21; 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/2102.08098.json · badge: /api/ran/2102.08098.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
zhuchen03/gradinit canonical (classifier label)
classifier basis: classifier_2025
6 ran · 6 no recorded run
johngull/gradinit community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
Bias Ran
ran on a synthesized input · constructed an object; no result was computed
zhuchen03/gradinit/gradinit_utils.py
pointer only (licence: NONE) · get_code("c0730d167396ae10")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhuchen03/gradinit 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. A run is recorded.

GradInitWrapper Ran
ran on a synthesized input · constructed an object; no result was computed
johngull/gradinit/gradinit/gradinit.py
code served (permissive licence) · get_code("9a7196571771cb7a")
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 an instance of its own class, GradInitWrapper: the run constructed the object and did not call it, so no result was computed. 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 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 small neural network module for testing
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

# Instantiate the model
module = SimpleModel()

# Define the arguments for GradInitWrapper
ARGS = {
    'module': module,
    'reinit_zeros': False,
    'reinit_std': 0.01
}
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 GradInitWrapper — the run constructed an instance of its own class and did not call it; no shape 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
RescaleAdam Ran
ran on a synthesized input · constructed an object; no result was computed
zhuchen03/gradinit/gradinit_utils.py
pointer only (licence: NONE) · get_code("e8c35deac250371a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhuchen03/gradinit 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. A run is recorded.

Scale Ran
ran on a synthesized input · constructed an object; no result was computed
zhuchen03/gradinit/gradinit_utils.py
pointer only (licence: NONE) · get_code("176e910936966ec2")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhuchen03/gradinit 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. A run is recorded.

get_batch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhuchen03/gradinit/gradinit_utils.py
pointer only (licence: NONE) · get_code("c1e69f1ba76b4145")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhuchen03/gradinit 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. A run is recorded.

get_ordered_params Ran
ran; our contract draft was wrong, not the code
zhuchen03/gradinit/gradinit_utils.py
pointer only (licence: NONE) · get_code("c938a8421f145ce5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhuchen03/gradinit 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. A run is recorded.

get_scale_stats Ran
ran; our contract draft was wrong, not the code
zhuchen03/gradinit/gradinit_utils.py
pointer only (licence: NONE) · get_code("c9c2bb7c9e67090d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhuchen03/gradinit 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. A run is recorded.

gradinit Not yet run
unverified (harvested, no recorded run)
zhuchen03/gradinit/gradinit_utils.py
pointer only (licence: NONE) · get_code("3e982e35fd420830")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhuchen03/gradinit 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.

recover_bn_modes Not yet run
unverified (harvested, no recorded run)
zhuchen03/gradinit/gradinit_utils.py
pointer only (licence: NONE) · get_code("452c257d158a624d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhuchen03/gradinit 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.

recover_params Not yet run
unverified (harvested, no recorded run)
zhuchen03/gradinit/gradinit_utils.py
pointer only (licence: NONE) · get_code("956cdc46d424dcb1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhuchen03/gradinit 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.

set_bn_modes Not yet run
unverified (harvested, no recorded run)
zhuchen03/gradinit/gradinit_utils.py
pointer only (licence: NONE) · get_code("11ed5bf89e48f109")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhuchen03/gradinit 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.

set_param Not yet run
unverified (harvested, no recorded run)
zhuchen03/gradinit/gradinit_utils.py
pointer only (licence: NONE) · get_code("1d8faa5c21301dd7")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhuchen03/gradinit 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.

take_opt_step Not yet run
unverified (harvested, no recorded run)
zhuchen03/gradinit/gradinit_utils.py
pointer only (licence: NONE) · get_code("9f608feffea5f5be")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhuchen03/gradinit 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.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 12 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
get_batch
brick of this paper's assembly: sampler
1 other paper
1 later
2203.06345 (2022-03)
The Principle of Diversity: Training Stronger Vision Transformers Calls for Reducing All Levels of Redundancy

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-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Innovations in neural architectures have fostered significant breakthroughs in language modeling and computer vision. Unfortunately, novel architectures often result in challenging hyper-parameter choices and training instability if the network parameters are not properly initialized. A number of architecture-specific initialization schemes have been proposed, but these schemes are not always portable to new architectures. This paper presents GradInit, an automated and architecture agnostic method for initializing neural networks. GradInit is based on a simple heuristic; the norm of each network layer is adjusted so that a single step of SGD or Adam with prescribed hyperparameters results in the smallest possible loss value. This adjustment is done by introducing a scalar multiplier variable in front of each parameter block, and then optimizing these variables using a simple numerical scheme. GradInit accelerates the convergence and test performance of many convolutional architectures, both with or without skip connections, and even without normalization layers. It also improves the stability of the original Transformer architecture for machine translation, enabling training it without learning rate warmup using either Adam or SGD under a wide range of learning rates and momentum coefficients. Code is available at https://github.com/zhuchen03/gradinit.

For agents

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

get_harvested_code_for_paper("2102.08098")
get_code_for_paper("2102.08098")
have("2102.08098")

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

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

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

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

Connect an agent — have() is free.