Reasoning in Parallel for LLM Agents
Listen to the summary
Uses a voice available on your device
Audio options
On this page 5 sections
Related concepts 3 concepts
Key Takeaways
- Second Thought forks four auxiliary reasoning branches immediately after the main thread thought phase concludes.
- Auxiliary branches decode concurrently with tool action and observation phases, generating interruption-friendly atomic thoughts.
- The method lowers the average turn count in all nine model-benchmark pairs and reduces main-thread decoding in six of them by up to 43%.
- A paired wall-clock replay confirms these reductions translate into a 10.9% lower median per-task latency.
Summary & Methodology Analysis
LLM agents following standard loops experience an idle reasoning window during each action and observation interval, during which no reasoning is performed. Second Thought addresses this by forking four auxiliary reasoning branches immediately after the main thread thought phase ends. These branches, named Check, Recall, Rehearse, and Alternative, receive the full history, the just-produced reasoning, and a short branch-specific instruction. They decode concurrently with the main thread action and observation phases, emitting a stream of atomic thoughts enclosed in tags and capped at five thoughts per dimension. When the environment returns feedback, all in-flight branches terminate, and the completed atomic thoughts are harvested and appended to the tool-observation message for the next turn.
In terms of empirical performance across benchmarks such as SWE-Bench-Pro, Terminal-Bench 2.1, and τ³-bench, Second Thought lowers the average turn count in all nine evaluated model-benchmark pairs. It reduces main-thread decoding in six of those pairs by up to 43%, while Pass@1 shows no significant change in seven of nine pairs and significant increases of +12.4 and +10.2 points in the other two. Against a compute-matched control that forces an equivalent budget onto the main thread's own reasoning, the approach attains strictly higher Pass@1 with 1.3× to 3.2× less sequential decoding in all four applicable settings.
Despite these performance and efficiency gains, the method has clear limitations. Running four auxiliary branches increases the total API cost by 66.4% to 181.5% across models, driven almost entirely by input prompt processing rather than output generation. Additionally, the compute-matched baseline is not applicable for MiniMax-M3 because it does not honor an unclosed-thought prefix, nor is it applicable on τ³-bench where prefix continuation cannot be combined with function-calling requests. Finally, in the limiting case where no branch yields any completed atomic thought, the agent falls back to the standard loop.
Interactive System Flowchart
Illustrative Implementation
A short sketch of the paper's core idea, not the authors' own code.
# Illustrative sketch (not from the paper)
import asyncio
async def main_loop(history):
# Thought phase: main LLM generates reasoning R_t
R_t = await generate_thought(history)
# Action phase: serialize and execute action A_t derived from R_t
A_t = parse_action(R_t)
action_task = asyncio.create_task(execute_action(A_t))
# Spawn four auxiliary branches that run in parallel with the action
aux_instructions = ["Check", "Recall", "Rehearse", "Alternative"]
aux_tasks = [asyncio.create_task(aux_branch(history + [R_t], instr))
for instr in aux_instructions]
# Observation phase: wait for environment feedback
O_t = await action_task
# Once observation arrives, cancel any unfinished branches
for t in aux_tasks:
if not t.done():
t.cancel()
# Harvest completed atomic thoughts (≤5 per branch, <thought> tags)
second_thoughts = []
for t in aux_tasks:
if t.done() and not t.cancelled():
thoughts = extract_atomic(t.result())
second_thoughts.extend(thoughts[:5])
# Append second thoughts to the observation message for next turn
new_message = {"observation": O_t, "second_thoughts": second_thoughts}
return new_message
# Placeholder async functions representing LLM calls / environment
async def generate_thought(history):
return "<thought>Reason about the task</thought>"
def parse_action(thought):
return "some_action"
async def execute_action(action):
await asyncio.sleep(0.1) # simulate latency
return "observation_from_env"
async def aux_branch(history, instruction):
# Decode a stream of atomic thoughts; here we return a mock string
await asyncio.sleep(0.05)
return "<thought>" + instruction + " insight</thought>"
def extract_atomic(text):
# Simple extraction of <thought>...</thought> chunks
import re
return re.findall(r"<thought>(.*?)</thought>", text)
# Example entry point
if __name__ == "__main__":
asyncio.run(main_loop([]))// Illustrative sketch (not from the paper)
const { spawn } = require('child_process'); // placeholder for LLM API
async function mainLoop(history) {
// Thought phase: main LLM generates reasoning R_t
const R_t = await generateThought(history);
// Action phase: derive and execute action A_t
const A_t = parseAction(R_t);
const actionPromise = executeAction(A_t);
// Spawn four auxiliary branches that run while action is pending
const auxInstructions = ['Check', 'Recall', 'Rehearse', 'Alternative'];
const auxPromises = auxInstructions.map(instr => auxBranch([...history, R_t], instr));
// Observation phase: wait for environment feedback
const O_t = await actionPromise;
// Cancel any unfinished auxiliary branches (simulated by ignoring their results)
const auxResults = await Promise.allSettled(auxPromises);
// Harvest completed atomic thoughts (≤5 per branch, <thought> tags)
const secondThoughts = [];
for (const res of auxResults) {
if (res.status === 'fulfilled') {
const thoughts = extractAtomic(res.value);
secondThoughts.push(...thoughts.slice(0, 5));
}
}
// Append second thoughts to observation for next turn
return { observation: O_t, secondThoughts };
}
// Mock async functions representing LLM calls / environment
async function generateThought(history) {
return '<thought>Reason about the task</thought>';
}
function parseAction(thought) {
return 'some_action';
}
async function executeAction(action) {
await new Promise(r => setTimeout(r, 100)); // simulate latency
return 'observation_from_env';
}
async function auxBranch(history, instruction) {
await new Promise(r => setTimeout(r, 50));
return `<thought>${instruction} insight</thought>`;
}
function extractAtomic(text) {
const regex = /<thought>(.*?)<\/thought>/g;
const thoughts = [];
let match;
while ((match = regex.exec(text)) !== null) {
thoughts.push(match[1]);
}
return thoughts;
}
// Example entry point
(async () => {
await mainLoop([]);
})();
Cross-Examination & FAQs
A deeper dive clarifying mechanics, constraints, and baseline evaluations.
Q1. What core problem does the paper address?
The paper addresses the idle reasoning window during each action and observation interval in standard agent loops, where no reasoning is performed and parallel compute capacity is potentially wasted.
Q2. What is Second Thought?
Second Thought is a method that forks four auxiliary reasoning branches to reason concurrently while the main thread waits for tool observations.
Q3. What are the primary benefits of Second Thought?
It reduces main-thread decoding by up to 43%, lowers average turn counts across all tested model-benchmark pairs, and achieves a 10.9% lower median per-task latency.
Q4. Which benchmarks were used in the evaluation?
The evaluations used SWE-Bench-Pro, Terminal-Bench 2.1, and τ³-bench.
Q5. How many auxiliary branches does Second Thought run?
It runs four auxiliary branches named Check, Recall, Rehearse, and Alternative.
Q6. What happens to incomplete thoughts when an observation arrives?
All in-flight branches are terminated, completed atomic thoughts are harvested and truncated at the last closed tag, and any incomplete unit is discarded.
Q7. How does Second Thought affect API costs?
Running four auxiliary branches increases the total API cost by 66.4% to 181.5% across models, which is almost entirely driven by input prompt processing rather than output generation.
Q8. Why is the compute-matched baseline not applicable for all models or benchmarks?
MiniMax-M3 does not honor an unclosed-thought prefix and emits a final answer instead, while τ³-bench cannot combine prefix continuation with function-calling requests.
Q9. What happens if no auxiliary branch yields a completed atomic thought?
The agent falls back to the standard baseline loop.