HMA Multi-Agent Alternation Framework: Breaking the Monolithic Bottleneck in Long-Horizon ML Engineering

HMA alternates two LLM agents on a shared workspace to set a new SOTA on MLE-bench at 1/4 the time budget.
HMA (Humanize MLE Agents) addresses two key failure modes in long-horizon ML engineering: long-horizon deceleration (reasoning quality degrading over long sessions) and harness staleness (custom framework gains disappearing as models improve). The approach is elegantly simple: two agents alternate on a shared workspace with context resets between sessions, requiring no task-specific harness or prior knowledge injection. Grounded in CR-SMDP theory, HMA achieves 78.2% any-medal rate on MLE-bench's 75 Kaggle tasks — an 8-point improvement over the strongest open-source baseline using only one-quarter of its time budget — with 6.4-point average gains across five heterogeneous agent pairs and near-top performance on kernel optimization.
Two Core Problems in Long-Horizon MLE Tasks
LLM-based agents tackling long-horizon machine learning engineering (MLE) tasks typically rely on what's known as "context engineering." Developers usually build customized harnesses to manage tool calls, skill reuse, and accumulated knowledge. While this approach can boost agent performance in the short term, deeper problems emerge as task duration extends.
Researchers observed two key phenomena in their experiments. The first is long-horizon deceleration: as a single session runs longer, the agent's reasoning intensity gradually declines and task progress slows. In other words, agents simply cannot maintain high-quality reasoning throughout an extremely long session. The second is harness staleness: the gains from carefully crafted custom harnesses tend to erode as the underlying model itself improves. The stronger the model, the more redundant the handcrafted scaffolding becomes.

