Beyond Test-Time Memory: State-Space Optimal Control for LLM Reasoning

Peihao Wang, Shan Yang, Xijun Wang, Tesi Xiao, Xin Liu, Changlong Yu, Yu Lou, Pan Li, Zhangyang Wang, Ming Lin, Rene Vidal

Introduction: The Need for "System 2" Thinking in LLMs

Modern Large Language Models (LLMs) excel at "System 1" thinking—fast, associative pattern matching that predicts the next token by extrapolating from past context. However, they lack a native architectural mechanism for "System 2" thinking: deliberate, multi-step planning and goal-directed reasoning.

While techniques like Reinforcement Learning (RL) or Chain-of-Thought (CoT) prompting attempt to bridge this gap, they typically operate externally to the model's core architecture or rely on generating long, computationally expensive sequences of text. To achieve true reasoning, planning must be internalized within the model's latent representations. This allows the model to project future states and select actions that optimize long-term objectives during every single forward pass.

To address this, researchers have introduced the Test-Time Control (TTC) layer, a novel architectural component that embeds deliberate planning directly into the forward pass of LLMs. By formulating reasoning as an optimal control problem, the model "thinks ahead" in latent space to optimize future outcomes before predicting the next token, leading to massive performance gains in mathematical and symbolic reasoning.

The Core Innovation: Reasoning as Optimal Control

The TTC layer is designed to replace or augment standard memory layers, such as Attention or State Space Models (SSMs). It achieves this through several key mechanisms:

  • Finite-Horizon LQR Planning: The layer treats the transition between latent states as a control problem. Given a specific context, it solves a finite-horizon Linear-Quadratic Regulator (LQR) problem. It identifies an "optimal action" (the next latent state) that minimizes a quadratic cost function over a future "planning horizon."
  • Differentiable Optimization: To ensure the TTC layer is fully trainable, the authors formulate the LQR solver as a Karush-Kuhn-Tucker (KKT) system. This allows gradients to flow seamlessly through the optimization process during backpropagation.
  • Contextualized World Models: The dynamics and cost matrices of the LQR problem are not static. They are generated on-the-fly based on the input context, allowing the model's internal "world model" to adapt dynamically to the specific problem being solved.

Overcoming the Hardware Bottleneck

A significant challenge in implementing optimal control within neural architectures is computational efficiency. Standard LQR solvers, such as Riccati iterations, are inherently sequential and perform poorly on modern GPUs.

To ensure scalability, the researchers developed a hardware-efficient solver based on symplectic geometry. This approach reformulates the sequential problem into parallelizable matrix products. Implemented as a fused CUDA kernel, this hardware-algorithm co-design achieves a 10x throughput increase over traditional solvers, enabling parallel execution with minimal overhead.

Key Insights: Planning Before Prediction

The TTC architecture introduces several paradigm-shifting insights for LLM reasoning:

  1. Looking Forward, Not Just Backward: Unlike standard models that only attend to past context, TTC-Net computes a latent value function to ensure the next token is not just statistically probable, but strategically sound.
  2. Test-Time Scaling: A major breakthrough is the ability to increase the planning horizon ($T$) at inference time. For example, a model trained on a horizon of 32 can perform better if allowed to "think" for a horizon of 64 at test time, unlocking zero-shot reasoning improvements.
  3. Latent Chain-of-Thought: TTC does not replace explicit text-based CoT; rather, it complements it. By providing a "latent CoT," the TTC layer improves the quality of each individual step in the chain, making the explicit text generation more concise and accurate.

Empirical Results

The researchers evaluated TTC-Net (integrated as an adapter into Llama-3-7B) across a rigorous suite of mathematical, symbolic, and general benchmarks, utilizing datasets like OpenThoughts2-114K and 800k self-collected examples for fine-tuning.

  • Mathematical Superiority: TTC improved MATH-500 performance by a staggering +27.8% compared to the base Llama-3-7B model.
  • Zero-to-Hero on AIME: On the notoriously difficult AIME 2024/2025 benchmarks, where the base model scored 0%, TTC-Net achieved up to 20% accuracy and demonstrated 2-3$\times$ Pass@8 improvements on AMC and AIME.
  • Symbolic Mastery: In a challenging 10k Sudoku dataset testing long-horizon constraint propagation, TTC-Net outperformed both Transformer and Mamba-based models in board-level accuracy.
  • High Efficiency: Despite the complex internal mathematics, the fused CUDA kernel keeps computational overhead remarkably low. At a planning horizon of $T=8$, the model maintains ~97% of the throughput of a standard Transformer.

Limitations and Future Directions

While the TTC layer represents a significant leap forward, the authors acknowledge several areas for future exploration. First, while a single TTC layer is well-understood, the theoretical dynamics of joint interactions among multiple TTC layers in a deep stack require further study. Second, the current model relies on linear dynamics and quadratic costs for efficiency; exploring non-linear control formulations could unlock even greater reasoning power, albeit with potential computational hurdles. Finally, current experiments focus on 7B-parameter models. Testing the "reasoning ceiling" of TTC layers in massive 70B+ parameter models remains an exciting frontier for the field.

Summary updated

BibTeX
@inproceedings{wang2026beyond,
  author = {Peihao Wang and Shan Yang and Xijun Wang and Tesi Xiao and Xin Liu and Changlong Yu and Yu Lou and Pan Li and Zhangyang Wang and Ming Lin and Rene Vidal},
  title = {{Beyond Test-Time Memory: State-Space Optimal Control for LLM Reasoning}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=PsCuRawx1I},
}
Figure