Skip to main content
Back

ProRata.ai's EPOCH Gives AI Agents a Shared Protocol to Self-Optimize

EPOCH is a two-phase agentic protocol that gives LLM agents a reproducible, role-separated loop for improving prompts, code, hyperparameters, and rules across production systems.

Pro

Paper, Full Access
  • EPOCH is a two-phase agentic protocol for multi-round system optimization, covering prompts, code, hyperparameters, and symbolic rules under one unified framework.
  • It separates optimization into Baseline Construction (Phase I) and Multi-Round Self-Improvement (Phase II), with six distinct roles that cannot cross-contaminate each other's responsibilities.
  • A hard separation between the agent that proposes changes and the agent that evaluates them prevents data leakage, overfitting, and evaluation drift across rounds.
  • Validated across four tasks: a Fibonacci code optimizer achieved a 6,000x speedup over 4 rounds; a prompt tuner hit perfect SST-2 accuracy in 3 rounds with zero leakage.
  • The protocol self-terminates when diminishing returns are detected, and handles rejected rounds with structured retry logic rather than breaking the control flow.
  • Code and configurations will be publicly released; the paper targets production-oriented teams needing reproducible, auditable optimization pipelines.

Every team building with LLMs eventually hits the same wall: the agent that rewrites your prompt has no idea the agent that tunes your hyperparameters even exists. Each optimizer runs its own loop, tracks its own state, and has no shared language with the rest of the system. Researchers from ProRata.ai think the missing piece is not a better optimizer -- it is a better protocol.

Their paper introduces EPOCH, an agentic protocol for multi-round system optimization. The core idea is deceptively simple: treat iterative improvement as a first-class engineering process with defined phases, separated roles, canonical interfaces, and round-level audit trails -- regardless of what you are optimizing.

The problem hiding in plain sight

Autonomous agents are increasingly used to improve prompts, code, and ML systems through iterative execution and feedback, yet existing approaches are usually designed as task-specific optimization loops rather than as a unified protocol for establishing baselines and managing tracked multi-round self-improvement. Tools like DSPy, PromptBreeder, AgentHPO, and RepairAgent are all excellent at their specific jobs, but none of them share a common abstraction.

Existing agentic optimization approaches lack a unified protocol for baseline establishment and multi-round self-optimization under consistent evaluation, resulting in no shared protocol abstraction, explicit role separation, canonical execution interfaces, or round-level state tracking across heterogeneous settings -- making it difficult to manage iterative improvements reproducibly and traceably in complex production environments.

This matters most in production. Real ML systems are not a single model or a single prompt. They are a tangle of preprocessing code, serving logic, model configs, and rule-based post-processors. Improving one component without a shared protocol means you cannot reliably know whether a change in component A caused the gain you saw in component B.

Two phases, four roles, one protocol

EPOCH structures every optimization run into two sequential phases. It organizes optimization into two phases -- baseline construction and iterative self-improvement -- and structures each round through role-constrained stages that separate planning, implementation, and evaluation, standardizing execution through canonical command interfaces and round-level tracking.

Phase I: Baseline Construction transforms a raw problem description into a runnable, evaluated starting point. Two roles handle this:

  • Seed Planner -- reads the task specification and designs the initial system and evaluation interface. It plans only; it never touches code or data.
  • Baseline Executor -- converts that design into a runnable implementation and generates the first accepted metrics. If a validated baseline already exists, this phase reduces to a simple validation step.

Phase II: Multi-Round Self-Improvement then runs a structured loop from that baseline. Four roles divide the work:

  • Orchestrator -- manages round-level control flow, budgets, retry limits, and state transitions. It never proposes or evaluates changes itself.
  • Investigator -- analyzes the current accepted state and available evidence to generate hypotheses. In ML tasks, it is restricted to the training split only.
  • Executor -- implements the proposed change within the admissible action space (prompt files, hyperparameter configs, rules, or source code).
  • Reviewer -- evaluates the candidate under the canonical evaluation interface and issues a structured verdict: accept, reject, retry, or terminate.

The key design decision is the hard separation between the agent that proposes a change and the agent that judges it. The component that decides whether a change is valid is not the same component that proposed or implemented it, which helps preserve the integrity of the evaluation, especially in settings where data leakage, overfitting, or inconsistent evaluation procedures would otherwise undermine the reliability of iterative optimization.

The whole thing maps onto the classic OODA loop (Observe, Orient, Decide, Act) -- a decision-making framework originally developed for military strategy -- but made explicit and auditable through role separation and artifact tracking.

What it actually looks like in code

