SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.02913 · ICML · 2023

Decentralized SGD and Average-direction SAM are Asymptotically Equivalent

Fengxiang He, Dacheng Tao, Tongtian Zhu, Mingli Song, Kaixuan Chen

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 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 4 have no contract verdict; 4 failures of our instrument; 2 no recorded run), measured 2026-11-24; 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/2306.02913.json · badge: /api/ran/2306.02913.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
raiden-zhu/icml-2023-dsgd-and-sam canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
alexnet Ran
ran on a synthesized input
raiden-zhu/icml-2023-dsgd-and-sam/networks/alexnet_micro.py
code served (permissive licence) · get_code("6f111de3f2e2945d")
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 AlexNet. 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 = {
    'pretrained': False,
    'progress': True,
}
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 AlexNet — a AlexNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AlexNet 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
conv1x1 Ran
ran; our contract draft was wrong, not the code
raiden-zhu/icml-2023-dsgd-and-sam/networks/resnet_micro.py
pointer only (licence: MIT); the stored copy get_code serves, from medaitech/scrd4ad, is pointer only (licence: NONE) · get_code("2a80220dabcb742a")
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 medaitech/scrd4ad, 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. A run is recorded.

conv3x3 Ran
ran; our contract draft was wrong, not the code
raiden-zhu/icml-2023-dsgd-and-sam/networks/resnet_micro.py
pointer only (licence: MIT); the stored copy get_code serves, from medaitech/scrd4ad, is pointer only (licence: NONE) · get_code("600ff2c45e0de056")
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 medaitech/scrd4ad, 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. A run is recorded.

densenet121 Ran
ran; our contract draft was wrong, not the code
raiden-zhu/icml-2023-dsgd-and-sam/networks/densenet_micro.py
code served (permissive licence) · get_code("a4f6b58f30dbc12d")
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 DenseNet. 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)

def densenet121(pretrained=False, progress=True, **kwargs):
    """Constructs a DenseNet-121 model.
    
    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
        progress (bool): If True, displays a progress bar while downloading the model
        
    Returns:
        DenseNet: A DenseNet-121 model instance
    """
    model = DenseNet(num_init_features=64, growth_rate=32, block_config=(6, 12, 24, 16),
                     **kwargs)
    if pretrained:
        state_dict = load_state_dict_from_url(model_urls['densenet121'], progress=progress)
        model.load_state_dict(state_dict)
    return model

# Build the arguments for densenet121
ARGS = {
    'pretrained': False,
    'progress': True,
}
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 DenseNet — a DenseNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DenseNet 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
densenet169 Ran
ran; our contract draft was wrong, not the code
raiden-zhu/icml-2023-dsgd-and-sam/networks/densenet_micro.py
code served (permissive licence) · get_code("f25c6f257d317d13")
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 DenseNet. 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)

def densenet169(pretrained=False, progress=True, **kwargs):
    """Constructs a DenseNet-169 model.
    
    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
        progress (bool): If True, displays a progress bar while downloading the model
        **kwargs: Additional arguments passed to DenseNet
    
    Returns:
        DenseNet: A DenseNet-169 model
    """
    # Simplified version for testing
    model = nn.Linear(10, 10)
    return model

ARGS = {
    'pretrained': False,
    'progress': True,
}
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 DenseNet — a DenseNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DenseNet 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
load_tinyimagenet Ran
ran on a synthesized input
raiden-zhu/icml-2023-dsgd-and-sam/datasets/tinyimagenet.py
code served (permissive licence) · get_code("82a52d4726940c97")
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 torch
import numpy as np
import pickle
import tempfile
import os
from PIL import Image
import torchvision.transforms as tfs
from torch.utils.data import DataLoader, Dataset

torch.manual_seed(0)

# Create temporary directory and mock pickle files
temp_dir = tempfile.mkdtemp()
data_dir = os.path.join(temp_dir, 'data', 'tiny-imagenet')
os.makedirs(data_dir, exist_ok=True)

# Create mock training data pickle file
train_data = {
    'data': np.random.randint(0, 256, (4, 64, 64, 3), dtype=np.uint8),
    'targets': np.array([0, 1, 2, 3])
}
with open(os.path.join(data_dir, 'tiny-imagenet_train.pkl'), 'wb') as f:
    pickle.dump(train_data, f)

# Create mock validation data pickle file
val_data = {
    'data': np.random.randint(0, 256, (2, 64, 64, 3), dtype=np.uint8),
    'targets': np.array([0, 1])
}
with open(os.path.join(data_dir, 'tiny-imagenet_val.pkl'), 'wb') as f:
    pickle.dump(val_data, f)

# Mock distribute_dataset function
def distribute_dataset(dataset, split, rank, seed=666):
    return dataset

# Make distribute_dataset available in the scope
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'distribute_dataset', distribute_dataset)

