Long-程 Agent Practices with a 3-Trillion-Parameter Model

    This article examines what it takes to move AI agents from single-turn chat to long-running, production-grade execution. It covers the four-layer agent runtime (orchestration, tool calling, state, and execution), why post-training and verifiable rewards have become the main battleground, how to use million-token context effectively through layering and structured retrieval, evaluation lessons from code and terminal scenarios, and cost governance for hosted agents. The core takeaway: parameters and context length are only the entry ticket, while the real moat is a post-training loop, verifiable environments, and an operable runtime.

    1. From “Answering” to “Sustained Work”: The Technical Divide for Long-程 Agents

    Over the past two years, LLM capability has mostly been evaluated on single-turn Q&A, short-form generation, and knowledge recall. Once models are placed in real engineering environments, however, the bar shifts quickly: can they execute dozens of steps in a resource-constrained environment, self-diagnose after failures, and reliably reuse the same reasoning strategy across hundreds of downstream domains? A model with on the order of three trillion parameters and million-token context effectively moves the competition from “parameter scale” to “post-training and runtime infrastructure.”

    The key difference between a long-程 agent and a chat model is the time scale. Chat happens in seconds; long-程 tasks run for hours or even days. This introduces three new problems: how to compress and retrieve context, how to persist intermediate state, and how to roll back on failure. In practice, the agent runtime (harness) is usually split into four layers: an orchestration layer for plan decomposition and dependency management; a tool-calling layer that provides a unified abstraction over the terminal, browser, file system, and external APIs; a state layer for checkpoints and memory; and an execution layer for sandbox isolation and resource quotas. Only when all four layers are observable does a long-程 task become operable.

    1. # Skeleton: checkpoints and retries for a long-程 task
    2. class TaskNode:
    3. def __init__(self, name, action, retry=2):
    4. self.name, self.action, self.retry = name, action, retry
    5. def run_pipeline(nodes, state):
    6. for node in nodes:
    7. if state.done(node.name):
    8. continue
    9. for attempt in range(node.retry + 1):
    10. try:
    11. state.save(node.name, node.action())
    12. break
    13. except Exception as e:
    14. if attempt == node.retry:
    15. state.mark_failed(node.name, str(e))
    16. raise

    2. Why Post-Training Compute Has Become the Main Battleground

    The marginal returns from simply scaling pre-training are declining, while post-training (especially reinforcement learning) can turn “general language ability” into “executable task ability.” Extending reinforcement learning across hundreds of downstream domains means reward signals must be verifiable: code tasks use unit tests, data tasks use result comparison, and 3D creation uses geometry and rendering constraints. Verifiable rewards are the prerequisite for scaling long-程 agent training, and they are also the reason an environment quality-check platform exists—it filters noisy tasks, validates initial states, and confirms the evaluation scripts themselves are not flawed.

    At the training-framework level, three bottlenecks need to be solved: first, sampling throughput, since long-trajectory generation is expensive and requires asynchronous sampling and trajectory reuse; second, long-context memory pressure, commonly addressed with paged attention, sequence parallelism, and KV-cache reuse; and third, scheduling fairness, since tasks across domains have different priorities and need quota and preemption mechanisms. In engineering terms, “training—evaluation—environment repair” can be built into a closed-loop pipeline, where any evaluation failure flows back as an environment defect ticket rather than being simply attributed to insufficient model capability.

    3. The Right Way to Use Million-Token Context

    Long context does not mean stuffing all material into the prompt. The effective strategy is layering: the first layer holds task constraints and output specifications; the second holds retrieved relevant snippets; the third holds a summary of the historical trajectory. For very long logs or codebases, build a structured index first, then retrieve by “file—symbol—call chain.” For example:

    1. [System constraints] Use only APIs within the given repository; do not add dependencies
    2. [Retrieved snippet] src/pipeline/task.py#L40-L96
    3. [Trajectory summary] Config parsing fixed; 3 failing cases remain
    4. [Current instruction] Locate the failing cases and output a minimal patch

    Combined with a cache-hit mechanism, this can significantly reduce the cost of repeated prefixes; for latency-sensitive scenarios, you can adopt a faster inference tier of equivalent capability, trading throughput for response time.

    4. Evaluation Lessons from Code and Terminal Scenarios

    Real terminal evaluation emphasizes resource constraints and specialized testing. A score close to leading closed-source models indicates that the open-weight route is already engineering-viable. For teams, the more valuable move is to build a long-程 code benchmark: fixed repository snapshots, fixed dependency versions, and fixed test commands, recording end-to-end success rate and average step count. It is advisable to look at success rate, rollback rate, and human-takeover rate together, rather than only the final answer.

    5. Hosted Agents and Cost Governance

    Offering the runtime as a cloud-hosted service lets enterprises avoid sandbox and scheduling operations. When rolling out, it is recommended to: tier tasks (interactive / batch / long-running), set budget caps and circuit breakers, and maintain full-chain logging and auditing. If the runtime is carried on general capabilities such as compute, containers, object storage, and monitoring/alerting from Baidu AI Cloud, elastic scaling can handle peaks, and the log service can help locate failing nodes.

    6. Conclusion

    Three trillion parameters and million-token context are only the entry ticket; the real moat is a post-training closed loop, a verifiable environment, and an operable runtime. Build the evaluation baseline, checkpoints, and cost guardrails first, then talk about model selection—only then can a long-程 agent move from demo to production.