SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.05988 · NeurIPS · 2020

Random Reshuffling: Simple Analysis with Vast Improvements

Peter Richtárik, Konstantin Mishchenko, Ahmed Khaled

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; 2 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 0 failures of our instrument; 1 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/2006.05988.json · badge: /api/ran/2006.05988.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
konstmish/random_reshuffling canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
get_dataset Ran
ran on a synthesized input
konstmish/random_reshuffling/datasets/utils.py
code served (permissive licence) · get_code("93a358c02b10d447")
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
import sklearn
from sklearn.datasets import load_svmlight_file
from scipy.sparse import csr_matrix
import tempfile
import os

# Create a temporary directory for mock dataset files
tmpdir = tempfile.mkdtemp()

# Create mock svmlight format files for datasets that need them
def create_mock_svmlight_file(filepath, n_samples=10, n_features=5):
    """Create a simple mock svmlight file"""
    with open(filepath, 'w') as f:
        for i in range(n_samples):
            label = i % 2
            features = ' '.join([f"{j}:{i*j % 10}" for j in range(1, n_features+1)])
            f.write(f"{label} {features}\n")

# Create mock dataset files
for dataset_name in ['covtype', 'real-sim', 'webspam', 'mushrooms', 'gisette', 'w8a', 'YearPredictionMSD']:
    if dataset_name in ['covtype', 'real-sim', 'webspam', 'YearPredictionMSD']:
        filepath = os.path.join(tmpdir, dataset_name + '.bz2')
    else:
        filepath = os.path.join(tmpdir, dataset_name)
    
    # For bz2 files, create uncompressed version and we'll handle it
    if filepath.endswith('.bz2'):
        base_filepath = filepath[:-4]
        create_mock_svmlight_file(base_filepath, n_samples=10, n_features=5)
        # For this test, we'll just use the uncompressed version
        # In reality bz2 would be used, but we avoid compression complexity
    else:
        create_mock_svmlight_file(filepath, n_samples=10, n_features=5)

ARGS = {
    'dataset': 'mushrooms',
    'data_path': tmpdir + '/'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — 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
logsig Ran
ran, honoured the contract we drafted
konstmish/random_reshuffling/loss_functions/logistic_regression.py
pointer only (licence: MIT); the stored copy get_code serves, from liyipeng00/SFL, is pointer only (licence: NONE) · get_code("fbb68ed59acbdac7")
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 liyipeng00/SFL, 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.

relative_round Ran
ran, honoured the contract we drafted
konstmish/random_reshuffling/utils.py
code served (permissive licence) · get_code("fccd6875c293069d")
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 float, 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 math

def relative_round(x):
    """
    A util that rounds the input to the most significant digits.
    Useful for storing the results as rounding float
    numbers may cause file name ambiguity.
    """
    mantissa, exponent = math.frexp(x)
    return round(mantissa, 3) * 2 ** exponent

# The function takes a single numeric parameter x
# It uses math.frexp() which works on floats
# and returns a rounded float value

ARGS = {
    "x": 3.14159265359
}
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 float, 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
safe_sparse_add Ran
ran on a synthesized input
konstmish/random_reshuffling/loss_functions/utils.py
code served (permissive licence) · get_code("8124a74030b255c0")
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 csr_matrix. 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 scipy
import numpy as np

# Create test sparse and dense arrays
sparse_a = scipy.sparse.csr_matrix(np.array([[1, 0, 2], [0, 3, 0]]))
sparse_b = scipy.sparse.csr_matrix(np.array([[1, 1, 0], [2, 0, 1]]))
dense_a = np.array([[1, 2, 3], [4, 5, 6]])
dense_b = np.array([[1, 1, 1], [1, 1, 1]])

ARGS = {
    "a": sparse_a,
    "b": sparse_b
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type csr_matrix — a csr_matrix output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a csr_matrix 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
safe_sparse_dot Ran
ran on a synthesized input
konstmish/random_reshuffling/loss_functions/utils.py
code served (permissive licence) · get_code("93448d7e10c42b22")
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 scipy
import scipy.sparse
import numpy as np

# Create two sparse matrices for testing
# Create a 2x3 sparse matrix
a_dense = np.array([[1, 2, 3], [4, 5, 6]], dtype=float)
a = scipy.sparse.csr_matrix(a_dense)

# Create a 3x4 sparse matrix
b_dense = np.array([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]], dtype=float)
b = scipy.sparse.csr_matrix(b_dense)

ARGS = {
    "a": a,
    "b": b
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
safe_sparse_multiply Ran
ran on a synthesized input
konstmish/random_reshuffling/loss_functions/utils.py
code served (permissive licence) · get_code("2f70f473d9821025")
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 2, dtype family int, shape (2, 3) 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
import scipy.sparse

# Create test data for safe_sparse_multiply
# The function takes two arguments: a and b
# Both can be either scipy sparse matrices or dense numpy arrays

# Create a small sparse matrix (2x3)
sparse_a = scipy.sparse.csr_matrix(np.array([[1, 0, 2], [0, 3, 0]]))

# Create a small dense array (2x3)
dense_b = np.array([[1, 1, 1], [2, 2, 2]])

ARGS = {
    "a": sparse_a,
    "b": dense_b,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (2, 3) — shape (2, 3) 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
get_trace Not yet run
unverified (harvested, no recorded run)
konstmish/random_reshuffling/utils.py
code served (permissive licence) · get_code("45ea328b237ba674")
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, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 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
get_trace 1 other paper
1 later
2311.16086 (2023-11)
MAST: Model-Agnostic Sparsified Training
logsig 1 other paper
1 later
2311.03154 (2023-11)
Convergence Analysis of Sequential Federated Learning on Heterogeneous Data
relative_round 1 other paper
1 later
2311.16086 (2023-11)
MAST: Model-Agnostic Sparsified Training

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

Random Reshuffling (RR) is an algorithm for minimizing finite-sum functions that utilizes iterative gradient descent steps in conjunction with data reshuffling. Often contrasted with its sibling Stochastic Gradient Descent (SGD), RR is usually faster in practice and enjoys significant popularity in convex and non-convex optimization. The convergence rate of RR has attracted substantial attention recently and, for strongly convex and smooth functions, it was shown to converge faster than SGD if 1) the stepsize is small, 2) the gradients are bounded, and 3) the number of epochs is large. We remove these 3 assumptions, improve the dependence on the condition number from κ 2 to κ (resp. from κ to √ κ) and, in addition, show that RR has a different type of variance. We argue through theory and experiments that the new variance type gives an additional justification of the superior performance of RR. To go beyond strong convexity, we present several results for non-strongly convex and non-convex objectives. We show that in all cases, our theory improves upon existing literature. Finally, we prove fast convergence of the Shuffle-Once (SO) algorithm, which shuffles the data only once, at the beginning of the optimization process. Our theory for strongly convex objectives tightly matches the known lower bounds for both RR and SO and substantiates the common practical heuristic of shuffling once or only a few times. As a byproduct of our analysis, we also get new results for the Incremental Gradient algorithm (IG), which does not shuffle the data at all. * (6) Once we have this recursion, it is useful to notice that the scalar product can be decomposed as

For agents

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

get_harvested_code_for_paper("2006.05988")
get_code_for_paper("2006.05988")
have("2006.05988")

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

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

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

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

Connect an agent — have() is free.