Geometric Prompt-Trajectory Planning for Test-Time Scaling
Abstract
Test-time scaling (TTS) improves large language model (LLM) reasoning by allocating additional inference-time computation, often through repeated sampling and aggregation. This width-heavy strategy increases the generation cost and can reinforce common failure modes. We introduce Maze, a TTS framework that shifts part of this computation from repeated target-model calls to planning over ordered few-shot exemplars. The central idea is to treat an ordered exemplar sequence as a prompt trajectory embedded in a latent geometric space. Instead of asking the LLM for many independent attempts, Maze first ranks candidate prompt trajectories using cached encoder representations and a path scorer, i.e., a lightweight learnable metric, then spends one call (or a few calls) only on the most promising trajectories. Directed transitions, node contributions, and query-conditioned cross-layer fusion model how the complete path guides the target model. The selected trajectory is executed with one call, or with a small call budget in MultiMaze. A separate frozen encoder preserves black-box access to the target LLM. Across five reasoning benchmarks, single-call Maze outperforms the evaluated single-call prompt-optimization baselines, while MultiMaze improves on 32-call majority vote using 16 target-model calls. A theoretical analysis relates selection quality to candidate coverage and ranking error, explaining when planner-side computation can substitute for repeated sampling and when it cannot.