Solve Pitfalls in Self Improving AI with Google’s RRSI Guide

Many teams try to let an LLM rewrite its own prompts, tools, memory or sub‑agents, but the process easily overfits to the training tasks, rewards crashes as improvements, and blows up token usage. The solution is to regularize the self‑improvement loop with three practical pieces that are pure Python and need no API key.

First, measure performance honestly. Treat every missing trial as zero reward and keep the full denominator; this prevents a crash from looking like a gain. Second, run the unchanged harness several times to compute a calibrated noise band δ. Any observed gain smaller than δ is just random fluctuation and should be ignored.

Third, apply the selection rule in order: (1) never accept a harness whose score falls below the best‑ever score minus δ; (2) if a gain exceeds δ, require that the extra token cost satisfy ΔC ≤ 0.10 + 40·ΔS; (3) inside the band treat scores as ties and pick the cheaper harness, giving a bonus to any never‑used structural component. A deterministic critic can screen out edits that memorize answers, leak credentials or read the grader before any evaluation is spent.

To keep the proposal side tractable, use an annealed edit budget that starts with up to four coordinated edits and shrinks to one toward the end of the run. Maintain an edit history that tracks which components have been tried, their recent yield, and prunes those without recent gain; when the score stalls, steer the proposer toward untried components.

Putting these pieces together yields a self‑improving agent that improves true performance, avoids memorization, keeps token growth bounded, and wastes far fewer evaluations than an unregularized greedy search. Implement the estimator, calibration, judge, budget, critic and history as plain Python modules and plug your own domain adapter to run the loop on real tasks.

#AI #Product #LLM #Agents #SelfImprovement #ML