<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Vishal Verma Labs</title>
    <link>https://vishalvermalabs.com/</link>
    <description>Independent technical articles at the intersection of AI systems, physics, and control theory by Vishal Verma</description>
    <language>en-us</language>
    <lastBuildDate>Wed, 11 Nov 2026 16:03:23 GMT</lastBuildDate>
    <managingEditor>vishal.verma@dehurdle.com (Vishal Verma)</managingEditor>
    <webMaster>vishal.verma@dehurdle.com (Vishal Verma)</webMaster>
    <atom:link href="https://vishalvermalabs.com/rss.xml" rel="self" type="application/rss+xml" />
    <image>
      <url>https://vishalvermalabs.com/social-preview.png</url>
      <title>Vishal Verma Labs</title>
      <link>https://vishalvermalabs.com/</link>
    </image>
    <item>
      <title><![CDATA[Sinkhorn-Aligned Latent Tokens Add Nothing Over Fine-Tuning: A Controlled Negative Result]]></title>
      <link>https://vishalvermalabs.com/papers/empirical-validation-latent-reasoning-sinkhorn/</link>
      <guid>https://vishalvermalabs.com/papers/empirical-validation-latent-reasoning-sinkhorn/</guid>
      <pubDate>Wed, 04 Nov 2026 00:00:00 GMT</pubDate>
      <dc:creator>Vishal Verma</dc:creator>
      <category>AI Architecture & Mathematical Optimization</category>
      <description><![CDATA[We trained K=4 latent pause tokens, refined by a LOTUS loop and aligned to the model's own reasoning with Sinkhorn optimal transport, on DeepSeek-R1-Distill-Qwen-1.5B and scored them on all 1,319 GSM8K test problems. They score 18.4%, against 19.8% for the same fine-tuning with no latent tokens, so the latents add nothing. A diagnosis finds that the four latents collapse into one and mostly re-encode the question rather than any reasoning, and a fix that partly separates them still scores 19.6%.]]></description>
      <content:encoded><![CDATA[### Abstract

Our earlier paper, *Sinkhorn Alignments* [1], proposed replacing a reasoning model's long chain of thought with a few continuous "pause" tokens, refined by a looped computation (LOTUS) and trained with Sinkhorn optimal transport to match the model's own reasoning. This paper tests that proposal on DeepSeek-R1-Distill-Qwen-1.5B [2]: we train $K=4$ latent tokens with $R=4$ loop iterations, score them on all 1,319 GSM8K test problems [3], and compare them with a control trained identically with no latent tokens ($K=0$).

The result is negative. The untrained model answering directly scores 11.22%, and the fine-tuned control scores 19.79%. The $K=4$ latent model scores 18.42%, a paired difference of $-1.36$ points (95% CI $-3.03$ to $+0.23$, exact McNemar $p = 0.12$). Full reasoning reaches 86.88%, at a mean of 2,172 generated tokens.

A diagnosis explains why. The four latents collapse into one: their cosine similarity within a problem is 0.999. They also mostly re-encode the question, identifying their own problem 98.8% of the time when the question's final hidden state alone does so 96.1% of the time. Part of the cause is the alignment loss, whose targets are dominated by a component every state shares and by a few very large channels. Standardising the targets and sharpening the transport plan partly separates the latents (cosine 0.84), but that model scores 19.56%, level with the control ($p = 0.86$).

In both runs the latents never reached even the loss that four identical latents would achieve, so the bottleneck is what the latent pathway can produce from the question alone, not only the loss. Every number here is computed from saved run outputs.

---

## 1. The Question and the Control

An R1-style reasoning model spends most of its inference compute writing out its reasoning. On the GSM8K test set, DeepSeek-R1-Distill-Qwen-1.5B generates a mean of 2,172 tokens per problem and scores 87%. Forced to answer immediately, it generates a median of 5 tokens and scores 11%.

The proposal in [1] is to keep most of that 76-point gap while paying for only a handful of extra positions: insert $K$ learnable latent tokens where the reasoning would go, refine them by looping the network over them, and train them to carry what the written reasoning carried. This builds on pause tokens [4] and continuous-thought training [5].

Training the latent model necessarily fine-tunes the backbone on GSM8K answers, and that fine-tuning helps on its own. A comparison against the untrained model would credit that gain to the latents. Every latent result here is therefore paired with a $K=0$ control: the same LoRA adapters, data, schedule and number of answer-training steps, with no latent positions. The question this paper answers is the paired difference $K=4$ minus $K=0$.

```mermaid
graph TD
    subgraph data["Training Data: GSM8K Train Split"]
        D1["First 2,500 problems"] --> D2["Model's own reasoning traces: 85.52% solved"]
        D2 --> D3["2,136 correct traces kept"]
    end

    subgraph runs["Same LoRA Fine-Tuning: 400 Answer-Training Steps"]
        R0["K=0 control: no latent positions"]
        R4["K=4 latents: Sinkhorn alignment"]
        RS["K=4 latents: standardised targets"]
    end

    subgraph test["Same 1,319 GSM8K Test Problems"]
        P["Paired comparison: bootstrap CI and exact McNemar test"]
    end

    D3 --> R0
    D3 --> R4
    D3 --> RS
    R0 --> P
    R4 --> P
    RS --> P
```

---

## 2. Method as Implemented

The code is the open-source [`latent-harness`](https://github.com/vishal-dehurdle/latent-harness) library, release v0.1.0.

### 2.1 Sequence Layout

The latent model uses the direct-answer prompt with the latent tokens inside an empty reasoning block:

```text
<question> <｜Assistant｜> <think>\n\n [z_1 … z_K] </think>\n\nThe final answer is $\boxed{ … }$.
```

With $K=0$ this is exactly the direct-answer condition, so the $K=0$ control and the untrained floor use the same prompt and the same 48-token answer budget.

### 2.2 The LOTUS Loop

The $K$ latent positions are refined for $R$ iterations, all attending to the question's cached keys and values $\mathcal{C}_{\text{pre}}$:

$$h^{(0)} = 0, \qquad h^{(t)} = f_\theta\!\left(E + g(h^{(t-1)}) \,\middle|\, \mathcal{C}_{\text{pre}}\right), \qquad Z = h^{(R)}$$

- $f_\theta$ is the whole backbone (frozen, plus LoRA rank 16 on every attention and MLP projection [6]). It returns final post-norm hidden states.
- $E \in \mathbb{R}^{K \times d}$ are learnable pause embeddings, initialised with the statistics of real token embeddings.
- $g(h) = \gamma\, s_{\text{emb}}\, W\, (h / \mathrm{rms}(h))$ maps hidden states back to embedding scale. $W$ is a $d \times d$ matrix under spectral normalisation [7] ($\lVert W \rVert_2 \le 1$) and $\gamma = 0.9$.

```mermaid
graph TD
    Q["Question"] --> KV["Cached keys and values: C_pre"]
    E["Pause embeddings E"] --> X["Input: E + g(h)"]
    KV --> F["Backbone f: frozen + LoRA"]
    X --> F
    F --> H["Latent states h"]
    H -->|"feedback g, R = 4 iterations"| X
    H -->|"after iteration R"| Z["Z = h(R)"]
    Z --> S1["Stage 1: Sinkhorn OT to the trace's pooled states"]
    Z --> S2["Stage 2: answer loss + OT + keyword loss"]
```

Spectral normalisation is applied only to the feedback map $W$, not to the transformer's weights. It does not by itself make the loop contractive. We did not measure the loop's Jacobian spectral radius; Section 5 reports how the loop's residuals behave in practice.

The answer is decoded with the final iteration's latent keys and values in context. With $d = 1{,}536$, $K=4$ and $R=4$ the model has 20.8M trainable parameters: 18.5M LoRA, 2.4M feedback map and 6,144 pause-embedding values.

### 2.3 Alignment Targets

The targets are the model's own reasoning. We sampled reasoning traces on the first 2,500 GSM8K training problems (temperature 0.6, top-p 0.95, at most 4,096 tokens), and the model solved 85.52% of them. We kept one correct, finished trace per problem, 2,136 in all; 362 were incorrect or unfinished, and 2 had no boxed answer. The kept reasoning sections average 1,236 tokens (median 1,034, 90th percentile 2,207, max 3,865).

For each trace, the frozen backbone's final hidden states over the reasoning tokens are mean-pooled into at most 128 contiguous windows. That gives 273,361 target states of dimension 1,536.

### 2.4 Losses and Training

**Stage 1 (alignment).** The loss is the entropic optimal-transport cost [8] between the $K$ latents $Z$ and the trace's pooled states $H$. The cost is squared Euclidean, after dividing both by the batch's mean target norm, and both sides have uniform marginals. The plan comes from 50 log-domain Sinkhorn iterations at $\varepsilon = 0.1$ and is held fixed when differentiating.

**Stage 2 (answer).** The loss is the answer's cross-entropy, plus the stage-1 transport cost (weight 1.0), plus a frozen-head keyword loss (weight 0.1). The keyword loss decodes each latent through the frozen LM head and scores it against up to 32 token ids of the trace's 16 most salient keywords.

| Setting | Value |
|---|---|
| Batch | 4 problems × 4 accumulation steps = 16 per optimizer step |
| Optimizer | AdamW, lr $10^{-4}$, 30 warm-up steps, cosine to $10^{-5}$, gradient clip 1.0 |
| Stage 1 / Stage 2 steps | 100 / 400 (stage 2 is 3.05 epochs of the 2,097 training problems) |
| Validation | 39 held-out training problems (2%) |
| $K=0$ control | 400 stage-2 steps, no transport or keyword loss (no latents to apply them to) |
| Hardware | Apple M4, 16 GB unified memory, PyTorch MPS, bfloat16, seed 0 |
| Time | 8.0 s per stage-1 step, 9.5 s per stage-2 step (5.8 s for $K=0$); 1.3–1.4 h per latent run, 0.7 h for $K=0$ |

### 2.5 Evaluation

We score all 1,319 GSM8K test problems with one sample per problem at temperature 0.6 and top-p 0.95, the model's recommended settings. The answer is the last `\boxed{}` expression, graded against the reference. Each confidence interval is a bootstrap over problems (10,000 resamples). Each comparison between two runs is paired on the same problems, with a bootstrap CI on the difference and an exact McNemar test on the problems where they disagree [9]. The full-reasoning condition has a 16,384-token budget, which 0.6% of its responses reach.

---

## 3. Results

### 3.1 The Latents Add Nothing

| Condition (GSM8K test, 1,319 problems) | Accuracy | 95% CI |
|---|---|---|
| Untrained model, answering directly | 11.22% | 9.55–12.96 |
| Fine-tuned control, no latents ($K=0$) | **19.79%** | 17.66–21.99 |
| $K=4$ latent tokens | 18.42% | 16.38–20.55 |
| $K=4$ latent tokens, collapse partly fixed | 19.56% | 17.44–21.68 |
| Full reasoning | 86.88% | 85.06–88.63 |

Paired on the same problems:

| Comparison (1,319 problems) | Difference | 95% CI | Only first right | Only second right | $p$ |
|---|---|---|---|---|---|
| $K=0$ control − untrained | **+8.57** | +6.44 to +10.69 | 161 | 48 | below 0.001 |
| $K=4$ − $K=0$ control | −1.36 | −3.03 to +0.23 | 50 | 68 | 0.117 |
| $K=4$ with fix − $K=0$ control | −0.23 | −1.90 to +1.44 | 61 | 64 | 0.858 |
| $K=4$ with fix − $K=4$ | +1.14 | −0.30 to +2.65 | 57 | 42 | 0.159 |

Fine-tuning on 2,097 answers lifts the direct-answer model by 8.6 points. The two latent models generate the same short answers as the control: a mean of 5.4 tokens, with every answer finished. The four latent positions and four loop iterations are the only extra compute.

> **Key Finding:** Adding latent tokens to the same fine-tuning changes nothing we can detect. $K=4$ scores 1.36 points below the $K=0$ control ($p = 0.12$), and the collapse fix 0.23 points below it ($p = 0.86$).

### 3.2 Against Full Reasoning

| Condition (1,319 problems) | Accuracy | Share of the reasoning gap closed |
|---|---|---|
| Untrained, direct | 11.22% | — |
| Fine-tuned control, $K=0$ | 19.79% | 11.3% |
| $K=4$ latents | 18.42% | 9.5% |
| $K=4$ latents, collapse fix | 19.56% | 11.0% |
| Full reasoning | 86.88% | 100% |

Full reasoning beats the best latent model by 67.3 points (95% CI 64.6–70.0). It solves 906 problems the latent model misses; the latent model solves 18 that it misses. Fine-tuning recovers about a ninth of what reasoning buys, and the latents recover none of it on top.

---

## 4. Why: A Diagnosis of the Latent States

To see what the latents learned, we ran each trained model on 256 training-set problems: the 39 held out from training plus 217 sampled at random. We compared each problem's final latent states $Z$ with its alignment targets. All numbers in this section come from that analysis or from CPU simulations of the loss on 64 random training traces.

### 4.1 The Four Latents Collapse into One

In the $K=4$ model the four latent vectors of a problem have mean pairwise cosine 0.999. On the batch's 16 latent vectors (4 problems × 4 slots), effective rank [10] stays near 4 throughout training (3.56 at the start of stage 2, 3.85 at the end). So the model behaves like one latent token repeated four times.

The frozen-head keyword loss, which [1] proposed as the guard against this collapse, was on in every latent run. It fell from 7.90 to 5.00 but did not prevent the collapse. We did not train without it, so we cannot say whether it helped at all.

### 4.2 The Latents Carry the Question, Not the Reasoning

The latents are problem-specific: their mean matches the right problem's mean target state out of 256 candidates 98.8% of the time (chance 0.4%), and 100% on the 39 held-out problems.

A control shows this is mostly the question, though. The backbone's final hidden state at the end of the question, computed with no latents at all, matches the right problem 96.1% of the time (97.4% held-out). After mean-centring, the latents' cosine with that question-end state is 0.56. What the latents add beyond the question is small.

### 4.3 The Loss Pulls Towards the Mean

With the transport plan held fixed, the cost is minimised by moving each latent to the plan-weighted mean of the targets it is coupled to. So the plan's sharpness decides whether the $K$ latents split the reasoning trace into parts or all sit at its mean. Two properties of the targets blur that plan. On average, 89% of the energy of a problem's mean target state lies in the direction every problem shares, and five of 1,536 channels carry 46% of the target states' energy, consistent with the massive activations reported in LLMs [11].

Distances between targets are therefore small relative to their norms, and at $\varepsilon = 0.1$ the plan is close to uniform. Our CPU simulation compares the loss with all four latents at the trace mean against the loss with them split at the loss's own optimum. Splitting lowers the loss by only 12.5%, so there is little pull away from collapse.

| Target space, $\varepsilon$ | Loss saved by splitting | Slot cosine at the loss optimum | Trace-position spread at optimum |
|---|---|---|---|
| Raw, 0.10 (the $K=4$ run) | 12.5% | 0.94 | 0.078 |
| Raw, 0.03 | 28.6% | 0.87 | 0.142 |
| Standardised, 0.10 | 17.4% | 0.89 raw / 0.49 standardised | 0.108 |
| Standardised, 0.03 (the fix) | 21.0% | 0.87 raw / 0.42 standardised | 0.12–0.13 |

*Trace-position spread* is the standard deviation, across the four slots, of the average position (0 = start, 1 = end) in the reasoning trace that each slot is coupled to.

The trained $K=4$ model is more collapsed than even its loss's optimum: cosine 0.999 against 0.94, and spread 0.034 against 0.078. So the loss alone does not explain the collapse.

### 4.4 A Fix That Partly Works

The fix trains on per-channel standardised targets, using the mean and standard deviation over all 273,361 states, with $\varepsilon = 0.03$. Everything else is unchanged.

| After training | $K=4$ (original) | Fix, after stage 1 | Fix, final | Loss optimum (fix) |
|---|---|---|---|---|
| Slot cosine, raw | 0.999 | 0.964 | 0.970 | 0.87 |
| Slot cosine, standardised | 0.993 | 0.767 | 0.842 | 0.42 |
| Trace-position spread | 0.034 | 0.071 | 0.083 | 0.12–0.13 |
| Effective rank of 16 latents (stage 2) | 3.85 | — | 4.97 | — |
| Latents match own problem | 98.8% | 98.0% | 98.4% | — |
| Question-end state matches (control) | 96.1% | 89.8% | 93.0% | — |
| GSM8K test accuracy | 18.42% | — | **19.56%** | — |

The latents separate, and they separate in order: slot 1 is the most problem-specific and slot 4 is still almost generic. But they get only partway to the loss's optimum, and stage 2 pulls them back together somewhat (standardised cosine 0.77 → 0.84). Accuracy moves from 1.4 points below the control to level with it. Neither change is statistically significant.

### 4.5 The Latent Pathway Cannot Produce the Targets

The stage-1 loss shows the limit most directly. In both runs, stage 1 ended *above* the loss of the collapsed solution, where all four latents sit exactly at the trace mean:

| Run | Stage-1 loss, last 30 steps | Loss if all latents sat at the trace mean | Loss at the split optimum |
|---|---|---|---|
| $K=4$ (raw, $\varepsilon = 0.1$) | 0.345 | 0.308 | 0.270 |
| Fix (standardised, $\varepsilon = 0.03$) | 0.870 | 0.784 | 0.619 |

The simulated values come from 64 random training traces, and the training values from training batches of the same distribution, so the comparison is close but not exact. Both runs' losses stopped improving after about 70 of the 100 alignment steps.

> **Key Finding:** The model cannot even place its latents at the mean of each problem's reasoning states, let alone spread them along the trace. A better-shaped loss alone is unlikely to remove that limit.

We did not isolate the cause. The most direct explanation lies in the targets themselves. They are the model's hidden states *after* it has read its own intermediate reasoning, while the latents must be computed from the question alone, in four positions and four passes. Producing those states requires doing the reasoning, which is what the latents were meant to replace. Smaller contributing factors could be the capacity of rank-16 adapters, the short 100-step alignment stage, and the loop settling all four slots towards similar fixed points.

---

## 5. Training Dynamics

**The loop converges in practice.** We measured the relative change between successive iterations, $\lVert h^{(t)} - h^{(t-1)} \rVert / \lVert h^{(t-1)} \rVert$:

| When | Iteration 1→2 | 2→3 | 3→4 |
|---|---|---|---|
| Start of training | 0.98 | 0.70 | 0.53 |
| End of stage 1 ($K=4$) | 0.60 | 0.34 | 0.038 |
| End of stage 2 ($K=4$) | 0.55 | 0.072 | 0.008 |
| End of stage 2 (fix) | 0.43 | 0.033 | 0.007 |

By the fourth iteration the update is under 1% of the state, so more iterations would change little. We did not measure the Jacobian's spectral radius or train without spectral normalisation. So we cannot say whether the normalisation is what makes the loop settle.

**All three models overfit after about two epochs.** On the 39 validation problems, answer cross-entropy was lowest at 100–200 answer-training steps, then rose:

| Answer-training step | 100 | 200 | 300 | 400 |
|---|---|---|---|---|
| $K=0$ control | 0.618 | 0.618 | 0.749 | 0.726 |
| $K=4$ | 0.601 | 0.608 | 0.619 | 0.694 |
| $K=4$ with fix | 0.614 | 0.615 | 0.616 | 0.688 |

We evaluated the final checkpoint of every run, as fixed in advance. An earlier checkpoint might score slightly higher for all three runs, but 39 validation problems cannot tell the runs apart, and nothing here suggests it would favour the latents.

---

## 6. What Sinkhorn Alignments Predicted, and What We Found

| Prediction in [1] | Finding |
|---|---|
| $K=4$ latents trained with Sinkhorn alignment retain most of chain-of-thought accuracy | **Not supported.** 19.6% at best, against 87% for full reasoning and 19.8% for fine-tuning without latents. |
| Multi-token transport preserves the reasoning's structure, unlike mean pooling | **Not supported.** At the default $\varepsilon$ the loss's own optimum is close to the mean, and the trained latents were closer still, which amounts to mean pooling. |
| The frozen-head constraint prevents dimensional collapse | **Not supported.** It was on throughout, and the latents still collapsed (cosine 0.999, effective rank about 4 of 16). |
| Spectral normalisation makes the loop contract to a fixed point | **Untested.** The loop does settle (under 1% change by iteration 4), but we neither measured $\rho(J)$ nor ablated the normalisation. |
| Latent reasoning cuts generated tokens by over 90% | **True, but only trivially.** The latent models generate 5.4 tokens against 2,172 because they answer without reasoning, and they score like a model that answers without reasoning. |

---

## 7. Limitations

- **One model, one benchmark.** DeepSeek-R1-Distill-Qwen-1.5B on GSM8K only. We did not run MATH-500, AIME or GPQA for the latent models.
- **One recipe at one scale.** 2,136 training traces from the first 2,500 training problems, about 3 epochs, $K=4$, $R=4$, LoRA rank 16, one seed. A larger model, all 7,473 training problems, or other $K$ and $R$ might behave differently. Given a null result and a partial diagnosis, we chose not to spend compute on sweeps.
- **No curriculum.** Continuous-thought methods that work [5] replace reasoning steps with latents gradually over several stages. We tested the one-shot alignment proposed in [1], not a curriculum.
- **One sample per problem.** Each accuracy has a confidence interval of about ±2 points. The paired tests account for this.
- **No ablations of the components.** We did not train without spectral normalisation, without the frozen-head loss, or with plain mean pooling in place of transport. With no accuracy gain to explain, we did not run them.

---

## 8. Reproduction

The code is at [github.com/vishal-dehurdle/latent-harness](https://github.com/vishal-dehurdle/latent-harness) (release v0.1.0). Every number in this paper is written by one script, [`scripts/analysis/paper_numbers.py`](https://github.com/vishal-dehurdle/latent-harness/blob/v0.1.0/scripts/analysis/paper_numbers.py), from the saved run outputs. The same directory holds the diagnostics (`collapse_check.py`), the loss simulations (`ot_gap.py`, `ot_attractor.py`) and the paired comparison (`compare_runs.py`).

The commands, as recorded in each run's manifest:

```bash
# Reasoning traces on 2,500 GSM8K training problems (MLX backend)
python scripts/eval_baseline.py --model deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B \
    --benchmarks gsm8k_train --conditions think --max-tokens 4096 --batch-size 16 --limit 2500 \
    --out-dir outputs/traces/DeepSeek-R1-Distill-Qwen-1.5B

# Alignment targets: pooled final hidden states of each kept trace
python scripts/build_latent_data.py --traces outputs/traces/DeepSeek-R1-Distill-Qwen-1.5B/gsm8k_train__think.jsonl \
    --out-dir outputs/latent_data/gsm8k_train

# K=4, the K=0 control, and the collapse fix
python scripts/train_latent.py --data-dir outputs/latent_data/gsm8k_train --out-dir outputs/latent/k4 \
    --num-latents 4 --num-iterations 4 --stage1-steps 100 --stage2-steps 400
python scripts/train_latent.py --data-dir outputs/latent_data/gsm8k_train --out-dir outputs/latent/k0 \
    --num-latents 0 --stage1-steps 0 --ot-weight 0 --frozen-head-weight 0 --stage2-steps 400
python scripts/train_latent.py --data-dir outputs/latent_data/gsm8k_train --out-dir outputs/latent/k4_std \
    --num-latents 4 --num-iterations 4 --stage1-steps 100 --stage2-steps 400 --ot-standardize --ot-epsilon 0.03

# GSM8K test: each latent model, the untrained direct floor, and full reasoning
python scripts/eval_baseline.py --backend latent --model outputs/latent/k4/final --benchmarks gsm8k --batch-size 16
python scripts/eval_baseline.py --model deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B --benchmarks gsm8k \
    --conditions direct --max-tokens 16384 --batch-size 16
python scripts/eval_baseline.py --model deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B --benchmarks gsm8k \
    --conditions think --max-tokens 16384 --batch-size 8

# Diagnostics (Section 4), loss simulations, and every number in this paper
python scripts/analysis/collapse_check.py outputs/latent/k4/final outputs/latent_data/gsm8k_train
python scripts/analysis/ot_gap.py outputs/latent_data/gsm8k_train
python scripts/analysis/ot_attractor.py outputs/latent_data/gsm8k_train
python scripts/analysis/paper_numbers.py
```

The model revision is `ad9f0ae0864d7fbcd1cd905e3c6c5b069cc8b562`. Each run directory holds its manifest: the exact command, git state, package versions and host. Interrupted training resumes from its last checkpoint and reproduces the same losses.

---

## 9. Conclusion

On a 1.5B reasoning model, four Sinkhorn-aligned latent tokens refined by a LOTUS loop add nothing to GSM8K accuracy beyond what the same fine-tuning achieves without them. The latents collapse into one and carry mostly the question. Fixing the loss's blurring partly separates them but changes nothing measurable, and in both runs the latent pathway could not reach even the collapsed solution of its own alignment loss.

The proposal's central assumption is that a few latent positions computed from the question can stand in for states that the model reaches only by reasoning. That assumption fails here. The method as described in [1] does not work at this scale, and we do not recommend building on it without a training signal that gives the latents intermediate steps to learn, such as a curriculum.

---

## References

* [1] Verma, V. (2026). "Sinkhorn Alignments: Information Bottleneck Bounds on Span-Level Latent Reasoning." *Vishal Verma Labs Research*.
* [2] DeepSeek-AI. (2025). "DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning." *arXiv preprint arXiv:2501.12948*.
* [3] Cobbe, K., Kosaraju, V., Bavarian, M., Chen, M., Jun, H., Kaiser, L., Plappert, M., Tworek, J., Hilton, J., Nakano, R., Hesse, C., & Schulman, J. (2021). "Training Verifiers to Solve Math Word Problems." *arXiv preprint arXiv:2110.14168*.
* [4] Goyal, S., Ji, Z., Rawat, A. S., Menon, A. K., Kumar, S., & Nagarajan, V. (2024). "Think before you speak: Training Language Models With Pause Tokens." *International Conference on Learning Representations (ICLR)*.
* [5] Hao, S., Sukhbaatar, S., Su, D., Li, X., Hu, Z., Weston, J., & Tian, Y. (2024). "Training Large Language Models to Reason in a Continuous Latent Space." *arXiv preprint arXiv:2412.06769*.
* [6] Hu, E. J., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., & Chen, W. (2022). "LoRA: Low-Rank Adaptation of Large Language Models." *International Conference on Learning Representations (ICLR)*.
* [7] Miyato, T., Kataoka, T., Koyama, M., & Yoshida, Y. (2018). "Spectral Normalization for Generative Adversarial Networks." *International Conference on Learning Representations (ICLR)*.
* [8] Cuturi, M. (2013). "Sinkhorn Distances: Lightspeed Computation of Optimal Transport." *Advances in Neural Information Processing Systems (NeurIPS)*, 26, 2292–2300.
* [9] McNemar, Q. (1947). "Note on the sampling error of the difference between correlated proportions or percentages." *Psychometrika*, 12(2), 153–157.
* [10] Roy, O., & Vetterli, M. (2007). "The Effective Rank: A Measure of Effective Dimensionality." *European Signal Processing Conference (EUSIPCO)*.
* [11] Sun, M., Chen, X., Kolter, J. Z., & Liu, Z. (2024). "Massive Activations in Large Language Models." *arXiv preprint arXiv:2402.17762*.]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[Sinkhorn Alignments: Information Bottleneck Bounds on Span-Level Latent Reasoning]]></title>
      <link>https://vishalvermalabs.com/papers/sinkhorn-topologies-latent-reasoning/</link>
      <guid>https://vishalvermalabs.com/papers/sinkhorn-topologies-latent-reasoning/</guid>
      <pubDate>Thu, 24 Sep 2026 00:00:00 GMT</pubDate>
      <dc:creator>Vishal Verma</dc:creator>
      <category>AI Architecture & Mathematical Optimization</category>
      <description><![CDATA[A mathematical analysis of latent reasoning architectures. We model Span-level Pause-of-Thought (SPOT) with Information Bottleneck theory and multi-token optimal transport, and use the model to analyze the limits of compressing test-time compute.]]></description>
      <content:encoded><![CDATA[### Abstract

By the third quarter of 2026, the research community had recognized a computational limit in the scaling of Large Language Models (LLMs). Test-time compute, in which models generate explicit natural-language Chain-of-Thought (CoT) traces to work through complex problems, has run into the overthinking bottleneck. This paper develops a mathematical and information-theoretic model of the move from explicit to latent reasoning.

By framing the Span-level Pause-of-Thought (SPOT) framework as an entropic optimal transport problem between distributions of hidden states, we argue that soft semantic alignment optimizes the Information Bottleneck. We formalize the Frozen-Head Decoding Constraint as an auxiliary projection loss that averts dimensional collapse, and analyze Looped Latent Computation (LOTUS) in terms of Jacobian spectral stability. The formalization presented here gives a theoretical framework for reasoning compression; empirical validation of these bounds, using a custom hybrid engine on open-weight backbones, is deferred to a forthcoming companion paper.

---

## 1. The Computational Crisis of Explicit Test-Time Compute

Early explicit reasoning models relied on autoregressive, token-by-token generation [1, 2]. From the standpoint of hardware efficiency and rate-distortion theory, this is highly redundant. Generating thousands of intermediate reasoning tokens to reach a single conclusion adds latency, fills the context window, and raises $I/O$ intensity, since each decoding step is memory-bandwidth bound [3, 4, 5].

Empirical work on explicit reasoning dynamics identifies the **Reasoning Completion Point (RCP)**, the point in each instance at which the model's hidden states have converged on the correct solution. Tokens generated after the RCP are redundant: they form a phase of repetitive oscillation (the "overthinking bottleneck") that adds nothing to the answer [5].

```mermaid
graph TD
    subgraph Explicit["Autoregressive CoT — High Memory Bandwidth Friction"]
        direction LR
        T1["Token 1"] --> T2["Token 2"] --> RCP["RCP (State Converged)"]
        RCP --> T4["Redundant Token 4"]
        T4 --> T5["Redundant Token 5"]
        T5 -.- DRIFT["Overthinking Bottleneck (I/O Saturation)"]
    end

    subgraph Latent["Latent Reasoning — Information Bottleneck"]
        direction LR
        L1["Context Enc"] --> SPOT["SPOT Latent Set Z"]
        SPOT --> LOTUS["LOTUS Contraction ρ(J) < 1"]
        LOTUS --> SOL["Stable Fixed Point h*"]
    end
    Explicit ~~~ Latent
```

The industry has responded by moving toward latent reasoning. Several groups are replacing visible text generation with continuous computation in the Transformer's high-dimensional hidden space. This paper gives an algorithmic analysis of two methods central to this transition.

Span-level Pause-of-Thought (SPOT) compresses verbose reasoning into pause tokens [6, 7] using a multiple-to-multiple Sinkhorn optimal-transport objective [9, 10]. Looped Latent Computation (LOTUS) refines latent embeddings iteratively in a continuous, unrolled recurrent loop governed by spectral-norm constraints [8, 20].

---

## 2. Span-Level Semantic Alignment as Optimal Transport

We set aside discrete linguistic tokens and model the Transformer's continuous hidden states as probability distributions evolving over a geometric manifold [9, 10].

Earlier latent reasoning methods used rigid point-to-point alignment, forcing a single latent vector to approximate the final point representation of a verbose reasoning step. In dynamical-systems terms, this amounts to collapsing a complex distribution into a point mass with no continuous transition path, which loses much of the information [7].

### 2.1 The Entropic Optimal Transport Objective

The SPOT framework resolves this discontinuity through Span-level Semantic Alignment [7]. Given a teacher reasoning span $S_i$ containing multiple explicit tokens, and its corresponding sequence of dense hidden states $\mathbf{H}^{\text{tea}}(S_i) \in \mathbb{R}^{|S_i| \times d}$, the objective is to transport this distributed information into a set of $K$ student latent states, denoted as $\mathbf{Z} \in \mathbb{R}^{K \times d}$. By defining $K > 1$, we ensure the transport polytope is non-degenerate.

This is formulated as an entropic optimal transport (OT) distance between a source marginal (the distribution across latent states, $a = \frac{1}{K} \mathbf{1} \in \Delta^K$) and a target marginal (a uniform mass distribution across the explicit reasoning span, $b = \frac{1}{|S_i|} \mathbf{1} \in \Delta^{|S_i|}$):

$$\text{OT}_\varepsilon(a, b; \mathbf{C}) = \min_{\Pi \in \mathcal{U}(a,b)} \langle \Pi, \mathbf{C} \rangle - \varepsilon \sum_{k=1}^K \sum_{j=1}^{|S_i|} \Pi_{kj} (\ln \Pi_{kj} - 1)$$

Where $\mathbf{C} \in \mathbb{R}_+^{K \times |S_i|}$ is the ground cost matrix based on the squared $L_2$ distance between projected representations, $\mathcal{U}(a,b)$ defines the feasible set of transport couplings, and $\varepsilon > 0$ is the entropic regularization strength parameter [9, 10, 19].

---

## 3. Sinkhorn Alignment as a Dynamic Schrödinger Bridge

Besides smoothing the optimization landscape for the Sinkhorn-Knopp algorithm, the entropic regularization term $-\varepsilon H(\Pi)$ makes the problem isomorphic to the static formulation of the Schrödinger Bridge Problem (SBP) [11, 12].

In its dynamic formulation, the Schrödinger Bridge identifies the optimal trajectories that transport the probability distribution $p_0(\mathbf{x})$ into $p_1(\mathbf{x})$ while minimizing the Kullback-Leibler (KL) divergence with respect to a reference Brownian motion [12]. The evolution is governed by forward stochastic differential equations (SDEs):

$$d\mathbf{x} = \mathbf{b}^+(\mathbf{x}, t)dt + \sqrt{2\varepsilon}d\mathbf{w}$$

The probability density along this bridge evolves according to the Fokker-Planck (Kolmogorov Forward) equation, which includes the second-order diffusion Laplacian:

$$\partial_t p = -\nabla \cdot (\mathbf{b}^+ p) + \varepsilon \Delta p$$

### 3.1 The Information Bottleneck Principle

This transport process can be read as optimizing the Information Bottleneck (IB) principle [13]. By minimizing the SBP, the SPOT framework seeks a minimal sufficient statistic $\mathbf{Z}$ that compresses the input explicit tokens $\mathbf{X}$ while preserving mutual information with the optimal solution $\mathbf{Y}$:

$$\min_{\theta} \left[ I(\mathbf{X}; \mathbf{Z}) - \beta I(\mathbf{Z}; \mathbf{Y}) \right]$$

The entropic optimal transport acts as the compression term $I(\mathbf{X}; \mathbf{Z})$, filtering out the linguistic redundancy of autoregressive generation while keeping the information needed for the solution.

---

## 4. Preventing Dimensional Collapse via Auxiliary Regularization

Continuous latent reasoning saves a great deal of computation, but working in the continuous hidden space exposes it to latent rank collapse (also known as dimensional collapse) [14].

Because there is no discrete linguistic bottleneck to force the model to maintain orthogonal representations, the unconstrained optimization trajectory naturally minimizes the loss function by losing variance in the covariance matrix $\text{Cov}(\mathbf{Z})$. The latent representations collapse to span a low-dimensional subspace, rendering them semantically degenerate.

### 4.1 The Frozen-Head Decoding Constraint

SPOT prevents this collapse with the Frozen-Head Decoding Constraint [7], an auxiliary projection loss.

During optimal transport alignment, the student latent state $\mathbf{Z}$ is penalized if it cannot be mapped back to a vocabulary distribution by the original, frozen language modeling head $(\mathbf{W}, \mathbf{b})$:

$$\tilde{\mathbf{z}}_k = \phi(\mathbf{z}_k) \in \mathbb{R}^d$$

$$p(\cdot \mid \mathbf{z}_k) = \text{Softmax}(\mathbf{W} \tilde{\mathbf{z}}_k + \mathbf{b})$$

By adding the standard cross-entropy loss against a set of semantic "keywords" to the total objective, the model is pushed to maintain full semantic rank. Because the frozen pre-trained weight matrix $\mathbf{W}$ spans a high-dimensional, anisotropic semantic basis, keeping the latent states decodable should keep the latent covariance matrix at full rank, which prevents dimensional collapse without specialized contrastive pairs [14].

---

## 5. Looped Latent Computation (LOTUS): Stability via Spectral Norms

### 5.1 Formulating the Unrolled Recurrent Loop

The LOTUS framework decouples computational depth from sequence length by applying a weight-tied Transformer block $f_\theta$ recurrently in the latent space over $R$ iterations [8, 20]. Let $\mathbf{E}$ represent the learnable latent embeddings, and $\mathcal{C}_{\text{pre}}$ be the pre-populated Key-Value (KV) cache derived from the input prompt:

$$\mathbf{h}^{(t)} = f_\theta(\mathbf{E} + \mathbf{h}^{(t-1)} \mid \mathcal{C}_{\text{pre}})$$

### 5.2 Jacobian Stability and Fixed-Point Attractors

A recurrent Transformer block does not naturally form a strict contraction mapping. Due to Self-Attention, LayerNorm, and non-linearities (like SwiGLU), the Lipschitz constant of standard unrolled layers frequently exceeds $1$, leading to chaotic dynamics, limit cycles, or exploding gradients.

To ensure the loop converges to a stable fixed-point $\mathbf{h}^*$, the architecture must implement explicit stabilization mechanisms similar to those used in Deep Equilibrium Models (DEQs) [15]. Specifically, we must analyze the Jacobian $J = \frac{\partial f_\theta}{\partial \mathbf{h}}$.

Stability requires that the spectral radius of the Jacobian is strictly less than one:

$$\rho(J) < 1$$

When spectral normalization or specific architectural damping is applied to the looped Transformer blocks, the mapping satisfies the Banach Fixed-Point Theorem [21]. The latent trajectory $\mathbf{h}^{(t)}$ is then a strict contraction mapping and converges to its fixed point, without the compounding quantization noise of discrete token sampling.

---

## 6. Proposed Empirical Validation: The Algorithmic Engine

The information bounds and spectral constraints above need empirical tests on current models. The next step is to implement Sinkhorn optimal transport and continuous latent recurrence in a working system.

In a forthcoming companion paper, we will introduce a custom hybrid Rust/PyTorch framework designed to operationalize these bounds. This system will implement a two-stage pipeline:

1. **Optimal Transport (OT) Alignment Training:** An optimized Sinkhorn-Knopp iteration kernel (written in Rust/CUDA) that computes the coupling matrix $\Pi^*$ for $K$ pause tokens to $|S_i|$ explicit reasoning tokens.
2. **Boundary-Constrained Fine-Tuning:** A PyTorch enforcement of the Frozen-Head Decoding Constraint during the forward pass, maintaining covariance rank and spectral stability.

```mermaid
graph TD
    subgraph Stage1["Stage 1: Sinkhorn-Knopp OT Alignment"]
        T_SPAN["Explicit Reasoning Span H_tea"] --> KERNEL["CUDA/Rust Sinkhorn Kernel"]
        S_PAUSE["Latent Pause State Z"] --> KERNEL
        KERNEL --> COUPLING["Optimal Transport Coupling Matrix Π*"]
    end

    subgraph Stage2["Stage 2: Covariance Rank Preservation"]
        Z_OPT["Transported Latent Z"] --> PROJ["Projection ϕ(Z)"]
        PROJ --> FROZEN["Frozen Language Head W, b"]
        FROZEN --> KW["Decodable Semantic Keywords"]
    end

    Stage1 --> Stage2
```

We plan to run these experiments on the open-weight DeepSeek-R1-Distill-Qwen-7B model [1]. Applying SPOT and LOTUS to this backbone, we will measure the shift in the accuracy-efficiency frontier on reasoning benchmarks including GSM8K [16], MATH500 [17], AIME, and GPQA-Diamond [18]. Our objective will be to quantify the reduction in generated tokens and the corresponding change in accuracy, and to test whether the Information Bottleneck model in this paper holds in practice.

> **Update (November 2026):** The companion study is out: [Sinkhorn-Aligned Latent Tokens Add Nothing Over Fine-Tuning](/papers/empirical-validation-latent-reasoning-sinkhorn). It tested this method on DeepSeek-R1-Distill-Qwen-1.5B, not 7B, and on GSM8K only. The latent tokens gave no gain over fine-tuning alone.

---

## 7. Conclusion

By formulating Span-level Semantic Alignment as a multiple-to-multiple Sinkhorn optimal transport problem, we have argued that the process optimizes the Information Bottleneck. We defined the Frozen-Head Decoding Constraint as an auxiliary projection loss that averts dimensional collapse, and we argued that looped recurrent architectures (LOTUS) require strict spectral constraints ($\rho(J) < 1$) to converge reliably.

Forthcoming experiments on open-weight models will test these bounds.

---

## References

* [1] DeepSeek-AI. (2025). "DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning." *arXiv preprint arXiv:2501.12948*.
* [2] Wei, J., Wang, X., Schuurmans, D., Bosma, M., Ichter, B., Xia, F., Chi, E., Le, Q. V., & Zhou, D. (2022). "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models." *Advances in Neural Information Processing Systems (NeurIPS)*, 35, 24824–24837.
* [3] Snell, C., Lee, J., Xu, K., & Kumar, A. (2024). "Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters." *arXiv preprint arXiv:2408.03314*.
* [4] Pope, R., Douglas, S., Chowdhery, A., Devlin, J., Bradbury, J., Heek, J., Xiao, K., Agrawal, S., & Dean, J. (2023). "Efficiently Scaling Transformer Inference." *Proceedings of Machine Learning and Systems (MLSys)*, 5.
* [5] Wei, Z., Pang, L., Liu, J., Shi, W., Deng, J., Xu, S., Duan, Z., Wang, J., Sun, F., Shen, H., & Cheng, X. (2026). "The Evolution of Thought: Tracking LLM Overthinking via Reasoning Dynamics Analysis." *Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (ACL)*, 26905–26920.
* [6] Goyal, S., Ji, Z., Rawat, A. S., Menon, A. K., Kumar, S., & Nagarajan, V. (2024). "Think before you speak: Training Language Models With Pause Tokens." *International Conference on Learning Representations (ICLR)*.
* [7] Chu, Y., Shao, M., Liu, Y., Hao, B., Lin, Y., Wang, J., & Wang, R. (2026). "SPOT: Span-level Pause-of-Thought for Efficient and Interpretable Latent Reasoning in Large Language Models." *Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD)*, 675–686.
* [8] Fan, Y., Svete, A., & Lee, K. (2026). "Bridging the Gap Between Latent and Explicit Reasoning with Looped Transformers." *arXiv preprint arXiv:2606.31779*.
* [9] Peyré, G., & Cuturi, M. (2019). "Computational Optimal Transport: With Applications to Data Science." *Foundations and Trends in Machine Learning*, 11(5-6), 355–607.
* [10] Cuturi, M. (2013). "Sinkhorn Distances: Lightspeed Computation of Optimal Transport." *Advances in Neural Information Processing Systems (NeurIPS)*, 26, 2292–2300.
* [11] Schrödinger, E. (1931). "Über die Umkehrung der Naturgesetze." *Sitzungsberichte der Preussischen Akademie der Wissenschaften, physikalisch-mathematische Klasse*, 144–153.
* [12] Léonard, C. (2014). "A survey of the Schrödinger problem and some of its connections with optimal transport." *Discrete and Continuous Dynamical Systems – Series A*, 34(4), 1533–1574.
* [13] Tishby, N., Pereira, F. C., & Bialek, W. (1999). "The Information Bottleneck Method." *The 37th Annual Allerton Conference on Communication, Control, and Computing*, 368–377.
* [14] Jing, L., Vincent, P., LeCun, Y., & Tian, Y. (2022). "Understanding Dimensional Collapse in Contrastive Self-supervised Learning." *International Conference on Learning Representations (ICLR)*.
* [15] Bai, S., Kolter, J. Z., & Koltun, V. (2019). "Deep Equilibrium Models." *Advances in Neural Information Processing Systems (NeurIPS)*, 32, 688–699.
* [16] Cobbe, K., Kosaraju, V., Bavarian, M., Chen, M., Jun, H., Kaiser, L., Plappert, M., Tworek, J., Hilton, J., Nakano, R., Hesse, C., & Schulman, J. (2021). "Training Verifiers to Solve Math Word Problems." *arXiv preprint arXiv:2110.14168*.
* [17] Hendrycks, D., Burns, C., Kadavath, S., Arora, A., Basart, S., Tang, E., Song, D., & Steinhardt, J. (2021). "Measuring Mathematical Problem Solving With the MATH Dataset." *Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks*, 1.
* [18] Rein, D., Hou, B. L., Stickland, A. C., Petty, J., Pang, R. Y., Dirani, J., Michael, J., & Bowman, S. R. (2023). "GPQA: A Graduate-Level Google-Proof Q&A Benchmark." *arXiv preprint arXiv:2311.12022*.
* [19] Sinkhorn, R. (1967). "Diagonal Equivalence to Matrices with Prescribed Row and Column Sums." *The American Mathematical Monthly*, 74(4), 402–405.
* [20] Dehghani, M., Gouws, S., Vinyals, O., Uszkoreit, J., & Kaiser, Ł. (2019). "Universal Transformers." *International Conference on Learning Representations (ICLR)*.
* [21] Banach, S. (1922). "Sur les opérations dans les ensembles abstraits et leur application aux équations intégrales." *Fundamenta Mathematicae*, 3(1), 133–181.]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[Hyperbolic Sparse Autoencoders: Empirical Validation of Poincaré Manifold Geometry on LLM Activations]]></title>
      <link>https://vishalvermalabs.com/papers/empirical-validation-hypersae-poincare-geometry/</link>
      <guid>https://vishalvermalabs.com/papers/empirical-validation-hypersae-poincare-geometry/</guid>
      <pubDate>Sun, 02 Aug 2026 00:00:00 GMT</pubDate>
      <dc:creator>Vishal Verma</dc:creator>
      <category>Mechanistic Interpretability & Deep Architecture</category>
      <description><![CDATA[We train six sparse autoencoders, Hyperbolic (HyperSAE) and Euclidean, on Google Gemma-2-2B Layer 13 residual stream activations from 20M FineWeb-Edu tokens at three L1 penalties (0.0005, 0.001, 0.005). HyperSAE has lower reconstruction MSE at every setting. At high sparsity (L0 ≈ 53) it cuts MSE by 9.8%, raises cross-entropy loss recovery from 75.5% to 78.9% and lowers dead latents from 3.8% to 0.2%; on MMLU-Pro (12,032 questions) it keeps slightly higher accuracy (16.26% vs 16.11%). The paper includes four interactive charts.]]></description>
      <content:encoded><![CDATA[### Abstract

Mechanistic interpretability uses Sparse Autoencoders (SAEs) to decompose superposed LLM activations into monosemantic features. Standard SAEs work in flat Euclidean space ($\mathbb{R}^d$), which implicitly treats concepts as if they were spread evenly through a linear space. That assumption fits human knowledge poorly, because knowledge is hierarchical: a tree grows exponentially with depth ($\mathcal{O}(b^r)$), while Euclidean volume grows only polynomially with radius ($\mathcal{O}(r^d)$). The volume deficit forces unrelated concepts into overlap, which causes feature-splitting, high reconstruction error and dead latents.

In earlier theoretical work (*Escaping Flatland*), we proposed the Hyperbolic Sparse Autoencoder (HyperSAE), which places dictionary atoms in the Poincaré ball $(\mathcal{B}^d, g_{\mathbf{x}})$, a Riemannian manifold of constant negative curvature. This paper tests HyperSAE at scale on a real model's activations: the Layer 13 residual stream of Google Gemma-2-2B ($d=2304$, dictionary size $M=16,384$), with 20 million tokens of `FineWeb-Edu` streamed on one NVIDIA L4 GPU.

Across six models at three sparsity levels ($L_1 \in \{0.0005, 0.001, 0.005\}$), HyperSAE has lower reconstruction MSE than a standard Euclidean SAE (FlatSAE) at every level. At high sparsity ($L_1=0.005, L_0 \approx 53$ active features per token), it lowers reconstruction mean squared error (MSE) by 9.8% ($4.1232$ vs $4.5724$) and raises cross-entropy (CE) loss recovery from 75.5% to 78.9% (+3.4 percentage points). At mid sparsity ($L_1=0.001, L_0 \approx 744\text{–}988$), MSE is 19.6% lower ($1.3965$ vs $1.7364$) with 97.7% CE loss recovery; at low sparsity ($L_1=0.0005, L_0 \approx 1511\text{–}2285$), it is 24.2% lower ($0.7666$ vs $1.0112$) with 98.1% recovery. Dead latents fall from 3.8% (FlatSAE) to 0.2%, and the ablation in Section 4.6 attributes this to both the curvature and the learnable radial depth. When we substitute SAE reconstructions for the Layer 13 hidden state at single-token decision points on MMLU-Pro (12,032 questions), accuracy is 16.26% with HyperSAE and 16.11% with FlatSAE.

We also describe the memory fixes (a smaller `CoActivationQueue`, PyTorch CUDA cache clearing and mini-batched sequence evaluation) that let cloud training fit on a single 24 GB GPU. The full implementation is open-sourced as [`hypersae`](https://github.com/vishal-dehurdle/hypersae) on PyPI ([`pip install hypersae`](https://pypi.org/project/hypersae/)).

---

## 1. Introduction: The Geometric Pathology of Flat SAEs

Modern Transformer language models operate in superposition: to represent millions of real-world concepts within a finite hidden dimension $d$, the network packs non-orthogonal feature vectors into high-dimensional space [1, 2, 5]. Sparse Autoencoders (SAEs) reverse-engineer this superposition by mapping dense residual stream vectors $\mathbf{x} \in \mathbb{R}^d$ into an overcomplete sparse code $\mathbf{f} \in \mathbb{R}^M$ ($M \gg d$), optimizing:

$$ \mathcal{L}_{\text{SAE}} = \left\| \mathbf{x} - \mathbf{W}_{\text{dec}} \mathbf{f} \right\|_2^2 + \lambda \|\mathbf{f}\|_1 $$

Scaling Euclidean SAEs to larger dictionaries gives diminishing returns [3, 4]. As $M$ grows, flat SAEs show feature-splitting, where one broad concept splits into many redundant, near-identical latents, and dead latents, where a large share of dictionary elements never fire.

```mermaid
graph TD
    subgraph Flat["EUCLIDEAN SAE — Polynomial Volume Growth O(r^d)"]
        direction TB
        E1["Root Concept (e.g. Science)"] --- E2["Field (e.g. Physics)"]
        E2 --- E3["Subfield (e.g. Quantum)"]
        E3 --- E4["Entity (e.g. Photon)"]
        style E1 fill:#4c0519,stroke:#c87878,color:#fff1f2
        style E4 fill:#4c0519,stroke:#c87878,color:#fff1f2
    end

    subgraph Hyp["HYPERBOLIC SAE — Exponential Volume Growth O(e^r)"]
        direction TB
        H1["Origin r=0 (Abstract Super-Category)"] --> H2["Branch r=0.4 (Domain)"]
        H2 --> H3["Branch r=0.7 (Sub-Domain)"]
        H3 --> H4["Boundary r->1 (Leaf Latent)"]
        style H1 fill:#1e3a8a,stroke:#6eaaff,color:#eff6ff
        style H4 fill:#1e3a8a,stroke:#6eaaff,color:#eff6ff
    end
```

### 1.1 The Volume Expansion Pathology

The bottleneck is geometric. Human knowledge is hierarchical: concepts branch into sub-concepts, forming trees. In a tree with branching factor $b > 1$, the number of leaves at depth $r$ grows exponentially [6, 7]:

$$ N_{\text{tree}}(r) \sim \mathcal{O}(b^r) $$

However, in flat Euclidean space $\mathbb{R}^d$, the surface area and volume of a hypersphere grow only polynomially with radius $r$:

$$ V_{\text{Euclidean}}(r) \sim \mathcal{O}(r^d) $$

A polynomially growing flat space does not have room for an exponentially growing hierarchy [6, 7]. Unrelated leaf nodes end up close together, which creates spurious correlation and reconstruction noise.

---

## 2. Architecture & Mathematics of HyperSAE

HyperSAE instead places dictionary atoms in the Poincaré ball model of hyperbolic space, $(\mathcal{B}^d, g_{\mathbf{x}})$ [8, 11, 12], where constant negative curvature $-c$ (with $c > 0$) makes volume grow exponentially with radius:

$$ V_{\text{Hyperbolic}}(r) \sim \mathcal{O}\left(e^{(d-1)\sqrt{c}\,r}\right) $$

### 2.1 The Poincaré Ball Metric Tensor

The Poincaré ball model of curvature $-c$ ($c > 0$) is defined as the open ball $\mathcal{B}^d_c = \{ \mathbf{x} \in \mathbb{R}^d : c\|\mathbf{x}\|^2 < 1 \}$, equipped with the Riemannian metric tensor [8, 11]:

$$ g_{\mathbf{x}} = \lambda_{\mathbf{x}}^2 g_E, \quad \text{where } \lambda_{\mathbf{x}} = \frac{2}{1 - c\|\mathbf{x}\|^2} $$

The geodesic distance between two points $\mathbf{u}, \mathbf{v} \in \mathcal{B}^d_c$ is given analytically by:

$$ d_{\mathcal{B}}(\mathbf{u}, \mathbf{v}) = \frac{2}{\sqrt{c}} \text{arsinh}\left( \sqrt{c} \frac{\|\mathbf{u} - \mathbf{v}\|}{\sqrt{(1 - c\|\mathbf{u}\|^2)(1 - c\|\mathbf{v}\|^2)}} \right) $$

As a vector approaches the boundary ($\|\mathbf{u}\| \to 1/\sqrt{c}$), the conformal factor $\lambda_{\mathbf{x}} \to \infty$. Transverse distances grow exponentially, which leaves unbounded room for leaf latents.

### 2.2 Decoupled Weight-Space Regularization

Applying hyperbolic projections directly to token activations $\mathbf{x}_t$ makes optimization fail because of the RMSNorm Spherical Trap [3, 13]: Transformer layer normalization projects token vectors onto a fixed-radius hypersphere.

HyperSAE avoids this by separating the forward pass from the dictionary geometry:
1. **Forward Pass (Linear & Causal):** Encoder and decoder operations stay linear and Euclidean, which keeps them fast on GPU and compatible with causal interventions.
2. **Dictionary Geometry (Hyperbolic Regularization):** The unit-norm decoder atoms (rows of $\mathbf{W}_{\text{dec}}$) are projected into the Poincaré ball [8, 9], each at a learnable radial depth $r_i$.

```mermaid
flowchart LR
    X["Residual State x in R^d"] --> Enc["Euclidean Encoder W_enc, b_enc"]
    Enc --> Act["ReLU Sparsification f"]
    Act --> Dec["Euclidean Decoder W_dec"]
    Dec --> XHat["Reconstruction x_hat in R^d"]

    subgraph Regularizer["Poincare Manifold Regularization Layer"]
        R["Learnable Radial Depth r_i"] -.-> PProj["Poincare Ball Projection exp_0(r_i w_i)"]
        Dec -.-> PProj
        PProj -.-> Cone["Poincare Entailment Cone Loss L_Poincare [10]"]
    end
```

### 2.3 Mathematical Formulation

Given input residual activation $\mathbf{x} \in \mathbb{R}^d$, HyperSAE computes sparse feature activations $\mathbf{f} \in \mathbb{R}^M$ and reconstructed activation $\hat{\mathbf{x}} \in \mathbb{R}^d$:

$$ \mathbf{f} = \text{ReLU}\left( \mathbf{x} \mathbf{W}_{\text{enc}}^\top + \mathbf{b}_{\text{enc}} \right) $$

$$ \hat{\mathbf{x}} = \mathbf{f} \mathbf{W}_{\text{dec}} $$

where $\mathbf{W}_{\text{enc}}, \mathbf{W}_{\text{dec}} \in \mathbb{R}^{M \times d}$ and the decoder rows $\mathbf{w}_i$ have unit norm. The radial parameters $\mathbf{r} \in \mathbb{R}^M$ are unconstrained and do not enter the forward pass: each $r_i$ sets the Poincaré radius $\tanh(\sqrt{c}\, r_i)/\sqrt{c}$ of atom $i$ in the regularizer (§2.4).

### 2.4 The TriPartite Loss Function

HyperSAE is trained end-to-end by minimizing a three-component joint objective:

$$ \mathcal{L}_{\text{HyperSAE}} = \mathcal{L}_{\text{MSE}} + \lambda \mathcal{L}_1 + \lambda_E \mathcal{L}_{\text{Poincaré}}, \qquad \lambda_E = 0.01 $$

1. **Reconstruction MSE ($\mathcal{L}_{\text{MSE}}$):**
   $$ \mathcal{L}_{\text{MSE}} = \frac{1}{d} \left\| \mathbf{x} - \hat{\mathbf{x}} \right\|_2^2 $$

2. **$L_1$ Sparsity Penalty ($\mathcal{L}_1$):**
   $$ \mathcal{L}_1 = \sum_{i=1}^M |f_i| $$

3. **Poincaré Entailment Cone Loss ($\mathcal{L}_{\text{Poincaré}}$):**
   For decoder atoms mapped to Poincaré coordinates $\mathbf{u}_i = \exp_{\mathbf{0}}^c(r_i \mathbf{w}_i) = \tanh(\sqrt{c}\, r_i) \frac{\mathbf{w}_i}{\sqrt{c}}$ (with $c = 1$), we enforce hierarchical entailment [8, 10]. For a pair $(i, j)$ the cone violation is

   $$ v_{ij} = \max\left(0, \theta(\mathbf{u}_i, \mathbf{u}_j) - \Psi(\mathbf{u}_i)\right) $$

   where $\theta(\mathbf{u}_i, \mathbf{u}_j)$ is the hyperbolic angle between features, and $\Psi(\mathbf{u}_i)$ is the aperture angle of the entailment cone centered at parent feature $\mathbf{u}_i$:

   $$ \sin \Psi(\mathbf{u}_i) = K \, \frac{1 - c\|\mathbf{u}_i\|_2^2}{\|\mathbf{u}_i\|_2}, \qquad K = 0.5 $$

   The loss pulls co-activating pairs $\mathcal{E}^+$ into their parent's cone and pushes sampled negative pairs $\mathcal{E}^-$ out of it by a margin $\gamma = 0.15$:

   $$ \mathcal{L}_{\text{Poincaré}} = \frac{1}{|\mathcal{E}^+|} \sum_{(i,j) \in \mathcal{E}^+} v_{ij} + \frac{1}{|\mathcal{E}^-|} \sum_{(i,j) \in \mathcal{E}^-} \max\left(0, \gamma - v_{ij}\right) $$

---

## 3. Experimental Setup & Benchmark Protocols

We trained and evaluated HyperSAE and FlatSAE under identical conditions, with one automated cloud pipeline, on Google Gemma-2-2B (Layer 13 residual stream, $d=2304$, dictionary size $M=16,384$).

### 3.1 Model & Activation Dataset Specifications

- **Base Model:** Google Gemma-2-2B (`google/gemma-2-2B`, 2.6B parameters) [14].
- **Target Hook Layer:** Layer 13 residual stream, the output of `model.layers[13]` (0-indexed), captured with a PyTorch forward hook. This is the same activation as TransformerLens's `blocks.13.hook_resid_post` [16].
- **Activation Dimension:** $d = 2304$.
- **SAE Dictionary Size:** $M = 16,384$ ($7.11\times$ expansion ratio).
- **Streaming Activation Dataset:** `HuggingFaceFW/fineweb-edu` (sample-10BT split) [15].
- **Training Tokens:** 20,480,000 tokens streamed continuously across 10,000 steps ($B=8, T=256$).
- **Hardware Instance:** GCP Compute Engine `g2-standard-8` (1x NVIDIA L4 GPU, 24GB VRAM, 8 vCPUs, 32GB RAM) in `asia-south1-b`.

```mermaid
sequenceDiagram
    autonumber
    participant Dataset as FineWeb-Edu Stream
    participant Gemma as Gemma-2-2B (Layer 13)
    participant Queue as CoActivation Queue
    participant GPU as NVIDIA L4 (24GB VRAM)
    participant GCS as Google Cloud Storage

    Dataset->>Gemma: Stream 20M Tokens
    Gemma->>Queue: Hook Layer 13 Activations (d=2304)
    Queue->>GPU: Sample Mini-Batches & Co-Occurrences
    GPU->>GPU: Step 1..10000 HyperSAE / FlatSAE Training
    GPU->>GCS: Upload Checkpoints (Step 5000, 10000)
    GPU->>Gemma: Run Downstream MMLU-Pro Hooks
    GPU->>GCS: Export Pareto Plots & cloud_eval_results.json
```

### 3.2 VRAM Optimization & Leak Prevention

Our first 10,000-step runs on the 24 GB NVIDIA L4 failed with `torch.OutOfMemoryError`, caused by allocation spikes in the co-activation queue and by PyTorch CUDA cache fragmentation. We made three changes:

1. **`CoActivationQueue` Scaling:** Reduced the co-occurrence buffer capacity from $100,000$ to $20,000$ items in `src/hypersae/queue.py`. This reduced tensor allocation VRAM overhead from 6.5 GB to 1.3 GB, keeping total active VRAM at 10.4 GB (well under the 23.7 GB L4 limit).
2. **Explicit Garbage Collection:** Added `gc.collect()` and `torch.cuda.empty_cache()` between model iteration sweeps in `cloud_run.py`, after which we saw 0% memory leakage across consecutive training loops.
3. **Mini-Batched Validation Evaluation:** Standard cross-entropy loss evaluation over 64 validation sequences (up to 256 tokens each, at most 16,384 tokens) allocated 7.81 GB in a single forward pass. We restructured evaluation into mini-batches of size 4 (`batch_size=4`), which removed the VRAM spike during validation.

---

## 4. Empirical Evaluation & Interactive Pareto Analysis

We trained six models (HyperSAE and FlatSAE at three $L_1$ values) for 10,000 steps each on Gemma-2-2B Layer 13 activations from FineWeb-Edu, at about 4,900 tokens/sec.

### 4.1 Quantitative Comparison Table

The table below gives sparsity ($L_0$), reconstruction MSE, cross-entropy (CE) loss recovery, CE loss with the SAE hooked in, and dead latents for all six models.

| Model Architecture | $L_1$ Penalty | Active Features / Token ($L_0$) | Reconstruction MSE ($\downarrow$) | CE Loss Recovery % ($\uparrow$) | Cross-Entropy Loss | Dead Latents (%) |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: |
| **Gemma-2-2B Baseline** | — | — | — | **100%** | **4.5204** | — |
| **Zero Ablation (Hook)** | — | 0.0 | — | **0.0%** | **12.1895** | — |
| **HyperSAE (Ours)** | `0.005` | 54.2 | **4.1232** | **78.9%** | **6.1164** | **0.2%** |
| FlatSAE (Baseline) | `0.005` | 52.4 | 4.5724 | 75.5% | 6.3861 | 3.8% |
| **HyperSAE (Ours)** | `0.001` | 988.8 | **1.3965** | **97.7%** | **4.6036** | **0.1%** |
| FlatSAE (Baseline) | `0.001` | 744.5 | 1.7364 | 97.2% | 4.6499 | 2.1% |
| **HyperSAE (Ours)** | `0.0005` | 2285.4 | **0.7666** | **98.1%** | **4.5721** | **0.0%** |
| FlatSAE (Baseline) | `0.0005` | 1511.8 | 1.0112 | 97.0% | 4.6608 | 1.4% |

> **Note:** The recovery column was computed by the evaluation script against its own baseline and zero-ablation losses, which were not saved. Recomputing it from the 4.5204 and 12.1895 shown here gives values 0.2–1.2pp higher.

---

### 4.2 Interactive Chart 1: Reconstruction MSE Pareto Frontier

Figure 1 plots reconstruction MSE ($\downarrow$) against active feature sparsity $L_0$. HyperSAE has lower MSE at all three $L_1$ settings.

---

### 4.3 Interactive Chart 2: Cross-Entropy Loss Recovery

Cross-Entropy Loss Recovery measures the percentage of baseline model loss preserved when substituting residual stream activations with SAE reconstructions:

$$ \text{Recovery \%} = 1 - \frac{\text{Loss}_{\text{SAE}} - \text{Loss}_{\text{Baseline}}}{\text{Loss}_{\text{Zero}} - \text{Loss}_{\text{Baseline}}} $$

---

### 4.4 Detailed Analysis Across Sparsity Regimes

#### 1. High-Sparsity Constrained Regime ($L_1 = 0.005$)
At high sparsity ($L_0 \approx 53$ active features per token), where the feature budget is tightest, HyperSAE's reconstruction MSE is 4.1232 against 4.5724 for FlatSAE, a 9.8% reduction, and its CE loss recovery is 78.9% against 75.5%, a gain of 3.4 percentage points.

We interpret this as a volume effect. With a tight feature budget, Euclidean space runs out of room and FlatSAE features overlap; negative curvature gives HyperSAE exponentially more angular volume near the boundary, so a few active latents can reconstruct the residual activation with less distortion.

#### 2. Mid-Sparsity Regime ($L_1 = 0.001$)
At moderate sparsity ($L_0 \approx 744\text{–}988$), MSE is 1.3965 for HyperSAE and 1.7364 for FlatSAE, a 19.6% reduction, with CE loss recovery of 97.7% and 97.2%.

#### 3. Low-Sparsity Dense Regime ($L_1 = 0.0005$)
At dense feature budgets ($L_0 \approx 1511\text{–}2285$), MSE is 0.7666 against 1.0112, a 24.2% reduction, with CE loss recovery of 98.1% and 97.0%.

---

### 4.5 Feature-Splitting & Pairwise Overlap Reduction

Feature-splitting, where one concept splits into many near-identical latent directions, is a known failure mode of Euclidean SAEs [2, 4, 5]. We quantify it as the mean pairwise cosine similarity of co-active feature directions:

$$ \overline{\cos}(\mathbf{w}_i, \mathbf{w}_j) = \frac{1}{|\mathcal{S}|} \sum_{(i,j) \in \mathcal{S}} \frac{|\mathbf{w}_i \cdot \mathbf{w}_j|}{\|\mathbf{w}_i\|_2 \|\mathbf{w}_j\|_2} $$

where $\mathcal{S}$ is the set of feature pairs that co-occur within the same token context window.

| Architecture | $L_1$ Penalty | Mean Co-Activating Cosine Similarity ($\downarrow$) | Feature-Splitting Reduction |
| :--- | :---: | :---: | :---: |
| **FlatSAE (Baseline)** | `0.005` | 0.421 | Baseline (High Overlap) |
| **HyperSAE (Ours)** | `0.005` | **0.181** | **57.0% Overlap Reduction** |
| **FlatSAE (Baseline)** | `0.001` | 0.312 | Moderate Overlap |
| **HyperSAE (Ours)** | `0.001` | **0.134** | **57.1% Overlap Reduction** |

> **Takeaway:** HyperSAE lowers mean co-activating cosine similarity by 57.0% at $L_1 = 0.005$ and 57.1% at $L_1 = 0.001$, consistent with the Poincaré regularizer pushing sibling features into separate angular sectors instead of duplicating them along flat directions.

---

### 4.6 Loss Component Ablation Study

To check whether the gains come from negative curvature and learnable radial depth, rather than from added parameters, we ran a three-condition ablation at $L_1=0.005$:

| Experimental Condition | Poincaré Curvature $c$ | Learnable Depth $r_i$ | Poincaré Cone Loss $\mathcal{L}_{\text{Poincaré}}$ | Reconstruction MSE ($\downarrow$) | CE Loss Recovery % ($\uparrow$) | Dead Latents (%) |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: |
| **Condition A: FlatSAE Baseline** | $0.0$ (Flat) | No | No | 4.5724 | 75.5% | 3.8% |
| **Condition B: Fixed-Depth Poincaré** | $1.0$ (Curved) | Fixed ($r=0.5$) |  | 4.3102 | 77.1% | 1.2% |
| **Condition C: Full HyperSAE (Ours)** | $1.0$ (Curved) |  |  | **4.1232** | **78.9%** | **0.2%** |

> **Key Ablation Finding:** 
> 1. Switching from Euclidean to Poincaré geometry (Condition A $\to$ B) accounts for 58.4% of the MSE reduction ($4.5724 \to 4.3102$).
> 2. Making radial depth $r_i$ learnable (Condition B $\to$ C) accounts for the remaining 41.6% of the MSE reduction ($4.3102 \to 4.1232$) and lowers dead latents from 1.2% to 0.2%. Both components contribute to the gain at this setting.

---

## 5. Downstream Reasoning Benchmark (MMLU-Pro)

To test whether HyperSAE reconstructions preserve the model's reasoning, we evaluated on MMLU-Pro [18], a harder, reasoning-focused multiple-choice successor to MMLU [17].

At each single-token decision point, we replace the Layer 13 residual stream activation with its SAE reconstruction ($\hat{\mathbf{x}} = \text{SAE}(\mathbf{x})$) and run the rest of the forward pass to the answer logits. Both SAEs are the $L_1 = 0.0005$ checkpoints.

```mermaid
graph LR
    Input["Input Question / Prompt"] --> Layer12["Gemma-2-2B Layers 0..12"]
    Layer12 --> Hook["Layer 13 Output x (0-indexed)"]
    Hook --> SAE["HyperSAE / FlatSAE Hook x_hat = SAE(x)"]
    SAE --> Layer14["Gemma-2-2B Layers 14..25"]
    Layer14 --> Logits["Decision-Point Choice Logits (A to J, up to 10 options)"]
```

### 5.1 Interactive Chart 3: Downstream Benchmark Accuracy Comparison

> **Key Finding:** On MMLU-Pro (12,032 multiple-choice questions), substituting HyperSAE reconstructions gives 16.26% accuracy, against 16.11% for FlatSAE. The 0.15-point gap is small and is at most consistent with HyperSAE keeping slightly more of the information the model uses to answer. Both fall below the unmodified model (17.69%), as expected when a hidden state passes through an autoencoder.

---

### 5.2 Zero-Overhead Causal Feature Steering

Because HyperSAE's forward pass stays Euclidean, causal steering at inference time works directly in the residual space, with no Poincaré inverse exponential map [19, 20]:

$$ \mathbf{x}_{\text{steered}} = \mathbf{x} + \alpha \mathbf{W}_{\text{dec}}[k] $$

where $\alpha \in \mathbb{R}$ is the intervention strength coefficient and $\mathbf{W}_{\text{dec}}[k]$ is the Euclidean direction vector of target feature $k$, consistent with the linear representation hypothesis [23, 24].

---

```mermaid
sequenceDiagram
    autonumber
    participant Prompt as Input Token Prompt
    participant L12 as Layer 13 Activation x
    participant Steer as Steering Vector +alpha * W_dec[k]
    participant L14 as Layers 14..25 Forward Pass
    participant Out as Steered Model Completion

    Prompt->>L12: Compute Residual Stream Activation x
    L12->>Steer: Add Linear Euclidean Steering Vector (0ms latency)
    Steer->>L14: Inject x_steered into Remaining Layers
    L14->>Out: Generate Concept-Targeted Text Stream
```

#### Steering Benchmark Experiment (Gemma-2-2B Layer 13)

As an example, we steer Gemma-2-2B by clamping `Feature #412` (Python Syntax / Functions, $r=0.45$) with coefficient $\alpha = +5.0$:

- **Unsteered Baseline Prompt:** `"Write a short essay explaining how software programs execute instructions."`
  - **Baseline Output:** *"Software programs execute instructions by translating human-readable text into machine code through a compiler or interpreter. The CPU reads instructions sequentially..."*
- **HyperSAE Steered Output ($\alpha = +5.0$):** *"def execute_program(instructions: list) -> None:\n    for stmt in instructions:\n        result = process_opcode(stmt)\n        return result..."*

---

## 6. Radial Depth & Hierarchical Taxonomy Extraction

HyperSAE predicts that the learned radial depth $r_i$ (Poincaré radius $\tanh(r_i) \in [0, 1)$) acts as a continuous measure of semantic abstraction, as in earlier hyperbolic embedding work [8, 10, 25]:

- **Root Features ($r_i \to 0$):** Located near the Poincaré origin, capturing broad domain super-categories.
- **Branch Features ($r_i \approx 0.5$):** Intermediate fields and sub-domains.
- **Leaf Latents ($r_i \to 1$):** Located near the Poincaré boundary, capturing specific token patterns and entity names.

### 6.1 Interactive Chart 4: Dictionary Feature Radial Depth Distribution

### 6.2 Qualitative Taxonomy Table

| Radial Depth $r_i$ | Feature Index | Sample Activating Tokens / Context | Semantic Category |
| :--- | :---: | :--- | :--- |
| **$r = 0.12$ (Root)** | `#104` | `"code", "function", "data", "system", "process"` | **Abstract Computer Science / Software** |
| **$r = 0.45$ (Branch)** | `#412` | `"def", "class", "return", "import", "async"` | **Python Language Constructs** |
| **$r = 0.88$ (Leaf)** | `#1802` | `"asyncio.get_running_loop()", "RuntimeError"` | **Python Async Execution Exceptions** |
| **$r = 0.15$ (Root)** | `#88` | `"molecule", "reaction", "cell", "energy"` | **Natural Sciences / Chemistry** |
| **$r = 0.52$ (Branch)** | `#914` | `"electron", "orbital", "covalent", "quantum"` | **Atomic & Quantum Physics** |
| **$r = 0.94$ (Leaf)** | `#3411` | `"quantum electrodynamics", "Feynman diagram"` | **Quantum Field Theory Notation** |

---

### 6.3 Deep Monosemanticity Activation Case Studies

To illustrate how radial depth relates to semantic abstraction, we trace two four-level chains of features on FineWeb-Edu text:

#### Case Study A: Computer Science Taxonomy Chain (`Feature #104` $\to$ `#412` $\to$ `#1280` $\to$ `#1802`)

```
Level 1: Root Latent (r = 0.12, Feature #104)
  Activating Tokens: "...computational algorithms process structured input data..."
  Max Activation: 14.82

Level 2: Branch Latent (r = 0.45, Feature #412)
  Activating Tokens: "...def calculate_loss(predictions, targets): return torch.mean..."
  Max Activation: 18.91

Level 3: Sub-Leaf Latent (r = 0.74, Feature #1280)
  Activating Tokens: "...async def fetch_payload(session, url): async with session.get..."
  Max Activation: 22.40

Level 4: Leaf Latent (r = 0.92, Feature #1802)
  Activating Tokens: "...raise RuntimeError('Event loop is closed') in asyncio.events..."
  Max Activation: 31.05
```

#### Case Study B: Quantum Physics Taxonomy Chain (`Feature #88` $\to$ `#914` $\to$ `#2104` $\to$ `#3411`)

```
Level 1: Root Latent (r = 0.15, Feature #88)
  Activating Tokens: "...thermodynamic systems exchange energy with surrounding..."
  Max Activation: 12.44

Level 2: Branch Latent (r = 0.52, Feature #914)
  Activating Tokens: "...atomic orbitals describe the spatial probability density of electrons..."
  Max Activation: 16.73

Level 3: Sub-Leaf Latent (r = 0.78, Feature #2104)
  Activating Tokens: "...quantum electrodynamics perturbation expansion terms..."
  Max Activation: 24.18

Level 4: Leaf Latent (r = 0.94, Feature #3411)
  Activating Tokens: "...Feynman propagator amplitude integral over virtual photon exchange..."
  Max Activation: 35.80
```

> **Takeaway:** In both chains, features at small radial depth ($r < 0.3$) activate across general domain text, while features near the boundary ($r > 0.9$) activate on narrow, single-concept technical phrases.

---

## 7. Open-Source PyTorch Implementation (`hypersae`)

The implementation is released as [`hypersae`](https://github.com/vishal-dehurdle/hypersae), an open-source PyTorch package, alongside other open dictionary-learning work such as Gated SAEs and Gemma Scope [21, 22]. The two core classes are listed below.

### 7.1 Core HyperSAE Model Definition

```python

class HyperSAE(nn.Module):
    def __init__(self, d_model: int, dict_size: int):
        super().__init__()
        self.d_model = d_model
        self.dict_size = dict_size
        
        # Encoder & Decoder Parameters
        self.W_enc = nn.Parameter(torch.empty(dict_size, d_model))
        self.b_enc = nn.Parameter(torch.zeros(dict_size))
        self.W_dec = nn.Parameter(torch.empty(dict_size, d_model))
        
        # Learnable Radial Depth Parameters (Initialized to root-ward r=0.1)
        self.r = nn.Parameter(torch.empty(dict_size))
        self.reset_parameters()
        
    def reset_parameters(self):
        init.kaiming_uniform_(self.W_enc, a=math.sqrt(5))
        init.kaiming_uniform_(self.W_dec, a=math.sqrt(5))
        init.constant_(self.r, 0.1)
        self.enforce_unit_norm()
        
    @torch.no_grad()
    def enforce_unit_norm(self):
        norms = torch.norm(self.W_dec, p=2, dim=-1, keepdim=True)
        self.W_dec.copy_(self.W_dec / torch.clamp(norms, min=1e-8))
        
    def forward(self, x: torch.Tensor):
        # Fast-Path Euclidean Forward Execution
        f = torch.relu(x @ self.W_enc.t() + self.b_enc)
        x_hat = f @ self.W_dec
        return x_hat, f
```

### 7.2 Asynchronous Co-Activation Queue

```python
class CoActivationQueue(nn.Module):
    def __init__(self, dict_size: int, max_size: int = 20000):
        super().__init__()
        self.dict_size = dict_size
        self.max_size = max_size
        self.register_buffer("queue_u", torch.zeros(max_size, dtype=torch.long))
        self.register_buffer("queue_v", torch.zeros(max_size, dtype=torch.long))
        self.register_buffer("ptr", torch.zeros(1, dtype=torch.long))
        
    @torch.no_grad()
    def push_coactivations(self, active_indices: torch.Tensor):
        # Asynchronously log co-activating feature pairs to GPU buffer
        pairs = torch.combinations(active_indices, r=2)
        n = pairs.size(0)
        if n == 0:
            return
        idx = (torch.arange(n, device=pairs.device) + self.ptr) % self.max_size
        self.queue_u[idx] = pairs[:, 0]
        self.queue_v[idx] = pairs[:, 1]
        self.ptr[0] = (self.ptr[0] + n) % self.max_size
```

---

## 8. Discussion, Limitations & Future Work

### 8.1 Hierarchical Interpretability
Beyond reconstruction MSE, HyperSAE's main advantage is that radial depth $r_i$ (Poincaré radius $\tanh(r_i) \in [0, 1)$) gives a quantitative measure of semantic abstraction. Features near the origin ($r_i \to 0$) capture broad abstractions such as *"Science"* or *"Code"*, and features near the boundary ($r_i \to 1$) capture fine-grained leaf latents such as *"Python asyncio loop exception"*.

### 8.2 Limitations
We evaluated only Layer 13 of Gemma-2-2B. Future work will extend the sweep to an early layer (Layer 6, syntactic) and a late layer (Layer 20, semantic), and to Llama-3-8B and Qwen-2.5-7B.

---

## 9. Frequently Asked Questions (FAQ)

### Q1: Why does standard Euclidean space fail for Sparse Autoencoders at large dictionary sizes?
Human knowledge is hierarchical, and a tree grows exponentially with depth, $\mathcal{O}(b^r)$. Volume in flat Euclidean space $\mathbb{R}^d$ grows only polynomially, $\mathcal{O}(r^d)$. As the dictionary size $M$ grows, flat space runs out of room and unrelated concepts are pushed into overlap, which shows up as feature-splitting and high reconstruction MSE.

### Q2: How does HyperSAE prevent the RMSNorm Spherical Trap in LLMs?
HyperSAE uses Decoupled Weight-Space Regularization. Token activations go through a fast, linear Euclidean forward pass that respects the base model's layer normalization (`RMSNorm`), and the Poincaré ball projection is applied only to the dictionary atom weights during training.

### Q3: Does causal feature steering with HyperSAE incur latency overhead?
No. The decoder weights are unit-norm Euclidean vectors in the residual space, so steering ($\mathbf{x}_{\text{steered}} = \mathbf{x} + \alpha \mathbf{W}_{\text{dec}}[k]$) is a plain vector addition with no manifold projection at inference time (0ms projection latency).

### Q4: What is the primary quantitative advantage of HyperSAE over FlatSAE?
At high sparsity ($L_0 \approx 53$), HyperSAE lowers reconstruction MSE by 9.8% ($4.1232$ vs $4.5724$), raises cross-entropy loss recovery by 3.4 percentage points ($78.9\%$ vs $75.5\%$) and cuts dead latents from 3.8% to 0.2%.

---

## 10. Conclusion

HyperSAE places dictionary atoms in a Poincaré ball while keeping a linear Euclidean forward pass. On Google Gemma-2-2B Layer 13 it has lower reconstruction MSE and higher CE loss recovery than a Euclidean SAE at all three $L_1$ settings. At high sparsity it lowers dead latents from 3.8% to 0.2% and co-activating feature overlap by 57.0%, and under substitution it keeps slightly higher MMLU-Pro accuracy (16.26% vs 16.11%).

---

## References

* [1] Elhage, N., Hume, T., Olsson, C., Schiefer, N., Henighan, T., Kravec, S., Hatfield-Dodds, Z., Lasenby, R., Drain, D., Chen, C., Grosse, R., McCandlish, S., Kaplan, J., Amodei, D., Wattenberg, M., & Olah, C. (2022). "Toy Models of Superposition." *arXiv preprint arXiv:2209.10652*.
* [2] Bricken, T., Templeton, A., Batson, J., Chen, B., Jermyn, A., Conerly, T., Turner, N., Anil, C., Denison, C., Askell, A., ... & Olah, C. (2023). "Towards Monosemanticity: Decomposing Language Models With Dictionary Learning." *Transformer Circuits Thread*.
* [3] Gao, L., Dupré la Tour, T., Tillman, H., Goh, G., Troll, R., Radford, A., Sutskever, I., Leike, J., & Wu, J. (2024). "Scaling and Evaluating Sparse Autoencoders." *arXiv preprint arXiv:2406.04093*.
* [4] Templeton, A., Conerly, T., Marcus, J., Lindsey, J., Bricken, T., Chen, B., Pearce, A., Citro, C., Ameisen, E., Jones, A., ... & Henighan, T. (2024). "Scaling Monosemanticity: Extracting Interpretable Features from Claude 3 Sonnet." *Transformer Circuits Thread*.
* [5] Cunningham, H., Ewart, A., Riggs, L., Huben, R., & Sharkey, L. (2024). "Sparse Autoencoders Find Highly Interpretable Features in Language Models." *International Conference on Learning Representations (ICLR)*.
* [6] Gromov, M. (1987). "Hyperbolic Groups." In *Essays in Group Theory*, Mathematical Sciences Research Institute Publications, Vol. 8, 75–263. Springer.
* [7] Sarkar, R. (2011). "Low Distortion Delaunay Embedding of Trees in Hyperbolic Plane." *Graph Drawing (GD 2011)*, Lecture Notes in Computer Science, Vol. 7034, 355–366. Springer.
* [8] Nickel, M., & Kiela, D. (2017). "Poincaré Embeddings for Learning Hierarchical Representations." *Advances in Neural Information Processing Systems (NeurIPS)*, 30, 6338–6347.
* [9] Ganea, O., Bécigneul, G., & Hofmann, T. (2018a). "Hyperbolic Neural Networks." *Advances in Neural Information Processing Systems (NeurIPS)*, 31, 5350–5360.
* [10] Ganea, O., Bécigneul, G., & Hofmann, T. (2018b). "Hyperbolic Entailment Cones for Learning Hierarchical Embeddings." *International Conference on Machine Learning (ICML)*, PMLR 80, 1646–1655.
* [11] Ungar, A. A. (2008). *Analytic Hyperbolic Geometry and Albert Einstein's Special Theory of Relativity*. World Scientific Publishing.
* [12] Poincaré, H. (1882). "Théorie des groupes fuchsiens." *Acta Mathematica*, 1, 1–62.
* [13] Zhang, B., & Sennrich, R. (2019). "Root Mean Square Layer Normalization." *Advances in Neural Information Processing Systems (NeurIPS)*, 32, 12360–12371.
* [14] Gemma Team, Google. (2024). "Gemma 2: Improving Open Language Models at a Practical Size." *arXiv preprint arXiv:2408.00118*.
* [15] Penedo, G., Kydlíček, H., Ben Allal, L., Lozhkov, A., Mitchell, M., Raffel, C., Von Werra, L., & Wolf, T. (2024). "The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scale." *Advances in Neural Information Processing Systems (NeurIPS), Datasets and Benchmarks Track*, 37, 30811–30849.
* [16] Nanda, N., & Bloom, J. (2022). "TransformerLens: A Library for Mechanistic Interpretability of Generative Language Models." *GitHub Repository*.
* [17] Hendrycks, D., Burns, C., Basart, S., Zou, A., Mazeika, M., Song, D., & Steinhardt, J. (2021). "Measuring Massive Multitask Language Understanding (MMLU)." *International Conference on Learning Representations (ICLR)*.
* [18] Wang, Y., Ma, X., Zhang, G., Ni, Y., Chandra, A., Guo, S., Ren, W., Arulraj, A., He, X., Jiang, Z., Li, T., Ku, M., Wang, K., Zhuang, A., Fan, R., Yue, X., & Chen, W. (2024). "MMLU-Pro: A More Robust and Challenging Multi-Task Language Understanding Benchmark." *arXiv preprint arXiv:2406.01574*.
* [19] Turner, A., Thiergart, L., Udell, D., Leech, G., Mini, U., & MacDiarmid, M. (2023). "Activation Addition: Steering Language Models Without Optimization." *arXiv preprint arXiv:2308.10248*.
* [20] Rimsky, N., Gabrieli, N., Schulz, J., Tong, M., Hubinger, E., & Turner, A. M. (2024). "Steering Llama 2 via Contrastive Activation Addition." *arXiv preprint arXiv:2312.06681*.
* [21] Rajamanoharan, S., Conmy, A., Smith, L., Lieberum, T., Varma, V., Kramár, J., Shah, R., & Nanda, N. (2024). "Improving Dictionary Learning with Gated Sparse Autoencoders." *arXiv preprint arXiv:2404.16014*.
* [22] Lieberum, T., Rajamanoharan, S., Conmy, A., Smith, L., Sonnerat, N., Varma, V., Kramár, J., Dragan, A., Shah, R., & Nanda, N. (2024). "Gemma Scope: Open Sparse Autoencoders Everywhere All At Once on Gemma 2." *arXiv preprint arXiv:2408.05147*.
* [23] Marks, S., & Tegmark, M. (2023). "The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasets." *arXiv preprint arXiv:2310.06824*.
* [24] Park, K., Choe, Y. J., & Veitch, V. (2023). "The Linear Representation Hypothesis and the Geometry of Large Language Models." *arXiv preprint arXiv:2311.03658*.
* [25] Chami, I., Ying, Z., Ré, C., & Leskovec, J. (2019). "Hyperbolic Graph Convolutional Neural Networks." *Advances in Neural Information Processing Systems (NeurIPS)*, 32, 4869–4880.]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[Escaping Flatland: Weight-Space Regularization and Hyperbolic Geometry in Mechanistic Interpretability]]></title>
      <link>https://vishalvermalabs.com/papers/escaping-flatland-hyperbolic-geometry/</link>
      <guid>https://vishalvermalabs.com/papers/escaping-flatland-hyperbolic-geometry/</guid>
      <pubDate>Thu, 25 Jun 2026 00:00:00 GMT</pubDate>
      <dc:creator>Vishal Verma</dc:creator>
      <category>Mechanistic Interpretability & Deep Architecture</category>
      <description><![CDATA[A mathematical critique of Euclidean Sparse Autoencoders (SAEs). Moving from flat linear algebra to the negative curvature of Riemannian manifolds, we show how Hyperbolic Sparse Autoencoders (HypSAEs) can use Weight-Space Regularization to extract hierarchical ontologies without optimization collapse.]]></description>
      <content:encoded><![CDATA[### Abstract

Current work on AI alignment and safety depends heavily on Mechanistic Interpretability, the attempt to reverse-engineer the dense, superimposed activations of Large Language Models (LLMs) into discrete, human-understandable concepts. Its main tool is the Euclidean Sparse Autoencoder (SAE). As researchers scale SAEs to tens of millions of features, larger dictionaries give diminishing returns in feature purity, along with dead latents, feature-splitting and fast-growing compute costs.

The cause is geometric. Current SAE architectures implicitly assume that semantic latent space is flat (Euclidean), but human semantic concepts are hierarchical (ontological trees). The number of nodes in a tree grows exponentially with depth, while volume in Euclidean space grows only polynomially, so embedding the tree in Euclidean space forces unrelated concepts to interfere and violates sphere-packing limits.

Moving the interpretability framework from linear algebra to the differential geometry of Riemannian manifolds, we propose the **Hyperbolic Sparse Autoencoder (HypSAE)**. A direct hyperbolic SAE runs into practical optimization problems, in particular the RMSNorm spherical trap, Algebraic Cancellation, and the Category Error of applying geometry to transient tokens. We avoid them by decoupling the geometry from the computation. The forward pass is Euclidean, and the Poincaré manifold is used only as a **Weight-Space Regularizer**, in which learned radial scalars, Momentum Contrast and Hyperbolic Entailment Cones group concepts hierarchically. This gives a mathematical route toward monosemanticity while keeping the SAE compatible with causal interventions.

---

## 1. The Dimensionality Crisis in Mechanistic Interpretability

Transformers must represent far more concepts than they have dimensions. They do this through **superposition**: packing unrelated concepts into the same active neurons as nearly orthogonal vectors in a high-dimensional continuous space [1].

To untangle this, the AI alignment community relies on Sparse Autoencoders (SAEs) [2, 3]. A standard Euclidean SAE maps the dense residual stream ($\mathbf{x} \in \mathbb{R}^d$) into a sparse, overcomplete dictionary ($\mathbf{f} \in \mathbb{R}^M$, where $M \gg d$), optimizing:

$$ \mathcal{L}_{\text{SAE}} = \underbrace{\left\| \mathbf{x} - \mathbf{W}_{\text{dec}} \mathbf{f} \right\|_2^2}_{\text{Reconstruction (MSE)}} + \underbrace{\lambda \|\mathbf{f}\|_1}_{\text{Sparsity}} $$

To achieve clean feature separation, labs train SAEs with tens of millions of features, at substantial computational cost [4]. Adding dimensions to a flat space is a brute-force fix that leaves the underlying geometry unchanged.

---

## 2. The Geometry of Thought: Trees vs. Flatland

Many semantic concepts are hierarchical. The concept of a *Golden Retriever* sits at the terminal leaf of a deeply nested ontological tree. 

```mermaid
graph TD
    E["Entity (Root)"]
    E --> Ab["Abstract"]
    E --> LO["Living Organism"]
    LO --> Pl["Plant"]
    LO --> An["Animal"]
    An --> Ma["Mammal"]
    Ma --> Ca["Canine"]
    Ca --> Wo["Wolf"]
    Ca --> GR["Golden Retriever"]
```

In a discrete tree with a branching factor $b > 1$, the number of nodes grows exponentially with depth $r$: $\mathcal{O}(b^r)$. However, in flat Euclidean space $\mathbb{R}^d$, the volume of a hypersphere grows only polynomially: $\mathcal{O}(r^d)$.

An exponentially growing number of concepts cannot be packed into a polynomially growing volume without overlap [5, 6, 7]. When a Euclidean SAE runs short of dimensions, the hierarchy breaks apart. A single coherent high-level concept splits into redundant, overly specific latents (a failure known as **feature-splitting**), and the dictionary becomes an unstructured cloud that is hard to interpret.

---

## 3. The Hyperbolic Manifold: Continuous Trees

To get past this packing limit, we move from flat affine spaces to Riemannian manifolds with constant negative curvature.

In hyperbolic space (often modeled with the Poincaré disk), the circumference and volume of a sphere grow *exponentially* with its radius [8, 9, 10]:

$$ V_{\text{Hyperbolic}}(r) \sim \mathcal{O}\left(e^{(d-1)\sqrt{c}\,r}\right) $$

Because hyperbolic space expands exponentially in the transverse (angular) direction, it has room to pack many highly specific leaf nodes without them overlapping.

```mermaid
graph LR
    subgraph flat["EUCLIDEAN SAE — Flat Space"]
        direction TB
        FA["Feature A"] --- FB["Feature B"]
        FB --- FC["Feature C"]
        FC --- FD["Feature D"]
        FA --- FC
        FB --- FD
        FA -.-|"Feature Splits"| FD
    end
    subgraph hyper["HYPERBOLIC SAE — Poincaré Disk"]
        direction TB
        R["Root (Abstract)"]
        R --> C1["Category 1"]
        R --> C2["Category 2"]
        C1 --> L1["Leaf A"]
        C1 --> L2["Leaf B"]
        C2 --> L3["Leaf C"]
        C2 --> L4["Leaf D"]
    end
```

| Property | Euclidean SAE (Flat Space) | Hyperbolic SAE (Poincaré Disk) |
| :--- | :--- | :--- |
| **Volume Growth** | Polynomial $\mathcal{O}(r^d)$ | Exponential $\mathcal{O}(e^r)$ |
| **Hierarchy Encoding** | Flawed / Feature-splitting | Native Radial Depth |
| **Concept Mapping** | Dense, crowded grids | Native ontological trees |

---

## 4. The Physics of Optimization: Escaping the Execution Traps

Hyperbolic space fits hierarchical data well, but mapping the SAE's reconstruction objective directly into it fails under unsupervised GPU optimization, in four ways:

1. **The Category Error (Tokens vs. Concepts):** Applying hyperbolic geometry to the transient *token activations* ($\mathbf{x}$) organizes random sequence snippets in a batch into a tree. Concepts live in the Weights (Parameters), not the Token Activations [11].
2. **The RMSNorm Spherical Trap:** Modern LLMs use RMSNorm, which projects every target residual token $\mathbf{x}$ onto a high-dimensional Euclidean hypersphere of fixed magnitude. Mapping $\mathbf{x}$ into a Poincaré cone therefore cannot produce a radially varying ontology: the map sends every token to the same thin spherical shell [12].
3. **The Algebraic Cancellation:** If one maps the residual stream to the Poincaré ball ($\exp_\mathbf{o}^c$) and then immediately back to the tangent space ($\log_\mathbf{o}^c$) to apply an $\ell_1$ sparsity penalty, the two maps cancel ($\log \circ \exp = \mathbf{I}$). The forward pass is then mathematically identical to a vanilla Euclidean SAE, and the GPU spends FLOPs computing the identity [14].
4. **The Collinear Rank-Collapse:** If one attempts to build hierarchies by placing parent and leaf concepts on the same angular ray to save Euclidean dimensions, one violates the Linear Representation Hypothesis [13, 14, 15]. Collinear dictionary atoms are linearly dependent, and the $\ell_1$ sparsity penalty will immediately prune one to zero [15]. By Gauss's Lemma, radial geodesics are isometric to Euclidean lines; true exponential packing capacity exists only in transverse (angular) deviations [16].

---

## 5. The Solution: Weight-Space Regularization

To avoid all four problems, we decouple the geometry from the forward pass.

We do not map the transient *token activations* ($\mathbf{x}$) to the manifold. Instead, we apply the Poincaré manifold only to the dictionary weights ($\mathbf{w}_i$), which represent the concepts, and use it as a structural regularizer.

### 5.1 The Pure Euclidean Forward Pass (The Interventional Territory)

The forward pass stays Euclidean. This respects the RMSNorm of the target data $\mathbf{x}_{\text{normed}}$, keeps GPU inference fast, avoids Algebraic Cancellation, and preserves the ability to perform causal Manifold Steering downstream [17, 18].

$$ \mathbf{f} = \text{ReLU}(\mathbf{W}_{\text{enc}} \mathbf{x}_{\text{normed}} + \mathbf{b}_{\text{enc}}) $$

$$ \mathbf{\hat{x}} = \sum_{i=1}^M f_i \mathbf{w}_i $$

$$ \mathcal{L}_{\text{Recon}} = \left\| \mathbf{x}_{\text{normed}} - \mathbf{\hat{x}} \right\|_2^2 $$

### 5.2 The Hyperbolic Concept Embeddings (The Unit-Norm Paradox)

The ontology lives in the columns of the Euclidean decoder weight matrix $\mathbf{W}_{\text{dec}}$. Let $\mathbf{w}_i \in \mathbb{R}^d$ be the $d$-dimensional Euclidean dictionary atom for Feature $i$.

To prevent the $\ell_1$ solver from collapsing the activations to zero while inflating dictionary magnitudes to infinity, standard SAEs enforce a unit-norm constraint on the decoder columns: $\|\mathbf{w}_i\|_2 = 1$. But mapping unit vectors directly through the exponential map would put every concept on the same radial shell in hyperbolic space, flattening the ontological tree onto a single sphere.

We avoid this unit-norm paradox with Decoupled Radial Depth, which separates the interventional direction from the ontological depth. Each feature gets a learned 1D scalar parameter $r_i \in \mathbb{R}^+$ that encodes its hierarchical depth.

We map these scaled Feature Weights into the $d$-dimensional Poincaré ball $(\mathbb{B}^d_c, g_x)$ via the Exponential Map at the origin [14, 19]:

$$ \mathbf{h}_i = \exp_\mathbf{o}^c(r_i \cdot \mathbf{w}_i) = \tanh(\sqrt{c} \, r_i) \frac{\mathbf{w}_i}{\sqrt{c}} $$

*(Since $\|\mathbf{w}_i\|_2 = 1$, the norm cancels out of the denominator, yielding a simple, numerically stable projection).*

The geometry is now computed in the model's own $d$ dimensions (2,304 for the Gemma-2-2B layer in the companion study), which is computationally stable and uses the low-dimensional packing capacity. It acts on the structural relationships between static concepts. $\mathbf{w}_i$ stays a flat Euclidean unit vector that sets the interventional direction, while $r_i$ sets ontological depth (Origin = Root, Boundary = Leaf), so the hierarchy is kept separate from the Euclidean $\ell_1$ solver.

### 5.3 Asymmetric Entailment via Momentum Contrast (MoCo)

Tracking a dense feature co-activation graph would need $\mathcal{O}(M^2)$ memory, which runs to petabytes. To build the structural prior without it, we use a **Momentum Contrast (MoCo) Queue** [20].

When a batch of tokens causes Feature $i$ (Parent) and Feature $j$ (Child) to heavily co-activate across the Zipfian token distribution, we sample this relationship from the MoCo queue and pull their hyperbolic weight embeddings ($\mathbf{h}_i$ and $\mathbf{h}_j$) into a Hyperbolic Entailment Cone [21]:

$$ \mathcal{L}_{\text{Entailment}} = \mathbb{E}_{\text{MoCo Queue}} \left[ \sum_{i,j \in \text{active}} \text{ConePenalty}(\mathbf{h}_i, \mathbf{h}_j) \right] $$

This asymmetric loss penalizes specific child concepts that fall outside the cone cast outward from their broader parents.

*(Where the ConePenalty uses the standard isometric invariant geodesic distance scaled by $1/\sqrt{c}$):*

$$ d_{\mathbb{B}_c}(\mathbf{u}, \mathbf{v}) = \frac{1}{\sqrt{c}} \text{arcosh} \left( 1 + 2c\frac{\|\mathbf{u} - \mathbf{v}\|^2}{(1 - c\|\mathbf{u}\|^2)(1 - c\|\mathbf{v}\|^2)} \right) $$

### 5.4 The Tri-Partite HypSAE Loss

The final objective combines the flat reconstruction and sparsity terms with the curved entailment term:

$$ \mathcal{L}_{\text{HypSAE}} = \underbrace{\left\| \mathbf{x}_{\text{normed}} - \mathbf{W}_{\text{dec}} \mathbf{f} \right\|_2^2}_{\text{Euclidean Recon}} + \underbrace{\lambda \|\mathbf{f}\|_1}_{\text{Sparsity}} + \underbrace{\beta \mathcal{L}_{\text{Entailment}}}_{\text{Weight-Space Map}} $$

---

## 6. The Architectural Payoff: Monosemanticity at Scale

With the geometry confined to weight space, HypSAE acts as a structural regularizer.

Because $\mathbf{W}_{\text{dec}}$ dictates how features superimpose in the LLM's flat residual stream, the optimizer is pushed to organize the Euclidean dictionary weights into an ontological tree to reduce the structural penalty. Root concepts remain near the origin ($r_i \approx 0$); distinct child concepts fan out transversely toward the boundary.

1. **Smaller Dictionaries:** Because exponential volume handles packing within the structural prior, HypSAE should need far fewer dictionary dimensions ($M_{\mathbb{H}} \ll M_{\mathbb{E}}$) to reach the same feature separation.
2. **Less Feature-Splitting:** The loss rewards grouping related concepts hierarchically rather than splitting a single concept into redundant Euclidean vectors to reduce MSE.
3. **Interventional Compatibility:** Because the forward pass ($\mathbf{W}_{\text{enc}} \mathbf{x}_{\text{normed}}$) and decoder ($\sum f_i \mathbf{w}_i$) remain flat matrix multiplications, there is no identity cancellation and causal linear steering is preserved.

### 6.1 HypSAE vs. Prior Art

Two recent architectures also address the ontological bottleneck: Hierarchical SAEs (Muchane et al., 2025) [22] and Matryoshka SAEs (M-SAE) [26], which build on Matryoshka Representation Learning [23]. Both simulate depth with discrete structure, nesting smaller Euclidean sub-spaces inside larger ones.

HypSAE replaces this discrete structure with a continuous geometry. Hyperbolic dictionary learning is already established in fields that need topological mapping, such as charting brain ventricles with hyperbolic Ricci flow in Alzheimer's imaging [24]. We adapt these Riemannian methods and use Momentum Contrast to keep the computation within GPU memory, so that hierarchical extraction respects both the LLM's geometry and the hardware's limits.

---

## 7. Conclusion: Escaping Flatland

In 1884, Edwin A. Abbott published *Flatland*, a novella about two-dimensional shapes that cannot conceive of a three-dimensional world above them [25]. Interpretability research is in a similar position: it tries to decode the exponentially branching structure of model representations with the polynomial geometry of flat Euclidean space.

Euclidean space cannot capture the dense, hierarchical ontology of human knowledge without feature-splitting. But differential geometry on its own also fails if it is forced to reconstruct the RMSNorm hypersphere of modern foundation models or is applied directly to transient token activations.

Weight-Space Regularization with the learned depth scalar $r_i$ respects the linear representation structure of the model while using the exponential packing capacity of hyperbolic space. The aim is structured, monosemantic dictionaries that are organized as ontological trees.

> **Empirical Validation & Implementation:** We tested HypSAE, released as HyperSAE, on Google Gemma-2-2B (Layer 13) with 20M FineWeb-Edu tokens, where it Pareto-dominates the flat SAEs it was compared with. Read the full empirical study: [Hyperbolic Sparse Autoencoders: Empirical Validation of Poincaré Manifold Geometry on LLM Activations](/papers/empirical-validation-hypersae-poincare-geometry). The open-source PyTorch package is available at [github.com/vishal-dehurdle/hypersae](https://github.com/vishal-dehurdle/hypersae) and PyPI ([`pip install hypersae`](https://pypi.org/project/hypersae/)).

---

## References

* [1] Elhage, N., Hume, T., Olsson, C., Schiefer, N., Henighan, T., Kravec, S., Hatfield-Dodds, Z., Lasenby, R., Drain, D., Chen, C., Grosse, R., McCandlish, S., Kaplan, J., Amodei, D., Wattenberg, M., & Olah, C. (2022). "Toy Models of Superposition." *Anthropic Transformer Circuits Thread*.
* [2] Bricken, T., Templeton, A., Batson, J., Chen, B., Jermyn, A., Conerly, T., Turner, N., Anil, C., Denison, C., Askell, A., ... & Olah, C. (2023). "Towards Monosemanticity: Decomposing Language Models With Dictionary Learning." *Transformer Circuits Thread*.
* [3] Cunningham, H., Ewart, A., Riggs, L., Huben, R., & Sharkey, L. (2024). "Sparse Autoencoders Find Highly Interpretable Features in Language Models." *International Conference on Learning Representations (ICLR)*.
* [4] Gao, L., Dupré la Tour, T., Tillman, H., Goh, G., Troll, R., Radford, A., Sutskever, I., Leike, J., & Wu, J. (2024). "Scaling and evaluating sparse autoencoders." *arXiv preprint arXiv:2406.04093*.
* [5] Gromov, M. (1987). "Hyperbolic groups." In *Essays in Group Theory*, MSRI Publications, Vol. 8, 75–263. Springer-Verlag.
* [6] Sarkar, R. (2011). "Low Distortion Delaunay Embedding of Trees in Hyperbolic Plane." *International Symposium on Graph Drawing (GD 2011)*, Lecture Notes in Computer Science, Vol. 7034, 355–366.
* [7] Conway, J. H., & Sloane, N. J. A. (1999). *Sphere Packings, Lattices and Groups*. 3rd Edition, Springer-Verlag, New York.
* [8] Nickel, M., & Kiela, D. (2017). "Poincaré Embeddings for Learning Hierarchical Representations." *Advances in Neural Information Processing Systems (NeurIPS)*, 30, 6338–6347.
* [9] Poincaré, H. (1882). "Théorie des Groupes Fuchsiens." *Acta Mathematica*, 1(1), 1–62.
* [10] Cannon, J. W., Floyd, W. J., Kenyon, R., & Parry, W. R. (1997). "Hyperbolic Geometry." In *Flavors of Geometry*, MSRI Publications, Vol. 31, 59–115. Cambridge University Press.
* [11] Olah, C., Cammarata, N., Schubert, L., Goh, G., Petrov, M., & Carter, S. (2020). "Zoom In: An Introduction to Circuits." *Distill*, 5(3), e00024.001.
* [12] Zhang, B., & Sennrich, R. (2019). "Root Mean Square Layer Normalization." *Advances in Neural Information Processing Systems (NeurIPS)*, 32, 12360–12371.
* [13] Park, K., Choe, Y. J., & Veitch, V. (2023). "The Linear Representation Hypothesis and the Geometry of Large Language Models." *arXiv preprint arXiv:2311.03658*.
* [14] Ganea, O., Bécigneul, G., & Hofmann, T. (2018). "Hyperbolic Neural Networks." *Advances in Neural Information Processing Systems (NeurIPS)*, 31, 5350–5360.
* [15] Tropp, J. A. (2004). "Greed is good: Algorithmic results for sparse approximation." *IEEE Transactions on Information Theory*, 50(10), 2231–2242.
* [16] Lee, J. M. (2018). *Introduction to Riemannian Manifolds*. 2nd Edition, Graduate Texts in Mathematics, Vol. 176. Springer International Publishing.
* [17] Turner, A., Thiergart, L., Udell, D., Leech, G., Mini, U., & MacDiarmid, M. (2023). "Activation Addition: Steering Language Models Without Optimization." *arXiv preprint arXiv:2308.10248*.
* [18] Wurgaft, D., et al. (2026). "Manifold Steering Reveals the Shared Geometry of Neural Network Representation and Behavior." *arXiv preprint arXiv:2605.05115*.
* [19] Ungar, A. A. (2008). *Analytic Hyperbolic Geometry and Albert Einstein's Special Theory of Relativity*. World Scientific Publishing.
* [20] He, K., Fan, H., Wu, Y., Xie, S., & Girshick, R. (2020). "Momentum Contrast for Unsupervised Visual Representation Learning." *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)*, 9729–9738.
* [21] Ganea, O. E., Bécigneul, G., & Hofmann, T. (2018). "Hyperbolic Entailment Cones for Learning Hierarchical Embeddings." *International Conference on Machine Learning (ICML)*, 1646–1655.
* [22] Muchane, M., Richardson, S., Park, K., & Veitch, V. (2025). "Incorporating Hierarchical Semantics in Sparse Autoencoder Architectures." *arXiv preprint arXiv:2506.01197*.
* [23] Kusupati, A., Bhatt, G., Rege, A., Wallingford, M., Sinha, A., Ramanujan, V., Howard-Snyder, W., Chen, K., Kakade, S., Jain, P., & Farhadi, A. (2022). "Matryoshka Representation Learning." *Advances in Neural Information Processing Systems (NeurIPS)*, 35, 30233–30249.
* [24] Zhang, J., Dong, Q., Shi, J., Li, Q., Stonnington, C. M., Gutman, B. A., Chen, K., Reiman, E. M., Caselli, R. J., Thompson, P. M., Ye, J., & Wang, Y. (2021). "Predicting future cognitive decline with hyperbolic stochastic coding." *Medical Image Analysis*, 70, 102009.
* [25] Abbott, E. A. (1884). *Flatland: A Romance of Many Dimensions*. Seeley & Co., London.
* [26] Bussmann, B., Nabeshima, N., Karvonen, A., & Nanda, N. (2025). "Learning Multi-Level Features with Matryoshka Sparse Autoencoders." *Proceedings of the 42nd International Conference on Machine Learning (ICML)*, PMLR 267, 6077–6101.]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[Empirical Lyapunov Stability: Growth-Ratio Energy Functions as Leading Indicators of Agent Task Failure]]></title>
      <link>https://vishalvermalabs.com/papers/empirical-lyapunov-stability-agent-failure/</link>
      <guid>https://vishalvermalabs.com/papers/empirical-lyapunov-stability-agent-failure/</guid>
      <pubDate>Thu, 04 Jun 2026 00:00:00 GMT</pubDate>
      <dc:creator>Vishal Verma</dc:creator>
      <category>Multi-Agent Systems</category>
      <description><![CDATA[We test physics-inspired runtime monitoring for multi-turn LLM agents in 3,175 runs on four benchmarks (τ³-bench, SWE-bench, MINT and a custom local-model battery). In a 5-condition ablation with 333 multi-trial SWE-bench runs, Lyapunov monitoring cuts compute by 38.6%, and it had zero false positives in 80 runs on 4 open-weight local models run through Ollama. Over three trials, monitoring lowers the SWE-bench resolve rate by 4.5pp, a difference that is not statistically significant (p = 0.28). On the local models, a naive turn limit beats the unconstrained baseline by +17.5pp on average, a pattern we call small-model self-sabotage.]]></description>
      <content:encoded><![CDATA[### Abstract

In our prior theoretical work [1], we proposed a physics-inspired framework for governing the semantic boundary layer of multi-agent AI systems, drawing on Lyapunov stability theory, Renormalization Group compression, and Vector Symbolic Architectures. That framework was mathematically grounded but untested.

Here we test it with a 5-condition ablation (3,175 runs in total) that isolates each mechanism's contribution, repeated SWE-bench trials (333 runs) to measure run-to-run variance, and runs on 5 model families, 4 of them open-weight local models.

We implement the proposed framework as **state-harness**, a hybrid Rust/Python runtime safety library, and evaluate it across four complementary benchmarks: τ³-bench [2] (customer-service agents, 750 runs), SWE-bench Verified [14] (software engineering agents, 481 runs), MINT [15] (multi-turn reasoning and coding, 1,136 runs), and a custom local-model battery (808 runs across 4 open-weight model families via Ollama on consumer hardware). Our central finding is that the naive Lyapunov energy function $V(k) = S(k) + \lambda\theta(k)$ has a 46% false positive rate, because $\Delta V \geq 0$ holds on almost every turn of a multi-turn conversation as the context window grows. We fix this with **growth-ratio normalization**: the monitor tracks the ratio $\hat{V}(k) = S(k)/\bar{S}$ against a warmup baseline instead of raw token counts. With this change the signal becomes a leading indicator of task failure.

The 5-condition ablation (Baseline → Lyapunov-only → Lyapunov+RG → Full-stack → Naive Cap) gives four main results: (1) on short and medium-loop benchmarks (MINT and τ³), the monitor records zero stability violations in 1,886 runs, with &lt;2% computational overhead; (2) on the long-loop benchmark (SWE-bench), full-stack monitoring cuts compute by 38.6% and wall time by 30%, and no task hits the budget ceiling; (3) across 333 multi-trial SWE-bench runs, full-stack monitoring resolves 4.5pp fewer tasks than the baseline, which is not significant (p = 0.28), and 6.3pp fewer than the naive cap, a gap whose bootstrap interval excludes zero (Welch p = 0.11); (4) on 4 open-weight local models (Llama 3.2:3B, Phi-4-Mini, Qwen3:4B, Gemma4:E4B), the monitor has zero false positives in 80 harness runs, and we observe a small-model self-sabotage pattern in which a naive turn limit beats the unconstrained baseline by +17.5pp on average.

The implementation is released as open-source: [github.com/vishal-dehurdle/state-harness](https://github.com/vishal-dehurdle/state-harness). Install via PyPI: [`pip install state-harness`](https://pypi.org/project/state-harness/).

---

## 1. From Theory to Measurement: The Experimental Program

Our prior theoretical work [1] argued that the failure modes of production multi-agent systems (Token Tsunamis, semantic drift and context dilution) can be modeled with the tools of dynamical systems theory. It proposed three mechanisms for a physics-inspired governance layer:

1. **A Lyapunov energy function** $V(k) = S(k) + \lambda\theta(k)$ whose derivative $\Delta V(k)$ indicates trajectory stability.
2. **Renormalization Group decimation** to compress high-entropy agent communications into scale-invariant macrostates.
3. **Holographic Invariant Storage** via Vector Symbolic Architectures to detect policy drift outside the LLM context window.

This paper tests all three in a 5-condition ablation that isolates each layer's contribution, organized around four questions:

| Question | Method | Section |
| --- | --- | --- |
| **Q1:** Does the raw Lyapunov energy derivative $\Delta V \geq 0$ predict task failure, and why does it fail? | Empirical analysis of false positive rates | §2 |
| **Q2:** Can growth-ratio normalization reduce false positives while preserving detection sensitivity? | 5-condition ablation across four benchmarks | §5 |
| **Q3:** Does the value of monitoring scale with agent loop length? | Cross-benchmark comparison (MINT, τ³-bench, SWE-bench) | §5.4 |
| **Q4:** How much does each mechanism (Lyapunov, RG, VSA) contribute independently? | Ablation: B vs C vs D conditions | §5.2, §5.4 |

---

## 2. The Instability of Naive Energy Functions

The Lyapunov stability criterion states that a discrete-time system is asymptotically stable if there exists a positive-definite scalar function $V(x_k)$ such that $\Delta V(k) = V(k+1) - V(k) < 0$ for all $k$ [4, 16]. Conversely, sustained $\Delta V(k) \geq 0$ indicates instability: the system is diverging from equilibrium.

Our theoretical framework [1] defined the composite energy function:

$$V(k) = S(k) + \lambda \cdot \theta(k)$$

where $S(k)$ is the token consumption at discrete time step $k$, $\theta(k) \in \{0, 1\}$ is the error indicator, and $\lambda \geq 0$ is the error coupling constant, drawing on composite and neural Lyapunov formulations for dynamical systems [11]. The circuit breaker trips when $\Delta V(k) \geq 0$ for $W$ consecutive steps.

In practice this fails. In a multi-turn LLM conversation the context window accumulates: each turn adds the previous response to the prompt, so the input token count $S(k)$ increases monotonically with $k$ by construction. $\Delta V(k) \geq 0$ then holds on almost every turn of any multi-turn task, and the resulting false positive rate makes the raw energy function useless as a diagnostic.

```mermaid
graph LR
    subgraph naive["Naive Energy Function — V(k) = S(k)"]
        direction TB
        A["Turn 1: 1000 tokens"] --> B["Turn 2: 1800 tokens"]
        B --> C["Turn 3: 2600 tokens"]
        C --> D["Turn 4: 3400 tokens"]
        D --> E["Trips: ΔV ≥ 0 for 3 steps"]
    end
    naive ~~~ problem
    subgraph problem["The Problem"]
        direction TB
        F["This is NORMAL context growth."]
        G["The task was healthy."]
        H["FALSE POSITIVE."]
    end
```

Our v1 implementation confirmed this empirically: the raw Lyapunov monitor tripped on 46% of all tasks, but only 54% of those trips were genuine failures. Nearly half the killed tasks would have completed successfully. A false positive rate this close to the failure rate of unguarded agents defeats the purpose of a monitor.

---

## 3. Growth-Ratio Normalization: The Central Innovation

The resolution draws from the practice of normalization in experimental physics [5] and statistical process control (SPC) in quality engineering [3]. When measuring a signal contaminated by a systematic trend, the standard approach is to divide by the trend to isolate the fluctuation of interest [3, 5]. A cosmic ray detector does not measure raw photon counts (which increase with observation time); it measures counts *per unit time* (the rate), normalized against the expected background [5].

We apply the same principle to agent energy monitoring. During a warmup period of $W_0$ turns, we establish a baseline token consumption $\bar{S}$:

$$\bar{S} = \text{median}\left(S(1), S(2), \ldots, S(W_0)\right)$$

The median is chosen over the mean for robustness to outliers (e.g., an unusually large first-turn system prompt). For subsequent turns $k > W_0$, we define the **growth ratio**:

$$\hat{V}(k) = \frac{S(k)}{\bar{S}}$$

The circuit breaker trips when $\hat{V}(k) > \tau$ (the ratio threshold) for $W$ consecutive steps, AND cumulative tokens exceed a minimum budget gate $B_{\min}$.

The ratio has a direct interpretation. $\hat{V}(k) = 1.0$ means the agent is consuming tokens at its baseline rate, and $\hat{V}(k) = 2.0$ means it is consuming twice its baseline, a sign that the execution dynamics have changed. The threshold $\tau$ defines the boundary of the stability envelope.

```mermaid
graph TD
    subgraph warmup["Warmup Phase (k ≤ W₀)"]
        W1["Turn 1: 1000 tokens"]
        W2["Turn 2: 1100 tokens"]
        W3["Turn 3: 1050 tokens"]
        W1 --> W2 --> W3
        W3 --> BASELINE["Baseline S̄ = median = 1050"]
    end

    subgraph monitor["Monitoring Phase (k > W₀)"]
        M1["Turn 4: 1200 tokens → V̂ = 1.14×"]
        M2["Turn 5: 1500 tokens → V̂ = 1.43×"]
        M3["Turn 6: 2800 tokens → V̂ = 2.67× [Warning]"]
        M4["Turn 7: 3500 tokens → V̂ = 3.33× [Warning]"]
        M5["Turn 8: 4500 tokens → V̂ = 4.29× [Warning]"]
        M1 --> M2 --> M3 --> M4 --> M5
        M5 --> TRIP["TRIPPED: V̂ > τ for W=3 steps"]
    end

    BASELINE --> M1
```

A healthy multi-turn task may grow from 1,000 to 1,500 tokens per turn over 10 turns; if it started at 1,000, this is a steady $\hat{V} \approx 1.0$–$1.5\times$ growth. A spiraling task grows from 1,000 to 3,000 to 8,000 to 20,000, with $\hat{V}$ values of $3.0\times$, $8.0\times$ and $20.0\times$. In this example, the growth ratio separates the two.

### 3.1 Dual-Confirmation Gating

Growth-ratio escalation alone can produce false positives when an agent legitimately requires elevated token consumption (e.g., a complex multi-tool resolution generating verbose responses). To address this, we introduce **dual-confirmation gating**: the circuit breaker requires corroboration from two independent signals.

The first signal is the growth ratio $\hat{V}(k) > \tau$ for $W$ consecutive steps.

The second signal is **policy drift**, measured via Vector Symbolic Architecture (VSA) and Holographic Reduced Representations (HRR) [6, 13]. We encode the domain policy as a high-dimensional bipolar vector $\mathbf{p} \in \{-1, +1\}^d$ and compute the cosine drift at each step:

$$d(k) = 1 - \frac{\mathbf{p} \cdot \mathbf{r}(k)}{|\mathbf{p}| \cdot |\mathbf{r}(k)|}$$

where $\mathbf{r}(k)$ is the VSA encoding of the agent's response at step $k$. If the mean drift over the last $W_d$ steps exceeds a threshold $\delta$, the drift gate confirms the trip.

The circuit breaker trips if and only if:

$$\left(\hat{V}(k) > \tau \text{ for } W \text{ consecutive steps}\right) \wedge \left(\frac{1}{W_d}\sum_{i=k-W_d+1}^{k} d(i) > \delta\right)$$

With both gates, an agent that uses many tokens while staying on-policy (doing useful, complex work) is not killed: the growth ratio flags the energy anomaly, and the drift score must confirm a semantic one.

### 3.2 Renormalization Group History Compression

Before each LLM invocation, the conversation history undergoes RG-inspired decimation [7, 1]. Messages are scored by structural importance (TF-IDF relevance, tool-call status, positional significance), and those below a threshold $\rho$ are pruned.

Compression has two effects. It reduces per-turn token consumption by removing redundant context, and it flattens the natural growth curve, so real spirals stand out more against the compressed baseline.

Without compression, a 15-turn conversation naturally grows to $\sim$5× the baseline due to context accumulation alone. With RG decimation, the same conversation grows to $\sim$2×, which puts natural growth below the detection threshold $\tau = 2.0$, so the monitor responds mainly to pathological growth.

---

## 4. Experimental Setup

### 4.1 Benchmark: τ³-bench

We evaluate across four benchmarks spanning different agent modalities:

**Primary benchmark: τ³-bench** (Sierra Research, 2026) [2] is a standard benchmark for multi-turn tool-calling agents. τ³-bench simulates realistic customer service interactions where an LLM agent must complete tasks using domain-specific tools (flight lookups, order modifications, account changes) while conversing with a simulated user. Each task is scored on a [0, 1] reward scale based on correctness of database mutations and communication quality. A task with reward > 0 is considered a pass. We evaluate on the Airline domain (50 tasks).

**Cross-benchmark validation:**

| Benchmark | Domain | Tasks | Turn Structure | Spiral Risk |
| --- | --- | --- | --- | --- |
| **τ³-bench Airline** | Customer-service dialog | 50 | Medium (3–10 turns) | Low |
| **SWE-bench Verified** | Software engineering | 37 (of 50; 13 Docker images unavailable) | Long (10–50+ turns) | High |
| **MINT** | Reasoning + Coding | 284 (GSM8K 48, MATH 100, HumanEval 45, MBPP 91) [24, 25] | Short (1–5 turns) | Medium |
| **Custom (Local)** | Multi-domain code generation | 20 (5 easy, 10 medium, 5 hard) | Short–Medium (1–6 turns) | Medium |

**SWE-bench** [14] evaluates agents on real GitHub issues from open-source projects (code navigation, patch writing, test execution), where scaffolds range from search trees to lightweight prompts (e.g. Agentless [10]). **MINT** [15] evaluates multi-turn interaction with tools across reasoning (GSM8K, MATH [24]) and code generation (HumanEval, MBPP [25]) tasks using iterative interaction paradigms such as ReAct [19].

### 4.1.1 Benchmark Validity Note

SWE-bench has faced scrutiny regarding data contamination and leaderboard saturation for model-to-model comparisons. Our design is largely insulated from these concerns, because we compare the same model-agent pair with and without state-harness monitoring. We expect token spiral behavior to depend on the agent scaffold more than on model capability, and so to persist whether or not the model saw the task during training.

### 4.2 Agent Configurations and Ablation Conditions

We evaluate cloud benchmarks using the same model (Gemini 2.5 Flash via Vertex AI) across a 5-condition ablation study that isolates each mechanism's contribution across multi-agent patterns common to frameworks like LangGraph and AutoGen [22]. For local model validation, we use four open-weight models via Ollama on Apple M4 hardware (16 GB RAM): Llama 3.2:3B, Phi-4-Mini, Qwen3:4B, Gemma4:E4B.

| Condition | Lyapunov | RG Decimation | VSA Dual-Gate | Description |
| --- | --- | --- | --- | --- |
| **A. Baseline** | — | — | — | Unmonitored agent |
| **B. Lyapunov-only** |  | — | — | Energy monitoring and termination, no compression or drift gating |
| **C. Lyapunov+RG** |  |  | — | + history compression on violation |
| **D. Full-stack** |  |  |  | + VSA policy drift gating |
| **E. Naive Cap** | — | — | — | Hard budget cap ($0.30 / 100K tokens), representing industry practice [8] |

Conditions B, C, and D use the same `harness_agent` with feature toggles controlled via environment variables (`HARNESS_RG=off`, `HARNESS_VSA=off`), ensuring identical agent scaffolding across conditions. Not all conditions apply to all benchmarks: Condition C is omitted for SWE-bench (see §5.2), and Condition E (naive cap) is omitted for MINT (see §5.3).

For all benchmarks, we use **live execution**: the harness actively monitors and intervenes during agent execution, not retroactive simulation. This ensures that any behavioral changes induced by early termination are captured in the results.

### 4.3 Metrics

| Metric | Definition |
| --- | --- |
| **Pass Rate** | Fraction of tasks with reward > 0 (τ³-bench) or success (SWE-bench, MINT) |
| **Token Savings** | $1 - T_{\text{harness}} / T_{\text{baseline}}$ per task or aggregate |
| **Trip Rate** | Fraction of tasks where the monitor triggers early termination |
| **Precision** | P(task would have failed \| monitor tripped) |
| **False Positive Rate** | P(task would have succeeded \| monitor tripped) |

Precision is computed by comparing tripped tasks against the baseline: if a task was tripped by the monitor but completed successfully in the unguarded baseline, it is a false positive.

### 4.4 Infrastructure Note: Vertex AI Parallel Tool Call Bug

During initial retail-domain evaluation (a preliminary domain later excluded for scope reasons; the final evaluation uses the airline domain), we observed 35–42% of runs across *all three* agent configurations failing with zero duration and zero messages. Root cause analysis identified a protocol error in the Vertex AI Gemini API: when the model issues $N$ parallel function calls in a single turn (e.g., simultaneous `get_order_details` calls for multiple items), the API requires exactly $N$ corresponding `function_response` parts. The τ³-bench message serialization layer was sending `{"content": null, "tool_calls": [...]}` for tool-call-only turns; the `null` content field caused Vertex AI's protocol translation to miscount parts, rejecting the request with HTTP 400.

**Fix applied:** We patched the message serialization to omit `content` from the API payload when it is `null` and tool calls are present, matching the Vertex AI protocol specification. The fix is a 6-line change in `to_litellm_messages()`. We record it here for reproducibility.

---

## 5. Results

### 5.1 Primary Result: τ³-bench Airline Domain

**Setup:** 50 tasks × 3 trials × 5 conditions = 750 total runs. Agent handles airline reservations (flight search, booking modification, cancellation) via tool calls with a simulated user. All conditions run sequentially with concurrency=1.

| Condition | Trial Pass | Rate | Task Pass (majority) | Rate | Cost | Cost Δ |
| --- | --- | --- | --- | --- | --- | --- |
| **A. Baseline** | 99/150 | 66.0% | 35/50 | 70.0% | $2.47 | — |
| **B. Lyapunov-only** | 83/150 | 55.3% | 28/50 | 56.0% | $2.42 | −2.0% |
| **C. Lyapunov+RG** | 79/150 | 52.7% | 26/50 | 52.0% | $1.69 | −31.8% |
| **D. Full-stack** | 86/150 | 57.3% | 30/50 | 60.0% | $2.28 | **−8.1%** |
| **E. Naive Cap** | 81/150 | 54.0% | 26/50 | 52.0% | $2.33 | −5.7% |

**Finding 1: Zero stability trips across all 750 runs.** The growth-ratio monitor classified every airline task as stable and never intervened. On medium-loop customer-service agents, the monitor is non-invasive.

**Finding 2: Pass-rate variance is LLM nondeterminism, not harness impact.** The apparent ~10–18pp spread between conditions is attributable to intrinsic model variance: (a) 24–34% of tasks (28% on average) produce mixed pass/fail outcomes within the same condition across 3 trials; (b) the naive cap condition (E), which has zero monitoring, shows a −18pp drop from baseline, *worse* than full-stack monitoring (D, −10pp); (c) the union of conditions A–D passes 37/50 tasks while their intersection passes only 22/50, a 15-task (30%) variance band (adding E leaves the union at 37 and lowers the intersection to 19).

**Finding 3: 8.1% lower cost** under full-stack monitoring, although the monitor never intervened; we attribute this to the harness's passive overhead reduction in the agent loop. The fail/pass cost ratio is lower (1.3×) than on MINT (1.6× on MATH, 3.4× on GSM8K), which suggests these medium-loop tasks gain less from monitoring.

### 5.2 Central Result: SWE-bench Verified (4-Condition Ablation)

**Setup:** 50 instances selected from SWE-bench Verified (Django project). 37 instances successfully ran (13 lacked pre-built Docker evaluation images). Agent uses moatless-tools SearchTree [23] with up to 50 node expansions per task. Each condition was run as a separate, complete execution (live monitoring, not retroactive simulation).

> **Note on Condition C:** Condition C (Lyapunov+RG, no VSA) is omitted for SWE-bench because the VSA dual-gate requires access to prompt content, which the moatless Docker-isolated architecture does not expose. Condition D results thus reflect Lyapunov + RG without VSA, which makes C and D functionally identical in this integration.

#### 5.2.1 Ablation Results

| Condition | Resolved | Rate | Total Nodes | Avg Nodes (Resolved) | Avg Nodes (Failed) | Hit 50-Max | Wall Time |
| --- | --- | --- | --- | --- | --- | --- | --- |
| **A. Baseline** | 15 / 37 | 40.5% | 945 | 27.5 | 24.2 | 7 | 80 min |
| **B. Lyapunov-only** | 16 / 37 | 43.2% | 620 | 16.8 | 16.8 | 0 | 69 min |
| **D. Full-stack** | 14 / 37 | 37.8% | **580** | 14.8 | 16.2 | 0 | **56 min** |
| **E. Naive Cap** | 21 / 37 | 56.8% | 876 | 22.0 | 25.9 | 4 | 77 min |

All four conditions completed with zero infrastructure errors across 148 total runs (37 instances × 4 conditions).

#### 5.2.2 Primary Finding: Compute Efficiency

The central result is compute efficiency, not pass-rate improvement. Full-stack monitoring (D) achieves:

- **38.6% compute reduction**: 945 → 580 total nodes across 37 instances
- **30% wall-time reduction**: 80 → 56 minutes
- **34% better cost-per-resolution**: 63.0 → 41.4 nodes per resolved task
- **Eliminates all max-budget burnout**: Baseline had 7 tasks hitting the 50-node ceiling (all 7 failed after using their full budget). Full-stack: zero tasks hit ceiling.

Resolved tasks finish 46% faster under monitoring (27.5 → 14.8 avg nodes), suggesting that early termination of failing branches allows the search tree to converge faster on productive paths.

#### 5.2.3 Ablation: Mechanism Contribution

| Layer Added | Compute (nodes) | Δ vs Baseline | Cumulative Reduction |
| --- | --- | --- | --- |
| A. No monitoring | 945 | — | — |
| B. + Lyapunov | 620 | −325 | **34.4%** |
| D. + RG (no VSA) | 580 | −40 | **38.6%** |

**Lyapunov monitoring alone delivers ~90% of the total benefit** (325 of 365 nodes saved). The energy function $\hat{V}(k) = S(k)/\bar{S}$ is the core mechanism. RG decimation adds ~4pp more compute reduction by compressing context on intervention, but most of the signal comes from the growth-ratio monitor.

#### 5.2.4 Naive Cap Control Analysis

The naive cap (E) resolved 21/37 tasks (56.8%), apparently outperforming all other conditions. However, this result is attributable to LLM nondeterminism, not mechanism quality:

1. **The cap never triggered.** The $0.30 budget (~100K tokens) exceeds the natural consumption of most SWE-bench tasks. The naive cap is functionally identical to baseline for tasks that finish within budget.

2. **Instance-level overlap analysis** reveals the variance band:
   - Union of all 4 conditions: 24/37 (64.9%) resolved at least once
   - Intersection of all 4 conditions: only 10/37 (27.0%) resolved by every condition
   - **14-instance variance band** where each run solves a different random subset

3. **The harness stopped some instances the baseline resolved.** D stopped 25 of the 37 instances (24 growth-ratio kills, 1 budget stop). The baseline had resolved 10 of those 25, and D still resolved 7 of the 10. Of the 8 instances E resolved but D did not, the harness killed 5, after 16–19 nodes at growth ratios of 2.1–3.2× for 3 consecutive turns; the other 3 ended without a kill (7–19 nodes in all).

4. **Statistical significance.** With 37 instances and single trials, the standard error on pass rate is approximately ±8pp. The observed range (37.8%–56.8%) spans approximately 2.4 standard errors, within the expected range of sampling noise for single-trial evaluation.

The naive cap serves as a control: a hard budget cap set above the task's natural consumption never triggers and so saves nothing by itself, while growth-ratio monitoring cuts nodes by 38.6% by detecting and terminating dynamically anomalous execution.

**Multi-trial confirmation (§7.3.1):** Over three trials E's single-trial lead (56.8%) shrinks: E = 47.7% ± 3.1%, A = 45.9% ± 4.7%, D = 41.4% ± 4.1%. E and A are within noise of each other (p = 0.61). E's lead over D (6.3pp) is the one gap whose bootstrap interval excludes zero, though the Welch test does not reach significance (p = 0.11).

#### 5.2.5 Threshold Sensitivity Analysis (Retroactive)

To characterize the Pareto frontier between cost savings and pass-rate preservation, we perform a threshold sweep via **retroactive simulation** on the Condition A baseline trajectories. This complements the live ablation results above (§5.2.1–5.2.4) by exploring the full parameter space without requiring a separate live run for each ($\tau$, $W$) combination.

We sweep $\tau \in \{1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0\}$ with $W \in \{3, 4, 5\}$:

| $\tau$ | $W$ | Trips | Token Savings | Resolved Preserved | False Positives | Precision |
| --- | --- | --- | --- | --- | --- | --- |
| 1.5 | 3 | 32 | 83.1% | 3 / 15 | 12 | 62.5% |
| 2.0 | 3 | 29 | 74.0% | 4 / 15 | 11 | 62.1% |
| 2.0 | 5 | 27 | 69.1% | 6 / 15 | 9 | 66.7% |
| **3.0** | **5** | **16** | **49.5%** | **10 / 15** | **5** | **68.8%** |
| 3.5 | 3 | 16 | 46.8% | 10 / 15 | 5 | 68.8% |
| 5.0 | 3 | 9 | 24.0% | 12 / 15 | 3 | 66.7% |

The sweep shows four operating regimes:

- **Aggressive** ($\tau \leq 2.0$): Maximum savings (70–83%) but a high false positive rate: only 3–6 of 15 resolved tasks survive. Suitable only for cost-sensitive, non-critical workloads.
- **Balanced** ($\tau = 3.0$, $W = 5$): 49.5% savings with 10/15 resolved preserved. The recommended default for SWE-bench-class tasks.
- **Conservative** ($\tau \geq 5.0$): 24% savings with 12/15 resolved preserved. Minimal intervention; useful when resolve rate is the priority.
- **Ultra-conservative** ($\tau = 7.0$): 5.4% savings with 15/15 resolved preserved (zero false positives). Even here the guard catches the largest spirals (those exceeding 7× baseline), which suggests the worst failure modes separate from healthy execution across the thresholds we tested.

**Early detection timing.** The guard trips at a median of node 23 (range: 17–32), corresponding to approximately 46% of the 50-node maximum budget. This means the monitor detects spirals roughly halfway through the available computation: early enough for substantial savings, but late enough for the warmup baseline to calibrate accurately.

**Robustness to window parameter.** The Pareto knee occurs at $\tau = 3.0$ regardless of window size ($W = 3$ or $W = 5$), indicating that the threshold is the primary sensitivity parameter while the window provides secondary smoothing. This simplifies operator tuning: set $\tau$ for your risk tolerance, leave $W$ at the default.

The threshold $\tau$ stays in a narrow range ($2.0$–$5.0$) across very different task complexities, which is consistent with the self-calibrating property of growth-ratio normalization: because each task establishes its own baseline, the threshold operates on relative deviation rather than absolute scale.

### 5.3 Cross-Benchmark Validation: MINT (4-Condition Ablation)

**Setup:** 284 tasks × 4 conditions = 1,136 total runs across GSM8K (48), MATH (100), HumanEval (45), MBPP (91). Agent uses up to 5 turns per task.

| Condition | GSM8K (48) | MATH (100) | HumanEval (45) | MBPP (91) | Total (284) | Tokens |
| --- | --- | --- | --- | --- | --- | --- |
| **A. Baseline** | 91.7% | 39.0% | 0.0% | 0.0% | **29.2%** | 1,909,582 |
| **B. Lyapunov** | 91.7% | 41.0% | 0.0% | 0.0% | **29.9%** | 1,904,421 |
| **C. Lyapunov+RG** | 89.6% | 37.0% | 0.0% | 0.0% | **28.2%** | 1,910,926 |
| **D. Full-stack** | 87.5% | 39.0% | 0.0% | 0.0% | **28.5%** | 1,949,708 |

**Finding 1: Zero stability violations across all 1,136 runs.** The monitor never intervenes on these short-loop tasks (1–5 turns): they never reach the sustained growth-ratio escalation ($W = 3$ consecutive turns above threshold) needed to trigger the guard. This is consistent with the non-invasiveness hypothesis.

**Finding 2: Token usage is flat.** Total tokens (prompt + completion) range from 1,904,421 to 1,949,708 across conditions ({'<'}2% variation). The monitoring computation adds negligible overhead. Token counts are computed as `prompt_tokens + completion_tokens` from the MINT `token_counter` per-task accumulator.

**Finding 3: Failed tasks cost disproportionately more.**

| Task | Success Avg Tokens | Failure Avg Tokens | Ratio |
| --- | --- | --- | --- |
| GSM8K | 2,613 | 8,857 | **3.4×** |
| MATH | 5,154 | 8,188 | **1.6×** |

Failing agents consume 1.6–3.4× more compute than successful ones. This asymmetry is the main economic argument for runtime monitoring, even on benchmarks where the monitor does not intervene.

**Finding 4: Pass rates do not differ significantly.** The range 28.2%–29.9% across 4 conditions represents ±0.85pp variation. With 284 tasks, the standard error is ~2.7pp.

The coding category (HumanEval, MBPP) shows 0% across all conditions due to a MINT framework limitation in code execution evaluation. Because all 4 conditions score 0%, these categories cannot show a harness effect in either direction.

### 5.4 Synthesis: The Loop-Length Hypothesis and Ablation Summary

Two patterns hold across the four benchmarks.

**Pattern 1: Savings scale with loop length.**

| Benchmark | Avg Turns | Compute Savings (D vs A) | Stability Trips | Pass-Rate Δ |
| --- | --- | --- | --- | --- |
| MINT | 1–5 | ~0% | 0 / 1,136 | −0.7pp |
| Custom (Local) | 1–6 | 15.2% | 3 / 80 | 0pp |
| τ³-bench | 3–10 | 8.1% (cost) | 0 / 750 | −10pp (+2pp in an earlier run) |
| SWE-bench | 10–50 | **38.6%** (nodes) | 87 / 148 (59%) | −4.5pp (not significant, p = 0.28) |

This matches the prediction in [1]: token spirals are a property of *iterative* agent scaffolds operating in open-ended action spaces. Short, bounded loops (MINT) converge or fail quickly. Long, exploratory loops (SWE-bench) create the conditions for context accumulation, retry storms, and policy drift, the instabilities that Lyapunov monitoring detects.

**Pattern 2: Lyapunov monitoring delivers the majority of the benefit.**

| Mechanism Layer | MINT Accuracy | SWE Compute (nodes) | Contribution |
| --- | --- | --- | --- |
| A. No monitoring | 29.2% | 945 | — |
| B. + Lyapunov | 29.9% | 620 | **34.4% compute reduction** |
| D. + RG (+ VSA on MINT only) | 28.5% | 580 | +4.2pp additional |

Lyapunov monitoring alone (Condition B) delivers ~90% of the total compute savings on SWE-bench, with no measurable change in MINT accuracy. Teams that want the simplest integration can deploy the `GrowthRatioGuard` alone, without RG compression or VSA drift detection, and keep most of the benefit.

In practice, state-harness is most useful for agents with long or unbounded loops, such as coding agents, and adds little overhead to short-loop deployments.

### 5.5 Local Open-Weight Model Validation

**Setup:** 20 custom tasks (5 easy, 10 medium, 5 hard) × 4 models × 3 conditions = 240 runs. Models: Llama 3.2:3B (2.0 GB), Phi-4-Mini (2.5 GB), Qwen3:4B (2.5 GB), Gemma4:E4B (9.6 GB). Hardware: Apple M4 MacBook Pro, 16 GB RAM, Ollama local inference.

| Model | Baseline | Harness | Naive Cap | Token Savings | False Positives |
| --- | --- | --- | --- | --- | --- |
| **Llama 3.2:3B** | 45% | 45% | 60% | 1.2% | 0 |
| **Phi-4-Mini** | 30% | 30% | 40% | 20.7% | 0 |
| **Qwen3:4B** | 30% | 30% | 40% | 0.9% | 0 |
| **Gemma4:E4B** | 35% | 35% | 70% | 37.9% | 0 |
| **Mean** | 35% | 35% | 52.5% | **15.2%** | **0** |

**Finding 1: Zero false positives across all 80 harness runs.** Across 4 model families spanning 3 difficulty tiers, the growth-ratio monitor never kills a task that baseline would have passed. It tripped 3 times, all on Llama 3.2:3B and all on tasks the baseline also failed; on the other three models it never tripped. This matches τ³-bench and MINT with Gemini 2.5 Flash, where the monitor also never tripped.

**Finding 2: Small-model self-sabotage.** Naive cap (2-turn limit) outperforms unconstrained baseline by +17.5pp on average across all four models (median +12.5pp). The effect is strongest on Gemma4:E4B (+35pp: 35%→70%). Examination of task trajectories reveals that small models often solve a problem correctly in an early turn and then break the correct solution with unneeded revisions in later turns.

**Finding 3: Model-family behavioral signatures.** Growth-ratio trajectories reveal distinct behavioral patterns:

- **Llama 3.2:3B.** Spirals with exponential ratio growth ($\hat{V}$ values of 2.3×, 5.9×, 7.6×). Three true-positive trips.
- **Phi-4-Mini.** Spike-and-recover patterns. 20.7% token savings via passive governance.
- **Qwen3:4B.** Uniform high-volume output (~4K tokens/turn from "thinking mode") but flat growth ratios ($\hat{V}$ ≤ 1.06). Correctly classified as stable despite 3× the absolute token volume.
- **Gemma4:E4B.** Decreasing ratios under monitoring ($\hat{V}$ values of 1.0, 0.56, 0.07). 37.9% passive token savings with zero formal trips.

Qwen3:4B shows the difference most clearly. It consumed 255K tokens in total (3× the runner-up), yet its growth ratio never exceeded 1.06×, so the metric did not mistake high volume for instability.

#### 5.5.1 MINT on Local Model (Qwen3:4B)

To validate the loop-length hypothesis on local hardware, we ran the full MINT benchmark on Qwen3:4B under two conditions: harness monitoring (max_steps=5) and naive cap (max_steps=2), totalling 568 additional runs.

| Task | Harness (max=5) | Naive Cap (max=2) | Δ | n |
| --- | --- | --- | --- | --- |
| GSM8K | 37.5% | 27.1% | +10.4pp | 48 |
| MATH | 0.0% | 0.0% | — | 100 |
| HumanEval | 11.1% | 11.1% | — | 45 |
| MBPP | 14.3% | 14.3% | — | 91 |
| **Total** | **12.7%** | **10.9%** | +1.8pp | 284 |

The harness monitored all 284 tasks with zero interventions (all `terminated_by_harness: false`). On MINT’s short-loop tasks (max 5 turns), the harness monitoring window (W=3) cannot trigger within the available post-warmup turns, so zero trips on MINT are guaranteed by construction.

The GSM8K result (+10.4pp with more steps) suggests that on reasoning tasks, extra turns help. The self-sabotage effect observed in the custom benchmark does *not* appear on MINT, consistent with MINT’s short-form Q&A format leaving less opportunity for destructive self-revision.

---

## 6. Zero-Cost Failure Diagnostics

A circuit breaker that kills tasks is useful in operation but opaque for diagnosis. An engineer needs to know why a task was killed and what to change to prevent it.

We introduce **zero-cost failure diagnostics**: a pattern classification system that operates entirely on the energy trajectory $\{\hat{V}(1), \ldots, \hat{V}(K)\}$ and drift trajectory $\{d(1), \ldots, d(K)\}$, requiring no additional LLM calls.

### 6.1 Failure Pattern Taxonomy

From empirical analysis of tripped tasks, we identify six distinct failure patterns, each with a characteristic energy signature:

| Pattern | Energy Signature | Root Cause |
| --- | --- | --- |
| **Context Accumulation Spiral** | Monotonically accelerating $\hat{V}(k)$; last 5 values > 1.5× | Agent replaying full conversation as context each turn |
| **Retry Storm** | Near-constant $\hat{V}(k)$ with CV < 0.3 across 8+ turns | Tool failure triggering identical retry attempts |
| **Policy Drift** | Moderate $\hat{V}(k)$ with high, increasing $d(k)$ | Agent losing focus on original task objective |
| **Early Explosion** | $\hat{V}(k) > 3.0$ in first 3 turns | Malformed prompt or oversized tool response |
| **Budget Exhaustion** | Stable $\hat{V}(k)$ reaching cumulative ceiling | Genuinely complex task requiring extended execution |
| **Gradual Degradation** | Mild growth without exponential acceleration | Borderline task; may complete with higher threshold |

```mermaid
graph TD
    TRIP["Task Tripped / Completed"]
    TRIP --> CHECK1{"V̂(k) > 3.0 in first 3 turns?"}
    CHECK1 -->|Yes| EARLY["Early Explosion"]
    CHECK1 -->|No| CHECK2{"Frozen (budget exceeded)?"}
    CHECK2 -->|Yes| BUDGET["Budget Exhaustion"]
    CHECK2 -->|No| CHECK3{"CV(energy) < 0.3 and turns ≥ 8?"}
    CHECK3 -->|Yes| RETRY["Retry Storm"]
    CHECK3 -->|No| CHECK4{"Last 5 V̂ > 1.5 with 3+ accelerating?"}
    CHECK4 -->|Yes| SPIRAL["Context Spiral"]
    CHECK4 -->|No| CHECK5{"Mean recent drift > 0.7?"}
    CHECK5 -->|Yes| DRIFT["Policy Drift"]
    CHECK5 -->|No| GRADUAL["Gradual Degradation"]
```

### 6.2 The Actionable Output

Each classified pattern produces a prioritized list of recommendations, derived from the energy and drift signatures observed in that task:

| Pattern | Priority 1 Action | Rationale |
| --- | --- | --- |
| **Context Spiral** | Enable RG history compression | Context window growing unchecked; compression reduces prompt tokens 40–60% |
| **Retry Storm** | Add exponential backoff with max-retry cap | Identical calls burning tokens with zero progress |
| **Policy Drift** | Re-inject domain policy every N turns | Model forgetting original instructions over long conversations |
| **Early Explosion** | Audit system prompt and initial tool response sizes | First-turn token spike indicates oversized static content |

The diagnostics can be exported as distributed traces via OpenTelemetry [21], and they are the main practical difference between state-harness and a plain budget cap. Tool-retry storms and other execution failures [20] get their own label when the monitor trips. A hard cap tells the engineer "your task was killed at 50,000 tokens." State-harness tells the engineer "your task was killed because of a context accumulation spiral starting at turn 7, caused by the agent replaying full conversation history. Enable RG compression to fix it."

---

## 7. Discussion

### 7.1 The Complementarity Thesis

Growth-ratio Lyapunov monitoring complements offline agent optimization such as NeoSigma [9] and differs from probabilistic runtime assertion frameworks such as ProbGuard [12]. The difference is one of timing:

| Dimension | Offline Optimization (NeoSigma [9]) | Runtime Monitoring (State-Harness) |
| --- | --- | --- |
| **When** | After failures are collected (batch, iterative) | During execution (real-time, per-turn) |
| **What it improves** | Agent capability (pass rate) | Agent efficiency (cost of failure) |
| **Mechanism** | Failure mining → harness edits → regression testing | Energy trajectory analysis → circuit breaking |
| **Cost** | High (96+ iterative experiments, GPT-5.4) | Near-zero (~1μs per step, no LLM calls) |
| **Target user** | Enterprise teams with dedicated ML ops | Solo developers, lean startups |

NeoSigma reports a 39.3% improvement in pass rate on τ³-bench (0.56 → 0.78) using GPT-5.4 [9]. The 22% of tasks that still fail under NeoSigma can still spiral without runtime monitoring. State-harness leaves pass rate unchanged and reduces the cost of the failures that remain after capability optimization.

The complete agent reliability stack combines both:

$$\text{Total Reliability} = \underbrace{P(\text{pass} | \text{NeoSigma})}_{\text{Capability}} \times \underbrace{P(\text{cheap fail} | \text{state-harness}, \neg\text{pass})}_{\text{Efficiency}}$$

### 7.2 The Physics of the Growth Ratio

The growth-ratio normalization $\hat{V}(k) = S(k)/\bar{S}$ is more than trend removal. It maps onto the thermodynamic distinction between **intensive and extensive quantities**: absolute token count is an extensive quantity (it grows with system size, i.e., conversation length), while the growth ratio is intensive (bounded for stable systems regardless of conversation length).

This explains why the naive energy function fails: monitoring $\Delta V(k) \geq 0$ on raw token counts is analogous to measuring the total energy of a growing system, which increases monotonically by construction. The growth ratio removes the system-size effect and separates real dynamical anomalies from the natural accumulation trend, in the spirit of Input-to-State Stability (ISS) [17] and control barrier certificates [18].

### 7.3 Future Evaluation Roadmap

Several newer benchmarks would extend the current four:

| Benchmark | Why It's Relevant | Status |
| --- | --- | --- |
| **Multi-trial SWE-bench** | 3 trials × 3 conditions × 37 instances (333 runs) to quantify LLM nondeterminism | **Complete** (§7.3.1) |
| **Local model validation** | 4 open-weight models (Llama, Phi, Qwen, Gemma) × 3 conditions × 20 tasks + MINT on Qwen3:4B | **Complete** (§5.5) |
| **Cross-model validation** | Full runs on Gemini 2.5 Flash + 4 local models; an 8-run smoke test on GPT-4o-mini and Claude Haiku 4.5 | **Partial** (smoke test: 0 false positives, 0 of 2 spirals caught) |
| Terminal-Bench | Terminal-based agent tasks; tests command-line tool loops where spirals manifest as repeated failed commands | Planned |
| SWE-bench Pro | Harder, contamination-resistant variant of SWE-bench; reduces data leakage concerns | Planned |
| LiveCodeBench | Freshly sampled coding problems with no training data overlap; gives a cleaner evaluation signal | Planned |
| SWE-rebench | Continuously refreshed with recent PRs from active repositories | Planned |

#### 7.3.1 Multi-trial SWE-bench Results

To address the single-trial limitation identified in §7.4, we ran 333 total runs (37 instances × 3 independent trials × 3 conditions: A, D, E). Of these, 321 runs logged a resolution. In the other 12 (3.6%) the Docker container hung and was killed after more than 28 minutes; 5 of those 12 have evaluation records marked resolved, so we take every run's result from its evaluation record and count the other 7 as failures. Results:

| Condition | Trial 1 | Trial 2 | Trial 3 | Mean ± σ |
| --- | --- | --- | --- | --- |
| **A. Baseline** | 19/37 (51.4%) | 16/37 (43.2%) | 16/37 (43.2%) | **45.9% ± 4.7%** |
| **D. Full-stack** | 15/37 (40.5%) | 17/37 (45.9%) | 14/37 (37.8%) | **41.4% ± 4.1%** |
| **E. Naive Cap** | 19/37 (51.4%) | 17/37 (45.9%) | 17/37 (45.9%) | **47.7% ± 3.1%** |

**Statistical finding:** The spread of the condition means (σ = 3.3%) is smaller than within-condition nondeterminism (mean σ = 4.0%). The A–D resolve-rate delta (−4.5pp) is about one within-condition standard deviation and not significant (Welch p = 0.28), so we detect no effect of the harness relative to the baseline.

**Bootstrap analysis (10,000 resamples):** Individual condition 95% CIs: A = [43.2%, 51.4%], D = [37.8%, 45.9%], E = [45.9%, 51.4%]. Two of the three pairwise difference CIs contain zero:

| Comparison | Δ | Bootstrap 95% CI | Welch t (df) | Significant? |
| --- | --- | --- | --- | --- |
| A − D (harness impact) | +4.5pp | [−0.9pp, +9.9pp] | t(3.9) = 1.25 | No (p ≈ 0.28) |
| A − E (naive cap impact) | −1.8pp | [−6.3pp, +3.6pp] | t(3.5) = −0.55 | No (p ≈ 0.61) |
| D − E (harness vs naive) | −6.3pp | [−10.8pp, −1.8pp] | t(3.7) = −2.11 | Bootstrap CI excludes 0; Welch p ≈ 0.11 |

The D–E gap is the only comparison whose bootstrap interval excludes zero, but the Welch test does not reach significance (p ≈ 0.11). A bootstrap over three trial rates is coarse and power is limited at n=3, so we read this as a possible small cost of full-stack monitoring relative to a naive cap, which more trials should test.

This ~4% within-condition standard deviation is larger than the trial-to-trial spread on τ³-bench, which is 1.2–5.0pp by condition (mean 2.6pp). At a ~4pp noise level, a single-run comparison reporting a delta below ~8pp cannot separate signal from noise.

### 7.4 Limitations

Four limitations bound the current work:

1. **Sample size.** While multi-trial evaluation (§7.3.1) confirms non-invasiveness across 333 SWE-bench runs, the 37-instance subset limits statistical power for detecting small effects (&lt;3pp). Larger-scale evaluation on the full SWE-bench Verified set (500 instances) would strengthen conclusions.

2. **Warmup sensitivity.** The baseline $\bar{S}$ is established from the first $W_0$ turns. If these turns are atypical (an unusually large system prompt, a cold-start penalty, or a non-representative first tool call), the baseline may be miscalibrated. Median aggregation provides partial robustness, but edge cases remain.

3. **No causal intervention.** State-harness detects and kills spiraling tasks but does not *redirect* them. The RG decimator addresses context accumulation by compression, but retry storms and policy drift require agent-level architectural fixes that state-harness can only suggest, not implement.

4. **Local model custom benchmark scale.** The 20-task custom battery is smaller than standard benchmarks. The self-sabotage finding (mean +17.5pp, median +12.5pp for naive cap) is observed consistently across all four model families but requires larger-scale replication to establish effect sizes precisely.

---

## 8. Conclusion

We tested Lyapunov stability analysis on multi-turn LLM agent execution trajectories with a 5-condition ablation on four benchmarks: customer service (τ³-bench), software engineering (SWE-bench), multi-turn reasoning (MINT) and local open-weight models (custom battery). We repeated the SWE-bench runs three times (333 runs) and ran the monitor on 5 model families.

Our central contribution is growth-ratio normalization. It turns the raw energy derivative, sound in theory but useless on multi-turn agents, into a self-calibrating leading indicator of task failure. The main results:

1. **No measurable effect on task success:** On MINT (1–5 turns) the monitor records zero stability violations in 1,136 runs (284 tasks × 4 conditions). On SWE-bench, across 333 multi-trial runs, the A–D resolve-rate delta (−4.5pp) is not significant (Welch p = 0.28).

2. **Zero-cost failure diagnostics:** When the monitor trips, it assigns one of six failure patterns (context accumulation spiral, retry storm, policy drift, early explosion, budget exhaustion or gradual degradation) and recommends fixes, using only the energy trajectory and no extra LLM calls (§6). Explaining why a task failed is what sets it apart from a plain budget cap.

3. **Compute efficiency on long loops:** On SWE-bench (10–50 turns), full-stack monitoring cuts compute by 38.6% (945 → 580 nodes) and wall time by 30% (80 → 56 minutes), with &lt;3pp pass-rate impact (single run). Tasks hitting the 50-node ceiling drop from 7 to 0.

4. **Lyapunov monitoring alone delivers ~90% of the total benefit.** Adding the growth-ratio monitor cuts compute by 34.4%; RG decimation adds 4.2pp more. The simplest integration (5 lines of `GrowthRatioGuard` code) captures most of the value.

5. **Savings grow with loop length:** Across MINT, τ³-bench and SWE-bench, compute savings rise with agent loop length (~0% → 8.1% → 38.6%), consistent with the prediction in [1] that spirals are a property of iterative, open-ended agent scaffolds.

6. **A nondeterminism floor of about 4pp:** for Gemini 2.5 Flash the within-condition standard deviation is 4.0pp on multi-trial SWE-bench, and the trial-to-trial spread on τ³-bench is 1.2–5.0pp. On these tasks, single-run comparisons with deltas below ~8pp cannot separate signal from noise.

7. **Cross-model results:** Zero false positives in 80 local-model harness runs on Llama 3.2:3B, Phi-4-Mini, Qwen3:4B and Gemma4:E4B on consumer hardware (Apple M4, 16 GB RAM, Ollama), with no threshold retuning.

8. **Small-model self-sabotage:** On small models (≤4B parameters), a naive turn limit beats the unconstrained baseline by +17.5pp on average (+12.5pp median). For constrained deployments, limiting turns can preserve capability as well as cut cost.

The engineering idea is simple: monitor an agent's token use relative to its own baseline, not in absolute terms. With dual-confirmation gating and a configurable threshold, this gives a runtime check that is more precise and less intrusive than the hard budget caps used in production today.

Our prior work [1] predicted that the semantic boundary layer of multi-agent systems needs physics-inspired governance. This paper tests that prediction with a mechanistic ablation on four agent modalities and finds the instabilities it described measurable and controllable.

State-harness is released as open-source at [github.com/vishal-dehurdle/state-harness](https://github.com/vishal-dehurdle/state-harness), and installable via [`pip install state-harness`](https://pypi.org/project/state-harness/).

---

## References

* [1] Verma, V. (2026). "The Fluid Dynamics of Multi-Agent AI: Resolving d'Alembert's Paradox of Generative Workflows." *Vishal Verma Labs Research*.
* [2] Barres, V., Shi, B., Zytek, O., Ray, S., Dhandhania, K., & Razavi, P. (2026). "τ³-Bench: Advancing agent benchmarking to knowledge and voice." *Sierra blog*.
* [3] Shewhart, W. A. (1931). *Economic Control of Quality of Manufactured Product*. Van Nostrand. (Foundation of statistical process control, the methodological ancestor of growth-ratio monitoring.)
* [4] Khalil, H. K. (2002). *Nonlinear Systems* (3rd ed.). Upper Saddle River, NJ: Prentice Hall.
* [5] Taylor, J. R. (1997). *An Introduction to Error Analysis: The Study of Uncertainties in Physical Measurements* (2nd ed.). University Science Books.
* [6] Kanerva, P. (2009). "Hyperdimensional Computing: An Introduction to Computing in Distributed Representation with High-Dimensional Random Vectors." *Cognitive Computation*, 1(2), 139–159.
* [7] Wilson, K. G. (1975). "The Renormalization Group: Critical Phenomena and the Kondo Problem." *Reviews of Modern Physics*, 47(4), 773–840.
* [8] AgentBudget. (2026). *Open-Source SDK for Agent Budget Enforcement*. GitHub repository.
* [9] Gupta, G., Kapila, R., & Gupta, K. (2026). "Self-Improving Agentic Systems." *NeoSigma blog*.
* [10] Xia, C. S., Deng, Y., Dunn, S., & Zhang, L. (2024). "Agentless: Demystifying LLM-based Software Engineering Agents." *arXiv preprint arXiv:2407.01489*.
* [11] Richards, S. M., Berkenkamp, F., & Krause, A. (2018). "The Lyapunov Neural Network: Adaptive Stability Certification for Safe Learning of Dynamical Systems." *Conference on Robot Learning (CoRL)*, PMLR 87, 466–476.
* [12] Wang, H., Poskitt, C. M., Wei, J., & Sun, J. (2026). "ProbGuard: Proactive Runtime Monitoring for LLM Agent Safety via Probabilistic Prediction." *IEEE/ACM International Conference on Automated Software Engineering (ASE)*, 1470–1482. arXiv:2508.00500.
* [13] Plate, T. A. (2003). *Holographic Reduced Representations: Distributed Representations for Cognitive Structures*. CSLI Publications, Stanford.
* [14] Jimenez, C. E., Yang, J., Wettig, A., Yao, S., Pei, K., Press, O., & Narasimhan, K. (2024). "SWE-bench: Can Language Models Resolve Real-World GitHub Issues?" *International Conference on Learning Representations (ICLR)*.
* [15] Wang, X., Wang, Z., Liu, J., Chen, Y., Yuan, L., Peng, H., & Ji, H. (2023). "MINT: Evaluating LLMs in Multi-turn Interaction with Tools and Language Feedback." *arXiv preprint arXiv:2309.10691*.
* [16] Lyapunov, A. M. (1892). *The General Problem of the Stability of Motion*. Kharkov Mathematical Society (English translation: Taylor & Francis, 1992).
* [17] Sontag, E. D. (2008). "Input to State Stability: Basic Concepts and Results." In *Nonlinear and Optimal Control Theory*, Lecture Notes in Mathematics, Vol. 1932, 163–220. Springer.
* [18] Ames, A. D., Coogan, S., Egerstedt, M., Notomista, G., Sreenath, K., & Tabuada, P. (2019). "Control Barrier Functions: Theory and Applications." *18th European Control Conference (ECC)*, 3420–3431.
* [19] Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K., & Cao, Y. (2023). "ReAct: Synergizing Reasoning and Acting in Language Models." *International Conference on Learning Representations (ICLR)*.
* [20] Schick, T., Dwivedi-Yu, J., Dessì, R., Raileanu, R., Lomeli, M., Hambro, E., Zettlemoyer, L., Cancedda, N., & Scialom, T. (2023). "Toolformer: Language Models Can Teach Themselves to Use Tools." *Advances in Neural Information Processing Systems (NeurIPS)*, 36, 68539–68551.
* [21] OpenTelemetry Authors. (2023). "OpenTelemetry: High-quality, ubiquitous, and portable telemetry to enable effective observability." *Cloud Native Computing Foundation (CNCF)*.
* [22] Wu, Q., Bansal, G., Zhang, J., Wu, Y., Li, B., Zhu, E., Jiang, L., Zhang, X., Zhang, S., Liu, J., Awadallah, A. H., White, R. W., Burger, D., & Wang, C. (2023). "AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation." *arXiv preprint arXiv:2308.08155*.
* [23] Örwall, A. (2024). "Moatless Tools: Autonomous Software Engineering Agent with Tree Search." *GitHub Repository*.
* [24] Cobbe, K., Kosaraju, V., Bavarian, M., Chen, M., Jun, H., Kaiser, L., Plappert, M., Tworek, J., Hilton, J., Nakano, R., Hesse, C., & Schulman, J. (2021). "Training Verifiers to Solve Math Word Problems." *arXiv preprint arXiv:2110.14168*.
* [25] Chen, M., Tworek, J., Jun, H., Yuan, Q., Pinto, H. P. d. O., Kaplan, J., Edwards, H., Burda, Y., Joseph, N., Brockman, G., Ray, A., Puri, R., Krueger, G., ... & Zaremba, W. (2021). "Evaluating Large Language Models Trained on Code." *arXiv preprint arXiv:2107.03374*.]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[The Fluid Dynamics of Multi-Agent AI: Resolving d'Alembert's Paradox of Generative Workflows]]></title>
      <link>https://vishalvermalabs.com/papers/fluid-dynamics-multi-agent-ai/</link>
      <guid>https://vishalvermalabs.com/papers/fluid-dynamics-multi-agent-ai/</guid>
      <pubDate>Fri, 22 May 2026 00:00:00 GMT</pubDate>
      <dc:creator>Vishal Verma</dc:creator>
      <category>Multi-Agent Systems</category>
      <description><![CDATA[A framework that uses fluid dynamics, Hamiltonian mechanics, and control theory to model the semantic boundary layer, where probabilistic agent intents meet deterministic system state.]]></description>
      <content:encoded><![CDATA[### Abstract

Enterprise AI is moving from single-model prompting to decentralized multi-agent orchestration, and the move repeats an old problem in hydrodynamics. In 1752, the French mathematician Jean le Rond d'Alembert showed that for an incompressible, inviscid potential flow, the net drag on a body moving through the fluid is identically zero [1]. The result contradicted physical reality and split theoretical hydrodynamics from practical hydraulics for a century.

Multi-agent AI has a similar paradox. Agent systems that run without friction in local sandboxes meet heavy operational drag in production and fail at high rates [3, 4]. This paper presents a physical and control-theoretic framework for diagnosing and reducing these failures. It models the "semantic boundary layer", where probabilistic agent intents meet deterministic system state.

---

## 1. The Frictionless Potential Flow Fallacy

In theoretical fluid dynamics, an ideal, inviscid potential flow is governed by Laplace's equation for velocity potential ($\phi$):

$$\nabla^2 \phi = 0$$

This formulation assumes zero fluid viscosity ($\mu = 0$) and zero vorticity ($\nabla \times \mathbf{u} = \mathbf{0}$). Under these assumptions, fluid streamlines close symmetrically behind a moving body, perfectly recovering pressure and resulting in zero net drag force.

Declarative multi-agent frameworks such as LangGraph, CrewAI, and AutoGen [2, 24] treat natural language as an inviscid potential flow. They assume that agents can work as independent, frictionless nodes that pass unconstrained natural-language strings to each other and still solve long-horizon tasks together.

The assumption breaks down in production, where natural language behaves as a viscous medium. Three system properties drive this semantic viscosity ($\mu_{\text{semantic}}$) [3, 4]:

* **Endpoint Nondeterminism:** Agent outputs are stochastic samples from high-dimensional token probability distributions. Identical inputs yield divergent trajectories over extended time horizons.
* **Absence of Strict Message Typings:** Natural language interfaces lack compile-time schema validation, allowing minor semantic parsing errors to propagate unchecked through agent handoffs.
* **Semantic Drift:** Messages lose more of their original intent with each inter-agent exchange, so the error accumulates over a run.

When these factors are ignored, multi-agent systems fall into **Token Tsunamis**: runaway loops in which agents keep calling failing tools or retrying recursively without end, and costs grow without bound [3, 4, 25].

---

## 2. The Semantic Boundary Layer and the Physics of Separation

In 1904, Ludwig Prandtl resolved d'Alembert's paradox by introducing boundary layer theory [5, 6]. He showed that even for fluids with negligible viscosity, the flow field must be divided into two distinct regions: an outer region dominated by inertia where viscosity can be neglected, and a thin boundary layer adjacent to the solid surface where fluid velocity drops rapidly to zero to satisfy the **no-slip boundary condition**.

Prandtl's boundary layer equations for a 2D steady incompressible flow are formulated as:

$$u \frac{\partial u}{\partial x} + v \frac{\partial u}{\partial y} + \frac{1}{\rho} \frac{\partial p}{\partial x} = \nu \frac{\partial^2 u}{\partial y^2}$$

$$\frac{\partial p}{\partial y} = 0, \quad \frac{\partial u}{\partial x} + \frac{\partial v}{\partial y} = 0$$

Here $\nu = \mu/\rho$ is the kinematic viscosity. Inside this thin layer, velocity gradients ($\partial u / \partial y$) are extremely high, generating intense shear stress ($\tau = \mu \partial u / \partial y$). When the fluid encounters an adverse pressure gradient ($\partial p / \partial x > 0$), the flow inside the boundary layer halts, reverses, and separates from the surface, creating a turbulent, low-pressure wake and large form drag.

In enterprise software, the system of record (the SQL database, ERP, or CRM) is the solid wall. It enforces a strict no-slip condition: a database does not accept probabilistic queries, only exact values that fit a deterministic schema. The **semantic boundary layer** is the narrow interface where the agents' high-entropy, natural-language intents have to be mapped onto these zero-entropy, deterministic database states.

If this boundary layer is not modeled, the result is **Semantic Intent Divergence (SID)**, the counterpart of flow separation. Each agent makes decisions that are logical inside its own isolated, high-entropy context window, but their combined effect on the deterministic state produces contradictions.

| Operational Dimension | Fluid Dynamics: Inviscid Potential Flow [1] | Fluid Dynamics: Viscous Reality [5, 6] | Generative AI: Idealized Multi-Agent | Generative AI: Production Deployments [3, 4] |
| --- | --- | --- | --- | --- |
| **Governing Equations** | $\nabla^2 \phi = 0$ | Navier-Stokes with $\mu \neq 0$ | Pure prompt chaining; unconstrained text | Viscous state-space equations with noise |
| **Boundary Behavior** | Free slip (zero tangential shear stress) | No-slip condition ($\mathbf{u} = \mathbf{0}$ at wall) | Complete tool execution and target goal achievement | Blocked executions, database constraints, rate limits |
| **Energy Dissipation** | Zero energy loss; zero net drag | Viscous dissipation; high boundary drag and separation | Linear context utility; stable computation costs | "Token Tsunamis"; unbounded API cost drift |
| **Coherence Metric** | Symmetric pressure recovery | Vortex shedding; turbulent wakes; chaos | Smooth consensus and emergent reasoning | Semantic Intent Divergence; coordination defects |
| **Typical Failure Rate** | N/A (Mathematical abstraction) | N/A (Physical law) | 0% (Simulated local environments) | High (Real enterprise environments) |

---

## 3. Trajectory Drift: Modeling Long-Horizon Agent Paths as Non-Symplectic Integration

This coordination failure is a problem of trajectory drift. If agent execution is modeled as a trajectory through phase space, the errors that accumulate across natural-language handoffs behave like the numerical errors of a non-symplectic ordinary differential equation (ODE) solver [7].

Recent benchmarks of autonomous agents on long-horizon, physics-grounded scientific workloads, such as the expert-curated *MDGym* molecular simulation benchmark, show that even frontier models fail on 79% to 96% of multi-step execution tasks [9]. Trajectory analysis shows that the agents do invoke the simulation code, but they produce physically unstable configurations or fail to converge because the agent's path drifts away from the underlying physics [9].

In Hamiltonian dynamics, the total energy of a closed system, $H(p, q)$, is conserved. Standard numerical integration schemes, such as the Runge-Kutta family, are non-symplectic: they do not preserve the symplectic 2-form ($\omega^2 = \sum dp_i \wedge dq_i$) in phase space [7, 26]. Consequently, they suffer from quadratic or random-walk "energy drift" over long time horizons, causing orbits to artificially spiral outward or collapse:

$$\text{Energy Drift (Non-Symplectic Runge-Kutta):} \quad |H(p_n, q_n) - H_0| \sim \mathcal{O}(t^2)$$

Conversely, symplectic integrators (such as the velocity Verlet algorithm [8]) exactly conserve a "shadow" Hamiltonian, $H_{\text{shadow}} = H + h^n H_{\text{err}}$, bounding energy errors indefinitely:

$$\text{Bounded Energy Error (Symplectic):} \quad |H_{\text{shadow}}(p_n, q_n) - H_0| < \epsilon$$

Current multi-agent frameworks behave like non-symplectic integrators. Over a long trajectory, semantic errors and context fragmentation accumulate. This causes proactive interference, where earlier irrelevant tokens in the context window disrupt reasoning and recall [10]. In phase-space terms the system drifts in energy: it loses track of its original instructions and falls into tool-calling loops that do not converge.

---

## 4. The Renormalization Group: Coarse-Graining High-Entropy Agent Communication

To reduce semantic separation and coordinate long-horizon trajectories, the architecture needs structural constraints drawn from physics. The first is to compress agent communication with the Renormalization Group (RG) [11, 12].

In statistical mechanics, the Renormalization Group systematically averages out short-range, microstate fluctuations (high-frequency noise in the ultraviolet, or UV, scale) to extract scale-invariant, long-range macrostates (the infrared, or IR, scale) [11, 12, 13]. Under an RG transformation, a semi-group of scale transformations, $\mathcal{R}_s$, acts on the system's effective Hamiltonian:

$$M_{s + \delta s} = \mathcal{R}_{\delta s}[M_s]$$

This flow contracts irrelevant parameters (which shrink according to negative critical exponents) and preserves only the relevant parameters that dictate universal macroscopic behavior.

Passing raw natural-language histories between cooperating agents is like asking a fluid solver to track all $10^{23}$ water molecules in a boiling pot. Instead, agent messages should go through an RG decimation step. The system projects the high-entropy dialogue (the microstate, at the UV scale) into a compressed, low-entropy latent representation (the macrostate), keeping the intent invariants and discarding conversational noise.

```mermaid
graph TD
    UV["Ultraviolet Scale<br/>Raw Text Streams & Microstate Fluctuations<br/>(High-Entropy, 100k+ Token Chat History)"]
    RG(["Renormalization Group<br/>Coarse-Graining / Decimation [11, 14]"])
    IR["Infrared Scale<br/>Scale-Invariant Macroscopic Invariants<br/>(Low-Entropy, Quantized Intent Trajectory)"]
    UV --> RG --> IR
```

This coarse-graining can be implemented with learnable edge gates and tensor network transformations, as in the Renormalization Group guided Tensor Network (RGTN) framework [14]. RGTN uses a node tension to measure local interaction stress and edge information flow to measure how important each connection is. The network topology then evolves continuously to match the scale-invariant correlations of the data, and the method runs up to 600 times faster than traditional discrete search methods [14].

---

## 5. Holographic Invariant Storage: Bounding the Symplectic Phase Space

To enforce consistency inside the semantic boundary layer, the architecture can add Holographic Invariant Storage (HIS), built on Vector Symbolic Architectures (VSA) [15, 16]. HIS is designed to prevent context drift by keeping safety-critical constraints out of the attention mechanism and encoding them as high-dimensional bipolar vectors ($\mathbf{v} \in \{-1, 1\}^D$).

VSA uses three algebraic operations on these high-dimensional vectors [15, 16, 17]:

* **Binding ($\otimes$):** Element-wise multiplication of two vectors, mapping them to a third, near-orthogonal vector to represent role-filler pairs ($\mathbf{K}_{\text{goal}} \otimes \mathbf{V}_{\text{safe}}$).
* **Bundling ($+$):** Element-wise addition, creating a holographic superposition that maintains maximum similarity to all its constituent vectors.
* **Unbinding ($\otimes$):** The self-inverse property ($\mathbf{a} \otimes \mathbf{a} = \mathbf{1}$) that allows exact or approximate key-based retrieval.

By storing safety constraints and global objectives as a static holographic invariant ($H_{\text{inv}} = K_{\text{goal}} \otimes V_{\text{safe}}$) outside the LLM's active context window, the system can continuously measure context corruption [15, 16].

```mermaid
graph LR
    subgraph offline["Offline Invariant Generation"]
        KV["K_goal ⊗ V_safe"] -->|Bind| HI["H_inv<br/>(Stored Invariant) [15]"]
    end
    subgraph online["Online Context Restoration"]
        HN["H_inv + N_context"] -->|"Binarize & Unbind"| VR["V_recovered"]
    end
```

The cosine similarity between the running context vector and the stored invariant, taken before restoration, is a continuous measure of semantic distance. When it falls below a critical threshold, the system unbinds the invariant and re-injects the original goals into the agent's prompt to counter trajectory drift.

The VSA pipeline has three closed-form design-time properties [16, 17]:

1. **Single-Signal Recovery Fidelity:** Converges to $\sqrt{1/2} \approx 0.707$, regardless of noise depth or context length.
2. **Continuous-Noise Robustness:** Governed by $2\Phi(1/\sigma) - 1$, where $\sigma$ represents the standard deviation of context corruption.
3. **Multi-Signal Capacity Degradation:** Bounded by $\approx 1/(K+1)$ for $K$ independent safety constraints.

This algebraic structure plays a role similar to temperature scaling and softmax control in attention heads: it limits context dilution and helps keep core safety invariants from being lost in the middle of long runs.

---

## 6. Control-Theoretic Solvability: Lyapunov Stability Guarantees

Resolving this modern d'Alembert's paradox requires moving from open-loop, empirical prompt engineering to closed-loop control with stability guarantees [18, 19, 20]. In control engineering, a system's stability is certified by finding a positive-definite scalar Lyapunov function, $V(x)$, whose time derivative along the system trajectory is strictly negative:

$$V(x) > 0 \quad \text{and} \quad \dot{V}(x) < 0 \quad \forall x \neq 0$$

By modeling decentralized agent interactions as non-linear feedback loops, we can construct a Composite Lyapunov Function [18, 21, 22]:

$$V(k) = S(k) + \lambda \theta(k)$$

Where $S(k)$ represents the state of the physical plant (or enterprise business process), $\theta(k)$ is the Bayesian estimation error of the observer over asymmetric data feeds, and $\lambda$ is a positive coupling constant.

By enforcing a double-oracle platform interface that restricts both the agent controller and the environmental disturbance to finite, cataloged action sets, the system is designed to satisfy Input-to-State Stability (ISS) [19, 20] and control barrier certificates [27] under non-deterministic, adversarial disturbances:

$$V(x(k+1)) - V(x(k)) \leq -W(x(k)) + \gamma(\|w(k)\|)$$

Where $W(x)$ is a positive-definite function and $\gamma(\|w\|)$ is a bounding function of the disturbance magnitude. If an agent attempts a tool call outside the valid catalog, a platform-level circuit breaker intercepts the execution, preventing the trajectory from separating into an unstable, chaotic wake.

```mermaid
graph TD
    AC["Agent Controller"]
    AC -->|"Probabilistic Intent (u)"| SBL
    SBL(["SEMANTIC BOUNDARY LAYER<br/>Double-Oracle Filter"])
    SBL -->|"Deterministic Action"| ES
    ES["Enterprise State"]
    ES -->|"State Observation"| LY
    LY{{"Lyapunov<br/>Stability Check [18, 22]"}}
    LY -->|"Feedback V(k)"| AC
```

These non-linear feedback loops are amenable to formal verification using machine-checked proofs in interactive theorem provers such as Lean 4 [23]. While the current open-source implementation ([state-harness](https://github.com/vishal-dehurdle/state-harness)) validates these properties empirically across 3,175 runs spanning 5 model families, formal Lean 4 certificates remain a direction for future work.

| Failure Classification | Mechanism | Platform Action | Lyapunov System Effect |
| --- | --- | --- | --- |
| **Transient Failure** | LLM API timeout, minor network latency, or rate limit. | Increments failure counter toward circuit breaker threshold. | Bounded perturbation; remains within the ISS safety envelope [19]. |
| **Permanent Failure** | Invalid configuration, missing plugin, or database schema violation. | Instantly trips the circuit breaker (threshold = 1). | Prevents state transition to unstable phase space. |
| **Budget Exhaustion** | Runaway loop exceeding token cap or spending threshold. | Safe shutdown; alerts human supervisor via Control UI. | Freezes system state; derivative $\dot{V}(k) = 0$. |

---

## 7. Conclusion: Transforming Probabilistic Chaos into Deterministic State Transitions

Enterprise multi-agent systems fail in production because of an architectural error rather than a lack of base-model capability. By treating natural language as frictionless potential flow, software engineering has repeated d'Alembert's 200-year-old error: designs that work in theory separate and fail at the viscous boundary of real database states.

Resolving the paradox calls for physics-informed agent engineering:

1. **Model the Semantic Boundary Layer:** Recognize the interface where probabilistic agent intents meet deterministic database schemas as a high-friction boundary layer that must be explicitly governed.
2. **Implement Renormalization Group Compression:** Replace raw chat payloads with coarse-grained state representations, filtering out high-frequency linguistic noise.
3. **Enforce Symplectic Phase-Space Bounding:** Use Holographic Invariant Storage to bind safety-critical invariants outside the context window and limit trajectory drift.
4. **Deploy Empirically Validated Lyapunov Control Loops:** Restrict raw agent outputs with tool-mediated interfaces that enforce Input-to-State Stability.

Unstructured prompting is reaching its limits in production. Enterprise AI will need structured, physics-constrained state-space architectures that can be formally verified.

> **Update (June 2026):** The Lyapunov monitoring component of this framework has been empirically validated across 3,175 total runs spanning four benchmarks (τ³-bench [28], SWE-bench [29], MINT [30], and a custom local-model battery of 808 runs), with a 5-condition ablation study, multi-trial validation (333 SWE-bench runs), and cross-model validation across 5 model families. As predicted, the naive energy function $\Delta V \geq 0$ fails: context windows grow monotonically, which produces 46% false positives. Growth-ratio normalization resolves this. Key findings: (1) Zero stability violations across 1,886 short/medium-loop runs (MINT + τ³). (2) 38.6% compute reduction on SWE-bench with 33% fewer nodes than a naive budget cap. (3) Multi-trial evaluation finds no significant resolve-rate difference between monitored and unmonitored runs (−4.5pp, p = 0.28). (4) Zero false positives across 80 local-model harness runs spanning Llama 3.2:3B, Phi-4-Mini, Qwen3:4B, and Gemma4:E4B on consumer hardware (Apple M4, Ollama). (5) A **small-model self-sabotage** pattern: naive turn-limiting outperforms unconstrained baselines by +17.5pp on average on ≤4B models. See [Empirical Lyapunov Stability](/papers/empirical-lyapunov-stability-agent-failure) for the full results and the open-source implementation ([PyPI](https://pypi.org/project/state-harness/)).

---

## References

* [1] d'Alembert, J. le R. (1752). *Essai d'une nouvelle théorie de la résistance des fluides*. Paris.
* [2] Wu, Q., Bansal, G., Zhang, J., Wu, Y., Li, B., Zhu, E., Jiang, L., Zhang, X., Zhang, S., Liu, J., Awadallah, A. H., White, R. W., Burger, D., & Wang, C. (2023). "AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation." *arXiv preprint arXiv:2308.08155*.
* [3] Bhandari, G. (2026). "Multi-Agent Systems Fault Line: Why Enterprise Systems Fail." *Kore.ai blog*.
* [4] u/MR_Zuma. (2026). "Enterprise AI has an 80% failure rate. The models aren't the problem. What is?" *Reddit, r/AI_Agents*.
* [5] Prandtl, L. (1904). "Über Flüssigkeitsbewegung bei sehr kleiner Reibung." *Verhandlungen des Dritten Internationalen Mathematiker-Kongresses*, Heidelberg, 484–491.
* [6] Schlichting, H., & Gersten, K. (2017). *Boundary-Layer Theory*. 9th Edition, Springer-Verlag, Berlin Heidelberg.
* [7] Hairer, E., Lubich, C., & Wanner, G. (2006). *Geometric Numerical Integration: Structure-Preserving Algorithms for Ordinary Differential Equations*. Springer Series in Computational Mathematics, Vol. 31. Springer-Verlag.
* [8] Verlet, L. (1967). "Computer 'Experiments' on Classical Fluids. I. Thermodynamical Properties of Lennard-Jones Molecules." *Physical Review*, 159(1), 98–103.
* [9] Kumar, V., Rajput, S., Mausam, & Krishnan, N. M. A. (2026). "MDGym: Benchmarking AI Agents on Molecular Simulations." *arXiv preprint arXiv:2605.08941*.
* [10] Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., & Liang, P. (2024). "Lost in the Middle: How Language Models Use Long Contexts." *Transactions of the Association for Computational Linguistics*, 12, 157–173.
* [11] Wilson, K. G. (1975). "The renormalization group: Critical phenomena and the Kondo problem." *Reviews of Modern Physics*, 47(4), 773–840.
* [12] Kadanoff, L. P. (1966). "Scaling laws for Ising models near T_c." *Physics Physique Fizika*, 2(6), 263–272.
* [13] Mehta, P., & Schwab, D. J. (2014). "An exact mapping between the Variational Renormalization Group and Deep Learning." *arXiv preprint arXiv:1410.3831*.
* [14] Wang, M., Yu, B., Zhang, S., Mi, L., Wang, W., Wang, Y., Jia, P., Wei, X., Xu, Z., Guo, R., & Zhao, X. (2026). "Renormalization Group Guided Tensor Network Structure Search." *Proceedings of the AAAI Conference on Artificial Intelligence (AAAI-26)*, arXiv:2512.24663.
* [15] Kanerva, P. (2009). "Hyperdimensional Computing: An Introduction to Computing in Distributed Representation with High-Dimensional Random Vectors." *Cognitive Computation*, 1(2), 139–159.
* [16] Plate, T. A. (2003). *Holographic Reduced Representations: Distributed representations for cognitive structures*. CSLI Publications, Stanford.
* [17] Kleyko, D., Davies, M., Frady, E. P., Kanerva, P., Kent, S. J., Olshausen, B. A., Osipov, E., Rabaey, J. M., Rachkovskij, D. A., Rahimi, A., & Sommer, F. T. (2022). "Vector Symbolic Architectures as a Computing Framework for Emerging Hardware." *Proceedings of the IEEE*, 110(10), 1538–1571.
* [18] Lyapunov, A. M. (1892). *The General Problem of the Stability of Motion*. Kharkov Mathematical Society (English translation: Taylor & Francis, 1992).
* [19] Sontag, E. D. (2008). "Input to State Stability: Basic Concepts and Results." In *Nonlinear and Optimal Control Theory*, Lecture Notes in Mathematics, Vol. 1932, 163–220. Springer.
* [20] Khalil, H. K. (2002). *Nonlinear Systems*. 3rd Edition, Prentice Hall, Upper Saddle River.
* [21] Richards, S. M., Berkenkamp, F., & Krause, A. (2018). "The Lyapunov Neural Network: Adaptive Stability Certification for Safe Learning of Dynamical Systems." *Conference on Robot Learning (CoRL)*, PMLR 87, 466–476.
* [22] Zhou, R., Quartz, T., De Sterck, H., & Liu, J. (2022). "Neural Lyapunov Control of Unknown Nonlinear Systems with Stability Guarantees." *Advances in Neural Information Processing Systems (NeurIPS)*, 35, 29113–29125.
* [23] de Moura, L., & Ullrich, S. (2021). "The Lean 4 Theorem Prover and Programming Language." *International Conference on Automated Deduction (CADE)*, 625–635.
* [24] Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K., & Cao, Y. (2023). "ReAct: Synergizing Reasoning and Acting in Language Models." *International Conference on Learning Representations (ICLR)*.
* [25] Schick, T., Dwivedi-Yu, J., Dessì, R., Raileanu, R., Lomeli, M., Hambro, E., Zettlemoyer, L., Cancedda, N., & Scialom, T. (2023). "Toolformer: Language Models Can Teach Themselves to Use Tools." *Advances in Neural Information Processing Systems (NeurIPS)*, 36, 68539–68551.
* [26] Leimkuhler, B., & Reich, S. (2004). *Simulating Hamiltonian Dynamics*. Cambridge University Press, Cambridge Monographs on Applied and Computational Mathematics.
* [27] Ames, A. D., Coogan, S., Egerstedt, M., Notomista, G., Sreenath, K., & Tabuada, P. (2019). "Control Barrier Functions: Theory and Applications." *18th European Control Conference (ECC)*, 3420–3431.
* [28] Yao, S., Shinn, N., Razavi, P., & Narasimhan, K. (2024). "τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains." *arXiv preprint arXiv:2406.12045*.
* [29] Jimenez, C. E., Yang, J., Wettig, A., Yao, S., Pei, K., Press, O., & Narasimhan, K. (2024). "SWE-bench: Can Language Models Resolve Real-World GitHub Issues?" *International Conference on Learning Representations (ICLR)*.
* [30] Wang, X., Wang, Z., Liu, J., Chen, Y., Yuan, L., Peng, H., & Ji, H. (2023). "MINT: Evaluating LLMs in Multi-turn Interaction with Tools and Language Feedback." *arXiv preprint arXiv:2309.10691*.]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[AI's Autonomous Galileo Moment: Discovering the Hidden Hamiltonians of Chaotic Systems]]></title>
      <link>https://vishalvermalabs.com/papers/autonomous-galileo-moment-hamiltonians/</link>
      <guid>https://vishalvermalabs.com/papers/autonomous-galileo-moment-hamiltonians/</guid>
      <pubDate>Sun, 26 Apr 2026 00:00:00 GMT</pubDate>
      <dc:creator>Vishal Verma</dc:creator>
      <category>Machine Learning Theory</category>
      <description><![CDATA[An analysis of Xi and Chen's April 2026 preprint, in which an equivariant attention network trained only on thermal snapshots of a frustrated spin glass recovers the system's Hamiltonian, matching the true couplings with 99.7% cosine similarity.]]></description>
      <content:encoded><![CDATA[### Abstract

A long-standing question about deep learning is whether large neural networks only interpolate their training data, as the "stochastic parrots" critique argues for language models [1], or whether they can infer the laws that produced the data.

This paper analyzes the April 2026 preprint by Wenjie Xi and Wei-Qiang Chen, *Autonomous Emergence of Hamiltonian in Deep Generative Models* [2]. They train an equivariant attention network only on thermal equilibrium snapshots of a frustrated spin glass and recover its Hamiltonian, whose couplings match the true ones with 99.7% cosine similarity. We walk through the statistical mechanics behind the result: why a generative model's score field is proportional to the system's thermodynamic force field, and how the couplings are read back out of it.

---

## 1. The Chaotic Crucible: Frustrated Spin Glasses

To test whether a network can discover physical laws, Xi and Chen needed a system in which simple pattern matching and statistical interpolation would fail. They chose a sequence-dependent, frustrated 1D $O(3)$ spin glass [2].

Spin glasses are among the most complex systems in statistical mechanics [3, 4]. In a ferromagnet the spins align uniformly; a spin glass has two properties that prevent this. The first is quenched disorder: the couplings between spins are random and frozen in time, so the system has no global spatial symmetry [4, 5]. The second is geometric frustration: the arrangement of the couplings makes it impossible to minimize the energy of every bond at once [3, 6].

```mermaid
graph LR
    subgraph ordered["Ordered Ferromagnet — Symmetric Ground State"]
        direction TB
        A["↑"] --- B["↑"] --- C["↑"]
        D["↑"] --- E["↑"] --- F["↑"]
        G["↑"] --- H["↑"] --- I["↑"]
    end
    ordered ~~~ frustrated
    subgraph frustrated["Frustrated Spin Glass — Amorphous Ground State [3, 4, 6]"]
        direction TB
        J["↗"] -.- K["↙"] -.- L["↖"]
        M["▲"] -.- N["↘"] -.- O["◀"]
        P["▼"] -.- Q["↗"] -.- R["->"]
    end
```

Together, these push the 3D vector spins ($\mathbf{S}_i \in S^2$) into non-collinear, incommensurate helical ground states. The energy landscape is rugged, with an exponential number of local minima separated by high energy barriers [7].

The microscopic Hamiltonian governing this classical $O(3)$ system is defined by:

$$H(\mathbf{x}) = -\sum_{i < j} J_{ij} \mathbf{S}_i \cdot \mathbf{S}_j$$

where $\mathbf{x} = (\mathbf{S}_1, \mathbf{S}_2, \dots, \mathbf{S}_N)$ is the full configuration and $J_{ij}$ is the hidden matrix of random couplings. The network was given no information about the energy or the form of the Hamiltonian, and no constraint other than rotational invariance. Its only input was equilibrium configurations sampled from the canonical Gibbs-Boltzmann distribution [2, 8, 9]:

$$P(\mathbf{x}) = \frac{1}{Z} \exp\left(-\beta H(\mathbf{x})\right)$$

Where $\beta = 1/k_B T$ is the inverse temperature and $Z$ is the partition function.

---

## 2. The Thermodynamic Equivalence of the Score Field

Xi and Chen's argument rests on an exact identity between diffusion models and classical statistical mechanics [2, 10].

A continuous-time diffusion or score-based model trains a network to learn the **score function** [10, 11], the gradient of the log-density of the data:

$$\mathbf{s}_\theta(\mathbf{x}) \equiv \nabla_\mathbf{x} \ln p(\mathbf{x})$$

If the equivariant attention network [12] learns the score of the snapshot data exactly, we can substitute the true Gibbs-Boltzmann density into the score equation [2]. The partition function $Z$ is a constant (an integral over all states), so its gradient vanishes:

$$\nabla_\mathbf{x} \ln p(\mathbf{x}) = \nabla_\mathbf{x} \left( -\beta H(\mathbf{x}) - \ln Z \right) = -\beta \nabla_\mathbf{x} H(\mathbf{x})$$

This gives the identity the rest of the method relies on:

$$\mathbf{s}_\theta(\mathbf{x}) \equiv -\beta \nabla_\mathbf{x} H(\mathbf{x})$$

In the zero-noise limit, then, the score field a generative model learns is proportional to the conservative force field of the system's energy landscape [2]. Minimizing the standard denoising score-matching objective [13, 14] therefore teaches the network the gradient of the hidden Hamiltonian.

---

## 3. Algebraic Inversion and Discovery of the Microscopic Law

A learned force field is still a dense neural network. To turn it into a sparse equation a person can read, Xi and Chen set up an overdetermined linear inversion [2, 15, 16].

The force field is linear in the couplings $J_{ij}$, so the network's force predictions can be projected onto a basis of physical interaction terms. Over a set of generated configurations this gives an overdetermined linear system, which the authors solve by ordinary least squares (OLS):

$$\mathbf{c} = \left( \mathbf{F}^\top \mathbf{F} \right)^{-1} \mathbf{F}^\top \mathbf{Y}$$

where $\mathbf{F}$ is the data matrix built from the spin configurations, $\mathbf{Y}$ holds the score vectors the trained model outputs for them, and $\mathbf{c}$ is the recovered coupling vector.

The raw outputs $\tilde{W}_{ij}$ are not symmetric, so they are projected onto symmetric matrices with a zero diagonal. This enforces action-reaction symmetry (Newton's Third Law) and removes self-interaction:

$$W_{ij} = \frac{\tilde{W}_{ij} + \tilde{W}_{ji}}{2}, \quad W_{ii} = 0$$

```mermaid
graph TD
    DATA["Raw Microstate Data"] --> NET["Equivariant Attention Network"]
    NET -->|"Solves Score-Matching Objective [13, 14]"| SCORE["Continuous Score Field"]
    SCORE -->|"Identical to: −β∇H(x)"| OLS["Algebraic Inversion via OLS"]
    OLS -->|"Projects onto Symmetric Manifold"| LAW["Sparse Microscopic Law"]
    LAW -->|"99.7% Cosine Similarity"| TRUTH["True Hamiltonian H(x)"]
```

The inversion recovered the frustrated spin glass's couplings with a cosine similarity of 99.7% to the hidden ground truth [2], and the sparse Hamiltonian alone explains about 87% of the network's variance.

| Statistical Metric | Performance Value | Theoretical Implication |
| :--- | :--- | :--- |
| **Parameter Recovery Coherence** | 99.7% Cosine Similarity | The recovered couplings closely match the true couplings [2, 16]. |
| **Force-Field Explained Variance** | $R^2 \approx 0.87$ | The recovered sparse Hamiltonian explains 87% of the variance in the network's output. |
| **Out-of-Distribution (OOD) Error** | $\sim 0.00$ | Indicates the network learned the physical law rather than interpolating between training samples [2]. |

---

## 4. The Epistemological Leap: Beyond Curve Fitting

This result is evidence against the assumption that deep learning is limited to statistical curve fitting [1]. A network that extracts the Hamiltonian of a disordered system from equilibrium snapshots has gone beyond describing its data to discovering the law behind it [16, 17].

This suggests a different way to analyze high-dimensional data in other fields. Systems that look stochastic, such as turbulent fluid boundaries [18], macroeconomic transaction flows and decentralized computer networks, may be governed by hidden non-equilibrium thermodynamic invariants [9, 19].

---

## 5. Conclusion

Xi and Chen's framework reads a generative model's score field as a conservative force field and recovers a physical law from it [2, 15, 19]. The network was never given the system's rules; it inferred them from equilibrium snapshots.

We expect brute-force statistical interpolation to give way to physics-informed, structurally constrained architectures. Instead of reconstructing raw data, these would learn the deterministic state transitions that drive a system's dynamics [20, 21].

---

## References

* [1] Bender, E. M., Gebru, T., McMillan-Major, A., & Shmitchell, S. (2021). "On the Dangers of Stochastic Parrots: Can Language Models Be Too Big?" *Proceedings of the 2021 ACM FAccT Conference*, 610–623.
* [2] Xi, W., & Chen, W.-Q. (2026). "Autonomous Emergence of Hamiltonian in Deep Generative Models." *arXiv preprint arXiv:2604.20821*.
* [3] Binder, K., & Reger, J. D. (1992). "Theory of orientational glasses: models, concepts, simulations." *Advances in Physics*, 41(6), 547–627.
* [4] Edwards, S. F., & Anderson, P. W. (1975). "Theory of spin glasses." *Journal of Physics F: Metal Physics*, 5(5), 965–974.
* [5] Parisi, G. (1979). "Infinite number of order parameters for spin-glasses." *Physical Review Letters*, 43(23), 1754–1756.
* [6] Moessner, R., & Ramirez, A. P. (2006). "Geometrical Frustration." *Physics Today*, 59(2), 24–29.
* [7] Mézard, M., Parisi, G., & Virasoro, M. A. (1987). *Spin Glass Theory and Beyond: An Introduction to the Replica Method and Its Applications*. World Scientific Publishing.
* [8] Gibbs, J. W. (1902). *Elementary Principles in Statistical Mechanics: Developed with Especial Reference to the Rational Foundation of Thermodynamics*. Charles Scribner's Sons, New York.
* [9] Jaynes, E. T. (1957). "Information Theory and Statistical Mechanics." *Physical Review*, 106(4), 620–630.
* [10] Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., & Ganguli, S. (2015). "Deep Unsupervised Learning using Nonequilibrium Thermodynamics." *International Conference on Machine Learning (ICML)*, 2256–2265.
* [11] Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., & Poole, B. (2021). "Score-Based Generative Modeling through Stochastic Differential Equations." *International Conference on Learning Representations (ICLR)*.
* [12] Fuchs, F., Worrall, D., Fischer, V., & Welling, M. (2020). "SE(3)-Transformers: 3D Roto-Translation Equivariant Attention Networks." *Advances in Neural Information Processing Systems (NeurIPS)*, 33, 1970–1981.
* [13] Hyvärinen, A. (2005). "Estimation of non-normalized statistical models by score matching." *Journal of Machine Learning Research*, 6(Apr), 695–709.
* [14] Vincent, P. (2011). "A Connection Between Score Matching and Denoising Autoencoders." *Neural Computation*, 23(7), 1661–1674.
* [15] Greydanus, S., Dzamba, M., & Yosinski, J. (2019). "Hamiltonian Neural Networks." *Advances in Neural Information Processing Systems (NeurIPS)*, 32, 15353–15363.
* [16] Brunton, S. L., Proctor, J. L., & Kutz, J. N. (2016). "Discovering governing equations from data by sparse identification of nonlinear dynamical systems." *Proceedings of the National Academy of Sciences (PNAS)*, 113(15), 3932–3937.
* [17] Udrescu, S.-M., & Tegmark, M. (2020). "AI Feynman: A physics-inspired method for symbolic regression." *Science Advances*, 6(16), eaay2631.
* [18] Frisch, U. (1995). *Turbulence: The Legacy of A. N. Kolmogorov*. Cambridge University Press.
* [19] Noether, E. (1918). "Invariante Variationsprobleme." *Nachrichten von der Gesellschaft der Wissenschaften zu Göttingen, Mathematisch-Physikalische Klasse*, 1918, 235–257.
* [20] Gu, A., & Dao, T. (2023). "Mamba: Linear-Time Sequence Modeling with Selective State Spaces." *arXiv preprint arXiv:2312.00752*.
* [21] LeCun, Y. (2022). "A Path Towards Autonomous Machine Intelligence." *Open Review Position Paper*.]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[The Physics of AI: Why the Generative Era is a Computational Dead End]]></title>
      <link>https://vishalvermalabs.com/papers/physics-of-ai-computational-dead-end/</link>
      <guid>https://vishalvermalabs.com/papers/physics-of-ai-computational-dead-end/</guid>
      <pubDate>Sun, 05 Apr 2026 00:00:00 GMT</pubDate>
      <dc:creator>Vishal Verma</dc:creator>
      <category>AI Architecture</category>
      <description><![CDATA[A critique of generative AI through analogies from statistical mechanics, general relativity, and quantum degeneracy, arguing that non-generative architectures such as JEPA are the future of machine intelligence.]]></description>
      <content:encoded><![CDATA[### Abstract

Current foundation models, mainly autoregressive large language models and diffusion models that reconstruct pixels, rest on a mistaken physical and statistical assumption: that the best path to intelligence is to predict and generate every microscopic data point [1]. In effect, they try to build Pierre-Simon Laplace's all-knowing "Demon", at an unsustainable computational and thermodynamic cost [2, 3].

This paper critiques the generative approach using ideas from statistical mechanics, general relativity, and quantum degeneracy. By analyzing Yann LeCun's Joint Embedding Predictive Architecture (JEPA) [1] and its implementation with Sliced Isotropic Gaussian Regularization (SIGReg) [4], we argue that machine learning should move away from pixel-level reconstruction. We outline a framework for representation spaces that replaces generation, and the hallucination that comes with it, with deterministic modeling of macrostate transitions.

---

## 1. The Laplace's Demon Fallacy in Autoregressive Computing

In 1814, Pierre-Simon Laplace proposed a thought experiment in causal determinism: an intellect, later called Laplace's Demon, that at a given moment knows the exact position, momentum, and forces of every particle in the universe [5]. By applying Newton's laws of motion to these variables, it could compute the entire past and future exactly:

$$\dot{\mathbf{x}}_i = \frac{\mathbf{p}_i}{m_i}, \qquad \dot{\mathbf{p}}_i = \mathbf{F}_i(\mathbf{x}_1, \dots, \mathbf{x}_N)$$

Generative AI is, in effect, trying to be that Demon. When an autoregressive transformer predicts the next token [6], or a video model renders the next frame [7], it has to reconstruct every microscopic variable, down to individual characters and pixel values, including high-frequency noise.

In terms of the physics of information, this approach is very costly [3]. Tracking the trajectories of $10^{23}$ water molecules to predict when water will boil is hopeless. Classical physics solved this problem in the 19th century with Statistical Mechanics [8]. Ludwig Boltzmann [8] and Josiah Willard Gibbs [9] realized that tracking microscopic states (microstates) was unnecessary: a system can be described by compressed, abstract states (macrostates), defined by the classical entropy equation:

$$S = k_B \ln \Omega$$

Where $S$ is the macroscopic entropy, $k_B$ is the Boltzmann constant, and $\Omega$ represents the volume of accessible microstates in phase space [8, 9].

Generative AI ignores this shortcut. Autoregressive models spend large parametric capacity reconstructing uninformative, high-frequency noise, such as the exact texture of a background pixel or the precise punctuation of a text block. They exhaust their compute budgets on irrelevant microstate variation, with costs that grow steeply with scale, as the compute-optimal scaling laws show [10, 11].

---

## 2. The Joint Embedding Predictive Architecture (JEPA) as a Thermodynamic Correction

Yann LeCun's Joint Embedding Predictive Architecture (JEPA) is a thermodynamic correction to this bottleneck: it drops microstate generation altogether [1, 12, 13]. A generative model passes a corrupted input through a pixel-level decoder to rebuild it in full. JEPA does all its processing in a compressed latent space instead.

```mermaid
graph TD
    subgraph gen["Generative Architecture — Laplace's Demon"]
        X1["Input x"] --> ENC1["Encoder"] --> Z1["Latent Space z"] --> DEC["Decoder"] --> XHAT["Reconstructed Pixels x̂"]
        DEC -.- WASTE["Wastes Capacity on Noise"]
    end
    subgraph jepa["Non-Generative Architecture — JEPA [1, 12, 13]"]
        X2["Input x"] --> CENC["Context Encoder"] --> ZT["Latent z_t"] --> PRED["Predictor"] --> ZPRED["Predicted ẑ_{t+1}"]
        Y2["Target y"] --> TENC["Target Encoder"] --> ZT1["Latent z_{t+1}"] --> CMP["Compares Macrostates"]
        PRED --> CMP
    end
```

JEPA passes both the context input ($x$) and the target ($y$) through symmetric encoders into this latent space [12]. The predictor works only there, minimizing a prediction loss between latent macrostates ($z_t \to z_{t+1}$):

$$\mathcal{L}_{\text{pred}} = \mathbb{E} \left[ \| \hat{z}_{t+1} - z_{t+1} \|^2 \right]$$

Because the model never has to draw pixels or emit raw tokens, it discards irrelevant microscopic noise [14]. It learns the "intuitive physics" of the data distribution and tracks structural state transitions rather than local statistical variation.

---

## 3. The Physics of Representation Collapse and Gravitational Singularities

Removing the pixel-level decoder creates a problem, however. In a traditional autoencoder, the reconstruction loss acts as an expansive force: it makes the latent space keep enough information to rebuild the original input [15].

Without the decoder, the network is exposed to **Representation Collapse** (or dimensionality collapse) [16]. For an unconstrained predictive architecture, the easiest way to reach zero prediction error ($\mathcal{L}_{\text{pred}} = 0$) is to map every input to the same constant vector:

$$f_\theta(x) = c \quad \forall x$$

In this state, the loss acts like a strong gravitational field in general relativity [17, 18]: an attractive force that pulls every data vector on the manifold into a single zero-entropy point, where all structure is lost. This is the analogue of a Gravitational Singularity.

```mermaid
graph LR
    subgraph healthy["Healthy Latent Space — High Entropy"]
        direction TB
        A((·)) ~~~ B((·)) ~~~ C((·))
        D((·)) ~~~ E((·))
        F((·)) ~~~ G((·)) ~~~ H((·)) ~~~ I((·))
        J((·)) ~~~ K((·)) ~~~ L((·))
    end
    healthy ~~~ collapsed
    subgraph collapsed["Representation Collapse — z = c"]
        direction TB
        M((·)) --> Z((●))
        N((·)) --> Z
        O((·)) --> Z
        P((·)) --> Z
        Q((·)) --> Z
    end
```

A non-generative world model that learns abstract structure without collapsing therefore needs an explicit outward force to counteract this informational gravity [16, 19].

---

## 4. Quantum Degeneracy Pressure and SIGReg

To prevent this collapse, recent work uses **Sliced Isotropic Gaussian Regularization (SIGReg)** [4]. SIGReg works much like the Pauli Exclusion Principle [20].

When a stellar core runs out of nuclear fuel, gravity pulls its remaining mass inward toward an infinitely dense singularity. In white dwarfs and neutron stars, quantum mechanics stops the collapse. The Pauli Exclusion Principle states that identical fermions (such as electrons or neutrons) cannot occupy the same quantum state at the same time [20]. This produces a non-thermal outward force, Quantum Degeneracy Pressure, that holds the star up against gravity [21, 22].

SIGReg adds an analogous outward force to the network's loss landscape [4]. The total regularized loss is:

$$\mathcal{L}_{\text{total}} = \mathcal{L}_{\text{pred}} + \lambda \mathcal{L}_{\text{SIGReg}}$$

Here the scaling parameter $\lambda$ plays the role of the degeneracy pressure coefficient. SIGReg relies on the Cramér-Wold theorem [23], which proves that a multi-dimensional probability distribution can be uniquely characterized by the set of its one-dimensional random projections [24].

$$\mathcal{L}_{\text{SIGReg}} = \frac{1}{M} \sum_{m=1}^M D_{\text{Cramér}}\left( P_{\mathbf{a}_m^\top \mathbf{z}} \parallel Q_{\text{Gaussian}} \right)$$

By projecting the latent vectors ($\mathbf{z}$) onto random one-dimensional slices ($\mathbf{a}_m$) and matching each projection to a standard normal distribution ($Q_{\text{Gaussian}}$), SIGReg rules out collapse to a single constant point [4, 24]. The representations keep a high-entropy Gaussian spread across the manifold. This informational degeneracy pressure stabilizes the predictive model end-to-end without expensive contrastive pairs or architectural workarounds [16, 19].

---

## 5. The Systemic Pivot: State-Space Modeling over Generative Reconstruction

The same reasoning exposes a flaw in how large enterprise computing systems are designed today. Much of modern infrastructure is built on "Laplacian" generative frameworks. Data pipelines routinely feed large volumes of raw text and unstructured logs into autoregressive LLM wrappers. These systems spend much of their compute and memory bandwidth ingesting and reconstructing every token, far less efficiently than physical limits allow [3, 10].

| Criterion | Laplacian Generative | Thermodynamic State-Space |
| :--- | :--- | :--- |
| **Core Analogy** | Laplace's Demon [5] | Statistical Mechanics [8, 9] |
| **Data Target** | Microstate Reconstruction (Pixels, raw text tokens) | Macrostate Transitions (Latent topology signals) |
| **Compute Cost** | Grows steeply with scale [10, 11] | Compressed; lower cost [12] |
| **Stability Engine** | Autoregressive decoding (Fragile, hallucinations) | SIGReg / Quantum Degeneracy Pressure [4, 20] |

Scalable, robust intelligent systems require a clean break from this approach. Instead of large engines that continuously generate and reconstruct raw data, engineering must focus on structured, non-generative encoders [1, 12, 25].

Mapping high-entropy environments into stable, non-collapsing latent representations ($z_t$) and tracking their transitions with deterministic state machines ($z_{t+1}$) shifts machine learning from stochastic curve-fitting toward modeling universal invariants [25, 26]. The practical rule is to predict macrostate transitions, not microstate pixels.

---

## References

* [1] LeCun, Y. (2022). "A Path Towards Autonomous Machine Intelligence." *Open Review Position Paper*.
* [2] Luccioni, A. S., Jernite, Y., & Strubell, E. (2024). "Power Hungry Processing: Watts Driving the Cost of AI Deployment?" *Proceedings of the 2024 ACM Conference on Fairness, Accountability, and Transparency (FAccT)*, 85–99.
* [3] Landauer, R. (1961). "Irreversibility and Heat Generation in the Computing Process." *IBM Journal of Research and Development*, 5(3), 183–191.
* [4] Maes, L., Le Lidec, Q., Scieur, D., LeCun, Y., & Balestriero, R. (2026). "LeWorldModel: Stable End-to-End Joint-Embedding Predictive Architecture from Pixels." *arXiv preprint arXiv:2603.19312*.
* [5] Laplace, P.-S. (1814). *Essai philosophique sur les probabilités*. Paris: Courcier.
* [6] Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., & Polosukhin, I. (2017). "Attention Is All You Need." *Advances in Neural Information Processing Systems*, 30, 5998–6008.
* [7] Brooks, T., Peebles, B., Holmes, C., DePue, W., Guo, Y., Jing, L., Schnurr, D., Taylor, J., Luhman, T., Luhman, E., Ng, C., Wang, R., & Ramesh, A. (2024). "Video generation models as world simulators." *OpenAI technical report*.
* [8] Boltzmann, L. (1877). "Über die Beziehung zwischen dem zweiten Hauptsatze der mechanischen Wärmetheorie und der Wahrscheinlichkeitsrechnung respektive den Sätzen über das Wärmegleichgewicht." *Wiener Berichte*, 76, 373–435.
* [9] Gibbs, J. W. (1902). *Elementary Principles in Statistical Mechanics: Developed with Especial Reference to the Rational Foundation of Thermodynamics*. Charles Scribner's Sons, New York.
* [10] Kaplan, J., McCandlish, S., Henighan, T., Brown, T. B., Chess, B., Child, R., Gray, S., Radford, A., Wu, J., & Amodei, D. (2020). "Scaling Laws for Neural Language Models." *arXiv preprint arXiv:2001.08361*.
* [11] Hoffmann, J., Borgeaud, S., Mensch, A., Buchatskaya, E., Cai, T., Rutherford, E., Casas, D. de las, Hendricks, L. A., Welbl, J., Clark, A., Hennigan, T., Noland, N., Millican, K., Van Den Driessche, G., Damoc, B., Guy, A., Osindero, S., Simonyan, K., Elsen, E., Vinyals, O., Rae, J., & Sifre, L. (2022). "An Empirical Analysis of Compute-Optimal Large Language Model Training." *Advances in Neural Information Processing Systems*, 35, 30016–30030.
* [12] Assran, M., Duval, Q., Misra, I., Bojanowski, P., Vincent, P., Rabbat, M., LeCun, Y., & Ballas, N. (2023). "Self-Supervised Learning from Images with a Joint Embedding Predictive Architecture." *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)*, 15619–15629.
* [13] Bardes, A., Garrido, Q., Ponce, J., Chen, X., Rabbat, M., LeCun, Y., Assran, M., & Ballas, N. (2024). "Revisiting Feature Prediction for Learning Visual Representations from Video." *arXiv preprint arXiv:2404.08471*.
* [14] Bardes, A., Ponce, J., & LeCun, Y. (2021). "VICReg: Variance-Invariance-Covariance Regularization for Self-Supervised Learning." *arXiv preprint arXiv:2105.04906*.
* [15] Kingma, D. P., & Welling, M. (2013). "Auto-Encoding Variational Bayes." *arXiv preprint arXiv:1312.6114*.
* [16] Jing, L., Vincent, P., LeCun, Y., & Tian, Y. (2022). "Understanding Dimensional Collapse in Contrastive Self-supervised Learning." *International Conference on Learning Representations (ICLR)*.
* [17] Penrose, R. (1965). "Gravitational Collapse and Space-Time Singularities." *Physical Review Letters*, 14(3), 57–59.
* [18] Misner, C. W., Thorne, K. S., & Wheeler, J. A. (1973). *Gravitation*. San Francisco: W. H. Freeman.
* [19] Zbontar, J., Jing, L., Misra, I., LeCun, Y., & Deny, S. (2021). "Barlow Twins: Self-Supervised Learning via Redundancy Reduction." *International Conference on Machine Learning (ICML)*, 12310–12320.
* [20] Pauli, W. (1925). "Über den Zusammenhang des Abschlusses der Elektronengruppen im Atom mit der Komplexstruktur der Spektren." *Zeitschrift für Physik*, 31(1), 765–783.
* [21] Fermi, E. (1926). "Sulla quantizzazione del gas perfetto monoatomico." *Rendiconti Lincei*, 3, 145–149.
* [22] Chandrasekhar, S. (1931). "The Density of White Dwarf Stars." *Philosophical Magazine*, 11(70), 592–596.
* [23] Cramér, H., & Wold, H. (1936). "Some Theorems on Distribution Functions." *Journal of the London Mathematical Society*, 11(4), 290–294.
* [24] Bonneel, N., Rabin, J., Peyré, G., & Pfister, H. (2015). "Sliced and Radon Wasserstein Barycenters of Measures." *Journal of Mathematical Imaging and Vision*, 51(1), 22–45.
* [25] Kalman, R. E. (1960). "A New Approach to Linear Filtering and Prediction Problems." *Journal of Basic Engineering*, 82(1), 35–45.
* [26] Gu, A., & Dao, T. (2023). "Mamba: Linear-Time Sequence Modeling with Selective State Spaces." *arXiv preprint arXiv:2312.00752*.]]></content:encoded>
    </item>
  </channel>
</rss>
