Finite-Horizon Random-Reshuffling Optimizer
Implementation & benchmark of arXiv:2606.32005 — Random Reshuffling Dominates Stochastic Gradient Descent
Source paper: Random Reshuffling Dominates Stochastic Gradient Descent arXiv:2606.32005 ⓘ · analyzed Aug 29, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace with-replacement minibatch sampling by random reshuffling: at the start of every epoch, draw one fresh permutation of the dataset and consume each example exactly once. The paper claims that random reshuffling dominates ordinary SGD on smooth convex finite sums after every finite number of epochs for reasonable stepsizes, so this can be tested as a drop-in training-policy change without modifying the model architecture.
Formulas
Mathematical statement
The paper studies the finite-sum objective f(x) = (1/n) sum from i=1 to n of f_i(x), where x is in R^d, n is the number of component losses or data points, and every differentiable component f_i is convex and L_i-smooth. Smoothness means ||grad f_i(x) - grad f_i(y)|| <= L_i ||x-y|| for all x and y. The existence assumption is that x_star minimizes f, with f(x_star) = inf_x f(x). For epoch e, let pi_e be a uniformly random permutation of {1,...,n}. The random-reshuffling update processes each component exactly once: x_(e,k+1) = x_(e,k) - eta grad f_(pi_e(k))(x_(e,k)), for k from 0 to n-1, and the next epoch starts at x_(e+1,0) = x_(e,n). Ordinary SGD instead draws independent indices I_(e,k), uniformly from {1,...,n}, and applies x_(e,k+1) = x_(e,k) - eta grad f_(I_(e,k))(x_(e,k)). The claimed theorem-level property is that random reshuffling dominates SGD after any finite number of epochs under any reasonable stepsize, removing the prior theoretical restriction that eta be proportional to 1/n. The extracted text does not provide the exact dominance inequality or constants, so the first implementation should use the update rule directly and validate the claimed finite-horizon advantage empirically.
Implementation notes
1. Integration point: modify the dataloader or sampler feeding the optimizer, not the neural-network architecture or loss. At the beginning of each epoch, generate a fresh random permutation of all training indices. Partition that permutation into minibatches of size B and perform one update per minibatch. For a fair first test, use identical models, batch sizes, learning-rate schedules, augmentations, and optimizer hyperparameters in the random-reshuffling and baseline conditions. 2. Pseudocode: for epoch in range(E): perm = randperm(N); for ids in chunks(perm,B): loss = mean(loss_i(model(x[i]),y[i]) for i in ids); g = grad(loss,theta); v = beta*v + g; theta = theta - eta*v. Here perm represents pi_e, each per-example loss is f_i, B is minibatch size, eta is the minibatch stepsize, and v is optional momentum. Do not sample replacement indices inside an epoch. 3. The finite-sum objective and smoothness condition come from the paper; no theorem constant is available in the extracted material. If adaptive stepsizes are tested, estimate a local smoothness proxy with gradient-difference probes: L_hat = norm(g(theta+delta)-g(theta))/norm(delta). 4. First cheap experiment: train an MLP on MNIST and ResNet-18 on CIFAR-10, comparing ordinary shuffled minibatch SGD, random-reshuffling minibatches, and random reshuffling with momentum for 5, 20, and 100 epochs over at least five random seeds. Plot training loss, test accuracy, gradient norm, and wall-clock time versus examples processed. A successful result is lower loss or higher accuracy at equal examples processed, particularly during early epochs, while remaining stable at learning rates where ordinary SGD is noisier; additionally test whether random reshuffling avoids any learning-rate reduction proportional to dataset size.
Verification
This idea has not been verified yet.
Verification happens in two stages: Stage 1 — a mechanism check on a toy system confirms the claimed mathematical phenomenon reproduces; Stage 2 — a benchmark implements the idea on a real (small) neural network task and compares it against a tuned baseline over 8 paired seeds with a permutation test.
Artifacts
Artifacts unavailable.