SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.18106 · 2026

Symmetry-Compatible Principle for Optimizer Design: Embeddings, LM Heads, SwiGLU MLPs, and MoE Routers

Weijie Su, Tim Tsz, Kit Lau

arXiv · PDF · Open in the Atlas

Code that ran

3 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 2 violated it and 1 has no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-24; 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/2605.18106.json · badge: /api/ran/2605.18106.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
timlautk/equivariant_optimizers community
Papers with Code archive
3 ran · 4 no recorded run
FunctionStatusWhere it lives
LeftPolarGradM Ran
ran on a synthesized input · constructed an object; no result was computed
timlautk/equivariant_optimizers/optim/leftpolargrad.py
code served (permissive licence) · get_code("bb62e664b5e49b4d")
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 an instance of its own class, LeftPolarGradM: the run constructed the object and did not call it, so no result was computed. 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
from torch.optim.optimizer import Optimizer

torch.manual_seed(0)

# Create a simple model with parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

# Prepare parameters for the optimizer
params = list(model.parameters())

# Create sample arguments for LeftPolarGradM.__init__
ARGS = {
    'params': params,
    'lr': 0.001,
    'beta': 0.95,
    'alpha': 1.0,
    'eps': 1e-08,
    'weight_decay': 0.0,
    'backend': 'polar_express',
    'num_steps': 5,
    'center_rows': 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 LeftPolarGradM — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LeftPolarGradM 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
is_matrix_param Ran
ran, violated the contract we drafted
timlautk/equivariant_optimizers/optim/leftpolargrad.py
code served (permissive licence) · get_code("6cc1a186129c5d0e")
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 bool, 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 torch

torch.manual_seed(0)

# The function is_matrix_param checks if a tensor has exactly 2 dimensions (ndim == 2)
# We need to provide a torch.Tensor as the parameter 'p'

# Create a 2D tensor (matrix) - this will return True
p = torch.randn(4, 3)

ARGS = {
    "p": p
}
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 bool, 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
symmetrize Ran
ran, violated the contract we drafted
timlautk/equivariant_optimizers/optim/leftpolargrad.py
code served (permissive licence) · get_code("3fba78841d11b568")
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 Tensor, ndim 3, dtype family float, shape (2, 4, 4) 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 torch

torch.manual_seed(0)

# The function takes a tensor A and symmetrizes it by averaging with its transpose
# A should be a 2D or higher-dimensional tensor where the last two dimensions can be transposed
# For a matrix, this creates (A + A^T) / 2

A = torch.randn(2, 4, 4)  # batch size 2, 4x4 matrices

ARGS = {
    "A": A,
}
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 Tensor, ndim 3, dtype family float, shape (2, 4, 4) — shape (2, 4, 4) 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
decoupled_weight_decay_ Not yet run
unverified (harvested, no recorded run)
timlautk/equivariant_optimizers/optim/leftpolargrad.py
code served (permissive licence) · get_code("3609593b5035e8d4")
How it ran

no invocation recorded.

symmetric_matrix_invsqrt Not yet run
unverified (harvested, no recorded run)
timlautk/equivariant_optimizers/optim/leftpolargrad.py
code served (permissive licence) · get_code("178af75ac58ca1ca")
How it ran

no invocation recorded.

symmetric_matrix_invsqrt_newton_schulz Not yet run
unverified (harvested, no recorded run)
timlautk/equivariant_optimizers/optim/leftpolargrad.py
code served (permissive licence) · get_code("8c6c55560efc5af8")
How it ran

no invocation recorded.

symmetric_matrix_invsqrt_polar_express Not yet run
unverified (harvested, no recorded run)
timlautk/equivariant_optimizers/optim/leftpolargrad.py
code served (permissive licence) · get_code("f8fd62b24d872815")
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-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

A striking geometric disparity has long persisted in the practice of deep learning. While modern neural network architectures naturally exhibit rich symmetry and equivariance properties, popular optimization methods, such as Adam and its variants, operate inherently coordinatewise, rendering them unable to respect the equivariance structures of the parameter space. In this paper, we address this disparity by introducing a symmetry-compatible principle for optimizer design. Specifically, we argue that the gradient update rule should be equivariant under the symmetry group acting on the corresponding weight block, and should remove symmetryredundant directions when the parameterization has quotient structure. Following this principle, we first provide a unified perspective on bi-orthogonally equivariant updates for general matrix layers, as employed by stochastic spectral descent, Muon, Scion, and polar gradient methods. More importantly, by moving from orthogonal groups to permutation and shared-shift symmetries, we derive new classes of symmetry-compatible optimizers tailored to parameter blocks whose symmetries differ from those of ordinary matrix layers: for embedding and LM head matrices, leftpermutation and right-orthogonal equivariance leads to one-sided spectral, row-norm, and hybrid row-norm/spectral updates, with projected variants for LM heads; for SwiGLU MLP projections, intermediate-neuron permutation symmetry motivates row-aware and column-aware variants; and for MoE routers, expert-permutation symmetry together with shared-logit-shift invariance gives rise to projected centered row-norm and left-spectral updates. These constructions yield an end-to-end layerwise optimizer stack in which each major matrix-valued parameter class is assigned an update whose equivariance matches its symmetry group. We corroborate this optimizer design principle through extensive pre-training experiments on dense and sparse MoE language models, including Qwen3-0.6B-style, Gemma 3 1B-style, OLMoE-1B-7B-style, and downsized gpt-oss architectures. Across these experiments, symmetry-compatible update rules consistently improve final validation loss, reduce expert load imbalance in sparse MoE models, and in several cases control final vocabulary-logit growth, improve router stability, and overall training stability over the corresponding AdamW updates.

For agents

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

get_harvested_code_for_paper("2605.18106")
get_code_for_paper("2605.18106")
have("2605.18106")

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

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

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

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

Connect an agent — have() is free.