A task is defined through a YAML specification that wires up all the moving parts:

run:
  goal: "Optimize sentiment classifier prompt"
  task_type: "prompt_tune"
  max_rounds: 5
  max_retries_per_round: 1
roles:
  seed_planner: true
  investigator: true
  executor: true
  reviewer:
    enabled: true
    mode: "metric_driven"
evaluation:
  primary_metric: "accuracy"
  min_delta: 0.02
  train_cmd: null
  eval_cmd: "python evaluate.py"
  acceptance_rule: "eval accuracy improves by min_delta without leakage"

Each round produces a structured artifact directory: investigation reports, proposed metrics, round-to-round deltas, and a run summary. The full history of why every change was accepted or rejected is preserved.

Four experiments, one protocol

The team validated EPOCH across four very different optimization tasks. The goal was not to beat state-of-the-art task-specific optimizers -- it was to show that a single protocol can handle all of them coherently.

Code improvement (Fibonacci calculator): EPOCH was given a naive O(n) Fibonacci implementation that needed to compute fib(10^6) under 2 seconds. It managed a staged optimization automatically:

  • Round 1: Iterative O(n) baseline -- 8,420 ms for fib(10^6), 17/19 tests passing
  • Round 2: Replaced with fast-doubling algorithm -- 34.3 ms, all 19 tests passing
  • Round 3: Switched to gmpy2 big-integer arithmetic -- 2.39 ms
  • Round 4: Used gmpy2's native Fibonacci routine directly -- 1.33 ms
  • Round 5: Self-terminated when profiling showed no further Python-level gain was possible

Hyperparameter tuning (MNIST with MobileNetV2): EPOCH diagnosed underfitting in the baseline loss trajectory and improved hold-out precision by switching from Adam to AdamW while increasing the learning rate. A more aggressive learning-rate increase then caused instability and was rejected, showing that the protocol does not simply accept monotonic parameter escalation. On retry, it switched optimizer families entirely to SGD with momentum and achieved the best final accuracy while also reducing the train-eval gap.

Prompt tuning (SST-2 sentiment classification): Using GPT-4.1-nano on a small balanced subset of SST-2, EPOCH reached perfect held-out accuracy in just three rounds -- first by adding domain framing and negation guidance to the system prompt, then by injecting a handful of few-shot examples drawn exclusively from the training set. Leakage checks passed every round.

Rule-based optimization (Iris classification): EPOCH refined a hand-crafted symbolic rule set, reached perfect held-out accuracy in round 2, then correctly rejected further training-only refinements that would have overfit the rules without improving held-out performance.

What the cross-task results reveal

The experiments surface three consistent behaviors that are hard to get from ad-hoc optimization loops:

  • Explicit state transitions -- every accepted or rejected change is logged with its rationale, making the full optimization trajectory reconstructable.
  • Rejection and retry without collapse -- the protocol handles failed rounds gracefully, as seen most clearly in the hyperparameter experiment where a bad learning rate was rejected and a different optimizer family was tried.
  • Principled self-termination -- EPOCH stops when configured criteria indicate diminishing returns, whether that is a performance ceiling (Fibonacci) or a saturated held-out metric (SST-2, Iris).

When to use it -- and when not to

EPOCH is a strong fit when you need to optimize multiple components of a production system in a reproducible, auditable way -- especially when those components span different modalities (code, prompts, configs, rules). It is also useful when you want a shared evaluation discipline enforced across an entire optimization campaign.

It is less suited as a drop-in replacement for specialized optimizers. EPOCH does not replace task-specific methods with a single optimizer; instead, it provides a shared protocol in which heterogeneous optimization tasks can be carried out and tracked consistently. If you only need to tune prompts and DSPy already fits your workflow, EPOCH adds overhead without adding value.

The experiments also use small, controlled datasets by design -- the goal was protocol observability, not benchmark competition. Teams working at scale will need to validate whether the role-separation overhead is justified for their specific throughput requirements.

The bigger picture

This design enables coordinated optimization across prompts, model configurations, code, and rule-based components while preserving stability, reproducibility, traceability, and integrity of evaluation. That combination -- coordination plus auditability -- is what separates EPOCH from a clever script.

The authors point to multi-agent coordination as the natural next step: extending EPOCH from single-target iterative optimization to multiple specialized agents operating in parallel across different subsystems, coordinated through shared evaluation checkpoints and system-level metrics. The code, configurations, and task-specific instantiations are set to be publicly released alongside the paper, which should make it straightforward to adapt the protocol to new task types by swapping role implementations while keeping the orchestration layer fixed.