home

A language model made of waves

June 15, 2026

I trained a 548M-parameter masked diffusion language model in which the three places a discrete model touches its tokens are all replaced by wave mechanics. Tokens are unit-magnitude wave packets. Forward diffusion is phase decoherence. The sequence mixer is an attention-free split-step integrator of a Schrödinger equation. Everything else (the MDLM objective, the sampler, the evaluation protocol) is standard, so anything that differs from a transformer baseline is attributable to the substrate rather than to the training setup.

The weights are on Hugging Face, with an interactive demo that visualises the wavefield as it denoises.

It writes fluent, on-topic English. It is not a knowledge oracle; it rambles and it is not factually reliable. The interesting part is not the samples, it is a negative result about the piece of the model I was least willing to give up.

Tokens as phasors

Every vocabulary item vv owns a learned phase vector Φ[v]Rm\Phi[v] \in \mathbb{R}^m, initialised uniform on (π,π](-\pi, \pi]. Its clean packet is the unit phasor

e(v)=exp(iΦ[v])Cme(v) = \exp\big(i\,\Phi[v]\big) \in \mathbb{C}^m

so every token has identical componentwise magnitude, e(v)j=1|e(v)_j| = 1, and identity lives entirely in phase. Magnitude is deliberately left free: it becomes the carrier of corruption.

Diffusion as decoherence

The forward process jitters phases with a log-linear noise scale θ(t)=0.05120t\theta(t) = 0.05 \cdot 120^{\,t}:

ψt(v)=exp(i(Φ[v]+θ(t)ω)),ωN(0,Im)\psi_t(v) = \exp\big(i(\Phi[v] + \theta(t)\,\omega)\big), \qquad \omega \sim \mathcal{N}(0, I_m)

Each component stays on the unit circle, but its expectation contracts. The Gaussian characteristic function gives the whole story in one line:

Eω ⁣[ei(ϕ+θωj)]=eiϕE ⁣[eiθωj]=eiϕeθ2/2\mathbb{E}_{\omega}\!\left[e^{i(\phi + \theta\omega_j)}\right] = e^{i\phi}\,\mathbb{E}\!\left[e^{i\theta\omega_j}\right] = e^{i\phi}\,e^{-\theta^{2}/2}

Phase information is scrambled, and the degree of scrambling is recorded in the expected magnitude, the textbook signature of decoherence. That envelope eθ2/2e^{-\theta^2/2} is what the schedule is really doing:

θ = 110.5000.631diffusion time tcoherence
Expected phasor magnitude against diffusion time, plotted from the closed form, with no measurements involved. Coherence sits near 1 for the first two-thirds of the schedule, then falls off a cliff. By θ5.9\theta \ge 5.9 the factor is numerically zero.

This is where the framing earns something. In ordinary discrete diffusion the absorbing [MASK] state is a reserved extra symbol with a learned embedding. Here it is not reserved at all: it is the θ\theta \to \infty limit of a continuous physical corruption, reached along a path of partially coherent states, and the mask embedding is forced to be the zero vector rather than learned.

The mixer

The denoiser sees LL corrupted packets and predicts clean ones at every position. Its blocks contain no attention. Each one advances itψ=(K+V)ψi\,\partial_t \psi = (K + V)\psi by a single first-order Lie–Trotter split step: apply the kinetic factor, then the potential factor, each exactly, eating the usual error in their commutator.

The kinetic step is diagonal in the sequence-frequency domain, which is what makes it cheap:

ψ    F1 ⁣[eiωc(k)Fψ],ωc(k)=a1k+a2k2+a3k3\psi \;\leftarrow\; \mathcal{F}^{-1}\!\Big[e^{-i\,\omega_c(k)}\,\mathcal{F}\psi\Big], \qquad \omega_c(k) = a_1 k + a_2 k^2 + a_3 k^3

with k=2πfftfreq(L)k = 2\pi\,\mathrm{fftfreq}(L) and (a1,a2,a3)(a_1, a_2, a_3) learned per complex channel: an advection term, a free-particle term, and an Airy term. Because eiωc(k)=1|e^{-i\omega_c(k)}| = 1 this step is exactly unitary: an all-pass filter that can translate, spread and skew packets along the sequence but cannot create or destroy signal energy. The potential step is content-dependent, and is where energy is allowed to leave:

z    zexp(iVrsoftplus(Vi)),[Vr,Vi]=MLP([Rez;Imz])z \;\leftarrow\; z \odot \exp\big(-i\,V_r - \mathrm{softplus}(V_i)\big), \qquad [V_r, V_i] = \mathrm{MLP}([\mathrm{Re}\,z; \mathrm{Im}\,z])

a unitary rotation by VrV_r plus a strictly contractive absorbing term, since softplus(Vi)>0\mathrm{softplus}(V_i) > 0 means magnitudes can only shrink.

Here is the kinetic step, running. This is not a video of a simulation; it is the same three lines the mixer executes, in your browser: FFT along the sequence, multiply by the phase plate eiωc(k)dte^{-i\omega_c(k)\,\mathrm{d}t}, inverse FFT. Hue is phase and brightness is amplitude, so the fringes where the two packets overlap are literal interference, and the white trace is the amplitude the Born readout would see.

Drag the coefficients. a1a_1 translates a packet without changing its shape. a2a_2 is the free-particle term, so it spreads. a3a_3 skews the packet into the Airy tail. Every setting conserves total energy exactly, because the multiplier has modulus one. The waterfall below the live band is the sequence's history running downward; it reseeds every few seconds so the collision replays.

Watch what the amplitude trace does when the two packets cross: it goes flat and featureless at exactly the moment the hue banding is richest. All of the structure is in phase, and a magnitude-only readout sees none of it. That turns out to be the whole story.

