Home › Blog › The Maestro · Part 1
The Maestro · Part 1 · Phase 0 · 🔬 Researcher hat

Finding the Moat in a Self-Improving (L4) Model

This series follows one person, Gopala, from an idea to a working AI factory and the products that run on it. He wears every hat in turn: researcher, founder, infrastructure engineer, ML engineer, evaluator, safety lead, operator. It starts here, with the least glamorous and most important part: deciding what to build and why anyone would pay for it instead of using a model from a big lab. In three weeks of reading, sketching and coding, Gopala places his idea on the ladder of self-improving AI, picks level L4, writes hypotheses that could prove him wrong, and runs a first experiment that fails before a second one works.

FL
FrontierAGI Team
🔬 Researcher🧭 Strategist💻 Coder
⚠️ How to read this series Gopala and his company are a teaching scenario, not a real start-up; the plan is set at a realistic start-up scale (a few thousand GPUs at most, rented before owned) and kept global for now. Facts about published research, products and prices are sourced and dated; figures marked ⚠️ are secondary or vendor-reported; budgets, timelines and calculators are our models. All code runs: the experiment in this part runs in under ten seconds on a laptop with plain Python, and its printed output below is real. No single person can physically do everything an AI factory needs, so every part has a delegation box stating what Gopala does himself, what AI agents do, and what he buys or rents. Disclosure: Claude, made by Anthropic, helps write this site.
New to AI?Start with the 2-minute primer (seven short animations: tokens, models, GPUs, training, why 1,024 GPUs, serving, the AI factory) and the live system map of every layer in this series.

1. Meet the Maestro

Every hat Gopala wears

🔬 ResearcherThe L4 idea, experiments, kill criteria (Parts 1–2)
💼 FounderMoney, partners, investors (Part 3)
🏗️ InfrastructureGPUs, power, bring-up, cluster software (Parts 4–7)
🧠 ML engineerData, architecture, pre- and post-training (Parts 8–11)
📏 Evaluator · 🛡️ Safety leadEvals, safety layers, approvals (Parts 12–14)
🔄 Operator · productServing, agents, operations (Parts 15–18)

One person, six hats, 18 parts. The series follows the order the hats are needed.

Phase 0 · The ideaResearcher and founder hats: the moat, small proofs, the plan and the money (Parts 1–3).
Phase 1 · Securing the machineInfrastructure hat: compute, site and power, bring-up, cluster software (Parts 4–7).
Phase 2 · Building the modelML engineer hat: data, architecture, pre-training, post-training and the self-improvement loop (Parts 8–11).
Phase 3 · Proving itEvaluator and safety hats: evaluation, safety layers, approvals (Parts 12–14).
Phase 4 · ShippingProduct and operator hats: serving, agents and client products, operations, the scorecard (Parts 15–18).

2. Mission log: weeks 1–3

Week 1 · Reading
  • Day 1–2: pulls every L3–L5 paper from the RSI map's catalog for 2024–2026 into a reading list; asks a research agent to summarise each in a fixed template (claim, evidence, compute, what is frozen, what changes).
  • Day 3–4: reads the dozen that matter in full, not the summaries: STaR, Reflexion, Voyager, Self-Rewarding Language Models, the Darwin Gödel Machine, AlphaEvolve, DreamCoder.
  • Day 5: writes a one-page "what everyone freezes" table (section 4). The pattern jumps out: almost every system keeps the foundation model frozen and improves something around it.
Week 2 · Choosing
  • Places five candidate ideas on the L1–L5 ladder; rejects two L5 ideas as too hard to make safe and too hard to sell; rejects one L2 idea as easy to copy.
  • Chooses an L4 idea: a model whose deployment produces verified skills that are kept, and periodically folded back into the weights, under a fixed, human-approved gate.
  • Writes the moat argument and asks two friends who run start-ups to attack it (section 6).
Week 3 · Testing
  • Writes falsifiable hypotheses and kill criteria (section 7).
  • Codes a toy version of the loop in an afternoon. It makes things worse (section 8). Spends two days understanding why.
  • Second version works (section 9). Writes up the result honestly, including the failure, and moves on to proving it with real models (Part 2).

3. The self-improvement ladder

Where does the idea sit?

Tap a level. Definitions from the catalog behind our RSI map; the start-up notes are our reading.

4. Reading the field

WorkWhat improvesWhat stays frozenHow "better" is decidedLesson for the idea
STaR (Zelikman et al., 2022)Model weights, by fine-tuning on its own rationales that reached correct answersThe training recipeGround-truth answersVerified self-generated data can improve weights
Reflexion (Shinn et al., 2023)A memory of written self-reflectionsModel weightsTask feedbackMemory alone helps, but it is per-task and fragile
Voyager (Wang et al., 2023)A library of executable code skills in MinecraftModel weightsThe skill runs and succeeds in the gameCode skills are verifiable and reusable: the closest ancestor
DreamCoder (Ellis et al., 2021)A library of abstractions for program synthesisThe learning algorithmSolving tasks more compactlyStore the reusable core, not whole solutions (we relearn this in section 8)
Self-Rewarding LMs (Yuan et al., 2024)Model weights, via preferences the model judges itselfThe procedureThe model's own judgementsPowerful but risky: the judge and the student are the same model
Darwin Gödel Machine (Zhang et al., 2025)The agent's own code, evolved as an archiveThe foundation modelsBenchmark scores (SWE-bench 20.0% → 50.0%, Polyglot 14.2% → 30.7%, reported)Empirical validation replaces proofs; run in sandboxes with human oversight
AlphaEvolve (Google DeepMind, 2025)Algorithms and code, via evolutionary search with LLMsThe models and evaluatorsAutomatic evaluatorsValue comes where results can be checked by machine; DeepMind reports a scheduling heuristic that recovers about 0.7% of Google's fleet-wide compute ⚠️

5. The idea: a verified-skill flywheel

The verified-skill flywheel

🧩AttemptModel tries a task, retrieving stored skills first
✅VerifyHidden tests, no-regression check
📚CurateKeep only abstracted, verified skill cores
🚦GateFixed, human-controlled sign-off
⚙️UpdateWeights updated only after the gate

The loop closes back to Attempt. The gate is fixed and owned by a human; the model cannot change it.

The loop Gopala wants to own

Press play. Each lap, verified work becomes skills; at fixed intervals the best skills are folded into the next model, but only through the gate. Our diagram.

Press play.

6. Is it a moat?

Moat scorecard

Our framework. 1 = weak, 5 = strong.

For: proprietary verified dataEvery client task produces data nobody else has: real problems with machine-checked solutions. It compounds with usage.
For: trust and auditabilityThe skill library is inspectable and the gate is documented, which matters to regulated clients more than a few benchmark points.
Against: big labs can do this tooEvery frontier lab runs reinforcement learning on verifiable tasks. Gopala's edge must be focus, client data and the gate, not the technique.
Against: open models keep improvingA cheaper open model plus someone else's skill library may be good enough. Owning a model must earn its cost (Part 3 tests this).

7. Hypotheses and kill criteria

H1 · Skills transfer. With the same compute per task, retrieving verified skills raises the success rate on new, held-out tasks from the same domain.
Kill if: no gain on held-out tasks after the library holds 1,000 skills, or gains only on tasks near-identical to stored ones.
H2 · Folding skills into weights beats generic data. Fine-tuning on verified skills improves held-out success more than the same amount of compute spent on generic high-quality code data.
Kill if: no difference, or regressions on general benchmarks that the gate cannot prevent.
H3 · The gate catches bad changes. A fixed acceptance rule (hidden tests, no regression on a validation set, human sign-off for weight updates) rejects skills and model versions that would make things worse.
Kill if: injected bad skills (overfit, reward-hacked or unsafe) get past the gate more than rarely in red-team tests.

8. Experiment 1: it fails

The full script is in the next section; this is the line that compares the variants, with a fixed random seed:

off r0:16/40( 0) r1:12/40( 0) r2:14/40( 0) r3:12/40( 0) r4:14/40( 0) r5:16/40( 0) hoard r0:14/40(13) r1:10/40(17) r2: 5/40(20) r3:14/40(29) r4: 7/40(31) r5:15/40(40) format: round:solved-on-hidden-tests(skills in library)

Two days of digging find two reasons, both of which matter for the real system:

Whole solutions are not skillsA stored solution includes the task-specific first and last steps. It only helps on that exact task. The reusable part is the shared core in the middle.
More options dilute the searchEvery new vocabulary item makes each random guess less likely to hit. Without retrieval, a bigger library is a bigger haystack. Real models suffer the same way when too many tools or memories are put in context (Agent Layer Part 6).

9. Experiment 2: it works

Experiment results: average tasks solved (of 40, hidden tests)

Off (no skills)14.0
Hoard every skill10.8
Curate verified skills20.8

Real output of l4_toy.py, averaged over six rounds. Hoarding hurts; curating helps.

l4_toy.py · Python 3, no dependencies · ~7 s
"""l4_toy.py — a toy L4 (deployment-adaptation) loop you can run on a laptop.

A solver searches for small programs that match a task's examples. Verified
solutions become reusable skills, kept only if a fixed, human-written gate
approves them. Two versions are compared at the SAME search budget per task:
  v1 "hoard":  every verified solution is added to the search vocabulary
  v2 "curate": abstract the reusable core, retrieve the top skills, try them first
Pure Python 3, no dependencies. Run:  python3 l4_toy.py
"""
import random

PRIMS = {
    "add1": lambda x: x + 1, "add3": lambda x: x + 3, "sub2": lambda x: x - 2,
    "dbl": lambda x: 2 * x, "tri": lambda x: 3 * x, "sq": lambda x: x * x,
    "neg": lambda x: -x, "half": lambda x: x // 2, "mod7": lambda x: x % 7,
}
CORES = [["dbl", "add3"], ["sq", "sub2"], ["tri", "mod7"], ["neg", "half"], ["add1", "sq", "dbl"]]
PROBE = list(range(-9, 10))


def run(prog, x):
    for op in prog:
        x = PRIMS[op](x)
        if abs(x) > 10**9:
            raise OverflowError
    return x


def passes(prog, pairs):
    try:
        return all(run(prog, x) == y for x, y in pairs)
    except OverflowError:
        return False


def make_task(rng):
    """Tasks share hidden sub-routines: a random op, a shared core, a random op."""
    core = rng.choice(CORES)
    pre, post = rng.sample(list(PRIMS), 2)
    target = [pre] + core + [post]
    xs = rng.sample(PROBE, 8)
    pairs = [(x, run(target, x)) for x in xs]
    return {"visible": pairs[:4], "hidden": pairs[4:]}


