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

TL;DR

TTC layer enhances LLM reasoning via LQR planning, achieving 27.8% improvement on MATH-500.

cs.LG 🔴 Advanced 2026-03-10 41 views
Peihao Wang Shan Yang Xijun Wang Tesi Xiao Xin Liu Changlong Yu Yu Lou Pan Li Zhangyang Wang Ming Lin René Vidal
LLM optimal control reasoning mathematical reasoning CUDA optimization

Key Findings

Methodology

The paper introduces the Test-Time Control (TTC) layer, embedding finite-horizon Linear Quadratic Regulator (LQR) planning into large language models (LLMs) during inference. The TTC layer performs planning over latent states, serving as a nested objective function to enable planning before prediction. A hardware-efficient LQR solver based on symplectic formulation is implemented for parallel execution, reducing computational overhead.

Key Results

  • On the MATH-500 dataset, TTC layers improved mathematical reasoning performance by up to 27.8%. On AMC and AIME datasets, Pass@8 improved by 2-3x, significantly outperforming traditional methods.
  • Experiments demonstrate that TTC layers significantly enhance LLM performance on complex reasoning tasks like Sudoku and mathematical problem solving.
  • Ablation studies show that the introduction of TTC layers effectively improves reasoning capabilities, especially in long-horizon planning tasks.

Significance

This study introduces optimal control into language model architecture, providing an effective mechanism beyond test-time training to address the limitations of traditional memory models in reasoning. TTC layers can be integrated into pretrained LLMs as adapters without modifying the base architecture, significantly enhancing reasoning performance.

Technical Contribution

The paper internalizes the optimal control problem within the architecture, embedding a value function into sequence modeling mechanisms. It proposes a fully differentiable TTC layer and develops a symplectic LQR solver, significantly improving computational parallelism and throughput.

Novelty

This is the first work to embed the optimal control problem directly into the language model reasoning process, contrasting with traditional test-time self-supervised training or memory-only prediction methods, offering new theoretical guarantees and engineering possibilities.

Limitations

  • TTC layers may face computational resource constraints in high-complexity tasks, particularly in long-horizon planning.
  • The method requires high hardware demands, potentially unsuitable for resource-limited environments.

Future Work

Future research could explore the application of TTC layers in other domains, such as natural language understanding and generation tasks, and further optimize hardware implementations to reduce computational costs.

AI Executive Summary

Traditional large language models (LLMs) face limitations in reasoning capabilities, primarily relying on memory and retrieval mechanisms, lacking System 2-style planning abilities. This paper proposes a new architectural perspective, viewing reasoning and planning as an optimal control problem over internal representations. By introducing the Test-Time Control (TTC) layer, finite-horizon Linear Quadratic Regulator (LQR) planning is embedded into the inference process, enabling planning before prediction.

The TTC layer performs planning over latent states during inference, serving as a nested objective function to enable planning before prediction. A hardware-efficient LQR solver based on symplectic formulation is implemented for parallel execution, reducing computational overhead. Experimental results show that TTC layers significantly enhance LLM performance on complex reasoning tasks like Sudoku and mathematical problem solving.

This study introduces optimal control into language model architecture, providing an effective mechanism beyond test-time training to address the limitations of traditional memory models in reasoning. TTC layers can be integrated into pretrained LLMs as adapters without modifying the base architecture, significantly enhancing reasoning performance. Future research could explore the application of TTC layers in other domains, such as natural language understanding and generation tasks, and further optimize hardware implementations to reduce computational costs.

Deep Analysis

Background

As sequence-processing architectures evolved from RNNs to Transformers, and more recently to State-Space Models (SSMs) and linear RNNs, language models have made significant advances in memory and retrieval. However, these models still face challenges in reasoning, discovery, and problem-solving. Human intelligence operates through the interplay of System 1 and System 2 thinking, with current LLM architectures largely embodying System 1 behavior, lacking System 2-style planning capabilities.

Core Problem

Current language models face limitations in reasoning capabilities, primarily relying on memory and retrieval mechanisms, lacking System 2-style planning abilities. Traditional methods like reinforcement learning are typically applied as external training or post-training procedures, unable to implement planning during inference.

Innovation

This paper proposes a new architectural perspective, viewing reasoning and planning as an optimal control problem over internal representations. By introducing the Test-Time Control (TTC) layer, finite-horizon Linear Quadratic Regulator (LQR) planning is embedded into the inference process, enabling planning before prediction.

