Subscribe
Research
5 min read

Tree-Ising Fixes a Looping LLM for $0.90, No AI Agent

Tree-Ising fixes Qwen3.5-0.8B's reasoning loops with bit-level weight edits. It beats an MIT agent fix on MATH-500 and costs $0.90 instead of $312.

Olivetti-style cover reading Tree-Ising Fixes a Looping LLM for $0.90, No AI Agent, beside a grid of binary weight bits with a few flipped bits in red
Olivetti-style cover reading Tree-Ising Fixes a Looping LLM for $0.90, No AI Agent, beside a grid of binary weight bits with a few flipped bits in red

A new arXiv paper, Tree-Ising (posted November 10, 2026), repairs a small reasoning model's looping bug by treating the fix as a math optimization problem over the model's stored weight bits. The authors, Hadi Salloum of QDeep and Ammar Ali of ITMO University's LEAD lab, compare it head to head with a fix that an AI agent wrote for the same model in recent MIT CSAIL work. In the paper's tests, the optimizer's fix scores 2.9 points higher on MATH-500, changes fewer weights, and costs about $0.90 of GPU time instead of $312.

What bug was being fixed?

The target is Qwen3.5-0.8B, a small reasoning model. In thinking mode, it often falls into a short cycle of repeated text and keeps going until it hits the token limit. Per the paper, this happens on 93% of MATH-500 problems under a 32,768-token cap, so the model scores only 7.9%. It rarely gets to write an answer.

How did the MIT agent fix it?

MIT CSAIL researchers Takehi, Teoh, Zhang and Khattab described the earlier fix in a blog post, "Sparks of Weight-Space Programming" (November 2, 2026). They gave a GPT-6 Astra agent the model checkpoint, practice problems and a budget of 50 forward-pass requests. The agent read the weights, traced the loops to the MLPs of layers 15 and 19, and rewrote 64 columns in each output projection. No gradient training was used. The MIT team reported that MATH-500 accuracy rose to 48.1%.

The Tree-Ising paper prices that run from the MIT team's released logs at list prices: 158 agent turns, 89.7 million tokens, 50 forward-pass requests, 12.2 GPU-hours of forward passes and 15.6 hours of wall clock time. Total: $312, of which $291 is API cost and $21 is GPU cost.

How does Tree-Ising work?

Tree-Ising does not ask a language model to reason about the fix. It writes the evidence the agent gathered, forward passes on looping answers versus successful ones, as an objective function, and then searches for the bit changes that best satisfy it. Because the edit changes the stored weights themselves, it stays in the model, unlike the run-time neuron steering in the recent Qwen "evil neuron" posts.

Comparison of the MIT agent edit and the Tree-Ising edit on Qwen3.5-0.8B: turns, tokens, forward passes, wall clock, cost and MATH-500 accuracy

The recipe has five steps:

  • Represent the weights as state trees. In the paper's lossless BF16 format, each group of 64 weights shares one exponent. The only allowed edits are sign flips and power-of-two scaling (exponent shifts) that leave every shared exponent and every mantissa untouched. That turns each candidate weight into a yes or no decision.
  • Pick the layers. One forward scan of the base model measures how strongly each MLP layer writes along the loop direction.
  • Define the goal. Forward statistics give a "loop direction" and a "concluding direction." The objective pushes the layer away from looping and toward concluding on loop tokens, keeps its output the same on productive tokens, and limits how many weights change.
  • Split it into Ising problems. For fixed statistics and preselected moves, the objective splits exactly into one independent QUBO (Ising) problem per output row: 2,048 row problems across the two layers.
  • Solve on a GPU. All rows of a layer are solved at once with simulated annealing or simulated bifurcation, a quantum-inspired solver.

What were the results?

On Qwen3.5-0.8B, with the same two layers and the same evaluation harness, Table 3 of the paper shows:

  • MATH-500 (4 completions per problem): agent edit 51.7%, Tree-Ising with annealing 54.6%, with simulated bifurcation 55.1%. The annealing gain is +2.9 points (p about 0.003).
  • GSM8K: agent edit 65.6%, Tree-Ising with annealing 70.5%.
  • AMC23, Minerva and OlympiadBench: both Tree-Ising solvers also score above the agent edit.

Only the MATH-500 and GSM8K gains are statistically significant after correcting for multiple comparisons. The paper also measures the agent edit at 51.7% on MATH-500 in its own harness, above the 48.1% the MIT team reported.

Bar chart of accuracy on Qwen3.5-0.8B from Table 3: agent edit vs Tree-Ising with annealing on MATH-500, GSM8K, AMC23, Minerva and OlympiadBench

The gain comes mostly from the model finishing its reasoning. On MATH-500, answers cut off at the token cap fall from 31.6% with the agent edit to 23.9% with Tree-Ising.

How cheap was it?

Tree-Ising used four forward-pass requests: 21.8 GPU-minutes, plus 8.8 minutes of annealing. Wall clock time was 31 minutes and the cost was about $0.90, with zero LLM tokens. The paper calls this about 350 times cheaper and 30 times faster.

The edit is also smaller. In Table 1, Tree-Ising changes 112,630 weights versus the agent's 130,188 (13% fewer) and makes 278,767 BF16 bit flips versus 621,388 (2.2 times fewer). It writes zero shared exponents and zero mantissas, by design.

Does it work without the agent?

On the larger Qwen3.5-2B, the authors let the forward scan choose the layers and set the edit strength from the base model only, with no agent and no reference edit. Greedy GSM8K accuracy rose from 21.6% to 69.4% (Table 7). The edit solved 669 problems the base model failed, but broke 38 of the 285 problems the base model had solved. Answers cut at the cap fell from 77.9% to 26.7%. The pipeline ran in 26 minutes on one A100 GPU.

Is quantum computing involved?

Only as a demo. The authors ran one eight-variable subproblem with QAOA on an IBM Heron processor. They state plainly that this is not evidence of quantum advantage, and all model results use the classical GPU solver.

What are the caveats?

The authors list several:

  • The cost comparison is not like for like. It pits the agent's full discovery run against one run of a fixed recipe that was designed after reading the agent's public logs. On the 0.8B model, Tree-Ising reuses the agent's two layers and calibrates its edit strength from the agent's edit.
  • Narrow scope. One failure mode (reasoning loops), one model family, math benchmarks only. Instruction following and general language ability were not tested, so side effects are unmeasured.
  • Evaluation limits. The 7.9% base score was not rerun, and each benchmark used one seed. Some MATH-500 problems were seen during development, but on the 400 held-out problems Tree-Ising still led, 53.8% to 50.8%.

Why this matters for engineers

The MIT work showed that an agent can find and write a weight-level fix. It is part of a wider line of research on small, targeted weight changes, such as Deletion Tuning, which zeroes fewer than 0.05% of a model's weights to teach it a new skill. Tree-Ising suggests a division of labor: once someone knows which direction in a model causes a failure, applying the fix can be a cheap, repeatable optimization step rather than another long agent session. The 2B result hints that the recipe can carry over within a model family without an agent. Whether it holds for other failure modes, larger models and non-math tasks is still open. The code is on GitHub.

Sources

ResearchLLMBenchmarks