LLMs don't reason. They replay patterns. Meta-Reasoning takes control away from the model and gives it to you. An external controller observes how the model reasons, bans its dominant strategies, forces it into unexplored territory, and records every failure. The model executes. You govern.
A standard LLM collapses into a single strategy. Meta-Reasoning forces exploration.
The standard LLM repeats its dominant pattern until it stalls.
Meta-Reasoning bans that pattern and forces the model into unexplored cognitive space.
Every other framework lets the LLM choose its own reasoning strategy. Meta-Reasoning doesn't. The model is stateless and cognitively passive. It receives instructions, produces structured output, and never decides goals, strategies, or when to stop. All of that is controlled from outside.
Produces text, structures, symbols. Stateless by design. Never decides:
A linguistic machine, not a mind.
The heart of the innovation. Observes output, interprets reasoning type, decides whether and how to mutate it, imposes cognitive constraints.
Does not generate content. Does not reason semantically. It governs — it does not think.
Not memory in the RAG sense. A structural trace of:
Ensures the system never revisits the same mental state.
Meta-Reasoning is built on five design decisions. Each one is a deliberate rejection of the idea that a model can regulate its own cognition.
As long as reasoning is just text, you can't control it. Meta-Reasoning forces every LLM output to include a formal trace of what cognitive operations were used. Not introspection — instrumentation. If the model cheats the trace, the controller punishes it.
{
"content": "...",
"reasoning_trace": {
"moves": ["assumption", "deduction", "analogy"],
"depth": 4,
"confidence_markers": 2,
"abstraction_level": "medium"
}
}
If the model "cheats" the trace, the controller penalizes it. Observability is enforced, not optional.
Reasoning moves are drawn from a finite, extensible taxonomy — a cognitive alphabet that makes trajectories comparable, measurable, and mutable:
The Cognitive Controller never evaluates whether the answer is correct. It doesn't care about truth. It measures form: entropy, repetition, stall, premature convergence. Like a conductor who doesn't play the instruments but controls the dynamics of the orchestra.
Diversity across the cognitive move taxonomy. Low entropy signals over-reliance on a single strategy.
Reuse of identical move sequences across iterations. High repetition triggers forced mutation.
Reasoning that goes deeper without introducing new moves — a sign of statistical path-following.
How quickly the model converges to a conclusion relative to the available reasoning space.
How often the model attempts to use operators that the controller has banned in the current cycle.
Shifts in abstraction level across a trajectory. Monotone levels signal rigid, brittle thinking.
These metrics do not exist in prior work. They are invented here — and are the foundation of cognitive governance.
When the controller detects stall or dominance, it doesn't ask the model to try harder. It bans moves, mandates alternatives, compresses conceptual space, forces inversions. The model must improvise because it literally cannot do anything else.
deduction — removes the dominant move from the available alphabet for this cycle
analogy:physical — mandates a physical analogy as the next reasoning move
max_concepts:2 — artificially reduces the conceptual space to force abstraction
causal_direction — reverses the assumed causal arrow in the current reasoning chain
contradiction_search — forces explicit search for internal contradictions before proceeding
A typical mutation cycle:
Output includes structured cognitive metadata alongside generated content.
Detects: dominant: deduction · premature_closure: 0.87
BAN: deduction · REQUIRE: analogy · COMPRESS: max_concepts:3
Not because it is "creative" — but because it cannot do otherwise within the constrained space.
Counterintuitive but fundamental. Improvisation doesn't come from giving the model more room — it comes from taking room away. Each cycle reduces available moves, increases pressure, narrows the space. Like jazz: you play despite the constraints, not without them.
Meta-Reasoning operationalizes this as anti-prompting: instead of telling the model what to do, you tell it what's forbidden. Prohibitions destroy memorized patterns, force novel trajectories, and expose the model's internal biases.
Meta-Reasoning does not optimize for correct answers. It treats collapsed trajectories, contradictions, and constraint violations as the most informative events possible.
Every failure is logged in the Epistemic Ledger as a negative cognitive map. The system learns not what to think, but which mental spaces to avoid. The controller can even deliberately make a task harder: "This is too easy. Make it impossible."
Put a breakpoint in thought. Step through the cognitive loop cycle by cycle, inspect which mutations were applied and why, understand what triggered a ban, and rewind to any previous cognitive state to explore alternative trajectories.
from meta_reasoning import ReasoningDebugger dbg = ReasoningDebugger(backend=my_backend, max_cycles=5) dbg.add_breakpoint(lambda cycle, metrics, muts: metrics.entropy < 1.0) result = dbg.run("Your task") snap = dbg.rewind_to(2) print(snap.explain()) # === Cycle 2 [continued] === # Moves: analogy, contradiction, compression # Entropy: 1.58 # Constraints imposed: # - BAN deduction (dominant at 75%) # - REQUIRE contradiction (premature closure 0.82)
Write cognitive governance rules in Python — not prompts. Policies are versionable, testable, and reviewable in code review. This is the leap from prompt engineering to cognitive infrastructure.
from meta_reasoning import ReasoningPolicy, PolicyRule, CognitiveEngine policy = ReasoningPolicy("my_policy") policy.add_rule(PolicyRule( name="ban_dominant", condition=lambda m, c: m.dominant_move is not None, mutations=lambda m, c: [Mutation(type=MutationType.BAN, target=m.dominant_move)], )) engine = CognitiveEngine(backend=my_backend, policy=policy) result = engine.run("Your task")
Run the same governed loop on different models and compare them not by accuracy, but by cognitive behavior: how rigid are they? How diverse? How do they respond to constraints? How well do they improvise under pressure?
from meta_reasoning import benchmark_models result = benchmark_models( backends={"gpt-4o": gpt, "claude": claude, "llama": llama}, task="Your task", ) print(result.comparison_table()) # Model Entropy Closure Stall Violations Cycles # gpt-4o 2.31 0.35 0.0% 0.00 5 # claude 1.87 0.48 20.0% 0.40 5 # llama 0.92 0.71 60.0% 1.20 5
Every model has a cognitive signature — a profile of which strategies it prefers, which it avoids, how it reacts to pressure, and at which cycle it tends to collapse. Use it for model selection, intelligent routing, auditing, or compliance.
from meta_reasoning import fingerprint_from_result fp = fingerprint_from_result("gpt-4o", engine_result) print(fp.summary()) # Cognitive Fingerprint: gpt-4o # Avg entropy: 2.46 # Stall rate: 0.0% # Preferred moves: deduction, assumption # Collapse at: [4, 7] # Move distribution: # deduction 17.6% # assumption 17.6% # analogy 17.6%
Instead of hiding failures, map them. Visualize them. Query them. Ask: "where does this model fail systematically?", "which mutations cause stall?", "which strategies are unstable?" — a form of cognitive observability that doesn't exist today.
atlas = engine.ledger.failure_atlas() atlas.by_reason() # group by failure cause atlas.stall_inducing_mutations() # which mutations caused stall? atlas.unstable_strategies() # which move sequences led to failure? atlas.query(max_entropy=0.5) # find low-entropy failures print(atlas.summary()) # Failure Atlas: 3 failures # cognitive stall: 2x # constraint violations: 1x # Stall-inducing mutations: # ban:deduction + require:contradiction (2x)
Same task + same controller = reproducible reasoning. Save entire sessions as JSON, reload them later, and diff two sessions frame-by-frame to detect exactly what changed. Scientific, enterprise-ready, and CI-testable.
from meta_reasoning import record_session, ReplaySession session = record_session(result, "task", max_cycles=5) session.save("session_v1.json") # Later: compare two sessions s1 = ReplaySession.load("session_v1.json") s2 = ReplaySession.load("session_v2.json") for diff in s1.diff(s2): print(diff) # Cycle 2 moves: ['deduction', 'analogy'] vs ['abduction', 'compression'] # Cycle 3 entropy: 1.58 vs 0.92
Instead of filtering output after the fact, detect cognitive patterns that correlate with hallucination — high confidence with low depth, single-strategy dominance, premature closure — and break them before they produce output. Governance, not fact-checking.
from meta_reasoning import assess_hallucination_risk risk = assess_hallucination_risk(metrics, confidence_markers=4, depth=1) print(risk.score) # 0.60 print(risk.triggers) # ["high_confidence_low_depth", "single_strategy"] print(risk.preventive_mutations) # [BAN deduction, REQUIRE contradiction] # → applied automatically before the next generation cycle
An open ecosystem where the community can define new mutation operators, new cognitive constraints, and new metrics. Register a plugin and it runs alongside the built-in engine — not a closed framework, but a cognitive ecosystem.
from meta_reasoning import PluginRegistry, MutationPlugin, CognitiveEngine registry = PluginRegistry() registry.register_mutation(MutationPlugin( name="force_narrative", description="Always require narrative_simulation", generate=lambda m, c: [Mutation( type=MutationType.REQUIRE, target=CognitiveMove.NARRATIVE_SIMULATION, )], )) engine = CognitiveEngine(backend=my_backend, plugin_registry=registry)
Automated cognitive regression testing that runs in your CI pipeline. Detect when a model becomes more rigid, less diverse, or more prone to stall after an update — test reasoning behavior, not just output correctness.
from meta_reasoning import CognitiveCI, assert_min_entropy, assert_no_total_stall ci = CognitiveCI(backend=my_backend, max_cycles=5) report = ci.run("Your task", [ assert_min_entropy(1.0), assert_no_total_stall(), assert_min_move_diversity(3), ]) assert report.passed # fails CI if cognitive behavior regresses print(report.summary()) # Cognitive CI: PASSED (0 failures / 3 assertions) # ✓ min_entropy>=1.0: avg_entropy=2.46 # ✓ no_total_stall: outcome=max_cycles_reached # ✓ move_diversity>=3: unique_moves=7
Reasoning is not text. It's a computational process. The Runtime treats it like one: explicit states (INITIAL → ANALYSIS → HYPOTHESIS → VALIDATION → REFLECTION → FINAL), typed transitions driven by metrics, budget management (tokens, branches, depth), and deterministic forking. The model does not choose to reflect. The runtime forces it.
from meta_reasoning import ReasoningRuntime, ReasoningBudget rt = ReasoningRuntime( backend=my_backend, budget=ReasoningBudget(max_cycles=8, max_branches=4), ) result = rt.run("Your task") print(result.summary()) # Runtime: Your task # Final state: final # States visited: initial → analysis → hypothesis → validation → reflection → final # Cycles: 6 # Budget: 6/8 cycles, 0/4 branches # Fork: explore two branches from the same cognitive state forks = rt.fork("Your task", [ [Mutation(type=MutationType.BAN, target=CognitiveMove.DEDUCTION)], [Mutation(type=MutationType.REQUIRE, target=CognitiveMove.NARRATIVE_SIMULATION)], ])