Methodology

  • �� Introduce TTC layer embedding LQR planning into inference.
  • �� Implement a hardware-efficient LQR solver based on symplectic formulation for parallel execution.
  • �� Integrate TTC layers into pretrained LLMs as adapters.

Experiments

Experiments were conducted on MATH-500, AMC, and AIME datasets, using Pass@8 as the primary evaluation metric. Ablation studies were conducted to verify the effectiveness of TTC layers, showing significant improvements in model reasoning performance.

Results

On the MATH-500 dataset, TTC layers improved mathematical reasoning performance by up to 27.8%. On AMC and AIME datasets, Pass@8 improved by 2-3x, significantly outperforming traditional methods. Ablation studies show that the introduction of TTC layers effectively improves reasoning capabilities.

Applications

TTC layers can be directly applied to complex reasoning tasks like Sudoku and mathematical problem solving. Their adapter nature makes them easy to integrate into existing pretrained LLMs without modifying the base architecture.

Limitations & Outlook

TTC layers may face computational resource constraints in high-complexity tasks, particularly in long-horizon planning. The method requires high hardware demands, potentially unsuitable for resource-limited environments. Future research could explore further optimizing hardware implementations to reduce computational costs.

Plain Language Accessible to non-experts

Imagine you're in a kitchen preparing a complex dinner. Traditionally, you'd memorize all the recipe steps and follow them one by one. This is like traditional language models, relying on memory and retrieval. The method proposed in this paper is like introducing a smart assistant in the kitchen, which can plan and adjust steps in real-time, ensuring you make the best dish. This assistant is the TTC layer, enhancing the model's reasoning ability through real-time planning.

ELI14 Explained like you're 14

Imagine you're playing a complex strategy game. Traditionally, you'd rely on remembering past game experiences to make decisions. The method in this paper is like having a super-smart assistant that helps you plan the best strategy in real-time, making you unstoppable in the game. That's the role of the TTC layer, enhancing language model reasoning through real-time planning.

Glossary

Linear Quadratic Regulator (LQR)

An optimal control method used in control systems to optimize performance by minimizing a cost function.

Used for planning during inference in this paper.

Symplectic Structure

A mathematical structure often used to optimize computational efficiency and stability.

Used to develop a hardware-efficient LQR solver.

Test-Time Control (TTC)

A layer for planning during inference to enhance model reasoning.

Integrated into pretrained LLMs as adapters.

Pass@8

An evaluation metric used to measure model performance on given tasks.

Used to evaluate TTC layer performance on AMC and AIME datasets.

State-Space Model (SSM)

A model used for sequence processing, aiming to generate predictions through state tracking.

Introduced alongside linear RNNs as background.

Open Questions Unanswered questions from this research

  • 1 How to effectively implement TTC layers in resource-limited environments?
  • 2 What is the potential for TTC layers in other domains?
  • 3 How to further optimize hardware implementations to reduce computational costs?

Applications

Immediate Applications

Mathematical Reasoning

TTC layers can be directly applied to mathematical reasoning tasks, enhancing model reasoning capabilities and accuracy.

Long-term Vision

Natural Language Understanding

TTC layers have the potential to be applied to natural language understanding tasks, enhancing model comprehension and generation capabilities.

Abstract

Associative memory has long underpinned the design of sequential models. Beyond recall, humans reason by projecting future states and selecting goal-directed actions, a capability that modern language models increasingly require but do not natively encode. While prior work uses reinforcement learning or test-time training, planning remains external to the model architecture. We formulate reasoning as optimal control and introduce the Test-Time Control (TTC) layer, which performs finite-horizon LQR planning over latent states at inference time, represents a value function within neural architectures, and leverages it as the nested objective to enable planning before prediction. To ensure scalability, we derive a hardware-efficient LQR solver based on a symplectic formulation and implement it as a fused CUDA kernel, enabling parallel execution with minimal overhead. Integrated as an adapter into pretrained LLMs, TTC layers improve mathematical reasoning performance by up to +27.8% on MATH-500 and 2-3x Pass@8 improvements on AMC and AIME, demonstrating that embedding optimal control as an architectural component provides an effective and scalable mechanism for reasoning beyond test-time training.

cs.LG