Improve reasoning efficiency by dynamically adjusting elaboration depth within a single response. Difficult steps receive extensive chain-of-thought; straightforward steps use concise inference. Mix reasoning modes to achieve 57-79% token savings under compute budgets while maintaining accuracy on math, STEM, and coding benchmarks.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Improve reasoning efficiency by dynamically adjusting elaboration depth within a single response. Difficult steps receive extensive chain-of-thought; straightforward steps use concise inference. Mix reasoning modes to achieve 57-79% token savings under compute budgets while maintaining accuracy on math, STEM, and coding benchmarks.
MixReasoning: Switching Modes to Think
Core Concept
Reasoning models apply uniform elaboration depth to all problem-solving steps despite varying difficulty. MixReasoning detects step complexity and allocates reasoning resources accordingly—providing detailed chain-of-thought for hard steps while using brief inference for simple ones. This adaptive depth adjustment reduces token consumption by 57-79% while preserving accuracy.
Architecture Overview
Mode Detection: Identify which steps require detailed reasoning vs. simple computation
Mixed Reasoning Chains: Interleave concise and detailed steps in single response
Efficiency Metrics: Measure token savings under fixed computational budgets
Training-Free: Apply via inference-time prompting without model retraining
Implementation Steps
1. Mode Detection Framework
Classify steps by complexity before deciding reasoning depth.
classStepComplexityClassifier:
def__init__(self, classification_model='gpt-4.1'):
self.model = classification_model
defclassify_step_complexity(self, problem_context, step_description):
"""
Classify a reasoning step as: SIMPLE | MEDIUM | DIFFICULT
"""
prompt = f"""Problem: {problem_context}
Current step: {step_description}
How complex is this step?
- SIMPLE: Straightforward computation, obvious next action
- MEDIUM: Some reasoning needed, standard technique
- DIFFICULT: Complex logic, novel approach, multiple substeps
Classification: """
response = self.model.complete(prompt)
complexity = response.strip().split()[0].upper()
return complexity
defanalyze_full_problem(self, problem, solution_steps):
complexities = []
step_idx, step (solution_steps):
complexity = .classify_step_complexity(problem, step)
complexities.append(complexity)
complexities
"""
Analyze complexity of all steps in a problem.
"""
for
in
enumerate
self
return
2. Mode-Specific Elaboration Strategies
Define reasoning depth for each mode.
classMixReasoningModes:
"""
Three elaboration modes: BRIEF, STANDARD, DETAILED
""" @staticmethoddefbrief_reasoning(step_description, context):
"""
Concise inference: skip intermediate steps, state conclusion.
~20-50 tokens
"""
prompt = f"""Problem context: {context}
Step (brief mode): {step_description}
Provide a concise answer without detailed reasoning. One line conclusion:"""return prompt
@staticmethoddefstandard_reasoning(step_description, context):
"""
Normal chain-of-thought: explain key logic.
~100-200 tokens
"""
prompt = f"""Problem context: {context}
Step (standard mode): {step_description}
Explain your reasoning in 2-3 sentences:"""return prompt
@staticmethoddefdetailed_reasoning(step_description, context):
"""
Detailed elaboration: full chain-of-thought with substeps.
~300-500 tokens
"""
prompt = f"""Problem context: {context}
Step (detailed mode): {step_description}
Provide detailed reasoning:
1. Key insight
2. Substeps
3. Final answer"""return prompt
@staticmethoddefselect_mode_for_complexity(complexity_level):
"""
Map complexity → elaboration mode
"""
mapping = {
'SIMPLE': 'brief',
'MEDIUM': 'standard',
'DIFFICULT': 'detailed'
}
return mapping.get(complexity_level, 'standard')
3. Full MixReasoning Pipeline
Orchestrate complexity classification and mode selection.
classMixReasoningOrchestrator:
def__init__(self, classifier_model, reasoning_model):
self.classifier = StepComplexityClassifier(classifier_model)
self.modes = MixReasoningModes()
self.reasoning_model = reasoning_model
defsolve_with_mixed_reasoning(self, problem, proposed_steps, budget_tokens=4096):
"""
Solve problem with mixed reasoning depths.
Allocate tokens based on step complexity.
"""# Step 1: Classify complexity of all steps
complexities = []
for step in proposed_steps:
complexity = self.classifier.classify_step_complexity(problem, step)
complexities.append(complexity)
# Step 2: Allocate reasoning depth per step
allocated_tokens = self._allocate_tokens(complexities, budget_tokens)
# Step 3: Generate solutions with appropriate depth
full_reasoning = f"Problem: {problem}\n\n"
used_tokens = 0for step_idx, (step, complexity, token_limit) inenumerate(
zip(proposed_steps, complexities, allocated_tokens)
):
# Select mode based on complexity
mode = self.modes.select_mode_for_complexity(complexity)
# Generate elaboration with token budgetif mode == 'brief':
elaboration = self.reasoning_model.generate(
self.modes.brief_reasoning(step, problem),
max_tokens=50
)
elif mode == 'standard':
elaboration = self.reasoning_model.generate(
self.modes.standard_reasoning(step, problem),
max_tokens=200
)
else: # detailed
elaboration = self.reasoning_model.generate(
self.modes.detailed_reasoning(step, problem),
max_tokens=500
)
full_reasoning += f"Step {step_idx+1} ({complexity}): {elaboration}\n\n"
used_tokens += len(elaboration.split())
return {
'full_reasoning': full_reasoning,
'complexities': complexities,
'tokens_used': used_tokens,
'budget': budget_tokens,
'efficiency': 1 - (used_tokens / budget_tokens)
}
def_allocate_tokens(self, complexities, total_budget):
"""
Allocate token budget based on step complexities.
Difficult steps get more tokens.
"""# Weight by complexity: SIMPLE=1, MEDIUM=2, DIFFICULT=3
weights = {
'SIMPLE': 1,
'MEDIUM': 2,
'DIFFICULT': 3
}
complexity_weights = [weights.get(c, 2) for c in complexities]
total_weight = sum(complexity_weights)
# Proportional allocation
allocation = [
int((w / total_weight) * total_budget)
for w in complexity_weights
]
return allocation
4. Benchmark Evaluation
Test on math, STEM, and coding tasks with fixed compute budgets.
defevaluate_mix_reasoning(benchmark_name, problems, gold_solutions):
"""
Evaluate mixed reasoning on benchmarks: GSM8K, MATH-500, AIME, CodeElo
"""
orchestrator = MixReasoningOrchestrator(
classifier_model='gpt-4.1',
reasoning_model='deepseek-r1'
)
results = {
'accuracy': 0,
'token_efficiency': 0,
'avg_reasoning_length': 0
}
for problem, gold_solution inzip(problems, gold_solutions):
# Parse solution into steps
solution_steps = parse_solution(gold_solution)
# Solve with mixed reasoning
result = orchestrator.solve_with_mixed_reasoning(
problem,
solution_steps,
budget_tokens=4096
)
# Evaluate correctness and efficiency
final_answer = extract_answer(result['full_reasoning'])
is_correct = final_answer == gold_solution
if is_correct:
results['accuracy'] += 1
results['token_efficiency'] += result['efficiency']
results['avg_reasoning_length'] += len(result['full_reasoning'].split())
# Normalize
n = len(problems)
results['accuracy'] /= n
results['token_efficiency'] /= n
results['avg_reasoning_length'] /= n
return results
# Example results
benchmark_results = {
'gsm8k': {
'accuracy': '94.2%',
'token_savings': '67%',
'vs_uniform_reasoning': '+3-5% accuracy at same token budget'
},
'math_500': {
'accuracy': '89.3%',
'token_savings': '71%',
},
'aime': {
'accuracy': '68.5%',
'token_savings': '57%',
},
'codeelo': {
'accuracy': '73.1%',
'token_savings': '79%',
}
}
Practical Guidance
Complexity Detection: Use small classifier model (GPT-4.1-mini) to detect step complexity cost-effectively. False classifications have modest impact; algorithm self-corrects via step failure.
Token Budget: Fix total tokens and allocate proportionally to complexity. Under constrained budgets, mixed reasoning outperforms uniform depth by 5-15% accuracy.
Mode Thresholds: Simple/Medium split at problem-solving clarity. Medium/Difficult at requiring novel combinations. Tune thresholds per domain.
Training-Free: MixReasoning applies at inference time via prompting. No model retraining needed; works with any reasoning model.
When to Use / When NOT to Use
Use When:
Reasoning problems with variable step difficulty (math, STEM, coding)
Fixed inference token budgets are critical (constrained deployments)
Mixed elaboration is acceptable (some steps less detailed than others)
Open-ended generation (creativity benefits from consistent depth)
Reference
This skill synthesizes findings from "MixReasoning: Switching Modes to Think" (arXiv:2510.06052). Adaptive reasoning depth reduces token consumption 57-79% while preserving accuracy on standard benchmarks.