Post-Training Trillion-Parameter Models and the Practice of Long-Horizon Agents

    This article examines why reinforcement learning during post-training—not pretraining—has become the main engine of capability growth for frontier trillion-parameter models with million-token context windows. It breaks down the RL efficiency formula, the necessity of multi-domain joint training to suppress catastrophic forgetting, and the full-stack optimizations needed to make every added unit of RL compute count, including asynchronous rollout decoupling, sample reuse, partial trajectory resumption, and length-balanced batching. It also covers the three-way pressure that long-context inference places on memory and attention, sandbox infrastructure and scheduling, environment quality checks, how to read evaluation results, the practical forms of long-horizon agents in coding, 3D and visual creation, and financial research, high-throughput inference techniques, and reusable cloud components. Readers will find practical engineering recommendations for moving models from "can chat" to "can deliver."

    1. Introduction: One More Step Toward the “Impossible”

    Gains in evaluation capability rarely come from a single trick; they come from systems engineering. There is a widely held view in the field: the only way to probe the boundary of what is “possible” is to walk one small step further in the direction of the “impossible.” As trillion-parameter-scale MoE architectures have become the standard configuration for flagship models, pretraining is increasingly constrained by the supply rate of high-quality data, and reinforcement learning during the post-training stage is becoming the primary engine of capability growth.

    The new generation of flagship models—operating at trillion-scale total parameters and million-token context windows—has multiplied post-training compute several times over and achieved notable gains in coding, 3D creation, financial research, and long-horizon agent tasks. A high-throughput variant of the same architecture, through inference-side optimization, has raised output speed to roughly 2–3x while keeping the intelligence level largely on par. Rather than restating any single product’s spec sheet, this article dissects the technical path and engineering constraints behind these results and offers reusable practical recommendations.

    2. The Center of Gravity for Capability Growth: Why Post-Training?

    2.1 Two-Stage Capability Formation

    Stage Primary Role Current Marginal Return
    Pretraining Provides the foundation of knowledge and language ability Constrained by the supply rate of high-quality data
    Post-training (SFT / RL) Converts “knowing” into “doing,” shaping behavior and strategy Ample supply of verifiable tasks; more significant marginal returns

    Breaking the evaluation dimensions apart: knowledge-QA scores depend more on the base model and the data mixture, while multi-step tool calling, long-horizon task completion rate, and error recovery are almost entirely determined by post-training.

    2.2 The Efficiency Formula for Reinforcement Learning

    A widely cited efficiency decomposition makes the issue clear:

    1. Effective RL compute = Total compute × Effective rollout ratio × Environment availability × Verification signal quality × Gradient update conversion rate

    This explains why “adding more GPUs” does not equal “getting stronger”: if any one of the five factors approaches zero, the product collapses. In multi-step tasks, a single trajectory often runs hundreds of steps and hundreds of thousands of tokens, so the effective rollout ratio is naturally low; an unavailable environment directly invalidates samples; and a fuzzy reward signal makes the optimization direction drift.

    2.3 The Necessity of Multi-Domain Joint Training

    The core purpose of large-scale joint training that supports hundreds of downstream domains is to suppress catastrophic forgetting. Chasing a high reward in a single domain often comes at the cost of general capability. Multi-domain mixed training must address:

    • Reward scales that differ across domains, requiring normalization before weighting;
    • Long-tailed distributions of task difficulty, requiring curriculum-style scheduling;
    • Conflicting gradients across domains, requiring control of the update step size and data sampling ratios.

    3. Full-Stack Optimization: Making Every Added Unit of RL Compute Count

    3.1 The RL Framework: Moving Rollout Off the Critical Path

    The bottleneck in the training loop is usually on the generation side, not the backpropagation side. Practical directions for improvement:

    1. Asynchronous decoupling: Independently scale the inference cluster and the training cluster, queue rollouts, and avoid long-tail samples blocking the entire batch;
    2. Sample reuse: Mix on-policy and near-on-policy data while controlling the drift between the old and new policies;
    3. Partial trajectory resumption: Reuse already-generated prefixes across rounds to cut redundant inference;
    4. Length imbalance governance: Setting the batch by the longest sample leaves GPUs idle, so batch by token count rather than by sample count.
    1. # Illustration: skeleton of an RL iteration under verifiable rewards (shows the flow, not a concrete implementation)
    2. for batch in task_pool.sample(batch_size):
    3. trajectories = [policy.rollout(task, env=sandbox(task))
    4. for _ in range(group_size)]
    5. rewards = [verifier(task, traj) for traj in trajectories]
    6. adv = group_normalize(rewards) # group-relative advantage reduces reliance on absolute rewards
    7. loss = pg_loss(trajectories, adv) + kl_coef * kl_penalty(traj)
    8. loss.backward(); optimizer.step()

    3.2 Million-Token Long-Context Inference: Triple Pressure on Memory and Attention

    The challenges of a 1M-token context concentrate in three areas:

    • Attention complexity: A naive implementation is O(L²), so it must rely on chunked/sparse attention and efficient kernels;
    • KV Cache memory: Grows linearly with length, requiring paged management and cross-request prefix reuse (prefix caching);
    • Effective information retrieval: Length does not equal useful information; the “lost in the middle” problem is especially pronounced in long-horizon tasks.

    Practical recommendation: for long-document tasks, keep an addressable segmented index so the model retrieves on demand rather than ingesting everything linearly.

    3.3 Sandbox Infrastructure and Scheduling Systems

    Agent training is essentially trial and error in real or simulated environments, and sandbox quality directly determines sample quality.

    • Sandbox side: Strong isolation (process/file/network/resource quotas), environment snapshots and fast rollback, layered image pre-warming to reduce cold starts, and full-trajectory replayability;
    • Scheduling side: Mixed deployment of inference and training, preemption by priority, topology-aware placement to reduce cross-machine communication, and automatic isolation and rescheduling of failed tasks.
    1. # Illustration: timeout and isolation for sandbox tasks (pseudocode)
    2. with Sandbox(image=task.image, cpu=task.cpu, mem=task.mem,
    3. net_policy="restricted", wall_clock=task.budget_s) as sb:
    4. result = sb.run(task.cmd, timeout=task.budget_s)
    5. sb.snapshot() # on failure, return to the initial state to avoid contaminating later rollouts

    3.4 Environment Quality Checks: An Underrated Step

    If the environment itself has bugs (flaky test scripts, missing dependencies, drifting initial states), the model will “learn” to attack the evaluator rather than solve the problem. A shared environment-quality validation platform takes on:

    • Environment reproducibility and dependency version locking;
    • Evaluator regression testing (before adding new tasks, verify that “an empty solution scores nothing and a correct solution must score”);
    • Difficulty stratification and pass-rate drift monitoring, promptly removing saturated or unsolvable samples;
    • Reward-signal consistency auditing to prevent reward hacking.

    4. How to Read Evaluations: From “Can Answer” to “Can Deliver”

    4.1 Real Terminal Tasks

    Consider terminal tasks that run under resource constraints in real environments (each task with strict dedicated tests): what they measure is planning and execution under budget constraints, not isolated knowledge.

    4.2 Internal Long-Horizon Code Benchmarks

    Internal multi-domain benchmarks focus on multi-step execution, tool calling, and end-to-end problem solving, covering categories such as engineering, data analysis, and script automation.

    4.3 Three Principles for Interpreting Results

    Principle Explanation
    Look at ranges, not point values The gap between 65.7% and 66.4% is smaller than common evaluation variance and is insufficient to support a “stronger” conclusion
    Look at task families, not the total score Long-horizon and short tasks follow different capability curves and should be broken down by domain
    Look at failure modes Error attribution (reading the wrong file, misusing a tool, failing to converge in a loop) is more instructive than the score

    5. Practical Forms of Long-Horizon Agents

    5.1 Coding: From Small Fixes to Whole-Repo Delivery

    The difference between fixing a defect in a single file and building a complete project from scratch lies in context management and tool orchestration. Engineering practice suggests:

    1. Provide repo-level retrieval (symbol index + dependency graph) to avoid loading everything;
    2. Define clear write boundaries (writable directories, generated artifacts that must not be touched);
    3. Enforce “plan before executing,” using tests as the convergence criterion;
    4. Require explicit confirmation for high-risk operations (dependency upgrades, database migrations).
    1. # Illustration: agent main loop with a budget constraint
    2. for step in range(MAX_STEPS):
    3. action = model.plan(state, context=state.relevant_files())
    4. if action.type == "submit":
    5. return run_tests_and_decide(action.patch)
    6. obs = sandbox.execute(action) # on timeout/failure, enter a retry or rollback branch
    7. state.update(obs)
    8. return "budget_exhausted" # exhausting the budget must be reported explicitly, not ended silently

    5.2 3D and Visual Creation

    Games and web experiences have demands for visual style that, on the technical side, come down to multi-tool collaboration: concept-art generation → geometry and material editing → parametric scripting → in-engine debugging. The model’s value lies in turning vague aesthetic intent into executable pipeline steps and knowing when to call professional software rather than hard-coding a render.

    5.3 Financial Research

    The difficulty of financial research lies in evidence-chain integrity: consistency of definitions, time alignment, unit and adjustment handling, and traceable citations. It is advisable to require that outputs carry sources and to double-check key figures.

    6. High-Throughput Inference: Keeping Intelligence in the Same Tier

    The value of the high-throughput variant is not “a little faster” but leveling the cost structure for latency-sensitive scenarios (interactive IDE completion, real-time customer service, high-concurrency batch processing). Common techniques include:

    • Speculative decoding / Medusa-style multi-token prediction;
    • Weight quantization and KV Cache quantization;
    • Continuous batching and request merging;
    • Prefix-cache hit optimization, with zero repeated computation for long system prompts.

    For acceptance testing, always compare using the dual metrics of “completion rate on the same task set + length-normalized cost” rather than looking only at tokens/s.

    7. Deploying on the Cloud: Reusable Technical Components

    Whether building in-house or relying on a public cloud (such as Baidu AI Cloud), inference and agent platforms typically reuse the same set of foundational capabilities:

    Need Common Component
    Elastic compute scheduling Container platform + auto-scaling
    Large-scale dataset and model-weight distribution Object storage / shared file system
    Async orchestration of long tasks Message queue + workflow engine
    Observability Logging + monitoring and alerting + distributed tracing
    Security boundaries Identity and access management, key management, network isolation

    8. Conclusion

    As pretraining hits a data bottleneck, the gap between models increasingly depends on the engineering quality of post-training: whether rollouts are fully utilized, whether the environment is trustworthy, whether the verification signals are clean, and whether scheduling keeps every GPU from idling. A lead in evaluation scores is a result, not a means; what truly matters is whether this full-stack optimization can be reproduced reliably in the next version. For developers, breaking a long-horizon agent into “verifiable subtasks + explicit budgets and boundaries + replayable execution traces” is the most pragmatic step from “the model can chat” to “the model can deliver.”