ψ(t)L × ℂᵐ× 24 blocksFFTdispersione^(−iω(k))unitaryIFFTpotentialrotate +absorblinear headW[Re ψ; Im ψ]O(L log L) per layer · no attentionand an FFN after each block, 4× expansion
One forward pass. Mixing costs O(LlogL)O(L\log L) per layer against attention's O(L2)O(L^2), which puts the model in the family of spectral token mixers, but with a complex state and a dispersion step that is unitary by construction rather than a learned real spectral gate.

The readout, not the dynamics

The first matched comparisons had the wave model trailing a parameter-matched transformer MDLM by roughly half a bit, and I spent a while assuming the wave dynamics were the problem. They weren't.

The denoiser exposes a complex field ψ^Cm\hat\psi \in \mathbb{C}^m per position, and the physics-native way to turn that into token probabilities is the Born rule. Score each token by intensity against its clean packet, I(v)=e(v),ψ^2I(v) = |\langle e(v), \hat\psi\rangle|^2, and take the logit as τlog(I(v)/m+ϵ)+bv\tau\log(I(v)/m + \epsilon) + b_v. At τ=1\tau = 1, b=0b = 0, ϵ0\epsilon \to 0 the softmax collapses to exactly

softmaxv(logI(v))=I(v)wI(w)\mathrm{softmax}_v\big(\log I(v)\big) = \frac{I(v)}{\sum_{w} I(w)}

token probabilities as relative measurement intensities. It is the most satisfying part of the design, and it was costing real bits.

Swapping it for an ordinary linear head on both quadratures, =W[Reψ^;Imψ^]+b\ell = W[\mathrm{Re}\,\hat\psi; \mathrm{Im}\,\hat\psi] + b, with identical wave dynamics and identical training, moves the model ahead of the transformer. But that comparison is capacity-confounded: the full linear head carries 2mV2mV parameters where the codebook-tied Born head carries mVmV. So the load-bearing control is a bottleneck linear head, rank K=819K = 819, sized to match the Born head exactly:

readoutparamsbits/token
transformer MDLM (baseline)56.9M5.689
log-Bornn/a6.150
bottleneck linear, K=819K=819matched to Born5.756
full linear73.2M5.625
MLP head77.4M5.738

text8, BPE-8192, 20k steps, mean of two seeds. Masked-LM bits/token, a conditional slice, not a likelihood.

+0.394 bits at matched parameters. The gap is the functional form of the measurement, not head capacity.

A second control sharpens it. The MLP head at 77.4M does not improve on the full linear head at 73.2M, so nonlinearity buys nothing: the information the Born rule was throwing away is linearly accessible in ψ^\hat\psi. It was being projected out three ways: phase collapse (the modulus keeps only the magnitude of each inner product), a rank-one PSD constraint (each token scored through Mv=e(v)e(v)HM_v = e(v)e(v)^{\mathsf{H}}), and norm invariance (the Born softmax is invariant to global rescaling of ψ^\hat\psi, deleting a degree of freedom outright).

Born-rule readouts have been advocated for language models on physical grounds. At matched capacity, in this setting, that motivation cost 0.394 bits over an ordinary linear map of the same size.

Which property of the mixer actually matters

The symmetric question is whether the Schrödinger form is doing the work. Mostly it isn't. What matters is structured complex spectral mixing:

mixer4.9M bits/char57M bits/token
schrod2d (split-step)0.8935.626
feyn2 (structured complex, non-Schrödinger)0.872n/a
schrodfree (free complex spectral gain)1.1416.139
AFNO-style real spectral gate1.2136.109

feyn2 is a structured complex mixer that is not a Schrödinger discretisation, and at char scale it slightly beats the split-step mixer. Removing unitarity or removing complex phase both degrade substantially. So the Schrödinger story is a good source of structure, not a necessary one.

The constraint matters more with scale, which was the surprise. At 57M, removing unitarity costs +0.51 bits despite schrodfree carrying slightly more parameters (58.4M vs 56.9M), roughly twice the char-scale gap. Complex arithmetic alone confers no advantage; the constrained unitary dispersion is what earns the bits, at the scale where the headline comparisons live.

The 548M model

Trained on 9.99B tokens of FineWeb-Edu, sequence length 512, one RTX-5090-week.

metricvalue
generative NELBO5.67 bits/token (±0.05)
conditional masked-LM~3.13 bits/token

The NELBO is the load-bearing number: a proper any-order marginal-likelihood upper bound, computed with two independent MD4 estimators that agree to 0.005 bits, so schedule-invariance holds and the bound is well-estimated. The conditional number is fill-in-the-blank quality: predict 15%-masked tokens given the other 85% as clean context. It is much lower because it is a much easier task. Both are reported because quoting only the second one would be flattering and wrong.

At equal parameters the linear-head wave model matches the transformer baseline, and the wave arm is actually the smaller of the two: 547.9M against 592.7M.

What it can't do

  • Not factually reliable. It is 548M parameters. It produces plausible prose, not correct facts, and it drifts.
  • Fixed length 512. The dispersion coefficients are learned on the grid k=2πfftfreq(L)k = 2\pi\,\mathrm{fftfreq}(L), which is tied to the training length. This does not transfer across lengths the way attention does, and it is the real structural cost of the approach.
  • Weak precise recall. Strong at distributed, statistical context; weak at sharp associative lookup.
  • A phrase quirk. It over-uses a few stock phrases picked up from the corpus. A model trait, left unsuppressed.

Prior art it leans on: MDLM (Sahoo et al., 2024), D3PM and SEDD for absorbing discrete diffusion, BD3-LMs for block decoding, LLaDA and Dream for diffusion LLMs at scale, and the split-step Fourier method from nonlinear Schrödinger numerics. The weights and demo are on Hugging Face.