EGGROLL: Low-Rank Evolution Strategies for Hyperscale Optimization
This post is a structured English summary of an in-depth Chinese technical analysis of the EGGROLL algorithm (Evolution Guided General Optimization via Low-rank Learning), which extends gradient-free Evolution Strategies (ES) to models with billions of parameters.
Key points
- Problem: Standard ES applies a full-rank Gaussian perturbation
E ∈ R^{m×n}per population member, costing O(mn) memory and compute per member — infeasible for billion-parameter models and large populations. - Core idea: EGGROLL replaces full-rank perturbations with low-rank products. For each member it samples Gaussian matrices
A ∈ R^{m×r}andB ∈ R^{n×r}withr ≪ min(m, n), formingε_i = (1/√r) A_i B_i^T(the 1/√r factor matches the variance of full-rank perturbations). Weights becomeW_i = W + σ ε_i. - Efficiency: Storage and forward-pass cost drop from O(mn) to O(r(m+n)); the perturbed forward pass decomposes as
y = Wx + (σ/√r) A(B^T x). Deterministic RNGs regenerate perturbations from seeds on the fly, eliminating stored noise; batched low-rank adapters let all population members share one base forward pass, delivering up to 100x training throughput gains. - Theory: Although each perturbation is low-rank, averaging over a large population yields high effective rank. The paper proves the low-rank update converges to the full-rank ES update at rate O(1/r) in the rank parameter r; empirically even r=1 performs competitively. Population size N must be large enough (law of large numbers) for the approximation to hold.
- Reinforcement learning: On tabula-rasa RL benchmarks (e.g., continuous control), EGGROLL matches full-rank ES in final reward and convergence while being far cheaper per member; throughput approaches pure batch-inference speed.
- LLM fine-tuning: For reasoning-focused fine-tuning (reward based on final answers), EGGROLL is reported competitive with GRPO, a strong gradient-based RL method, while avoiding gradient estimation issues and offering better stability on outcome-only reward settings.
- Integer-domain pretraining: EGGROLL can stably pretrain nonlinear recurrent language models operating purely on integer datatypes (e.g., int8), where gradients are undefined and backpropagation is impossible.
- HyperscaleES (GitHub,
ESHyperscale/HyperscaleES): official JAX-based implementation, research preview. Core code insrc/hyperscalees/; LLM experiments runnable viapython -m llm_experiments.general_do_evolution; includes a Dockerfile andtests/end_to_end_test.py. - nano-egg: a recommended single-file minimal implementation demonstrating pure-integer (int8) pretraining of a language model with EGGROLL.
- Typical setup: Python ≥ 3.10,
pip install -r requirements.txt; JAX and NumPy are core dependencies, with optionalvllmandtensorboardfor accelerated LLM fine-tuning experiments.
Applications and results
Comparison with other methods
| Property | Full-rank ES | EGGROLL | LoRA-style PEFT | Adam/SGD (PPO etc.) | |---|---|---|---|---| | Perturbation/update | Full-rank E | Low-rank AB^T, aggregated | Trainable low-rank side matrices | Gradient-based | | Storage | O(mn) per member | O(r(m+n)), near-zero via RNG reseeding | Small | Standard optimizer state | | Scope | Small models only | Full-parameter, gradient-free | Parameter-efficient | Requires differentiable loss | | Throughput | Bottlenecked | Up to 100x faster | Fast fine-tuning | Baseline |
Unlike LoRA (which trains small side adapters and freezes weights), EGGROLL updates all parameters using low-rank search directions aggregated into effectively high-rank updates. Compared with PPO/GRPO-style methods, ES avoids credit assignment, is robust to hyperparameters, and suits sparse/outcome-only rewards.
Open-source implementations
Takeaway
EGGROLL unifies high-rank exploration (via population averaging) with low-rank per-member computation, backed by an O(1/r) convergence guarantee. It makes gradient-free optimization practical at hyperscale for RL, LLM fine-tuning, and even non-differentiable integer-only models, positioning ES as a credible alternative to backpropagation in sparse-reward and non-differentiable settings.