Rust in Everything
← Papers

Tree-Ising: Repairing Language Models with Bit-Level Ising Edits

Hadi Salloum, Ammar Ali

2026-11-11▲ 77arXiv 2611.14210v1Hugging FaceCode

AI-generated from the full paper (deepseek-flash). It may contain mistakes; check the original.

TL;DR

Tree-Ising reformulates an LLM-agent weight repair of Qwen3.5-0.8B as a sparse discrete optimization over BF16 state trees, solved exactly as independent per-row QUBO/Ising problems on a GPU, beating the agent's edit on all five math benchmarks while changing fewer bits at about $0.90 per run.

Problem

Takehi et al. showed a GPT-6 Astra agent could repair Qwen3.5-0.8B's reasoning loops by rewriting 64 columns in the MLP output projections of layers 15 and 19, raising MATH-500 accuracy from 7.9% to 48.1% without gradients. That repair cost 158 turns, 89.7 million tokens, 50 forward-pass requests and 15.6 hours of compute, and every step relied on natural-language judgment with no guarantee of an optimal edit. The paper asks whether the same evidence gathered by the agent can instead be formalized as a mathematical objective over stored weights and solved directly.

Method

Weights are represented as lossless BF16 state trees in which a group of 64 weights shares an exponent node; admissible moves are sign flips and exponent shifts that preserve the group's shared exponent and mantissa, and one move is preselected per candidate weight so the edit becomes binary. A single forward scan of the base model scores each MLP's write along the loop direction and selects the layers to edit (layers 15 and 19), without an agent. Forward statistics define a loop direction and a concluding direction; the objective minimizes the layer's dose along their combination on loop tokens, penalizes collateral change of the output on productive tokens, and charges an L0 cost on modified weights, with gamma calibrated to a target dose and lambda adjusted to a weight budget. For fixed statistics the objective separates exactly into one dense QUBO per output row, rewritten as an Ising model with spins; K=512 retained columns give 1,024 problems per layer and 2,048 across the two edited layers, solved simultaneously on one GPU by simulated annealing or by the quantum-inspired simulated bifurcation method. The row Ising models are also the native input format for quantum annealers and QAOA.

Results

  • On MATH-500 with four completions per problem, both Tree-Ising solvers outperform the agent edit and the base model under the same harness. §4.2
  • Tree-Ising outperforms the agent edit on all five benchmarks with either solver, and MATH-500 and GSM8K gains survive a Bonferroni correction across the twelve comparisons. §4.2
  • Fewer answers are truncated at the 32,768-token cap with Tree-Ising than with the agent edit. §4.2
  • A single Tree-Ising repair requires four forward-pass requests and no LLM tokens, versus 50 requests and a $312 agent run. §4.3
  • The Tree-Ising edit changes fewer weights and far fewer bits than the agent edit, and by construction writes no shared exponents or mantissas. §4.4
  • Applied to Qwen3.5-2B with layers and dose derived from the base model alone, the recipe raises greedy GSM8K accuracy substantially. §5

Limitations

  • On Qwen3.5-0.8B the recipe reuses the agent's two selected layers and calibrates its dose from the agent's edit, so the comparison is not strictly dose-matched and no dose-matched (1.0x) edit was evaluated (stated in Sections 1, 4.3 and 4.5).
  • The practice screen used for ablation has a standard error of accuracy of approximately 4.4 points and the paper states it lacks resolution to distinguish differences of a few percentage points (stated in Section 4.5).
  • The quantum experiment is an eight-variable block from a single row of layer 15, judged only against a uniform-sampling control, which the paper itself calls a relatively weak baseline; the authors state it is not evidence of quantum advantage and that all full-model results come from the classical GPU solver (stated in Section 6).
  • A dense row with K=512 has 130,816 pairwise couplings while D-Wave's Advantage2_system1 lists only 41,205 couplers, so the paper states the full row cannot be embedded and a block-conditional hybrid loop would be required (stated in Appendix B.5).

Key points

  • In the lossless BF16 state tree, multiplying a weight by two changes one stored state bit while the shared exponent and mantissa are kept; one move is preselected per candidate weight so the edit is binary. §3
  • A single forward scan of the base model scores each MLP's write along the loop direction and selects layers 15 and 19, with the final layer excluded. §3
  • The objective combines a dose term along u on loop tokens, a collateral term on productive tokens equal to the layer-output reconstruction error used in pruning and quantization, and an L0 sparsity penalty. §3.3
  • For a novel model the target dose uses tau = 6.5 times the layer's own write, so the entire objective is derived from the base model alone. §3.3
  • With K=512 retained columns each edited layer yields 1,024 dense Ising problems with 512 spins each, giving 2,048 problems across the two edited layers; the decomposition is exact given the retained columns and preselected moves. §3.4
  • Removing the concluding direction (beta = 0) suppresses loops but leaves 53.1% of answers cut at the cap and accuracy at 43.8% on the practice screen, versus 57.0% for the selected configuration. §4.5
  • A dense closed-form solution of the identical objective reaches 57.8% on the practice screen but changes 7.02M weights, 62 times as many as Tree-Ising. §4.5
  • On ibm_fez, a depth-two eight-variable QAOA circuit sampled the exact optimum in 110 of 1,024 shots versus four shots for a uniform control; ideal statevector rate at depth three was higher but the measured rate fell. §6

Mind map

Tree-Ising
Problem
Agent weight repair cost 158 turns, 89.7M tokens
Qwen3.5-0.8B loops cut 93% of MATH-500 at cap
No optimality guarantee for agent edits
Method
BF16 state trees with sign and exponent moves
Layer selection by one forward scan
Objective dose plus collateral plus L0 cost
Exact split into per-row QUBO and Ising models
Solvers
GPU simulated annealing
Simulated bifurcation
QAOA on IBM Heron eight-variable block
Results on Qwen3.5-0.8B
MATH-500 54.6% SA and 55.1% SB vs 51.7% agent
Ahead on all five math benchmarks
13% fewer weights, 2.2x fewer BF16 flips
4 forward passes, 31 min, about $0.90
Transfer and ablations
Qwen3.5-2B GSM8K 21.6% to 69.4% greedy
Loop-only objective stalls in mid-40s
Dense closed form needs 62x more weights
Limitations
Reuses agent layers and dose on 0.8B
Practice screen error about 4.4 points
No quantum advantage claimed
Full-row embedding infeasible on annealers