Thermodynamic Two-State Expert Gate
Implementation & benchmark of arXiv:2607.08957 — Structural Origin of Water Heat Capacity Anomaly from Classical and Quantum Simulations
Source paper: Structural Origin of Water Heat Capacity Anomaly from Classical and Quantum Simulations arXiv:2607.08957 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Add a slow latent two-state gate to a recurrent, state-space, or world-model network so that separate experts represent two qualitatively different dynamical regimes. Train the gate using the paper's two-state population and fluctuation mechanism rather than allowing an unconstrained softmax to average incompatible regimes. The model should allocate extra capacity near the gate's susceptibility peak, where regime uncertainty and forecast variance are predicted to be largest.
Formulas
Mathematical statement
Let $q_t$ be a learned scalar structural coordinate computed from hidden state $h_t$, $z_t\in\{0,1\}$ the latent regime, and $p_t=\Pr(z_t=1\mid q_t)=\sigma((q_t-q_0)/\tau)$ the two-state population, where $q_0$ is the midpoint and $\tau>0$ is the softness or temperature parameter. For state energies $G_0$ and $G_1$, the equilibrium population is $p=1/(1+\exp(\Delta G/(k_B T)))$, with $\Delta G=G_1-G_0$. The two-state contribution to the variance of an observable with state-dependent values $Y_0,Y_1$ is $\operatorname{Var}(Y)_{\rm mix}=p(1-p)(Y_1-Y_0)^2$. The corresponding susceptibility of the structural coordinate is $\chi_q=\partial p/\partial b=p(1-p)/\tau$ when $b$ is an additive gate bias. This peaks at $p=1/2$, giving a sharp, measurable transition signature. Use two expert transitions $f_0,f_1$ and predict $\hat h_{t+1}=(1-p_t)f_0(h_t,x_t)+p_tf_1(h_t,x_t)$, while regularizing the gate toward calibrated two-state behavior and penalizing rapid gate changes.
Implementation notes
1. Integration point: insert the module after the hidden state of a GRU, S4/SSM, transformer world model, or recurrent dynamics predictor. Compute a scalar $q_t$ with a linear projection or a two-layer MLP, maintain two expert transition heads $f_0$ and $f_1$, and combine their outputs with the scalar gate $p_t$. For sequence prediction, use the same gate for a short block of $K$ steps or add a penalty on changes in $p_t$ so the regime is slower than token-level noise. 2. Pseudocode: compute q = q_net(h,x); compute p = sigmoid((q-q0+b)/tau); compute h0=f0(h,x) and h1=f1(h,x); set h_next=(1-p)*h0+p*h1; add the task loss, lambda_smooth*(p_next-p)**2, and a separation term that prevents both experts from becoming identical. Estimate pseudo-labels z_t by fitting a two-component Gaussian mixture to detached q_t values, or omit the calibration term initially. 3. Computed from the paper: the two-state mixture variance $p(1-p)$, the susceptibility peak at $p=1/2$, and the interpretation of excess fluctuations as regime interconversion. Estimated empirically: $q$, $q_0$, $\tau$, expert outputs, and transition labels. Fit $q_0$ to the median of the training gate logits and initialize $\tau$ from their interquartile range. 4. First cheap experiment: train a GRU world model on a synthetic switching linear dynamical system with two transition matrices, plus a small Lorenz-system dataset whose parameters switch between two regimes. Compare a single GRU, an unconstrained MoE, and this gate at equal parameter count. Sweep an externally supplied interpolation parameter controlling the regime mixture. The quantitative prediction is that forecast residual variance and gate susceptibility $\operatorname{Var}(p)/\tau$ peak near the balanced mixture $p\approx0.5$, with the peak location predicted by fitted $q_0$ within 20%; away from that point, the two-state model should reduce long-horizon error and gate autocorrelation should decay more slowly than token noise.
Verification
Stage 1 · Toy mechanism gate: Failed ✗
Stage 2 · Mechanism transferred to benchmark: Not tested
Stage 2 · Practical benchmark result: Not run
Methodology: Toy-system gate first; the benchmark stage runs only after a pass. How verification works
Stage 1 — Mechanism check agent confidence 9/10
Built a GRU switching-dynamics benchmark with a thermodynamic two-expert gate, smoothness regularization, and CPU fallback after the shared GPU produced a cuDNN allocation error. The numerical check reproduced the mixture-variance and susceptibility peaks at p=0.5, with finite-difference susceptibility 0.67557 versus the bound 0.67568. However, the learned gate stayed near 0.503 with near-zero regime correlation, and forecasting did not improve consistently, so the promised learned-regime effect was not observed.
- Agent confidence
- 9/10
- Baseline
- MSE rho=0.1/0.5/0.9: 0.030829/0.033351/0.036821; parameters: 1401
- Idea
- MSE rho=0.1/0.5/0.9: 0.030626/0.033319/0.036916; parameters: 1443; mean gate approximately 0.503; gate-regime correlation 0.008-0.014; susceptibility peak p=0.5
Limitations: Only a small scalar switching AR system was tested, not Lorenz dynamics, longer-horizon rollouts, an unconstrained MoE control, multiple random seeds, or a calibrated pseudo-label objective. The benchmark used CPU after CUDA/cuDNN failed and the idea model had about 3% more parameters than baseline.
How to run: python3 experiment.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Artifacts
- experiment.py 4.4 KB View Raw
- report.md 1.3 KB View
- results.json 1.3 KB View Raw