Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Evolution

The evolution subsystem optimizes agent system prompts through RLVR (Reinforcement Learning with Verifiable Reward) during GPU idle periods. It generates candidate prompts, evaluates them against held-out tasks, and promotes winners — operating as a continuous self-improvement loop.

Evolution Cycle

1. EvolutionDaemon monitors GPU utilization
2. When idle (<30% for 60s), select next agent (round-robin)
3. CurriculumAgent orders tasks by difficulty
4. AgentRunner generates responses via engine scheduler
5. DaemonOracle verifies responses against RASE constraints
6. compute_reward() produces scalar training signal
7. APO/GEPA optimizes prompt based on reward trajectory
8. If improved, promote new version; record lineage

The DaemonOracle uses the same RASE verification pipeline as production — Constraint[S] composition evaluated against API ground truth. This ensures the evolution reward signal is verifiable, not learned.

Optimization Methods

MethodDescriptionReference
APOAutomatic Prompt Optimization — gradient-free meta-prompt searchZhou et al., 2023
GEPAGenetic Evolution of Prompt Architectures — crossover/mutationGuo et al., 2024

Task Sources

Evolution draws training tasks from three sources:

SourceMethodCoverage
Nous ResearchJSONL reasoning tasks (load_reasoning_tasks())General reasoning
RASE ObjectivesKB objectives → tasks via ObjectiveGeneratorDomain-specific verification
Task IdeationTaskIdeationAgent analyzes capability gapsTargeted improvement

The CurriculumAgent orders tasks by difficulty, ensuring agents encounter progressively harder challenges rather than random sampling.

Held-Out Evaluation

The DailyEvaluator runs held-out evaluation against a reserved query pool — queries the evolution process has never seen:

  1. Sample N queries from the held-out pool (default 50)
  2. Run each through AgentRunner with the current prompt
  3. Score responses via the xAI evaluator (independent critique)
  4. Aggregate into a DailyEvalSummary with accuracy, per-capability breakdown, and trend

This provides an unbiased measurement of agent improvement over time, separate from the training reward signal.

Calibration

The CalibrationOracle cross-validates local evaluation scores against frontier models (Cerebras, xAI). If local scores diverge significantly from frontier assessments, it flags calibration drift — preventing the system from optimizing toward a biased local metric.

Model Merging

Agent versions can be combined in parameter space:

MethodDescriptionReference
LinearWeighted average: theta = alpha * theta_1 + (1-alpha) * theta_2
TIESResolves sign conflicts between model deltasYadav et al., 2023
DAREDrop and rescale for sparse mergingYu et al., 2024

The MergeCoordinator identifies merge candidates (versions with complementary strengths) and validates merged models before registration.

Atropos Compatibility

GaiusEvolutionEnv implements the Atropos BaseEnv interface, exposing Gaius evolution as a standard RL environment for external frameworks:

env = GaiusEvolutionEnv("leader")
item = await env.get_next_item()      # Training task
reward = await env.score_response(response)  # Verifiable reward

Configuration

evolution {
    enabled = true
    idle_threshold = 60    # seconds of GPU idle before triggering
    cycle_interval = 3600  # minimum seconds between cycles
}

The daemon runs in the engine process and activates only during GPU idle periods to avoid competing with interactive inference.