Frontier: software agents, evolutionary search and self-improvement
Survey frontier systems combining software and security agents, evaluator-guided evolutionary search for algorithms, self-improving code, and automated research agents. Reproduce a miniature evolutionary search and staged repair agent and critically read frontier claims.
After this lesson you can
- Compare autonomous software agents with staged localization, repair, and validation pipelines and explain reproduction tests.
- Implement a miniature local-LLM-guided evolutionary search with a program database, islands, and sandboxed evaluator.
- Describe self-improvement and agent-design search systems and their safeguards.
- Analyze automated research and ML engineering benchmarks and what their results establish.
- Critically read a recent agent paper for budget, baselines, contamination, and checker validity.
Before you start
- 23Code as action spaceError compounding over long horizonsExecution-feedback repairExecution sandboxAgent benchmark anatomyTask-completion time horizonAgentic benchmark validitySkill libraryMulti-turn agentic reinforcement learning
- 10Genetic algorithmHill climbingSymbolic executionConcolic execution
- 31Critical reading checklistExperiment plan
- 30Dangerous capability evaluationAI risk management frameworks
The whole system is the unit of evaluation
An agent repairing software combines model, tools, search, state, and verifier. A result does not belong solely to model weights: it also depends on inference budget, interface, available information, and test quality. Compare systems with explicit budgets and tasks before attributing a difference to one component.
Software engineering agents can explore a repository, edit code, and run tests iteratively. SWE-agent studies how an agent-designed interface affects that interaction. Agentless organizes repair in stages from localization through patch generation and selection. A useful reproduction test fails before the patch for the issue’s cause and passes afterward; a defective test may accept an incorrect repair. Regression tests detect some collateral damage, not all.
Localizing first restricts where to search and allows comparison of multiple patches at one location. It also introduces a dependency: if the correct file is omitted, a generator restricted to the list cannot repair it. An autonomous agent can explore again after a failed test, while paying for more calls and potentially modifying more state. A useful comparison counts all localization, generation, and review calls as well as tests each system runs. Token budget, initial information, and execution time should be comparable; a win with ten proposals against one does not isolate architecture.
Where repair can fail
An issue contains a symptom and sometimes reproduction instructions. Localization links text to files and functions; generation proposes a change; validation asks whether it corrects behavior without visible damage. Each stage can fail differently. The correct file may be absent from candidates, a patch may change the wrong condition, and an incomplete test may approve a defective result. Recording only the final label does not reveal where repair opportunity was lost.
A visible test result informs the searching system. Repeatedly querying it can adapt a patch to that particular set. Held-out tests should run after selection and outside the candidate’s control to measure behavior not used as feedback. Even then passing those cases does not prove absence of every failure. Reviewing the proposed diff and repository effects provides complementary evidence, particularly when a repair avoids the symptom without fixing the cause.
Voting among proposals has no automatic guarantee either. If candidates are copies or share an error induced by the same prompt, agreement is not independent correctness evidence. Conversely, different implementations can express the same valid solution and split the vote. This lesson’s prototype votes for identical code because the rule is easy to reproduce, but it must be reported as a specific heuristic. The independent later checker must not reduce its criterion to which proposal was most frequent.
To compare an interactive agent with a staged pipeline, fix the same tasks, initial access, and success criteria. Then choose which resources to match: token cap, call count, time, or cost. These are not interchangeable. Search using few tokens but running hundreds of tests may cost more compute time; another that stops early may spend less than its cap. Present success against observed cost and state where budget was exhausted. Count localization, summaries, and selection too, not just code-writing calls.
In the staged prototype, BM25 ranks names and content, the model selects a file from candidates, three proposals are generated, and two visible tests filter before voting on identical code. The local runner calls the server and lesson 14 sandbox. It uses ten synthetic functions from the prior benchmark and adds distractor files; that environment allows writing only calc.py. The strengthened final checker verifies polynomial identity within its limited grammar. Passing two visible tests can retain a wrong solution, and voting does not create an oracle.
The paired comparator gives both methods the same token cap and up to four calls; CodeAct uses a persistent isolated session per task. The analyzer requires all ten pairs, reports costs and transitions, and resamples tasks for a success difference. A common cap does not equalize observed spending, and all ten functions share one synthetic family. This is a small-scale Agentless-inspired test: it uses neither the same dataset nor its implementation. Version 2 of the original paper reports 96 repairs out of 300 under its SWE-bench Lite setup; that is not a lab result or a target directly comparable to ten toy tasks.
The local run used Qwen2.5-7B-Instruct Q4_K_M on CPU without repacking weights and the same 4096-token cap per method. Both solved 10/10 functions according to the checker; paired success difference was zero and per-task bootstrap gave [0, 0] on this sample. That interval reflects agreement in all ten pairs, not certainty about other repositories. The pipeline averaged 398.2 tokens and four calls per task; CodeAct, 114.3 tokens and one call. Mean times were 19.17 and 8.85 seconds on a shared machine, without establishing causality. The full analysis retains costs and the reproduction report explains differences from the paper.
Autonomous security agents can support locating, confirming, and repairing flaws in an authorized environment. Confirmation in this lesson uses toy examples and harmless tests, not third-party systems. The AIxCC review analyzes architectures and lessons from a vulnerability-repair competition; its setting and criteria do not automatically extrapolate to production.
Search for programs with an evaluator
Language-model-guided evolutionary search retains candidate programs and scores, selects some as context, proposes variants, and evaluates them. FunSearch combines generation and automatic evaluation; AlphaEvolve explores the same general space of proposals and evaluation. The model proposes, but evaluator and search budget determine what is retained. If the evaluator accepts a shortcut, search can optimize it instead of solving the problem.
Islands maintain separate populations to preserve diversity; periodic migration or resets change exploration. Selection with temperature can give a program with score weight proportional to . Subtracting the maximum prevents overflow without changing probabilities. An archive with many proposals tested on the same set can overfit even if every score is computed correctly: hold out validation instances, record all attempts, and compare with a classical heuristic under the same protocol.
A concrete iteration has four pieces. First choose an island and retrieve evaluated programs; then build a prompt containing some and a specification of the expected function. The model proposes a variant. The host checks that it belongs to the accepted language and a separate evaluator computes its score; only then is it inserted into the archive. Selection can be greedy or stochastic. Low temperature concentrates choices on highest scores, while higher temperature gives weaker candidates more probability, though actual diversity also depends on what variants the model can produce.
The program archive is part of experimental state. To repeat a continuation retain candidates, scores, assigned island, insertion order, and random generator state. Resetting an island with another’s best program can preserve a strong solution but reduces diversity if done too frequently. Fix reset policy, ties, and prompt example selection before interpreting the curve. Improvement after simultaneously changing model, evaluator, and proposal count does not identify which change caused it.
The packing evaluator must respect the problem’s online nature. The heuristic sees the current item and free spaces, not future sizes. Accidentally providing the full sequence would allow privileged information and make comparison with first-fit or best-fit unfair. Bins without enough capacity are not candidates even if the expression assigns a high score. If none is feasible, the system opens a new bin and updates free space.
A numeric score defines preference order; it is not directly the number of bins. Different expressions can induce exactly the same order on all observed decisions and therefore the same solution. Outcome evaluation can treat them as equivalent on that set, but does not prove equivalence on other sequences. When inspecting a winner, compare its decisions with the reference heuristic and check whether anything changed beyond score scale.
At positive temperature all finite-score candidates receive positive probability in the given formula, but that does not imply all are selected in a finite run. At very low temperature score differences dominate; as it rises weights approach each other. Subtracting the maximum avoids huge exponentials, though very negative values can numerically round to zero. If multiple programs are selected without replacement, later probabilities must be recomputed over those remaining. Tie-breaking also affects history and must be recorded.
The best observed score is a selection statistic: among many proposals one may benefit from evaluation-sample noise. Measuring the winner on held-out instances helps estimate performance outside those used to select it. If those instances are queried after each proposal and search changes based on results, they cease to be held-out validation. Compare with a baseline on the same instances, arrival order, and scoring criterion. Invalid candidates and timeouts also consume budget and belong in accounting.
In online packing, items arrive in a given order and must enter a bin with available capacity or open a new one. Best-fit places an item where it leaves least free space among feasible bins. This lab’s evaluator lets a numeric expression prioritize each bin without access to future items. Testing hundreds of expressions on the same sequences also selects those lucky on those sequences. Held-out validation estimates transfer to another sample from the same distribution; studying other distributions requires different sizes, orders, and capacities. Search failing to beat best-fit is informative too if budget and tests are recorded.
The local lab starts with a program database, packing evaluator, and evolution loop. The latter asks the model for an arithmetic expression, evaluates it in lesson 14’s sandbox, and inserts valid proposals into an island. By default the prompt contains the two best programs; an optional mode selects by temperature. The validation seed stays held out until candidate selection. The expression is interpreted using a limited AST without direct execution, and each step’s outputs are saved for audit. The language permits only item, remaining, constants, and elementary arithmetic; the evaluator uses synthetic sequences and the sandbox needs no network or external tools.
Five real searches ran Qwen2.5-7B-Instruct Q4_K_M on CPU without repacking, with 40 proposals per condition, two or four islands, and weighted or top-two selection. All five use the same seeds and 20 training sequences; the final candidate was evaluated on another 20 held-out sequences. Of 200 proposals, 111 produced valid scores. In all five searches the best retained candidate was seed -remaining: mean 55.25 bins in training and 55.30 in validation, equal to the best-fit baseline. No improvement over that baseline was observed. The manifest fixes conditions and analysis retains all 200 steps and curves.
Distinct valid expressions shown in the figure are different proposals observed up to the selected step, not program count across islands. All five searches use the same seeds, so the comparison neither estimates seed variation nor proves one selection pressure superior on other problems. Validation measures only other sequences from the same distribution; baseline -remaining was already among initial programs.
Before searching, fix a baseline. The next cell compares first-fit and best-fit on 20 sequences of 100 items per split. Sizes use distinct seeds and values between 0.01 and 0.99; arrival order is unchanged. On these instances best-fit uses mean 55.25 training bins and 55.30 validation bins, versus 55.90 and 55.75 for first-fit. These are simulation data, not proof of universal superiority or the result of model search.
from random import Random
def instancias(seed):
rng = Random(seed)
return [[rng.randint(1, 99)/100 for _ in range(100)] for _ in range(20)]
def empaquetar(items, mejor):
libres = []
for item in items:
posibles = [i for i, espacio in enumerate(libres) if item <= espacio + 1e-12]
if not posibles:
libres.append(1 - item)
else:
elegido = min(posibles, key=lambda i: libres[i]) if mejor else posibles[0]
libres[elegido] -= item
return len(libres)
for nombre, seed in [('entrenamiento', 3101), ('validación', 3102)]:
datos = instancias(seed)
print(nombre, 'mejor ajuste:', sum(empaquetar(x, True) for x in datos)/len(datos),
'primer ajuste:', sum(empaquetar(x, False) for x in datos)/len(datos))Agent self-improvement can search for modifications to the system itself or its organization. ADAS and Darwin Gödel Machine explore families of designs and modifications. Retain an independent evaluator copy, separate selection and evaluation data, and limit candidate permissions: allowing it to modify its own scoring criterion destroys interpretability.
What research benchmarks measure
Automated research agents can propose experiments, program them, and write reports. AI Scientist, PaperBench, MLE-bench, and RE-Bench pose different tasks and criteria. Reproducing a paper rubric, obtaining a competition score, and completing engineering research are not the same capability. Interpret a result by asking about models, tools, code and data access, cost, contamination, rubric, and failure review.
A reproduction may satisfy some rubric items without reproducing a paper’s complete conclusion. A competition can score predictions on a held-out set without assessing later system utility. A research task can admit many correct paths and thus need richer judgment than one binary test. Resource access changes what is measured: original code, external models, GPU time, or human assistance may be reasonable but must appear in comparison. If another model evaluates, examine agreement with expert review and disagreements; judge speed does not turn its labels into truth.
A useful rubric separates testable claims. If a paper claims a method beats a baseline on a set under a specific budget, reproduction must identify data, split, metric, baseline configuration, and seed treatment. It may also require sensitivity analysis or a specific figure. Reproducing a graph’s shape with invented values does not reproduce results; a reduced experiment can inform if its scale and differences are explained. Rubric points do not replace judgment of whether the experiment addresses the main claim.
A reviewable report includes failed attempts, dependencies, versions, and time spent as well as the selected result. If a run fails from lack of memory or unavailable data, that failure is not a zero score for the method. Similarly, a cell run with a simulated model checks wiring but does not prove a real model completes the task. This separation allows work to continue without turning an infrastructure test into a scientific result.
The evaluation unit matters too. An agent solving a task after a hundred proposals differs from one proposal succeeding first try. To evaluate the whole system, count all proposals, tools, and time until result selection. To study individual proposal quality, retain a sample of candidates before filtering. Both questions are useful but have different denominators and costs. If only the best candidate is published, one cannot reconstruct how many alternatives were needed to find it.
A reproducible run does not require every repetition to produce exactly the same text on every platform, but another person must be able to reconstruct conditions and check main artifacts. The log should identify inputs, sampling policy, stopping criteria, and actually available resources. If the system uses a response from an unversioned external service, that dependency may prevent identical repetition and should inform interpretation.
In a one-page report, separate the paper’s claim, local protocol, and observations. Present a difference between systems alongside its interval and both costs; then list model, data, and tool changes relative to the paper. If a condition could not run, declare it pending. These distinctions make a reduced result useful without suggesting it reproduces a figure obtained with another set or budget.
Baselines should run on the same inputs with a selection rule declared before seeing results. If a strategy benefits from extra information or attempts, that difference is part of the condition and must be counted. Retaining each proposal and its costs allows later review of what contributed to the final result and which attempts did not solve the task.
Horizon and recovery
If errors arrive as a Poisson process at constant rate per minute and each error is independently recovered with probability , unrecovered errors form a process with rate . If any unrecovered error prevents task completion and recovery takes no time, success probability is
Without recovery, ; for the ratio is . With this model has no finite horizon. Constant rate is not a law of agents: correlated errors, recovery costs, and difficulty changes alter results. The empirical time horizon requires documented tasks and human durations.
The calculation uses thinning: each Poisson error is independently retained as unrecovered with probability . Success requires zero retained events before , with probability given by the exponential above. If recovery adds time, exposure to errors rises and merely replacing the rate by no longer suffices. If one failure changes state and makes others more likely, independence also fails. The ratio illustrates a useful reasoning assumption, not a measured prediction of real-agent improvement.
A constant rate also ignores stages of different difficulty. An agent might perform many routine actions with few errors and concentrate failures in a complex integration operation. Measuring total time alone then dilutes information about when problems arise. Long-task traces permit study of events, recovery attempts, and outcomes, but recording a retry is insufficient to claim task recovery: inspect subsequent state and final goal.
p_correcto, p_acepta_correcto, p_acepta_incorrecto = .08, .95, .1
p_ca = p_correcto * p_acepta_correcto
p_ia = (1 - p_correcto) * p_acepta_incorrecto
al_menos_un_correcto = 1 - (1 - p_ca)**10
precision_si_hay_aceptado = p_ca / (p_ca + p_ia)
p_hay_aceptado = 1 - (1 - p_ca - p_ia)**10
print('al menos un correcto aceptado:', round(al_menos_un_correcto, 6))
print('precisión condicionada a que haya aceptados:', round(precision_si_hay_aceptado, 6))
print('éxito si ausencia de aceptados cuenta como fallo:', round(p_hay_aceptado * precision_si_hay_aceptado, 6))Exercises
Step 1 of 3. What is the rate of unrecovered errors?
class ProgramDatabase:
def __init__(self, n, seed=0):
pass
def insert(self, i, source, score):
pass
def select_two(self, i, temperature):
pass
def reset_worst(self):
pass