Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GodelZero: Open-Ended Self-Improvement for Language Models

Abstract

GodelZero is a research reinforcement learning framework designed to enable open-ended, non-episodic self-improvement in Large Language Models (LLMs). Conceptually analogous to AlphaZero, Godel abandons standard episodic optimization in favor of a persistent, multi-tree Monte Carlo Tree Search (MCTS) operating over a lineage of reasoning policies and cognitive scaffolds.

Architecture Specification

The system is rigorously factored into a client-server paradigm, separating the multi-objective verification logic from the generative agent policy.

1. GodelEnv: The Environment Substrate

The environment operates as a persistent evaluation engine that maintains a registry of all reasoning strategies historically generated.

  • Action Space: The primary action primitive is the StrategyPatch—a structured, grammar-constrained JSON mutation of the agent's current prompt reasoning logic.
  • Ground Truth Evaluation: Patches are rigorously tested across a held-out evaluation task bundle. The environment's "Governor" module performs multi-axis scoring (correctness, generalization, cost-efficiency, stability) and returns a PatchDecision.
  • Clade-Metaproductivity (CMP): Successful evaluations adjust the long-term utility score of the strategy's lineage, producing a delayed reward signal known as Clade-Metaproductivity (analogous to AlphaGo's Elo mechanism).

2. Godel RL Agents

The agent package (godel) manages an asynchronous fleet of workers performing parallel search and gradient optimization.

  • MCTS Lookahead: The self-play loop leverages multi-tree PUCT to explore counterfactual branches. The agent interacts with the environment securely via evaluate_only=True to sandbox and observe the Governor's verdicts without mutating global tournament state.
  • Grounded Offline Predictor: Because executing actual evaluations is highly compute-intensive, Godel utilizes an in-memory MLP (GovernorPredictor) as a "world model" to rapidly screen speculative MCTS candidates prior to executing environment steps.
  • Shared Dual-Head Implementation: The core LLM policy is backed by a custom DualHeadLLM architecture. It applies standard GRPO-style cross-entropy against the MCTS visit distribution on the LM head, while a dedicated ValueHead simultaneously regresses against the retrospective CMP generated dynamically by the Prioritized Replay Buffer.

Technical Nuances & Engineering Standards

  • Grammar-Constrained Decoding: Arbitrary or hallucinatory model outputs degrade the self-improvement loop. The generator enforces strict adherence to the StrategyPatch schema leveraging outlines. If structural generation fails, the system safely raises a strict termination error rather than polluting the MCTS tree with raw text.
  • Schema Boundaries: The project strictly compartmentalizes domain models. Canonical objects (GodelObservation, PatchDecision, StrategyPatch) are owned uniformly by the environment godel_engine. The RL client interprets flattened, agent-specific projections (RewardVector, GodelState) strictly initialized via the env_client middleware.

Deployment & Execution

1. Starting the Environment Server The persistent GodelEnv instance must be launched first. It maintains the registry and handles WebSocket requests from the RL workers.

python -m GodelEnv.server

2. Kickstarting the RL Pipeline Once the environment is accessible via localhost:7860, spin up the client asynchronous training loop:

python -m godel.train

Note: Achieving positive Clade-Metaproductivity and actual recursive improvement demands an underlying base model with significant reasoning capabilities (e.g., Llama-3-8B minimum). Attempting to run this scaffolding on highly compressed parameter ranges (under 1B) will lead to a 0% baseline Governor acceptance rate and RL loop starvation.

About

A Strategy Search for Measured Self-Improvement

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages