Long-Running Multi-Agent Tasks: Model Tiering and Cost Governance

    Long-running AI tasks require more than a capable model: they need coordinated agents, external verification, and strict resource limits. This article explains how to structure multi-agent workflows, assign models by task complexity, calculate total task costs, and establish the governance controls needed to move autonomous execution from demonstrations into production.

    1. From Single-Turn Answers to Long-Running Autonomy

    Over the past two years, large language model evaluations have focused largely on coding snippets, logical reasoning, and knowledge-based questions. The dominant interaction pattern has been a single question followed by a single answer.

    More recent public examples point to gains in a different class of work: operating system kernel development, formal proofs of mathematical propositions, open-ended theoretical physics calculations, electronic hardware design, and robot control.

    These tasks are difficult not simply because an individual problem is hard, but because the work extends over time:

    • Long duration: A task may run continuously for hours or days, far beyond the context window of a single session.
    • Large numbers of subtasks: Work must be divided into hundreds or thousands of parallelizable problems, with results continuously integrated.
    • Expensive verification: Correctness cannot be established by reading the output. It requires external validators such as compilers, tests, or formal proof checkers.
    • Limited human intervention: People confirm direction and accept results at key milestones rather than guide every step.

    Public examples illustrate this pattern. In one, a system given the goal of developing an operating system coordinated roughly a thousand subagents over several days. Starting from an empty directory, it produced a system that could boot and run on a laptop. In another, a similarly sized agent team completed the formalization of a classical mathematical proposition in tens of hours. An earlier effort using an unreleased research model had taken roughly ten times as long.

    For enterprises, the important shift is not merely the ability to answer harder questions. It is the ability to organize large numbers of agents, with limited human intervention, to complete projects that previously required sustained collaboration among specialist teams.

    2. The Engineering Core of Multi-Agent Orchestration

    Keeping long-running tasks under control requires the orchestration layer to address four core concerns.

    Task Decomposition and Dependency Management

    Represent the goal as a directed acyclic graph (DAG). Each node should be a minimal, independently verifiable unit of work, and each edge should represent a dependency.

    The granularity of decomposition determines parallelism. Tasks that are too large limit concurrency; tasks that are too small create excessive integration overhead. A practical baseline is a unit of work that can be verified within one compile or test cycle.

    Context Isolation

    Each subagent should receive only the context needed for its assigned task. This prevents the global context from expanding without bound.

    The parent agent should maintain task state and summaries of conclusions, rather than every raw execution log.

    A Verification Feedback Loop

    External verification is what separates long-running autonomy from output that merely looks plausible.

    Every deliverable must pass an appropriate external validator: compilation, unit tests, static checks, a formal proof checker, or a simulation environment. Tasks without a reliable external validator should not be assigned to an autonomous workflow.

    Failure Recovery and Budget Controls

    Failed subtasks must be retried, handled through a fallback path, or escalated to a human—not silently accepted as valid results.

    Hard limits are equally important:

    • Maximum iteration count
    • Maximum token consumption
    • Maximum wall-clock runtime

    The following framework-independent pseudocode illustrates the orchestration structure:

    1. def run_long_task(goal, budget):
    2. dag = decompose(goal) # Goal -> graph of verifiable subtasks
    3. while not dag.done() and budget.left():
    4. batch = dag.ready_nodes(limit=PARALLEL)
    5. results = parallel_map(execute, batch) # Run subagents in parallel
    6. for node, res in zip(batch, results):
    7. if verify(node, res): # External validator: tests/compiler/proof checker
    8. dag.commit(node, res)
    9. elif res.retries < MAX_RETRY:
    10. dag.requeue(node, hint=res.error)
    11. else:
    12. return escalate_to_human(node, res) # Human decision at a critical point
    13. budget.consume(results)
    14. return dag.summary()

    3. Model Tiering: Reserve the Strongest Models for Complex Work

    Subagent invocation volume is a primary driver of long-running autonomy costs. Model selection therefore needs to be tiered, rather than using the same capability level throughout the workflow.

    A practical architecture has three tiers:

    Tier Responsibilities Selection Principle
    Planning Goal decomposition, architectural decisions, conflict resolution Strongest reasoning capability, with very few calls
    Execution Coding, test writing, documentation, mechanical refactoring Mid-range capability, accounting for most calls
    Validation Format checks, linting, simple assertions Lightweight models or deterministic tools

    Reported public results support this approach. In evaluations that assess whether changes to an open-source project reach a quality level maintainers would be willing to merge, a newer-generation model at a high reasoning setting has approximately matched the previous flagship model at its highest setting, at roughly half the cost per task. Relative to its own predecessor, the newer model improved by more than ten percentage points.

    The implication is that capability gains and cost reductions can occur together, increasing the value of tiered model routing.

    4. Measure Cost per Task, Not Just Price per Token

    A common budgeting mistake is to make decisions solely on the price per million tokens. For long-running tasks, a simplified cost model is:

    1. Task cost ≈ Number of subtasks × Average rounds per subtask
    2. × (Input tokens + Output tokens) × Token price
    3. + Verification compute cost

    Reasoning-effort settings can increase both output quality and resource consumption. The appropriate approach is to allocate reasoning effort according to task risk: use higher settings for critical paths and lower settings for repetitive work.

    Verification infrastructure must also be included in the budget. Compilation clusters, test containers, and simulation environments incur costs that are often substantially underestimated in autonomous workflows.

    5. Where Practical Value Emerges: Modernizing Existing Systems

    Two high-value applications have been demonstrated repeatedly.

    Legacy Refactoring and Language Migration

    One team used an early agent version to migrate a critical production service from Python to Rust. After migration, service startup was approximately 26 times faster.

    The hardest part of this work is not generating code. It is verifying behavioral equivalence. A comprehensive regression-test baseline is essential; without it, an autonomous migration becomes an uncontrolled rewrite.

    Rediscovering Security Vulnerabilities

    In this type of evaluation, a model receives a set of publicly disclosed vulnerability identifiers and access to code rolled back to its pre-fix version. It must then locate the vulnerabilities again.

    The evaluation tests whether the model can reconstruct an attacker’s reasoning path. For defenders, the value lies in applying the same approach to inspect their own codebases before patches are released.

    One user’s feedback highlights a separate improvement in the working experience: the model understood the intent behind prompts without repeated wording corrections. Work that had stalled for weeks was completed within days, passed review, and attracted noticeably fewer review comments.

    This reflects better alignment with user intent, not simply faster generation.

    6. Enterprise Adoption: Governance Comes First

    Stronger autonomy requires stronger governance. Before deployment, enterprises should establish the following controls:

    • Sandbox isolation: Run agents in containerized environments, restrict network and file-system access, and prevent direct access to production.
    • Least privilege: Grant read-only or branch-scoped permissions, as appropriate, for code repositories, image registries, and secrets management.
    • End-to-end auditing: Log prompts, tool calls, outputs, and verification results so that execution can be replayed.
    • Observability and alerts: Monitor token consumption, failure rates, and stalled execution throughout long-running tasks.
    • Human approval gates: Require human approval for irreversible actions such as merges, releases, and permission changes.

    These requirements can typically be supported by standard cloud infrastructure categories: container platforms for sandboxes, object storage for artifacts and logs, message queues for task distribution, and logging and monitoring services for observability.

    General-purpose cloud offerings, including those from Baidu AI Cloud, can serve as an infrastructure foundation for this architecture. Product and regional availability should be assessed for the intended deployment.

    7. Key Risks

    • Missing verification: Without an external validator, autonomous execution lacks a reliable correctness boundary.
    • Context contamination: Sharing global context across subagents can cause their conclusions to interfere with one another.
    • Uncontrolled costs: Long-running tasks without hard budgets may consume far more resources than expected.
    • Compliance and accountability: Outputs such as formal proofs and hardware designs still require sign-off from responsible domain experts.

    Conclusion

    The central shift is from treating a model as an answer generator to treating it as an orchestratable engineering resource.

    Enterprises should not simply wait for a stronger standalone model. They should establish three foundations: verifiable task decomposition, tiered model scheduling, and a governance framework that combines sandboxing with auditing.

    Only when verification loops and cost budgets are in place can long-running autonomy move from a demonstration to a production workflow.