SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.15085 · 2026

An Integrable Token-Mixing Layer from the Generalized Yang-Baxter Equation

Snigdha Chandan Khilar

arXiv · PDF · Open in the Atlas

Code that ran

1 of 1 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 1 has no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2606.15085.json · badge: /api/ran/2606.15085.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
nssprogrammer/yb-mixer community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
SpectralYBMixer Ran
ran on a synthesized input
nssprogrammer/yb-mixer/harness/models.py
code served (permissive licence) · get_code("a079b05c980736f0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 16, 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 math
import torch
import torch.nn as nn
import torch.nn.functional as F

class SpectralYBMixer(nn.Module):
    """Bidirectional orthogonal token mixer: per-channel unit-magnitude spectral multiplier.
    multiplier(m, c) = exp( i * phi_c(f_m) )  [+ log-magnitude if not orthogonal],
    with phi_c(f) = sum_k W[c,k] sin(2 pi k f) + V[c,k] (1 - cos(2 pi k f)),  f = m/L.
    """

    def __init__(self, dim, n_basis=24, orthogonal=True, init=0.05):
        super().__init__()
        self.dim, self.n_basis, self.orthogonal = (dim, n_basis, orthogonal)
        self.Wp = nn.Parameter(init * torch.randn(dim, n_basis))
        self.Vp = nn.Parameter(init * torch.randn(dim, n_basis))
        if not orthogonal:
            self.Wm = nn.Parameter(init * torch.randn(dim, n_basis))
            self.Vm = nn.Parameter(init * torch.randn(dim, n_basis))
        self.scale = nn.Parameter(torch.ones(()))
        self.register_buffer('K', torch.arange(1, n_basis + 1).float())

    def _profiles(self, M, L, device, dtype):
        f = torch.arange(M, device=device, dtype=dtype) / L
        ang = 2 * math.pi * self.K.to(dtype)[None, :] * f[:, None]
        s, c = (torch.sin(ang), 1.0 - torch.cos(ang))
        phase = (s @ self.Wp.t().to(dtype) + c @ self.Vp.t().to(dtype)) * self.scale
        if self.orthogonal:
            logmag = torch.zeros_like(phase)
        else:
            logmag = -F.softplus(s @ self.Wm.t().to(dtype) + c @ self.Vm.t().to(dtype))
        return (phase, logmag)

    def forward(self, x):
        B, L, C = x.shape
        with torch.autocast(device_type=x.device.type, enabled=False):
            x32 = x.float()
            Xf = torch.fft.rfft(x32, dim=1)
            M = Xf.shape[1]
            phase, logmag = self._profiles(M, L, x.device, torch.float32)
            mult = torch.exp(torch.complex(logmag, phase))
            Xf = Xf * mult.unsqueeze(0)
            y = torch.fft.irfft(Xf, n=L, dim=1)
        return y.to(x.dtype)


INIT_ARGS = {
    'dim': 4,
    'n_basis': 8,
    'orthogonal': True,
    'init': 0.05,
}

ARGS = {
    'x': torch.randn(2, 16, 4),
}

if __name__ == '__main__':
    mixer = SpectralYBMixer(**INIT_ARGS)
    output = mixer(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output dtype: {output.dtype}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 16, 4) — shape (2, 16, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)

Also present in other papers' code

Of 1 samples lifted from this paper's linked repositories, 1 carry a function identity and 0 do not. Of the 1 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 1 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-23.

Repositories linked to this paper

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

Abstract

We introduce YB-Mixer, a sequence token-mixing layer derived from the free-fermion / generalized Yang-Baxter structure recently used to construct hidden transverse-field Ising models. The design rests on a single transferable principle from integrable systems: a local algebraic constraint on adjacent operations can certify global computational guarantees, independently of the representation. Concretely, the Ising exchange algebra (an extraspecial 2-group relation) certifies (i) a free-fermionic structure that makes the mixer an exactly norm-preserving orthogonal map, and (ii) commuting transfer matrices that make inference order-free and variable-budget ("anytime"). We provide a complete, reproducible empirical pipeline of seven experiments. We verify the generalized Yang-Baxter equation (gYBE) numerically to machine precision; prove and verify that the YBE constraint reduces to a well-conditioned algebraic surrogate, making integrable gates efficiently learnable; build a brick-wall YB-Mixer layer that is exactly norm-preserving and depth-stable (Jacobian condition number = 1 at all depths); verify commuting transfer matrices and the resulting schedule-invariant inference; train an integrable-flow model end-to-end that matches a selfattention baseline on a long-range transport task at ∼ 3.3× fewer parameters; and demonstrate exact order-free, variable-budget inference that attention lacks. We compare against orthogonal RNN, diagonal state-space, attention, and nonlinear-mixer baselines, finding YB-Mixer matches or exceeds the structured baselines on long-range memory at fewer parameters while honestly lagging a nonlinear mixer on content-dependent recall. Finally we show that the length-generalization failure of a local generator is fixed by a spectral (non-local, circulant) generator that remains orthogonal and commuting: trained at L=16 it generalizes to L=64 with roughly flat accuracy. Scaled to ∼ 2.5M parameters across five downstream tasks against properly-tuned baselines (an S4D-Lin/HiPPO SSM, LRU, Transformer, and FNet), the orthogonal spectral mixer is competitive with the strongest baseline-best or tied on three of five tasks at the fewest parameters, reaching 84.8% on sequential-CIFAR (LRA-Image) versus 51-72% for the identically-scaffolded Transformer, LRU, and FNet-and is one of only two mixers that solve long-range token retrieval (Induction Heads) exactly. Code: https://github.com/nssprogrammer/yb-mixer. We turn this pattern into a concrete neural layer, YB-Mixer, and validate every link of the chain numerically. Our contributions are: 1. A verified integrable primitive ( §4.1). We construct the gYBE R-matrix from extraspecial-2-group generators and verify the (d, 6, 3)-gYBE to machine precision.

For agents

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

get_harvested_code_for_paper("2606.15085")
get_code_for_paper("2606.15085")
have("2606.15085")

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

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

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

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

Connect an agent — have() is free.