Xolani Dube
Back to Blog
AIProblem SolvingAlgorithmsPythonResearch

RCD: A Self-Verifying Framework for Solving 'Impossible' Problems

How Recursive Cascade Decomposition transforms intractable problems into solvable approximations through typed contracts, selective recursion, and self-improving solution generation.

Try the Interactive Demo → Watch RCD cascade through impossible problems in real-time.

What if instead of giving up when a problem is "impossible," you systematically transformed that failure into progress? This is the core insight behind Recursive Cascade Decomposition (RCD), a framework I developed for building intelligent systems that solve problems through iterative refinement.

The Problem: AI Systems That Give Up

Traditional AI systems have a binary outcome: solve completely or fail entirely. When encountering problems beyond their capability:

  • No systematic way to transform failure into progress
  • Limited by pre-programmed strategies
  • Can't adapt to novel problem requirements
  • Stopped at theoretical impossibility barriers

The Solution: Analyze → Execute → Validate → Recurse

RCD structures problem-solving into three typed roles that communicate via contracts:

The Core Formula

L0=V0(E0(A0(P0)))L_0 = V_0(E_0(A_0(P_0)))

Where:

  • A (Analyzer): Decomposes problems into subgoals, identifies regime and abstractions
  • E (Executor): Creates concrete solutions using tools
  • V (Validator): Validates solutions using analysis tools and certificates

Typed Contracts

Each role produces typed reports:

// Analysis Report
interface R {
  regime: string;          // Problem type classification
  confidence: number;      // [0,1] certainty
  subgoals: Goal[];        // Decomposed objectives
  abstraction: Callable;   // Problem simplification
  ood_score: number;       // Out-of-distribution indicator
}

// Solution Report
interface S {
  artifact: any;           // Concrete output
  plan: Step[];            // Execution trace
  value_est: number;       // Expected utility
  risk_est: number;        // Risk assessment
  coverage: number;        // Requirement coverage
}

// Validation Report
interface V {
  factuality: number;      // Truth verification
  consistency: number;     // Internal coherence
  safety_metrics: Safety;  // Constraint satisfaction
  certificates: Tag[];     // Formal proofs
}

Selective Recursion: Only Grow What Fails

When the gate decides to EXPAND, RCD creates subproblems only for failing roles:

Domain Thresholds

Domain Threshold Metric
D1 (Analyzer) 0.75\geq 0.75 Confidence
D1 (Analyzer) 0.5\leq 0.5 OOD Score
D2 (Executor) 0.80\geq 0.80 Coverage
D2 (Executor) 0.30\leq 0.30 Risk
D3 (Validator) 0.92\geq 0.92 Factuality
D3 (Validator) 0.90\geq 0.90 Consistency

Real-World Results

Handling "Impossible" Problems

RCD transforms impossible problems through progressive refinement:

Layer 0: "Prove Riemann Hypothesis" → Fails (confidence 0.01)
Layer 1: "Explore zeta function properties" → Better (0.20)
Layer 2: "Implement numerical verification" → Progress (0.30)
Layer 3: "Apply random matrix theory" → Novel insights (0.40)
...
Layer 10: Sophisticated mathematical framework with computational verification

Algorithm Selection: RCD-Flavored

RCD applies to classic algorithms, making them adaptive:

Category RCD Enhancement
Sorting D1 detects distribution, D2 routes to Tim/Intro/Heap/Radix, D3 checks sortedness
Graph Paths D1 inspects weights/sparsity, D2 routes to BFS/Dijkstra/A*, D3 verifies triangle inequality
Linear Solvers D1 detects symmetry/conditioning, D2 picks CG/GMRES/BiCGSTAB, D3 checks residual
ANN Indices D1 judges vector regime, D2 routes HNSW/IVF-PQ, D3 probes recall@k

Morphable Data Structures

Data structures that adapt to workload:

# Morphable Map: Hash ↔ B-tree ↔ Trie ↔ LSM
D1: Detects keys & workload (range vs point, TTL, skew)
D2: Selects current structure
D3: Validates invariants (ordering, uniqueness)
Expansion: Live morphism with zero-loss when workload shifts

Architecture

rcd/
├── domains/
│   ├── d1_analyzer.py      # Problem decomposition
│   ├── d2_executor.py      # Tool-based execution
│   └── d3_validator.py     # Multi-dimensional validation
├── tools/
│   ├── base.py             # Tool framework
│   ├── general_tools.py    # Write, read, transform, fetch
│   ├── dynamic_tools.py    # Runtime tool creation
│   └── analysis_tools.py   # Code quality, reasoning, proofs
├── gate.py                 # Accept/Reject/Expand decisions
├── pipeline.py             # Orchestration
└── persistence.py          # State management

Key Capabilities

1. Dynamic Tool Creation

RCD creates custom tools on-demand:

# Layer 0: Realizes need for custom tool
# Layer 1: Creates basic version
# Layer 2: Refines tool based on usage
# Layer 3: Tool becomes reusable component

2. Self-Improving Solutions

Solutions evolve through validation feedback:

  • Failed solutions become specifications for better solutions
  • V₀ output → E₁ input creates improvement loop
  • Algorithm starting O(n³) automatically refined to O(n log n)

3. Multi-Modal Reasoning

Seamlessly combines different reasoning modes:

  • Mathematical proofs (D1 analyzer)
  • Code implementation (D2 executor with tools)
  • Empirical validation (D3 validator)

4. Budget-Aware Recursion

Controlled resource consumption:

maxΔUk=U(Rk,Sk,Vk)λcost(k)s.t.invariants(Vk)=true\max \Delta U_k = U(R_k, S_k, V_k) - \lambda \cdot \text{cost}(k) \quad \text{s.t.} \quad \text{invariants}(V_k) = \text{true}

Evaluation Metrics

Metric Description
Gate precision/recall Decision quality
Pass@depth Success rate by recursion level
Expansion rate Failure-to-progress ratio
ECE/Brier Calibration of confidence
OOD AUROC Out-of-distribution detection
Task success Final solution quality

What RCD Makes Possible

1. No Problem Is Truly Unsolvable

Every problem has a "best possible" solution. RCD finds it systematically.

2. Automatic Scientific Discovery

Can explore mathematical conjectures, discover new algorithms, bridge theory and practice.

3. Self-Improving Systems

Solutions get better over time. Systems learn from their own failures.

4. Theoretical Boundary Exploration

Systematically probes limits of computation. Transforms academic problems into practical tools.

The RCD Revolution

RCD fundamentally changes what's possible:

  1. Never gives up — transforms failure into progress
  2. Creates capabilities — builds tools as needed
  3. Discovers strategies — finds novel approaches
  4. Manages complexity — handles problems too large for single-pass solutions
  5. Learns from failure — each attempt improves the next

The key insight: RCD makes "impossible" a starting point, not an ending point.


See It In Action

Experience the cascade in real-time with our interactive visualizer:

Launch RCD Demo →

Watch as problems decompose through Analyze → Execute → Validate cycles, spawning new layers as the system refines its approach. The visualization shows exactly how RCD transforms "impossible" into "progress."


RCD doesn't just solve problems—it redefines what "solvable" means.