Rayleigh-Jeans Condensing Router
Implementation & benchmark of arXiv:2607.15119 — Thermodynamic theory of voting and EU elections
Source paper: Thermodynamic theory of voting and EU elections arXiv:2607.15119 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace a standard softmax MoE router with a thermodynamic router whose expert occupations maximize entropy subject to a prescribed total routing mass and mean routing energy. At high temperature, traffic is distributed across many experts; as temperature decreases or the energy budget tightens, traffic undergoes a predictable condensation transition in which excess load moves to the lowest-energy expert or expert group. This supplies an explicit control knob for adaptive specialization instead of relying only on unconstrained softmax competition.
Formulas
Mathematical statement
Let K experts have nonnegative occupations n_i, mode energies epsilon_i, total occupation N = sum_i n_i, and energy E = sum_i epsilon_i n_i. Maximizing the classical entropy S = sum_i[(1+n_i) log(1+n_i) - n_i log(n_i)] subject to fixed N and E gives the Rayleigh-Jeans occupation n_i = T/(epsilon_i - mu), where T = 1/beta is temperature and mu is a chemical potential satisfying mu < epsilon_min. If mu reaches the minimum energy epsilon_0, the excited-state capacity is N_ex(T) = sum over i with epsilon_i greater than epsilon_0 of T/(epsilon_i - epsilon_0). Whenever N > N_ex(T), the residual n_0 = N - N_ex(T) is a condensate in the minimum-energy mode. In an MoE batch, n_i is aggregate gate probability sent to expert i, while epsilon_i can be measured latency, recent loss, or a learned specialization cost.
Implementation notes
1. Integration point: insert this router immediately before expert dispatch in a sparse MoE layer. For a batch of B tokens, compute ordinary router logits a_bi, convert them to soft assignments r_bi = softmax_i(a_b), and define batch occupations n_hat_i = sum_b r_bi. Define each expert energy as epsilon_i = c_latency times normalized measured latency_i plus c_loss times EMA(expert loss_i) minus c_utility times EMA(expert utility_i); normalize all components across experts. 2. Pseudocode: initialize T and mu below min(epsilon). On each batch, estimate n_hat, solve sum_i T/(epsilon_i - mu) = N and sum_i epsilon_i T/(epsilon_i - mu) = E_star using bisection or Newton iterations, and form n_RJ. Add the KL, energy, and mass penalties to the task loss. For dispatch, use adjusted logits a_prime_bi = a_bi + log(n_RJ_i + small_constant) - log(n_hat_i + small_constant), then apply top-1 or top-2 routing. Anneal T only after experts have learned distinct functions. 3. Computed directly from the mechanism: the Rayleigh-Jeans target, chemical-potential solve, and critical excited capacity. Estimated empirically: expert energies, occupations, and task-loss response. 4. First cheap experiment: train a 4- or 8-expert top-2 MLP-MoE on CIFAR-100 or a small language-model corpus, comparing standard softmax routing, Switch load balancing, and this router. Sweep T and E_star. Fit observed occupations to T/(epsilon_i - mu) and measure condensate fraction. The quantitative prediction is that when N crosses N_ex(T), the minimum-energy expert's load exhibits a sharp increase while the remaining loads follow approximately 1/(epsilon_i - epsilon_0). The measured transition should be within 20 percent of the numerically solved threshold. Also measure whether controlled condensation reduces communication and routing entropy without increasing validation loss.
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.