Cross-Model Transfer of Self-Improving Agents: Making Experience a Portable Asset
This article examines why an execution harness optimized for one model often underperforms a native seed harness after being migrated to another model, and breaks down the transfer gap into four root causes: capability distribution mismatch, context budget differences, tool-calling convention differences, and evaluation criteria differences. It then presents a layered methodology that separates a model-agnostic policy layer from a replaceable adapter layer and a unified runtime layer, along with disciplines for cross-dataset transfer, baseline matrices and regression gates for evaluation, and a practical engineering checklist. Readers will learn how to turn implicit experience into a transferable, measurable, and rollback-safe asset so that agent improvements survive migration.
1. Background: Why “Experience” Resists Reuse Across Environments
In the practice of continuous self-improvement for AI agents, a common approach is to treat the execution harness—the collection of prompt organization, tool-call orchestration, context management, and retry and validation strategies—as a reusable experience asset that can be migrated to other execution environments after optimization. In engineering practice, however, a recurring pattern appears: a harness optimized with one model, when handed to a different model to perform the same workspace tasks, starts from a lower score than the target model’s own seed harness. One example from the source material: a harness that performs well in its native environment scores only 68.41 initially after migration, while the target environment’s seed harness scores 73.89—a transfer gap of roughly 5.5 points.
This shows that experience is not naturally portable. A harness embeds a large number of implicit parameters tuned to a specific model’s decoding characteristics, context window, tool-calling style, and error distribution. Once the executing model changes, those implicit assumptions break down, and the experience turns from an asset into a liability.
2. Root Causes: Four Sources of the Transfer Gap
- Capability distribution mismatch. Models differ markedly in instruction following, long-context retrieval, and structured-output stability, so the original harness’s prompt strength and constraint granularity may be too strong or too weak.
- Context budget differences. Different context windows and effective attention lengths mean the same history-compression strategy either wastes budget or discards critical information too early in the new environment.
- Tool-calling convention differences. Parameter naming, return structures, and error-code semantics vary, so the harness’s retry and correction logic may repeatedly trigger ineffective loops.
- Evaluation criteria differences. Inconsistent scoring scripts, case distributions, and decision thresholds can make a harness that “looks better” degrade on the real distribution.
3. Methodology: Turning Experience into a Transferable Asset
The core idea is layering and abstraction: push model-coupled parts down into a replaceable adapter layer, and lift task-related parts up into a stable policy layer.
- Policy layer: task decomposition, acceptance criteria, and rollback conditions, kept model-agnostic.
- Adapter layer: prompt templates, tool schema mapping, and context-compression parameters, injected per target model.
- Runtime layer: scheduling, concurrency, timeouts, logging, and monitoring alerts, kept unified.
Illustrative configuration (pseudocode):
policy:task_split: by_workspace_moduleacceptance: {min_score: 75, max_retries: 2}adapter:target_model_profile: "long_context_structured"context_budget_ratio: 0.7tool_schema_map: "auto"runtime:timeout_ms: 120000observability: [log_service, metric_alarm]
4. Cross-Dataset Transfer: Avoiding Overfitting to the Old Distribution
The main risk in cross-dataset transfer is overfitting of experience. Three disciplines are recommended:
- Data isolation: keep the optimization set, validation set, and holdout set strictly separate, with the holdout set excluded from any tuning.
- Distribution alignment: apply stratified sampling to new data sources and monitor drift in task type, difficulty, and input length.
- Minimal-change principle: change only one adapter parameter at a time, record the score change, and build a traceable causal chain.
5. Evaluation and Regression Protection: Making Improvements Measurable and Reversible
- Build a baseline matrix: compare native harness, target seed harness, and migrated harness in three columns to avoid misjudgment from single-point comparison.
- Add a regression gate: automatically block release when the migrated score falls below the seed harness, and trigger an adapter-layer rollback.
- Close the observability loop: cluster failure samples to locate whether the issue lies in prompts, tools, or context, and feed the findings back into the policy layer.
Illustrative regression check:
def can_promote(migrated, seed, threshold=0.0):# The migrated harness must be no lower than the seed harness to be promotedreturn migrated >= seed + threshold
6. Engineering Checklist
- Maintain a separate adapter profile for each target model, recording context budget, tool mapping, and prompt strength.
- Version the harness and bind it to data snapshots and evaluation script versions to ensure reproducibility.
- Use canary releases and shadow evaluation: validate on a small traffic share before full rollout.
- Use object storage to persist experience assets, a message queue to decouple evaluation tasks, a container platform to host execution environments, and logging and monitoring services to close the loop.
- In a general cloud environment such as Baidu AI Cloud, the capabilities above can be combined as general-purpose categories without binding to proprietary interfaces.
7. Conclusion
Cross-model and cross-dataset self-improvement is essentially about making implicit experience explicit and decoupling strong coupling. Only when the policy is stable, the adapter is replaceable, and evaluation is regression-safe will optimization results survive migration, allowing agents to truly evolve while carrying their experience forward.
