Large Model Evolution: Technical Practices for Long-Horizon Agents and Code Capabilities

    This article explains how large language models are moving from text chat toward long-horizon agents that carry out complex tasks. It covers reinforcement learning at scale, infrastructure changes, cloud-hosted agent services, multi-agent collaboration, terminal-based code evaluation, and the trade-off between inference speed and API cost.

    Large language models are moving from simple text conversation toward intelligent agents that can carry out complex, long-horizon tasks. As parameter counts reach the trillion scale and context windows extend to millions of tokens, models are being applied more deeply in areas such as code generation, 3D content creation, and financial research. For models to keep working reliably in real business environments, reinforcement learning in the post-training stage and systematic redesign of the underlying infrastructure are both essential. This article examines the technical practices behind long-horizon agents and code capabilities in very large models.

    1. Scaling Reinforcement Learning Frameworks and Rebuilding the Infrastructure

    Leading large-scale models now invest an unprecedented amount of compute in post-training. Traditional reinforcement learning (RL) frameworks were often limited to a single task or a small number of domains. Modern practice requires extending RL to hundreds of downstream task domains. Scaling both breadth and depth in this way places very high demands on compute scheduling and training frameworks.

    To support large-scale joint training, model development teams must systematically rebuild several key components:

    1. Long-context inference optimization: Million-token inputs consume large amounts of GPU memory and put pressure on the efficiency of attention algorithms. Paged attention and ring attention, combined with fine-grained KV cache compression, are the mainstream technical approaches for supporting long-horizon inference.
    2. Sandbox infrastructure hardening: Code execution and tool calls need a secure, isolated runtime. A modern sandbox must prevent malicious or erroneous instructions generated by the model from damaging the host system. It also needs to support snapshots, rollback, and resource quotas to handle the frequent trial and error in long-horizon tasks.
    3. Scheduling and environment quality checks: When RL training runs across hundreds of downstream domains in parallel, an efficient task scheduling system is essential. It needs to monitor feedback signals in real time. Combined with an environment quality inspection platform, it removes noisy data and filters out false negative and false positive rewards caused by environment failures, so that policy gradient updates move in the correct direction.

    2. Cloud-Hosted Architecture for Long-Horizon Agents and Multi-Agent Collaboration

    Single-turn, conversational API calls no longer meet the needs of complex business scenarios. Modern LLM applications increasingly rely on long-horizon agents that can work continuously, 24/7. To support these scenarios, cloud-hosted agent services have emerged.

    This architecture places the harness that keeps an agent running for long periods in cloud infrastructure. It shields enterprises and developers from the complexity of state management, resumable execution, and resource allocation. In a cloud-hosted model, an agent is no longer limited to the lifecycle of a single HTTP request. It can stay resident in the cloud and wait periodically for external events or scheduled internal tasks.

    More importantly, cloud-hosted architecture naturally supports multi-agent collaboration. In financial research or large-scale software engineering, complex tasks can often be broken into modules such as information gathering, data analysis, code writing, and result verification. Through unified scheduling in cloud infrastructure:

    • Parallel execution: Multiple specialized agents can work in parallel without blocking one another.
    • Shared state: Through message queues or shared memory, agents can exchange intermediate state and context efficiently.
    • Fault tolerance and retries: When a sub-agent fails, the scheduling system can retry automatically or switch to a backup strategy. This improves the completion efficiency and reliability of complex tasks.

    3. Evaluating Code and Terminal Execution

    Code capability is a core foundation for LLMs evolving into general-purpose agents. Industry benchmarks have moved from simple function generation to realistic, resource-constrained terminal environments. These tests require models to do more than write code. They must execute commands in a virtual terminal, handle errors, iterate on fixes, and ultimately complete complex, cross-file engineering tasks.

    Based on evaluation data, leading models now score close to, or in some cases on par with, the strongest closed-source models on these terminal tests. Pass rates on internal long-horizon code tests keep rising. This progress comes from post-training that closely mirrors real development environments.

    Despite these gains, models still face challenges in code generation, namely uneven skill coverage and verbose output:

    • Uneven coverage: Models perform well in some mainstream programming languages and common algorithm areas, but struggle with niche languages, low-level systems programming, and scenarios that require specialized domain knowledge. Addressing this requires a more balanced mix of training data.
    • Verbose output: On long-horizon problems, models tend to generate large amounts of explanatory text and unnecessary intermediate steps. This consumes extra token quota and adds time spent parsing and executing the output. Solving this requires more refined reward functions in the RLHF stage that penalize redundant output and guide models toward leaner, more direct execution scripts.

    4. Balancing Inference Efficiency and API Service Experience

    Alongside the pursuit of top intelligence, inference latency and API cost are core concerns for enterprise applications. A million-token context window results in high time to first token. To improve the experience, the industry commonly uses model quantization, speculative decoding, and KV cache reuse.

    For API pricing, tiered pricing based on cache hits is becoming a trend. For repeated prompt prefixes, such as system prompts, fixed knowledge base context, or tool definitions, a cache hit can substantially lower input cost. It also speeds up inference because the repeated prefill computation is avoided.

    For latency-sensitive scenarios, offering a “fast” variant of the model is another effective strategy. This variant has a compute scale similar to the standard model but an optimized inference graph. It keeps the same level of intelligence while using operator fusion, parallel decoding, and other low-level optimizations to raise output speed by 2 to 3 times. This supports smooth interaction for enterprise long-horizon agents.

    Conclusion

    Very large parameter models have entered a deeper stage of development, and chasing benchmark scores alone is no longer enough. Future competition will center on the stability of long-horizon tasks, the security of sandbox environments, the smoothness of multi-agent collaboration, and the overall cost-effectiveness of API calls. For developers and enterprises, understanding how these underlying architectures are evolving will help them design agent applications that fit their business logic and realize the productivity of large models in complex production environments.