> your AI agent picks dependencies from memory; give it dated facts — try starlog.dev ↗ vet your agent's deps ↗ vibe-coding is fine. vibe-importing isn’t. — try starlog.dev ↗ vibe-importing isn’t fine ↗ your agent has never seen your private packages — try starlog.dev ↗ facts for private packages ↗ a linter for the dependencies your AI agent picks — try starlog.dev ↗ a linter for agent deps ↗ whois is redacted, cdns mask the rest — get the real operator — try whoisgeni.us ↗ who really runs that domain ↗ domain attribution that shows its work — full evidence chain — try whoisgeni.us ↗ domain intel w/ evidence ↗

← Back to Articles

Building a Meta-Reasoning Controller: How Adaptive Test-Time Compute Makes LLMs Smarter Without Training

[ View on GitHub ]

Building a Meta-Reasoning Controller: How Adaptive Test-Time Compute Makes LLMs Smarter Without Training

Hook

What if your LLM could decide whether to think for 3 seconds or 3 minutes based on how hard the problem is—without training a single parameter? That's exactly what adaptive test-time compute allocation does.

Context

Most LLM deployments treat reasoning compute as a fixed hyperparameter: you either run beam search with width 5 on every problem, or you don't. This wastes resources on easy questions and underperforms on hard ones. The recent wave of reasoning models like OpenAI's o1 proved that spending more compute at inference time—generating multiple solution paths, verifying intermediate steps, backtracking from dead ends—can dramatically boost accuracy. But these systems use black-box learned controllers that decide how much to "think" per problem.

The AhsanBilal7/adaptive-test-time-compute repository offers a radically different approach: a completely training-free meta-reasoning framework where the same base LLM acts as its own controller through carefully designed prompts. Instead of learning when to apply chain-of-thought versus self-reflection, or whether to use greedy decoding versus beam search, the system prompts the model to make these decisions explicitly for each test problem. It's prompt orchestration taken to its logical extreme—four sequential agent roles per iteration, process reward model guidance for trajectory scoring, and adaptive search intensity based on problem decomposition. The result is a transparent alternative to proprietary reasoning systems that works with any sufficiently capable base model.

Technical Insight

Compute Backend

Single Base LLM

Per-step rewards

Trajectory scores

Iteration result

Test Problem

K Iterations Loop

Planning Agent

Problem Decomposition

Tool Selector

CoT vs Self-Reflection

Compute Selector

Search Strategy + Intensity

Finalization Agent

Extract Boxed Answer

Search Execution

Best-of-N/Beam/Lookahead

Qwen2.5-Math-PRM-7B

Score Each Step

Reward Aggregator

Mean Per-Step Scoring

Final Answer

Highest Mean Reward

Satori Math Checker

Symbolic Verification

System architecture — auto-generated

The architecture is deceptively simple: for each problem, run K iterations (default 10) where each iteration invokes the base LLM in four distinct roles. First, a planning agent decomposes the problem into steps. Second, a tool selector chooses between chain-of-thought and self-reflection reasoning modes based on that decomposition. Third, a compute selector picks a search strategy—best-of-N sampling, beam search, or lookahead search—along with an intensity parameter. Finally, a finalization agent extracts the boxed numerical answer from generated trajectories.

The critical innovation is dual-purpose use of process reward models. During trajectory generation, Qwen2.5-Math-PRM-7B scores every reasoning step using a custom verification prompt. Within an iteration, these scores prune low-quality branches during beam search. Across iterations, the system selects the final answer by comparing mean per-step PRM rewards—essentially voting not by majority count but by average solution quality. This creates a unified control signal without any learned components.

Here's what the tool selection prompt structure looks like in practice:

# Simplified from the actual system
tool_selection_prompt = f"""
You are a reasoning tool selector. Given this problem decomposition:
{planning_agent_output}

Choose the most appropriate reasoning approach:
- CoT (Chain-of-Thought): For problems requiring step-by-step calculation
- SR (Self-Reflection): For problems needing error checking and revision

Respond with just 'CoT' or 'SR'.
"""

tool_choice = base_llm.generate(tool_selection_prompt)

if tool_choice == "CoT":
    reasoner = chain_of_thought_agent
else:
    reasoner = self_reflection_agent