class Agent:
    def __init__(self, mode, seed):
        self.mode, self.rng, self.skills, self.uses = mode, random.Random(seed), [], {}

    # ── the solver: a fixed budget of candidate programs per task ────────────
    def solve(self, task, budget=3000):
        tried = 0
        if self.mode == "curate" and self.skills:          # retrieval: best skills first
            top = sorted(self.skills, key=lambda s: -self.uses.get(tuple(s), 0))[:8]
            wraps = [[]] + [[p] for p in PRIMS]
            for sk in top:
                for pre in wraps:
                    for post in wraps:
                        prog = pre + sk + post
                        tried += 1
                        if passes(prog, task["visible"]):
                            self.uses[tuple(sk)] = self.uses.get(tuple(sk), 0) + 1
                            return prog
                        if tried >= budget:
                            return None
        vocab = [[p] for p in PRIMS] + (self.skills if self.mode == "hoard" else [])
        while tried < budget:                               # blind search for the rest
            prog = [op for _ in range(self.rng.randint(1, 5)) for op in self.rng.choice(vocab)]
            tried += 1
            if passes(prog, task["visible"]):
                return prog
        return None

    # ── the gate: a fixed improvement process that never rewrites itself ─────
    def gate(self, prog, task, validation):
        if not passes(prog, task["hidden"]):
            return False                                    # overfit to visible examples
        cand = prog[1:-1] if (self.mode == "curate" and len(prog) >= 4) else prog
        sig = tuple(run(cand, x) for x in PROBE) if len(cand) >= 2 else None
        if sig is None or any(tuple(run(s, x) for x in PROBE) == sig for s in self.skills):
            return False                                    # trivial or a duplicate
        before = self.score(validation)
        self.skills.append(cand)
        if self.score(validation) < before:                 # must not make things worse
            self.skills.pop()
            return False
        return True

    def score(self, validation):
        state = self.rng.getstate()
        n = sum(self.solve(v, budget=800) is not None for v in validation)
        self.rng.setstate(state)
        return n


def experiment(mode, rounds=6, per_round=40, seed=1):
    data = random.Random(seed)
    validation = [make_task(data) for _ in range(12)]
    agent, rows = Agent(mode, seed), []
    for r in range(rounds):
        tasks = [make_task(data) for _ in range(per_round)]
        solved = 0
        for t in tasks:
            prog = agent.solve(t)
            if prog and passes(prog, t["hidden"]):
                solved += 1
            if prog and mode != "off":
                agent.gate(prog, t, validation)
        rows.append((r, solved, len(agent.skills)))
    return rows


if __name__ == "__main__":
    for mode in ("off", "hoard", "curate"):
        rows = experiment(mode)
        print(f"{mode:7s}", " ".join(f"r{r}:{s:2d}/40({k:2d})" for r, s, k in rows))
    print("format: round:solved-on-hidden-tests(skills in library)")
$ python3 l4_toy.py off r0:16/40( 0) r1:12/40( 0) r2:14/40( 0) r3:12/40( 0) r4:14/40( 0) r5:16/40( 0) hoard r0:14/40(13) r1:10/40(17) r2: 5/40(20) r3:14/40(29) r4: 7/40(31) r5:15/40(40) curate r0:20/40( 9) r1:22/40(12) r2:22/40(17) r3:20/40(19) r4:22/40(21) r5:19/40(23) format: round:solved-on-hidden-tests(skills in library)

Tasks solved per round, same budget

The real output above, charted. Each round is 40 new tasks; solved means correct on hidden tests.

10. The gate is the product

What the gate checks before any weight update

🙈Hidden testsTests the loop never saw
↩️No regressionOld skills still pass
🔍Red-team probeLooks for gaming of tests
🧑‍⚖️Human sign-offNamed person approves

If any check says no, the update does not happen. Default answer: no.

Its checks, in the order they will run:

CheckToy versionReal version (Phases 2–4)
VerifiedPasses hidden testsPasses hidden tests, static analysis and a sandboxed run; reviewed by an LLM judge for intent, with human spot checks (Evaluation Layer Part 3)
ReusableAbstracted core, not a duplicateGeneralised, documented, deduplicated by behaviour; applicability conditions stored
No regressionValidation score does not dropFull evaluation suite per skill batch and per model version; contamination checks (Part 2)
Safe(not modelled)No secrets, no network calls outside allowlists, no destructive operations; red-team probes for reward hacking (Agent Layer Part 8)
ApprovedAutomaticSkills: automatic within policy. Weight updates: human sign-off, logged, reversible

11. Safety from day one

Gopala writes his safety principles before writing the product, so every later design choice has to satisfy them:

