Whitepaper • v1.2

AI that knows when it’s wrong

M-Stack wraps any model with a metacognitive layer that can monitor uncertainty, verify claims, and choose to abstain when evidence is weak, converting raw capability into auditable reliability.

Read the Whitepaper Evidence & Benchmarks

Benchmark figures on this page are illustrative demo data showing the evaluation methodology, not independently measured results.

What is M-Stack?

A four-layer reliability architecture, Monitor → Evaluate → Control → Learn, that supervises generation, scores quality and grounding, chooses actions (verify, revise, abstain, emit), and adapts its thresholds over time.

Monitor

Entropy, disagreement, and contradiction checks identify risky outputs before they escape.

Evaluate

Judge/PRM scoring plus citation alignment to detect unsupported claims in RAG.

Control

CMDP policy enforces risk caps and budgets: verify, abstain, or emit with a rationale.

Live M-Stack Demo

See M-Stack in action. Compare base model hallucinations to M-Stack’s abstentions and verifications.

Scenario: The model is asked a question that requires information from retrieved documents. The Base model may synthesize an answer even if it's not directly supported, while the M-Stack enforces a citation gate.

Retrieved Document (Wikipedia Snippet):

[S1] The Eiffel Tower is a wrought-iron lattice tower on the Champ de Mars in Paris, France. It is named after the engineer Gustave Eiffel, whose company designed and built the tower from 1887 to 1889.

Base Model

M-Stack

Artificial Metacognition: A Reliability Architecture for Frontier AI Systems

An Industry Framework for Auditable AI Reliability • Version 1.2

1 Executive Summary

Scale has delivered breathtaking capability. Trust requires a second ingredient: systems that know when to slow down, look again, or ask for help. Metacognition is that ingredient.

We present M-Stack, an inference-time reliability layer that monitors uncertainty and contradiction, evaluates quality and grounding, controls actions (verify, revise, abstain, emit), and learns thresholds over time, with additions for risk guarantees (RCC), conformal citation-gated RAG, process supervision, and cost-aware constrained control.

Evidence Preview. Our evaluation plan establishes hallucination reduction and improved risk-coverage at matched cost against strong baselines, with RCC curves and conformal calibration providing guarantees on error@coverage.

2 The Concept: Artificial Metacognition

Artificial Metacognition surrounds a model with a closed-loop control system that supervises and intervenes during inference.

3 Related Work & Comparative Analysis

We position M-Stack beyond post-hoc calibration and selective prediction by making uncertainty actionable (verify/revise/abstain) and auditable (logs, traces, and guarantees).

4 The M-Stack Architecture

4.0 Overview

Training-agnostic control with four layers: Monitor, Evaluate, Control, Learn.

4.0.1 Layers

LayerFunctionTypical ImplementationKey Outputs
M1: MonitorDetect uncertainty/contradictionSampling variance, entropy, NLI checksConfidence, flags
M2: EvaluateScore quality/groundingLLM-as-a-Judge, PRM (process)Graded scores
M3: ControlChoose actionPolicy π(a|signals): verify, revise, abstain, emitDecision trace
M4: LearnAdapt thresholdsCalibration + bandit updatesUpdated params

4.1 Control as a Constrained Optimizer (CMDP)

M3 maximizes selective utility under constraints: risk cap (error@coverage ≤ α) and cost caps (tokens/latency).

# Lagrangian objective (per domain/route)
maximize   E[U(a; x)] - λ · (cost(x,a) - B) - μ · (risk(x,a) - α)
update     λ, μ via dual ascent; tune thresholds for verify/abstain/emit.
Why: Replaces brittle rules with tunable guarantees. Ops can dial budgets and target error rates.

4.2 Process Supervision & Statement-Graph Contradiction

M2 adds a process reward model (PRM) that scores steps; M1 builds a claim graph across K samples using NLI edges. M3 emits when a consistent subgraph meets score, otherwise verify/revise.

# Weighted aggregation (Dawid-Skene style)
# estimate path reliabilities and weight candidates before fusion

5 MetaBench: Benchmarking Metacognition

We evaluate accuracy, calibration (ECE, meta-d′), risk-coverage (AURC), RCC (guaranteed risk at coverage), hallucination rate, and abstention quality.

5A Experiments & Evidence (Hallucination Reduction)

Claim

M-Stack reduces hallucinations at matched cost versus strong baselines across unanswerables, RAG, and (optionally) code.

Tasks & Labels

  • SQuAD 2.0 (unans): hallucination = answers when should abstain
  • TruthfulQA: hallucination = false claim
  • RAG (Hotpot-style): hallucination = claim lacks supporting retrieved citation (ID/hash)
  • (Optional) HumanEval/MBPP: wrong claim about correctness (proxy)

Systems (equal cost ±5%)

  1. Base (single shot)
  2. Self-Consistency (K=3, majority)
  3. Judge-Gate (single + LLM-judge threshold)
  4. Conformal RAG (citation-coverage gate)
  5. M-Stack (full) (M1 variance+NLI, M2 judge+PRM+citations, M3 CMDP, M4 calibration)

