MODULE 06 // 24:10

Generator-Critic Loops & Verifiable Self-Correction

Pair generation nodes with external verifiers (compilers, linters, schema validators) rather than relying solely on self-critique.

// KEY ARCHITECTURAL TAKEAWAYS

  • Why LLM-only self-critique plateaus without external ground-truth feedback.
  • Feed compiler stack traces and test assertions back into the context window.
  • Track convergence across iteration rounds.
REFERENCE IMPLEMENTATION // SNIPPET
# Verifier-guided loop
result = run_sandbox_tests(generated_patch)
if not result.passed:
    state.append_error(result.stderr)