SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2202.00089 · 2022

Understanding AdamW through Proximal Methods and Scale-Freeness

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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 6 have no contract verdict; 0 failures of our instrument; 1 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/2202.00089.json · badge: /api/ran/2202.00089.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
zhenxun-zhuang/adamw-scale-free community (classifier label)
classifier basis not recorded on the link
6 ran · 1 no recorded run
FunctionStatusWhere it lives
bucketize Ran
ran on a synthesized input
zhenxun-zhuang/adamw-scale-free/utils/draw_histogram.py
code served (permissive licence) · get_code("e29b981a96aaf1bf")
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 numpy as np

# Construct arguments for bucketize function
data_vector = np.array([0.5, 2.3, 15.7, 0.001, 100.5, 0.1])
bin_power_base = 10.0
min_value = 0.01
max_value = 1000.0

ARGS = {
    "data_vector": data_vector,
    "bin_power_base": bin_power_base,
    "min_value": min_value,
    "max_value": max_value,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
evaluate Ran
ran on a synthesized input
zhenxun-zhuang/adamw-scale-free/src/evaluate.py
code served (permissive licence) · get_code("964c741bcbbd1927")
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 torch.nn as nn

torch.manual_seed(0)

# Create a small neural network
class SmallNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = nn.Linear(4, 8)
        self.fc2 = nn.Linear(8, 3)
    
    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x

# Create test data loader (list of (images, labels) tuples)
test_loader = [
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
]

# Create model
net = SmallNet()

# Create loss criterion
criterion = nn.CrossEntropyLoss(reduction='mean')

# Set device to CPU
device = 'cpu'

# loss_multiplier for testing scale-freeness
loss_multiplier = 1

ARGS = {
    'test_loader': test_loader,
    'net': net,
    'criterion': criterion,
    'device': device,
    'loss_multiplier': loss_multiplier,
}
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 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
heatmap2d Ran
ran on a synthesized input
zhenxun-zhuang/adamw-scale-free/utils/draw_heatmap_tr_curve.py
code served (permissive licence) · get_code("346481e44ee8347d")
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 numpy as np
import tempfile
import os

# Create a temporary directory for figure saving
temp_dir = tempfile.mkdtemp()

# Define the arguments for heatmap2d function
ARGS = {
    'optim_methods': ['SGD', 'Adam', 'RMSprop'],
    'test_errors': {
        'SGD': np.array([[0.15, 0.14, 0.13], [0.16, 0.12, 0.11], [0.17, 0.13, 0.10]]),
        'Adam': np.array([[0.12, 0.11, 0.10], [0.13, 0.09, 0.08], [0.14, 0.10, 0.07]]),
        'RMSprop': np.array([[0.14, 0.13, 0.12], [0.15, 0.11, 0.09], [0.16, 0.12, 0.08]]),
    },
    'xticks': [0.0, 0.0001, 0.001, 0.01, 0.1],
    'yticks': [0.01, 0.1, 1.0, 10.0],
    'heatmap_max_threshold': 0.20,
    'heatmap_min_threshold': 0.07,
    'fig_save_folder': temp_dir,
    'fig_save_name': 'test_heatmap',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy — 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
log_base_n Ran
ran on a synthesized input
zhenxun-zhuang/adamw-scale-free/utils/draw_histogram.py
code served (permissive licence) · get_code("fb14281145ddbe5c")
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 float64, ndim 0, 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 numpy as np

# Analyze the function: log_base_n(number, base)
# The function takes two parameters:
# - number: a value to take logarithm of (must be positive)
# - base: the base for logarithm (must be positive and != 1)
# Both are used with np.log(), so they should be numeric values

# Create valid arguments
number = 100.0  # positive number
base = 10.0     # positive base not equal to 1

ARGS = {
    "number": number,
    "base": base
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
merge_values_all_layers Ran
ran on a synthesized input
zhenxun-zhuang/adamw-scale-free/utils/draw_histogram.py
code served (permissive licence) · get_code("28f358224955fc39")
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 numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create sample data that matches the function's expectations
# The function expects:
# - name_per_layer: list of layer names
# - values_per_layer: list of dicts mapping group names to numpy arrays
# - eta0: a scalar (learning rate or similar)

name_per_layer = [
    'layer1.weight',
    'layer2.batchnorm.weight',  # This will be skipped due to 'batchnorm' check
    'layer3.weight',
]

# Create values_per_layer as a list of dicts
# Each dict maps group names to numpy arrays
values_per_layer = [
    {
        'update': np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]),
        'other': np.array([[0.1, 0.2], [0.3, 0.4]]),
    },
    {
        'update': np.array([[7.0, 8.0, 9.0]]),
        'other': np.array([[0.5, 0.6]]),
    },
    {
        'update': np.array([[10.0, 11.0, 12.0, 13.0]]),
        'other': np.array([[0.7, 0.8, 0.9]]),
    },
]

eta0 = 0.01

ARGS = {
    'name_per_layer': name_per_layer,
    'values_per_layer': values_per_layer,
    'eta0': eta0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
resnet Ran
ran on a synthesized input
zhenxun-zhuang/adamw-scale-free/src/resnet.py
code served (permissive licence) · get_code("15a456958afd748a")
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
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "depth": 20,
    "num_classes": 10,
    "no_batch_norm": False,
}
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
data_loader Not yet run
unverified (harvested, no recorded run)
zhenxun-zhuang/adamw-scale-free/src/data_loader.py
code served (permissive licence) · get_code("1509587e8398121b")
How it ran

no invocation recorded.

Also present in other papers' code

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

Adam has been widely adopted for training deep neural networks due to less hyperparameter tuning and remarkable performance. To improve generalization, Adam is typically used in tandem with a squared $\ell_2$ regularizer (referred to as Adam-$\ell_2$). However, even better performance can be obtained with AdamW, which decouples the gradient of the regularizer from the update rule of Adam-$\ell_2$. Yet, we are still lacking a complete explanation of the advantages of AdamW. In this paper, we tackle this question from both an optimization and an empirical point of view. First, we show how to re-interpret AdamW as an approximation of a proximal gradient method, which takes advantage of the closed-form proximal mapping of the regularizer instead of only utilizing its gradient information as in Adam-$\ell_2$. Next, we consider the property of "scale-freeness" enjoyed by AdamW and by its proximal counterpart: their updates are invariant to component-wise rescaling of the gradients. We provide empirical evidence across a wide range of deep learning experiments showing a correlation between the problems in which AdamW exhibits an advantage over Adam-$\ell_2$ and the degree to which we expect the gradients of the network to exhibit multiple scales, thus motivating the hypothesis that the advantage of AdamW could be due to the scale-free updates.

For agents

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

get_harvested_code_for_paper("2202.00089")
get_code_for_paper("2202.00089")
have("2202.00089")

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

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

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

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

Connect an agent — have() is free.