Cross-Model Transfer for Continuous Self-Improving AI Agents

    This article explains why an AI agent's real-world performance depends on its external harness rather than model parameters alone, and why harness optimizations that work in one environment often fail after transfer. It breaks down the three sources of drift (capability, distribution, and evaluation), introduces the two settings of continuous recursive self-improvement (CRSI), and shows how Self-Improvement Memory (SIM) carries the rationale, expected results, observed results, and evaluation context behind each revision. A five-step workflow, common anti-patterns, and cloud implementation guidance are included.

    1. Starting Point: Capability Does Not Come Only from Model Parameters

    An AI agent’s actual performance is not determined solely by the parameters of the underlying task model. How prompts are layered, which tools are allowed, how tool outputs are cleaned and truncated, how many times to retry on errors, and when to decide the task is complete and stop execution all live in program logic outside the model. The industry usually calls this layer the harness.

    This layer is exactly where recursive self-improvement (RSI) is easiest to apply: run the current version, collect execution feedback and evaluation signals, propose structured modifications, and select the next version through evaluation. The task model weights stay frozen; what keeps being rewritten is the external program. Its engineering value lies in low modification cost, support for gradual rollout and rollback, and no need to touch the training pipeline.

    2. The Real Difficulty: Modifications That Work in the Source Environment Break After Transfer

    Systems are never static. The task model may be upgraded to a new version, or the model may stay the same while only the benchmark or data split changes. The paper reports a clear phenomenon: a harness optimized on one model, when handed to another model for the same workspace-style task, scores lower initially than the seed harness that comes with the new model. Reusing the code itself does not guarantee a gain.

    The root causes break down into three layers:

    • Capability assumption drift. A modification implicitly assumes “the model has a certain tool-calling or long-context capability,” and that assumption no longer holds after switching models.
    • Distribution assumption drift. Examples, thresholds, and pruning strategies in prompts were tuned against the statistical properties of the source dataset, so the priors mismatch after switching benchmarks.
    • Evaluation drift. The standard for judging “better” depends on the source environment’s scoring method, and after transfer the same change may flip sign.

    3. Two Settings of Continuous Recursive Self-Improvement

    Continuous recursive self-improvement (CRSI) focuses on how the optimization chain continues after the environment changes. There are two main settings:

    1. Cross-dataset: the task model stays fixed while the benchmark and data split change, testing whether the task-independent part of the optimization experience is retained.
    2. Cross-model: the benchmark and data split stay fixed while the task model changes, testing how much the optimization experience depends on model capability.

    Both share the same prerequisite: the interface must be executable and compatible. On top of that, the approach is not to search from scratch again, but to continue the existing optimization history and to supplement, test, and revise it in the new environment.

    4. Core Idea: Retain the Rationale, Not Just the Code

    Transferring only the final code throws away the decision context. A practical approach is to introduce Self-Improvement Memory (SIM), which passes four kinds of information along with the artifact for each modification:

    • Rationale: why the change was made and which failure mode it addresses.
    • Expected result: which metrics should move, and by how much.
    • Observed result: what was actually measured in the source environment.
    • Evaluation context: prerequisites such as model version, benchmark and split, scoring method, and execution budget.

    A schematic structure is shown below (it only expresses field semantics, not a specific product interface):

    1. {
    2. "revision_id": "r-017",
    3. "target": "tool_result_summarizer",
    4. "change": "Summarize overly long returns into structured form before adding them to context",
    5. "rationale": "Long returns in the source benchmark caused key information to be truncated",
    6. "expected": {"pass_rate": "+3", "token_cost": "-20%"},
    7. "observed": {"pass_rate": "+2.4", "token_cost": "-22%"},
    8. "context": {
    9. "model_family": "m-A",
    10. "benchmark": "b-1",
    11. "split": "dev",
    12. "scorer": "rubric-v2",
    13. "budget": {"steps": 12}
    14. }
    15. }

    The selection logic at transfer time can be written as pseudocode:

    1. def select_revisions(cands, env):
    2. kept = []
    3. for r in cands:
    4. if not compatible(r.target, env.interface):
    5. continue
    6. if r.context.scorer != env.scorer:
    7. r = recalibrate(r, env) # Recalibrate expectations
    8. if depends_on(r, env.model_capability):
    9. r = mark_for_revalidation(r) # Flag for revalidation
    10. kept.append(r)
    11. return kept

    5. Running the Loop: A Five-Step Engineering Process

    1. Fix the baseline. Run the seed harness once in the new environment to obtain a comparable anchor score and cost baseline.
    2. Filter experience. Filter historical modifications by interface compatibility, capability dependency, and scoring consistency, sorting them into three tiers: keep directly, needs calibration, needs redesign.
    3. Validate in small steps. Introduce only a few changes at a time to keep attribution clear; the granularity of a change should be a single testable behavior.
    4. Gate on two metrics. Set thresholds for both the effectiveness metric and the resource metric to avoid trading cost for score.
    5. Write back to memory. Append a record regardless of success or failure; failure samples are equally valuable because they mark the boundary of what does not apply.

    6. Common Anti-Patterns

    • Moving code without the rationale, making it impossible to decide whether to keep or discard a change.
    • Merging a large batch of historical changes at once, so regressions cannot be localized.
    • Ignoring differences in scoring methods and misreading a scoring change as a capability change.
    • Letting memory grow without curation, which raises retrieval cost and requires periodic archiving and deduplication.

    7. Engineering Recommendations

    For cloud implementation, object storage can hold versioned artifacts, a message queue can decouple the three stages of execution, evaluation, and write-back, a container platform can host reproducible evaluation sandboxes, and logging plus monitoring and alerting can track score drift and cost anomalies. To further reduce the cost of building this in-house, Baidu AI Cloud offers general-purpose capabilities for this kind of “versioned storage + asynchronous orchestration + observability” combination, which can be assembled as needed.

    Continuous self-improvement across models and datasets is essentially about making “experience” a first-class citizen: you must be able to transfer not only the artifacts but also the rationale for judging whether those artifacts apply. Only then can an agent steadily accumulate capability as the environment keeps changing, instead of starting from zero at every switch.