RL Post-Training for LLMs: Improving Code and Agent Capabilities
Post-training, especially large-scale reinforcement learning, is becoming a key differentiator for LLM capabilities. This article examines the engineering stack behind RL post-training for code and agent tasks—training frameworks, long-context inference, sandbox infrastructure, environment validation, and scheduling—and discusses how to evaluate terminal and long-horizon engineering performance, along with practical implications for developers.
1. Why Post-Training Has Become a New Focus of Capability Competition
For the past few years, competition among large models has mainly centered on pre-training. Parameter scale, data quality, and compute investment together determine a model’s foundational capabilities. As the gap in foundational capabilities among models gradually narrows, the post-training stage has begun to take on more of the work of differentiation.
Recently, a model team released a trillion-parameter long-context model that supports a million-token context window. The team said the model improves on code, 3D creation, financial research, and long-horizon agent tasks, and it also introduced a version with faster output. From public information, the core method behind this upgrade is large-scale reinforcement learning (RL) post-training, in which the same base model gains capabilities across multiple downstream domains through RL.
It should be noted that the technical details discussed in this article mainly come from public descriptions and are not the team’s complete technical report. The engineering steps mentioned below are common industry practice, and specific implementations vary by team.
2. The Technology Stack for Large-Scale RL Post-Training
Supporting joint training across hundreds of downstream domains depends on more than stacking compute. Every layer of the training system needs dedicated optimization.
1. RL Training Frameworks
Large-scale RL training faces core issues of sample efficiency and training stability. Sparse reward signals, high variance in policy updates, and conflicting gradients across tasks can all prevent additional compute from translating into capability gains. Common responses fall into two categories. At the algorithm level, there are reward normalization and improved advantage estimation. At the system level, there are asynchronous sampling and experience replay. The two types of measures usually need to be used together.
In practice, the following items are worth monitoring closely:
- Whether the mean and variance of rewards drift abnormally as training steps increase;
- Whether gradient directions from different tasks cancel each other out over long periods;
- Whether the delay between sampling and parameter updates continues to grow.
2. Long-Context Inference Optimization
A million-token context rapidly increases attention computation overhead. Common optimization approaches include the following:
- Efficient attention variants and sparse attention, used to reduce the quadratic complexity of long sequences. Sparsification may lose some accuracy in long-distance dependencies, so regression testing on target tasks is needed.
- KV Cache quantization and paged management, used to control memory usage during inference. Low-bit quantization introduces some accuracy loss, and the bit width is usually chosen based on business tolerance.
- Chunked prefill and streaming decoding, used to shorten first-token response time in long-document scenarios. Chunk size needs to be adjusted according to hardware and load; setting it too large or too small affects throughput.
3. Sandbox Infrastructure
Agent capabilities depend on executable environments. Models need to repeatedly try, receive feedback, and improve in terminal and code execution environments. Building sandbox clusters with high concurrency, resource isolation, and fast reset is the foundation for scaling RL data production. A typical containerized sandbox configuration might look like this:
# Example sandbox configuration (for illustration only)sandbox:runtime: containerresources:cpu: 2memory: 4Ginetwork: restricted # Restrict external network access to reduce the risk of accidental operations and data leakagelifecycle:timeout: 300s # Automatically reclaim after a single task times outreset: on-exit # Reset the environment after the task ends
The network restriction in the configuration is important. Agents in training may execute arbitrary commands, so real secrets should not be placed in sandboxes, and sandboxes should not connect to production systems.
4. Environment Quality Checks
The upper bound of RL returns is determined by environment quality. If task descriptions are vague or reward functions have loopholes, models will find shortcuts to obtain high scores. This phenomenon is called reward hacking. Such behavior may look successful in metrics while the actual output quality is low. Teams usually need a shared platform to perform automated validation of training environments, checking whether tasks are solvable, whether tests are reliable, and whether rewards align with objectives.
5. Scheduling Systems
Joint training across hundreds of domains needs to handle heterogeneous compute, training tasks of varying lengths, and different environment dependencies. Unified scheduling can improve GPU utilization and reduce resource contention among tasks. Scheduling policies also need to balance queue fairness and the priority of critical tasks.
3. How to Evaluate Code and Agent Capabilities
Evaluation is key to determining whether capability improvements are real. The original text mentioned two types of evaluation; below is an explanation of what each measures.
Real terminal task evaluation. Terminal-style benchmarks commonly used in the industry evaluate coding agents in resource-constrained real terminal environments. Each task has explicit test cases, and the agent needs to complete the task and pass the tests. The original text reported that the model’s score in this type of evaluation was close to the strongest publicly available closed-source models, with a small gap to the top. When reading such numbers, it is necessary to confirm the benchmark name, number of tasks, model version, evaluation date, and runtime configuration, because the same model can score very differently under different settings.
Long-horizon multi-step engineering evaluation. Compared with single-turn code generation, long-horizon tasks are closer to real engineering. They require the model to execute multiple steps, call tools, modify across files, and ultimately solve an end-to-end problem. The original text said that the model showed clear improvement over the previous generation on internal benchmarks. Internal benchmarks are usually not public, making them difficult for external readers to verify, so such conclusions are better treated as directional references.
When evaluating, consider the following points:
- Look at scores together with task difficulty distribution and failure reasons;
- When comparing, require consistent model versions, tool permissions, and time budgets;
- For comparative experiments, it is best to run multiple times and report the mean and variation range.
4. What This Means for Developers
From an application perspective, the capability scope of such models is expanding, mainly in three areas.
- Covering diverse coding needs: The model can locate and fix defects in real codebases and also build small projects from scratch. Small teams have the opportunity to use one model to handle development tasks at different granularities.
- Combining vision and tools: In game and web page generation scenarios, the model can generate more detailed visual effects and choose appropriate external tools to complete implementation. This capability helps with tasks that connect design and execution.
- Combining long context with agents: A million-token context allows the model to read a large codebase or a long research report at once, and then use agent capabilities to handle workflows across documents and systems.
There are several points to note before use. Long-context inference costs and latency are both higher, so trade-offs should be made between effectiveness and cost. When agents have permission to execute commands, the tool scope needs to be restricted, and human confirmation steps should be retained. Evaluation scores should also be validated against your own business data rather than directly copying leaderboard results.
5. Conclusion
Post-training is becoming an important source of differences in model capabilities. A trillion-parameter base model, large-scale RL post-training, and well-developed sandbox and scheduling infrastructure together form the main engineering elements of current frontier models. For developers, what is more worth watching is whether RL training can reliably convert compute into capability, which depends on reward design, environment quality, and training stability. If full model weights are opened in the future, the community will have the opportunity to test these conclusions in real scenarios and feed back improvement directions.
