TL;DR
Test-time Recursive Thinking is a method that lets an LLM improve its answers in cycles: generate several solutions with different strategies → pick the best → extract insights from the failures → use those insights in the next round. It works in a regular chat with no extra training or external verification: the model itself decides which answer is best and draws its own lessons from what went wrong.
Typical approaches generate lots of independent attempts and pick one by voting. The problem: each attempt knows nothing about the others' mistakes, so the model steps on the same rakes. If the first attempt forgot an edge case, the second will forget it too. LLMs are good at analyzing and structuring information, but bad at learning between attempts unless context is passed along explicitly. Knowledge from one request doesn't carry over to the next on its own.
TRT solves this with a knowledge list: after each round the model compares the failed solutions with the best one, writes down "what to avoid," and adds it to the context of the next round. On top of that, each new solution gets a unique strategy (for code, say, "dynamic programming," "greedy algorithm," "recursion") so you don't churn out copies. The result: open models hit 100% on AIME-25/24, and closed models gained +10-15 points on hard programming tasks.
Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.
Method Blueprint
The method runs over several rounds (usually 4-8), and each round has three steps:
ROUND 1, 2, 3... up to N:
STEP 1: Generate
→ Create K solutions (usually 2-8), each with a unique strategy
→ Use the accumulated knowledge list of "what does NOT work"
→ Output: K different approaches to the task
STEP 2: Pick the best
→ Evaluate all K solutions (via tests for code / logic checks for math)
→ Pick the best solution of this round
→ Output: one candidate solution
STEP 3: Reflect
→ Compare each failed solution with the best one
→ Extract an insight: "why this solution is worse"
→ Add it to the knowledge list for the next round
→ Output: an updated "what to avoid" list
Important: Each round runs as a separate prompt. The knowledge list is passed between rounds through the context.
Example
Task: You're launching a referral marketplace for crypto exchanges (bring a friend → earn a cut of their trading fees). You need to decide: invest in paid traffic now, or wait for organic growth. It's a hard call: lots of variables, no clear-cut answer.
Round 1 prompt:
Task: should I invest in paid traffic for a crypto-exchange referral
marketplace, or wait for organic growth?
Context:
- Currently 200 active referrals per month
- CAC through ads ~$20
- Referral LTV after 6 months ~$40
- Organic is growing +15% per month
Generate 3 different approaches to analyzing this decision.
Each approach should use its own logic:
APPROACH 1: Financial model
Analyze through unit economics and the break-even point.
APPROACH 2: Market dynamics
Analyze through competitive position and the window of opportunity.
APPROACH 3: Risk management
Analyze through possible scenarios (best/worst/base case).
For each approach, give a clear recommendation: invest now or wait.
Round 2 prompt (after reviewing the round 1 results):
Same task.
KNOWLEDGE LIST from round 1:
- Don't focus only on current CAC/LTV: they change with scale
- Don't ignore competitors: if they grab the niche, organic will drop
- Don't make an all-or-nothing binary choice: there are in-between options
Generate 3 NEW approaches, avoiding the mistakes above:
APPROACH 4: Dynamic model
How will CAC and LTV change as we scale?
APPROACH 5: Hypothesis testing
What's the smallest test that would show whether paid traffic works?
APPROACH 6: Hybrid strategy
How do we combine paid + organic growth?
Result:
In each round the model produces several different analyses with different logic. After rounds 1-2 you'll see an evolution in thinking: the first attempts miss important factors, later ones take the earlier critique into account. By round 3-4 you get a more nuanced decision that covers many angles. The final pick is the best solution from the last round, or a consensus among the strongest solutions across rounds.
Why it works
LLMs are bad at learning between independent attempts. When you generate 10 answers in a row with temperature > 0, each answer knows nothing about the others' mistakes. If the model forgot to check an edge case in the first attempt, it will forget again in the second: there's no mechanism for passing knowledge between tracks.
LLMs are good at analyzing differences and extracting patterns. Show a model two texts and ask "how do they differ," and it will pinpoint it. Show it a good solution and a bad one, and it will explain why one is better. The LLM's strength: comparative analysis and articulating differences.
TRT uses the strength to get around the weakness: it turns each round into a source of knowledge for the next. The model compares failed attempts with the best one, spells out "what went wrong," and adds it to the context. In the next round that knowledge explicitly narrows the search space: the model sees "don't do X, because it led to Y last round." On top of that, unique strategies for each solution push the attempts into different corners of the solution space.
Prompt control knobs:
Number of rounds: more rounds = deeper exploration, but more expensive. For simple tasks 2-3 rounds are enough; complex ones need 6-8.
Solutions per round: the study found it's better to run more rounds with a smaller K (e.g., 8 rounds × 2 solutions) than fewer rounds with a larger K (2 rounds × 8 solutions). Depth beats breadth.
Type of strategies: for code, algorithmic paradigms (DP, greedy, divide-and-conquer); for analysis, different frameworks (finance, risk, psychology); for writing, different tones or structures.
Knowledge list format: write entries as negatives ("don't do X") rather than positives ("do Y"); that constrains the space better without repeating specific solutions.
Prompt Template
Base template (one round)
Task: {describe the task in detail}
Context: {add important details or constraints}
Generate {K} different approaches to solving this task.
Each approach should use its own strategy:
APPROACH 1: {strategy name 1}
{brief description of the logic}
APPROACH 2: {strategy name 2}
{brief description of the logic}
...
APPROACH K: {strategy name K}
{brief description of the logic}
For each approach:
1. Describe your logic step by step
2. Give a final solution/answer
3. State under what conditions this approach will NOT work
Next-round template (with accumulated knowledge)
Task: {the same task}
KNOWLEDGE LIST from previous rounds:
{paste insights from past attempts: what does NOT work and why}
Generate {K} NEW approaches, avoiding the mistakes above:
APPROACH {K+1}: {new strategy}
...
For each approach, give a final solution and explain how it differs
from the previous attempts.
Insight-extraction template (between rounds)
I have {K} different solutions to the same task.
Best solution (selected):
{paste the solution you consider strongest}
Alternative solution:
{paste one of the other solutions}
Compare these solutions:
1. What's the key difference between the approaches?
2. Why is the alternative solution weaker? What mistake does it contain?
3. State one rule in the form "Don't do X, because it leads to Y"
Keep the answer short, 2-3 sentences. I'll add this rule to the knowledge list
for the next round.
How to use it:
- {K}: number of solutions per round (usually 2-4 to save tokens)
- {strategies}: depend on the domain: for code (algorithms), for analysis (frameworks), for writing (styles)
- {knowledge list}: copy it over from previous rounds and add new insights after each round
🚀 Quick start: paste into your chat:
Here's a Test-time Recursive Thinking template. Adapt it to my task: [your task].
Ask me questions to fill in the fields and suggest strategies for the approaches.
[paste the template above]
The LLM will ask about the specifics of the task, how many rounds to run and which strategies to use, because TRT depends on understanding the domain (code, analysis, math) and the difficulty (simple tasks need 2-3 rounds, complex ones 6-8). It will take the "generate → select → reflect" pattern from the template and adapt it to your task, suggesting relevant strategies.
Limitations
⚠️ Hard tasks take many iterations: On simple questions ("capital of France") the method is overkill; one request is enough. It shines on tasks with no single obvious solution: code with edge cases, multi-factor analysis, problems that need to be looked at from different angles. Those tasks need 4-8 rounds.
⚠️ Quality of picking the best solution: Without ground truth, the model can pick wrong, especially on subjective criteria. For code, the method uses self-generated tests (the model writes its own checks); for math, mutual exclusivity (only one answer from 0-999 is correct). But for open-ended tasks (creative work, strategy), picking the "best" is less reliable.
⚠️ Context growth: Although the knowledge list is compact (under 1.5% of the context even after 64 rounds in the study), very long cycles may need pruning of stale insights. The researchers removed up to 1 entry per round, but that's a manual process.
⚠️ Requires strong models: The method needs the ability to reflect and compare; weaker models may fail to extract useful insights from comparing solutions. Tested on gpt-oss-120b, Qwen3-235B, o3 and o4-mini, i.e. GPT-4-class models and above.
How the research was done
A team from Microsoft Research and UC San Diego wanted to test: can LLMs improve without external feedback? Models are usually trained with reinforcement learning, where there's a clear reward (right/wrong). But what if the model decides for itself what's right and learns from that?
They tested two domains: math (AIME 2024/2025, 30 olympiad-level problems each) and code (the 203 hardest problems from LiveCodeBench v6). For math they used open models (gpt-oss-120b, Qwen3-235B), whose reasoning traces are visible and easy to analyze. For code, the closed o3 and o4-mini, which are stronger at programming.
The experimental logic: they compared three approaches with the same compute budget: - Parallel Thinking: generate 64 independent solutions, pick by voting (the baseline) - RSA (Recursive Self-Aggregation): iteratively improve a population of solutions by aggregating subsets - TRT: accumulate knowledge about mistakes and generate new solutions with that knowledge in mind
What surprised them: on math, both open models reached 100% accuracy with TRT, solving all 30 AIME-25 problems and all 30 AIME-24 problems. That's a first for open-source models. And the improvement was monotonic: accuracy rose with every round instead of jumping around. So the accumulated knowledge genuinely steered the model toward the right answer rather than adding noise.
On code the effect was smaller but steady: o4-mini went from 63.5% → 73.9% (+10.4 pp), o3 from 57.1% → 71.9% (+14.8 pp). RSA trailed by 2-3 points at the same compute, so it's not just "more attempts = better"; it's specifically the "knowledge about mistakes" mechanism that gives the edge.
Key insight from the analysis: looking at pass@k (how many of all generated solutions were correct), TRT with strategies beat random sampling by 2-7 percentage points for the same number of attempts. That proves strategic planning really does improve exploration: the model doesn't waste attempts on duplicates but explores different parts of the solution space.
Second insight: depth beats breadth. They tested K=2, K=4 and K=8 (solutions per round), and all three hit the same accuracy ceiling. So more rounds with a smaller K is more efficient than fewer rounds with a larger K. Better 8 rounds × 2 solutions than 2 rounds × 8 solutions.
Third insight, from the ablation: test execution is critical for picking the best solution. When they removed self-generated tests for code, the gap between "cumulative best" (the best among everything generated) and "selected" (what the model picked) grew from 4.9% to 11.8% for o4-mini. Without tests the model picks the wrong solution more often.
Adaptations and extrapolations
🔧 Technique: transparent reasoning → add self-explanation to every approach
The original TRT focuses on the final solutions and comparing them. But for learning or debugging it helps to see why the model chose a particular strategy.
Add this to each round's prompt:
For each approach:
1. Explain WHY you chose this strategy for this task
2. Describe the logic step by step
3. Give a final solution
4. State under what conditions this approach will NOT work
5. Rate your confidence in the solution (low/medium/high) and explain why
Now you see not just the results but the model's reasoning about its own reasoning, a meta level. That helps with extraction: you can add to the knowledge list yourself if the model missed an important insight.
🔧 Technique: tailor the strategies to your own way of thinking
Instead of abstract "APPROACH 1, 2, 3," name the strategies as specific analytical lenses that make sense to you.
An example for business decisions:
APPROACH 1: THE INVESTOR'S VIEW
How would a VC fund evaluate this decision? ROI, scalability, risks.
APPROACH 2: THE USER'S VIEW
How will this affect the customer experience? Which pain points does it solve or create?
APPROACH 3: THE COMPETITOR'S VIEW
What would my main competitor do in my shoes? How would it change my position?
Named personas like these sharpen role-play: the model gets into the "investor" character more easily than into an abstract "financial analysis." Plus they're easier for you to interpret: you immediately see "this is the investor angle, this is the customer angle."
You can use real people as archetypes: "How would Jeff Bezos approach this? What about Elon Musk? Warren Buffett?"
🔧 Technique: combine TRT + Chain-of-Thought Verification
After picking the best solution, add an extra step of verification through reverse reasoning:
You picked this solution as the best: {best solution}
Now CRITIQUE it from two positions:
CRITIQUE 1: The skeptic
Find the weak spots in this solution. What could go wrong?
Which assumptions haven't been tested?
CRITIQUE 2: The opposite approach
Build an argument for the opposite decision.
When would it be the right one?
If the critiques find serious holes, go back to the generation round with these
insights in the knowledge list.
This adds an adversarial check on the final choice, useful for high-stakes decisions (investments, hiring, architecture decisions on a project).
Resources
Test-time Recursive Thinking: Self-Improvement without External Feedback
Yufan Zhuang, Chandan Singh, Liyuan Liu, Yelong Shen, Dinghuai Zhang, Jingbo Shang, Jianfeng Gao, Weizhu Chen
Microsoft Research, UC San Diego
GitHub: test_time_recursive_thinking
Related work mentioned in the paper:
- Reflexion (Shinn et al., 2023): verbal reinforcement learning
- Self-Consistency (Wang et al., 2022): majority voting over reasoning chains
- Recursive Self-Aggregation / RSA (Venkatraman et al., 2025): iterative solution refinement
- Agentic Context Engineering (Zhang et al., 2025): evolving strategy playbooks