The compute selector operates similarly, but adds quantitative parameters:

compute_prompt = f"""
Based on problem complexity from planning:
{planning_output}

Select search configuration:
1. Strategy: best_of_n | beam_search | lookahead
2. Intensity: [1-10] where 1=minimal, 10=exhaustive

For best_of_n: intensity = number of samples
For beam_search: intensity = beam width  
For lookahead: intensity = lookahead depth

Format: strategy,intensity
"""

strategy, intensity = parse_llm_response(
    base_llm.generate(compute_prompt)
)

What makes this work is the process reward model acting as ground truth. When beam search with width 5 generates five partial solutions, the PRM scores each reasoning step. Low-scoring branches get pruned before the next generation step, focusing compute on promising paths. The verification prompt is domain-specific:

prm_verification = f"""
Evaluate this reasoning step for mathematical correctness:
Previous context: {previous_steps}
Current step: {current_step}

Rate validity from 0.0 (incorrect) to 1.0 (correct).
Consider: algebraic soundness, logical consistency, calculation accuracy.
"""

step_score = prm_model.score(prm_verification)

The repository includes complete compute cost accounting that tracks both generation tokens and PRM verification overhead. On MATH-500 with Llama-3.1-8B, the adaptive approach achieves 52.4% accuracy versus 30.8% for greedy decoding—a 21.6 point gain. The efficiency metrics show it matches the best fixed configuration's accuracy while using 3-5x less compute on problems that don't need intensive search.

The ablation grid is particularly revealing: testing 36 fixed configurations (2 reasoning tools × 3 search strategies × 3 intensity levels × 2 iteration counts) shows no single configuration dominates. CoT + beam search wins on algebraic problems, but SR + lookahead wins on geometry. The adaptive system's ability to route problems to appropriate configurations explains its consistent gains. The pathway logging captures every intermediate decision, making it possible to audit why the system chose beam search with width 7 for one problem but best-of-3 sampling for another.

Gotcha

The architecture has a fundamental dependency problem: it requires running a 7B parameter process reward model alongside your base LLM. This nearly doubles your inference costs and memory footprint. The paper's compute metrics honestly account for PRM overhead, but there's no escaping it—the system cannot function without step-level verification scores. If you're running on a single GPU or need sub-second response times, this is a dealbreaker.

Domain generalization is the second major limitation. Every component is designed for mathematical reasoning: the PRM was trained on math solutions, the tool selection prompt assumes numerical problems, and the symbolic answer checker uses Satori's math-specific parser. The authors only evaluate on MATH-500, AIME24, and AMO-Bench. Will the same prompts work for code generation where "correctness" is ambiguous until execution? For scientific reasoning where steps may be valid but suboptimal? There's no evidence either way, and adapting the system would require rewriting prompts and finding domain-appropriate verifiers. The K=10 iteration count appears arbitrary—no analysis of early stopping criteria or compute/accuracy tradeoffs for different K values. You're left guessing whether K=5 would work for your latency budget or if K=20 would improve accuracy. Finally, zero-shot prompting for all agent decisions means performance degrades sharply with weaker base models. The paper uses Llama-3.1-8B and GPT-4; smaller models may produce incoherent tool selections or invalid compute parameters, and there's no graceful degradation mechanism.

Verdict

Use if: you're building reasoning systems for mathematical domains where process reward models exist, have the GPU budget to run a 7B verifier alongside your base LLM, and need transparency into why certain problems get more compute than others. The prompt templates and dual-purpose PRM design offer genuine architectural insight for adaptive reasoning pipelines, and the compute accounting methodology is directly reusable. This is excellent for research prototypes exploring test-time compute allocation or for production systems where explainability matters more than raw speed. Skip if: you need sub-second inference, work outside mathematical reasoning (code, science, general QA), lack access to quality domain-specific process supervision, or want a production-ready library rather than a research artifact. The PRM dependency and math-specific design make this impractical for most real-world applications. Extract the core idea—that search strategy should be a runtime decision informed by problem analysis—but expect to rebuild the implementation with domain-appropriate heuristics. If you're comparing reasoning approaches, test this against Tree-of-Thoughts and self-consistency baselines, but don't deploy it as-is unless you're solving math competition problems.