The process is fixedThe loop can change skills and, through the gate, weights. It can never change the gate, the evaluations or its own objectives.
Checks are external"Better" is decided by tests and evaluations the model does not write and cannot see in full, never by the model judging itself alone.
Everything is sandboxedAll task execution in isolated, network-restricted sandboxes (Agent Layer Part 2).
Humans hold the switchWeight updates need human approval; any skill or version can be rolled back; tripwires pause the loop automatically.
Everything is loggedEvery skill's origin, tests and uses are traceable, so a bad behaviour can be traced to its source.

12. The 90-day research plan

The 90-day research plan

📖Weeks 1–3Read the field, write hypotheses and kill criteria
🧪Weeks 4–8Small proofs: trainer, scaling ladder, H1 and H2
💰Weeks 6–10Plan, budget, raise
🚦Month 3Gate G1: go or stop

From Part 1. Each step ends with a decision, not a report.

WeeksGoalOutputDecision at the end
1–3Choose and frame the idea (this part)Hypotheses, toy result, safety principlesProceed to real models? Yes
4–8Prove it small with real models (Part 2)H1 and early H2 on 100M–1B-parameter models and an open 7–8B model; scaling-law fitsDoes the effect survive with real models and grow with scale?
6–10Plan and fund (Part 3)Compute budget, build-versus-rent, from-scratch versus post-train decision, investor memoRaise and commit to a training run, or pivot to post-training an open model
8–12Design partnersTwo to three companies providing real, verifiable tasks under contractIs there demand at a price that pays for compute?

13. Delegation box

🙋 Gopala himself
  • Reading the key papers in full
  • Choosing the level and the domain
  • Writing hypotheses, kill criteria and safety principles
  • Writing the gate
🤖 AI agents
  • First-pass summaries of ~150 papers in a fixed template
  • Boilerplate code and plots for the toy
  • Red-teaming the moat argument
🤝 Bought, rented or borrowed
  • Two founder friends as critics
  • API credits for the research agent
  • Nothing else yet: Phase 0 runs on a laptop

14. Budget and risk tracker

ItemStatus after Part 1Note
Spend to date~$300 (our estimate)API credits for literature summaries; laptop only
Time3 of ~78 weeksPlan horizon ~18 months to first products at scale
Technical risk: does L4 work?Toy says the shape is rightUnproven with real models (Part 2)
Market risk: will clients share tasks?UntestedDesign partners in weeks 8–12
Competition risk: big labsHighMoat must be data and gate, not technique
Safety risk: loop driftPrinciples writtenGate and tripwires to be built and red-teamed
Capital risk: from scratch vs post-trainOpen questionDecided with numbers in Part 3

15. The series

The Maestro: 18 parts in five phases

Verdict
  • Gopala's idea is an L4 system: a model that keeps machine-verified skills from real work and folds the best of them back into its weights, under a fixed gate that people control.
    • The technique is not the moat; the verified data and the gate are.
    • A laptop toy shows both the trap (hoarding memories makes things worse) and the fix (abstract, retrieve, gate).
    • The next step is to see whether the effect survives with real models and grows with scale: Part 2, proving it small.

16. Reading the numbers

Primary (papers)
STaR (arXiv 2203.14465); Reflexion (2303.11366); Voyager (2305.16291); Self-Rewarding Language Models (2401.10020); Darwin Gödel Machine (2505.22954): SWE-bench 20.0% → 50.0%, Polyglot 14.2% → 30.7%; DreamCoder (PLDI 2021). L1–L5 definitions from the Awesome-RSI catalog (CC0) used by our RSI map.
Company-reported ⚠️
AlphaEvolve's ~0.7% fleet-wide compute recovery (Google DeepMind).
Our work
The scenario, plan, budget, moat scorecard and flywheel diagram. The toy experiment and its output are real and reproducible with the script above (one seed; treat as illustration, not evidence about real models).