PILOT: Planning via Internalized Latent Optimization Trajectories for Large Language Models

Haoyu Zheng, Yun Zhu, Yuqian Yuan, Bo Yuan, Wenqiao Zhang, Siliang Tang, Jun Xiao

TL;DR

Compact Large Language Models (LLMs) often struggle with global strategic planning, leading to cascading errors in complex multi-step reasoning tasks. To solve this, PILOT (Planning via Internalized Latent Optimization Trajectories) introduces a lightweight, non-invasive hyper-network that dynamically synthesizes instance-specific "latent guidance" vectors. By injecting these strategic anchors directly into the model's hidden layers, PILOT significantly boosts mathematical and coding performance with near-zero inference latency.

What Problem Does This Paper Address?

While large models excel at Chain-of-Thought (CoT) reasoning, smaller, more compact LLMs frequently suffer from "myopic" generation. They might possess the underlying domain knowledge, but they lack the strategic oversight required to map out a global solution path before diving into execution. As a result, a minor error in an early reasoning step cascades into a completely derailed final answer—a phenomenon known as error propagation.

Existing remedies typically fall into two camps, both with severe drawbacks:

  1. External Scaffolding: Relying on a larger "teacher" model at runtime to guide or correct the smaller model. This introduces massive latency penalties, high computational costs, and strict dependencies on API availability.
  2. Static Internal Adaptation: Fine-tuning methods like LoRA or activation steering techniques. These often apply fixed, instance-agnostic updates that bias the model toward brittle templates, or they invasively disrupt the model's native representation space, causing "embedding shock" and catastrophic forgetting.

PILOT bridges this gap by internalizing the strategic foresight of a larger model directly into the latent space of a compact model, adapting dynamically to each unique query without modifying the base model's weights.

Methods

PILOT operates via a two-stage framework: Heuristic State Extraction and Latent Anchor Synthesis.

The PILOT Framework Architecture overview.

1. Construct-and-Verify Pipeline

To gather high-fidelity training data, the authors use a larger expert model (DeepSeek-V3.1) to generate concise, high-level strategic hints ($g_{\text{exp}}$) for queries where the base model initially fails. Crucially, they run a "blind test": if the hint alone leaks the final answer without the query, the sample is discarded. This ensures the dataset captures genuine strategic intent rather than shortcuts. The verified sequence is passed through the base model, and the hidden states are mean-pooled to extract a ground-truth "homogeneous target state" ($z^*$).

The Construct-and-Verify data generation pipeline.

2. Anchor Adapter & Hyper-Network

During inference, an Anchor Adapter aggregates the query's global intent and salient entity features. This context vector is fed into a lightweight Hyper-Network that predicts channel-wise modulation coefficients (FiLM) to adjust a learnable global prior called the Proto-Anchor.

3. Energy-Aligned Injection

To avoid "embedding shock," PILOT appends a hidden placeholder token to the end of the input context. At a specific pivot layer ($l^\dagger$), this token's hidden state is replaced by the synthesized latent anchor ($\hat{z}$). PILOT uses an Energy-Aligned Injection mechanism that scales the injection vector to match the local activation magnitude of the context, ensuring it steers the model smoothly without overwhelming its native features.

Datasets

The authors evaluated PILOT across two primary domains:

  • Mathematics: Trained on a filtered subset of the MATH dataset (7,500 original samples). Evaluated on MATH500, AIMO Val (83 AMC-level problems), and GSM8K (for robustness).
  • Code Generation: Trained on a filtered subset of MBPP (374 original samples). Evaluated on HumanEval and MBPP-Test.

The data filtering statistics reveal that harder tasks or larger base models result in lower retention rates, focusing the training data purely on the model's reasoning frontier.

Data filtering and retention statistics across domains.

Key Insights and Ideas

  • Latent vs. Textual Planning: The authors proved that simply prompting a model to write out a natural language plan before solving a problem introduces a text-level information bottleneck and exposure bias. Internalizing the plan directly into the latent space bypasses surface-form generation entirely.
  • Task-Dependent Pivot Layers: Abstract mathematical reasoning benefits most when guided at the deepest layers (e.g., Layer 26 out of 28), acting as a "last-mile correction" for semantic aggregation. Conversely, coding tasks require earlier intervention (e.g., Layer 20) to structure the algorithmic logic before the syntax rigidifies.
Injection depth sensitivity curves for Math vs. Code tasks.
  • Preventing Structural Collapse: Coding tasks are highly sensitive to "structural shock" from raw vector injections. PILOT's energy alignment mechanism forces the injected vector's norm to track the context energy, stabilizing the intervention and preventing syntax collapse.
Energy alignment dynamics tracking injection vector L2 norms.

Key Results

PILOT consistently outperformed strong baselines (including LoRA, ReFT, and Soft CoT) across multiple model scales (Qwen2.5-1.5B/7B, Llama-3.1-8B):

  • Reasoning Gains: On MATH500, PILOT achieved an absolute accuracy increase of +8.88% over the zero-shot baseline for Qwen2.5-1.5B and +4.24% for Qwen2.5-7B.
  • Coding Generalization: On HumanEval, PILOT boosted Qwen2.5-7B performance from 71.34% to 77.44%.
  • Negligible Latent Overhead: Because PILOT injects a static anchor state at the prefill stage and adds no per-step recurrent computation during decoding, it introduces a tiny prefill overhead of just +3.10 ms and a negligible total end-to-end latency increase of 0.2%.

Limitations and Future Work

  • Data Construction Overhead: The offline Construct-and-Verify pipeline requires significant upfront computational effort to filter high-quality trajectories and generate teacher heuristics.
  • Static Domain Hyperparameters: The choice of the optimal pivot layer ($l^\dagger$) currently relies on empirical tuning per domain (e.g., math vs. code). The authors note that developing a fully dynamic, instance-wise layer selection mechanism is a promising direction for future research.

Summary updated

BibTeX
@inproceedings{zheng2026pilot,
  author = {Haoyu Zheng and Yun Zhu and Yuqian Yuan and Bo Yuan and Wenqiao Zhang and Siliang Tang and Jun Xiao},
  title = {{PILOT: Planning via Internalized Latent Optimization Trajectories for Large Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.acl-long.236},
}
Figure