ARGS = {
    'root': os.path.join(temp_dir, 'data'),
    'transforms': None,
    'image_size': 32,
    'train_batch_size': 2,
    'valid_batch_size': 2,
    'distribute': False,
    'split': 1.0,
    'rank': 0,
    'seed': 666
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — 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
smooth Ran
ran on a synthesized input
raiden-zhu/icml-2023-dsgd-and-sam/plots/plot_cifar10_alexnet.py
code served (permissive licence) · get_code("2a1297ced81c35ca")
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 torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - scalars: needs to be indexable (supports [0] and iteration)
# - weight: float parameter
# The function iterates through scalars and performs arithmetic operations

# Create a small list of scalar values to smooth
scalars = [1.0, 2.5, 3.2, 2.8, 4.1]
weight = 0.7

ARGS = {
    "scalars": scalars,
    "weight": weight
}
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 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
smoothing Ran
ran on a synthesized input
raiden-zhu/icml-2023-dsgd-and-sam/plots/plot_cifar10_alexnet.py
code served (permissive licence) · get_code("c6becdc07e1b2c30")
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 ndarray, ndim 1, dtype family float, shape (6,) 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 numpy as np

# Create a small numpy array to smooth
array = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], dtype=float)

# Define width for the smoothing window
width = 3

ARGS = {
    "array": array,
    "width": width
}
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 ndarray, ndim 1, dtype family float, shape (6,) — shape (6,) 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
densenet161 Not yet run
unverified (harvested, no recorded run)
raiden-zhu/icml-2023-dsgd-and-sam/networks/densenet_micro.py
code served (permissive licence) · get_code("634e282335a81f1e")
How it ran

no invocation recorded.

resnet18 Not yet run
unverified (harvested, no recorded run)
raiden-zhu/icml-2023-dsgd-and-sam/networks/resnet_micro.py
code served (permissive licence) · get_code("bae5275b075ccf95")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 3 the same month, 6 later) and 4 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
conv1x1 112 other papers
40 dated earlier, 4 the same month, 66 later, 2 same year, order not determinable · 6 only as an assembly brick
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1806.01531 (2018-06)
Deep Mixture of Experts via Shallow Embedding
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
and 109 more not named here
conv3x3 111 other papers
41 dated earlier, 4 the same month, 64 later, 2 same year, order not determinable · 6 only as an assembly brick
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1806.01531 (2018-06)
Deep Mixture of Experts via Shallow Embedding
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
and 108 more not named here
resnet18 36 other papers
19 dated earlier, 2 the same month, 15 later
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
2002.09564 (2020-02)
Towards Robust and Reproducible Active Learning Using Neural Networks
2003.04297 (2020-03)
Improved Baselines with Momentum Contrastive Learning
and 33 more not named here
densenet121 5 other papers
1 dated earlier, 4 later
2111.13998 (2021-11)
Targeted Supervised Contrastive Learning for Long-Tailed Recognition
2307.07873 (2023-07)
Why Does Little Robustness Help? A Further Step Towards Understanding Adversarial Transferability
2311.06423 (2023-11)
Transferability Bound Theory: Exploring Relationship between Adversarial Transferability and Flatness
and 2 more not named here
densenet161 5 other papers
1 dated earlier, 4 later
2111.13998 (2021-11)
Targeted Supervised Contrastive Learning for Long-Tailed Recognition
2307.07873 (2023-07)
Why Does Little Robustness Help? A Further Step Towards Understanding Adversarial Transferability
2311.06423 (2023-11)
Transferability Bound Theory: Exploring Relationship between Adversarial Transferability and Flatness
and 2 more not named here
densenet169 5 other papers
1 dated earlier, 4 later
2111.13998 (2021-11)
Targeted Supervised Contrastive Learning for Long-Tailed Recognition
2307.07873 (2023-07)
Why Does Little Robustness Help? A Further Step Towards Understanding Adversarial Transferability
2311.06423 (2023-11)
Transferability Bound Theory: Exploring Relationship between Adversarial Transferability and Flatness
and 2 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-24.

Repositories linked to this paper

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

Abstract

Decentralized stochastic gradient descent (D-SGD) allows collaborative learning on massive devices simultaneously without the control of a central server. However, existing theories claim that decentralization invariably undermines generalization. In this paper, we challenge this conventional belief and present a completely new perspective for understanding decentralized learning. We prove that D-SGD implicitly minimizes the loss function of an average-direction sharpnessaware minimization (SAM) algorithm under general non-convex non-β-smooth settings. This surprising asymptotic equivalence reveals an intrinsic regularization-optimization trade-off and three advantages of decentralization: (1) there exists a free uncertainty evaluation mechanism in D-SGD to improve posterior estimation; (2) D-SGD exhibits a gradient smoothing effect; and (3) the sharpness regularization effect of D-SGD does not decrease as total batch size increases, which justifies the potential generalization benefit of D-SGD over centralized SGD (C-SGD) in large-batch scenarios. Experiments support our theory and the code is available at D-SGD and SAM.

For agents

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

get_harvested_code_for_paper("2306.02913")
get_code_for_paper("2306.02913")
have("2306.02913")

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

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

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

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

Connect an agent — have() is free.