These two findings point to a deeper issue: harness benefits optimized for a specific model version may not carry over across versions. A framework tuned for today's model may become ineffective on the next generation. This led the research team toward a workflow-level rethinking — rather than stacking complex mechanisms inside a single agent, why not let multiple agents take turns collaborating across sessions, each building on the previous agent's work?
Modeling Agent Alternation with CR-SMDP
To provide a theoretical foundation for this kind of alternating collaboration, the researchers modeled alternating agent sessions as a Context-Reset Semi-Markov Decision Process (CR-SMDP). The core idea: after each session ends, the context is reset, but the work products remain in a shared workspace, allowing the next agent to pick up from a clean context.
Building on this model, the team accomplished three things. First, they established sufficient conditions under which an alternation strategy can outperform a single-agent reference ceiling, mathematically justifying why "relay" might beat "solo." Second, they derived an explicit experiment-budget bound characterizing performance under resource constraints. Third, they analyzed the conditions under which a session cap can preserve the advantages of alternation.
The significance of this theoretical framing is that it doesn't merely propose an empirical engineering trick — it attempts to explain why context resetting combined with multi-agent alternation can break through the inherent ceiling of monolithic agents. The essence of long-horizon deceleration can be understood as the accumulation of too much information in a single context interfering with reasoning; periodic resets relieve precisely this burden.
Semi-Markov Decision Processes (Semi-MDPs) are extensions of standard MDPs where action execution times can vary rather than being fixed single time steps. In agent session scenarios, each session's duration (i.e., the number of experiments executed) differs, making Semi-MDPs more accurate than standard MDPs at capturing temporal heterogeneity across sessions. The "context reset" modifier further distinguishes CR-SMDP from ordinary Semi-MDPs: the state space is split into "persistent state" (experimental results, code, and model files saved in the workspace) and "transient state" (in-context information within a single session), with the reset operation clearing the latter while preserving the former. This modeling approach lets researchers use rigorous mathematical language to ask "is relay better than a single long session?" — when long-horizon deceleration causes diminishing marginal returns within a session, each context reset effectively allows a new agent to restart near initial efficiency, theoretically exceeding the performance ceiling of a monolithic agent.
HMA: A Two-Agent Relay on a Shared Workspace
Guided by this theoretical analysis, the research team proposed Humanize MLE Agents (HMA). Its design is remarkably restrained: two agents alternate working on the same shared workspace, each session executing at most k experiments, with the context reset between sessions. Crucially, HMA requires no additional task-specific harness and injects no prior knowledge supplements.
This means HMA shifts complexity from inside the agent to the orchestration of the workflow. Rather than feeding a single agent with increasingly elaborate scaffolding, it lets the agent collective advance tasks like a human research team working in shifts — which is precisely the origin of the "Humanize" name. Each agent focuses within a limited number of experiments, then hands off its results to the next.
Benchmark Results on MLE-bench
HMA was evaluated on MLE-bench, a benchmark covering 75 Kaggle tasks. The results are striking: HMA achieved an any-medal rate of 78.2%, setting a new state-of-the-art (SOTA).
Even more notable is the efficiency comparison. Relative to the strongest open-source baseline, HMA improved the any-medal rate by 8.0 percentage points while using only one-quarter of its time budget. This shows that the alternation framework is not only more effective but also dramatically less resource-intensive — particularly important for computationally expensive long-horizon MLE tasks.
Generalizability Across Agent Pairs
To validate the method's universality, researchers tested six configurations spanning five heterogeneous agent pairs. Results showed that HMA improved any-medal rate by an average of 6.4 percentage points over its component baseline agents. This demonstrates that the alternation mechanism isn't only effective for one specific model pairing — it generalizes across combinations. Regardless of which agents are paired, relay collaboration delivers gains.
Extension to Kernel Optimization
Beyond standard MLE tasks, the team conducted a supplementary case study applying HMA to kernel optimization. In this setting, HMA achieved 878 optimization cycles, falling only 1.6% behind the top entry on the community leaderboard. This suggests HMA's applicability extends beyond machine learning engineering into broader engineering optimization problems.
MLE-bench is a standardized benchmark released by OpenAI in 2024, designed to systematically evaluate LLM agents on real-world machine learning engineering tasks. It draws from 75 historical competition tasks on Kaggle, spanning tabular data, computer vision, natural language processing, and more. Scoring directly mirrors Kaggle's medal system (bronze/silver/gold), where the "any-medal rate" refers to the proportion of tasks in which an agent earns at least one medal — the core metric for overall engineering capability. Unlike traditional benchmarks that assess single-task accuracy, MLE-bench requires agents to complete full end-to-end pipelines including data exploration, feature engineering, model training, and submission, typically under strict time and compute budget constraints. This makes it a high-difficulty testbed for long-horizon autonomous reasoning, lending additional weight to the 78.2% result.
Implications for Agent Design
HMA sends an intriguing signal: in an era of rapidly iterating model capabilities, complex frameworks hand-tuned for specific models may be a quickly depreciating investment. Rather than betting on scaffolding that's prone to staleness, it may be wiser to design more robust and general collaboration mechanisms at the workflow level.
The combination of context reset and multi-agent alternation addresses the long-horizon reasoning degradation problem in an almost "back-to-basics" fashion. It requires neither elaborate prior knowledge injection nor lock-in to any single model version. For developers building autonomous agent systems, this offers a new path that balances performance with sustainability — letting agents take turns like a human team may be more practical and more effective than engineering one all-powerful super-agent.
Related articles

Chain of Thought Isn't Just for AI: How Humans Can Use CoT to Improve Thinking Quality
Chain of Thought isn't just a prompt trick for large models. Starting from a Hacker News discussion, this article analyzes why CoT works for human thinking too, breaks down actionable ways to transfer it, and highlights the key differences between human CoT and machine CoT.
Cloudflare Teams Up with OpenAI: Closi…
Cloudflare Teams Up with OpenAI: Closing the Loop from Vulnerability Discovery to Defense with AI
Cloudflare uses OpenAI Daybreak to investigate security vulnerabilities and generate reviewable remediation plans, while developers use Codex to boost coding efficiency and quality.

Orca Multi-Agent Orchestration in Practice: A Guide to Parallel Collaboration with Claude and Codex
Orca is Stable AI's free open-source agent workbench supporting 34 agents like Claude Code and Codex in parallel. Learn its Git worktree isolation, multi-model orchestration, and mobile management.