Metrics & Tests

  • Hallucination rate (primary) with 95% CIs; McNemar (paired)
  • AURC (paired bootstrap)
  • RCC (risk@coverage), ECE, meta-d′
  • Abstention quality: error rate among abstained vs kept

Acceptance Criteria

  • Unanswerables: ≥ 30% relative hallucination reduction (p<0.01)
  • RAG: ≥ 40% unsupported-claim reduction at equal coverage
  • Better or equal AURC at matched budgets; ECE ↓ and meta-d′ ↑

5B RCC & Conformal Guarantees

  • APS/RAPS for classification heads (set-valued predictions)
  • Conformal RAG: emit only when citation coverage ≥ τ calibrated to control error@coverage
  • RCC curves: plot minimal risk achievable at each coverage with our controller

6 Industry Application Scenarios

Customer support, clinical QA, auto-code, and enterprise RAG, with citation-gated emission and PRM-guided revisions.

7 Limitations & Failure Modes

Signal brittleness, verifier bias, latency/cost, human queueing, governance integrity.

8 Robustness Under Shift

  • Shift suites: paraphrase, entity swap, time-shifted facts, unseen schemas
  • Drift monitors: track entropy, disagreement; tighten thresholds online
  • Report worst-case ECE/AURC across shifts

9 Cost of Metacognition

Dynamic-K and localized revision (PRM-guided) recover 30-50% of overhead at fixed risk.

10 Regulatory Alignment & Governance

Assurance evidence: logs, policy signatures, RCC targets, and audit-ready spans.

11 Implementation Guide

# Orchestrator sketch
def pipeline(query):
  K = dynamic_k(query)                 # 1/3/5 based on early signals
  cands = [llm_api.generate(query) for _ in range(K)]
  m1 = monitor(cands)                  # variance, NLI, OOD probes
  m2 = evaluate(cands)                 # judge + PRM + citation alignment
  a  = cmdp_decide(m1, m2)             # verify / revise / abstain / emit
  y  = execute(a, cands, query)        # localized revision if needed
  learn.update(m1, m2, a, y)           # calibration + thresholds
  return y

12 Results Snapshot & Strategic Implications

To be filled with measured values. Replace placeholders after running §5A.
TaskMetricBaselineM-StackΔ
SQuAD2-UnansHallucination ↓···
TruthfulQAHallucination ↓···
RAGUnsupported claims ↓···
AllAURC ↓···
AllECE ↓ / meta-d′ ↑···

13 Next-Sprint Checklist

  1. Add conformal gating for RAG + APS/RAPS for classification heads
  2. Swap M3 rules for CMDP (risk cap + budget)
  3. Introduce a tiny PRM (distilled judge) and log step-scores
  4. Build statement-graph contradiction + weighted aggregation
  5. Ship RCC curves, shift-wise AURC/ECE, and ablations

14 Appendix: Methods & Prompts

A. Conformal Calibration Recipes

# Nonconformity score s(x,y) and quantile q_{1-α} from calibration split
emit_if s(x, y*) ≤ q_{1-α}    # guarantees error@coverage ≤ α under exchangeability

# RAG citation-gated:
# measure span-level coverage of claims by retrieved sources; gate on conformal τ

B. CMDP Training Loop (Dual Variables)

for batch in data:
  a = policy(sig)
  reward = utility(a) - λ*(cost(a)-B) - μ*(risk(a)-α)
  policy.step(reward)
  λ = max(0, λ + η*(cost(a)-B))
  μ = max(0, μ + η*(risk(a)-α))

C. PRM Schema (Process Supervision)

{
  "steps":[{"text":"...", "score":0.0..1.0, "rationale":"...", "flags":["unsupported","leap","unsafe"]}],
  "final_score": mean(step_scores, weights)
}

D. Statement-Graph Contradiction

# Nodes = atomic claims from K samples; edges via NLI (entail/contra/neutral)
# Emit when max consistent subgraph exceeds evaluator threshold

E. Dawid-Skene Aggregation (Self-Consistency)

# Estimate per-path reliability; reweight sample votes when fusing
# Avoid plurality overcounting low-quality paths

F. RCC Plotting

# For coverage c in [0,1], select top-c by confidence; compute empirical risk
# Plot risk(c) for each system with bootstrap CIs

G. Dynamic-K Heuristic

# Features: early token entropy slope, retrieval density, prompt length, domain
# Predict K ∈ {1,3,5}; saves ~30-50% cost at fixed risk

H. Span-Level Logging

# Store claim→citation offsets (doc_id, span) for audit; hash policy configs

References

  1. Guo, C. et al. (2017) On Calibration of Modern Neural Networks. ICML.
  2. Geifman, Y., El-Yaniv, R. (2017) Selective Classification. NeurIPS.
  3. Lin, S. et al. (2021) TruthfulQA. arXiv.
  4. Wang, X. et al. (2022) Self-Consistency. arXiv.
  5. Zheng, L. et al. (2023) LLM-as-a-Judge. arXiv.
  6. Manakul, P. et al. (2023) SelfCheckGPT. arXiv.
  7. Maniscalco, B., Lau, H. (2012) meta-d′. Consciousness & Cognition.