FireFlash: a long-horizon coding agent trained on 64 B300 GPUs, with an open RL recipe

The team post-trains GLM-5.3-Flash using task filtering, asynchronous sampling, and a shared runtime framework, reporting terminal and software engineering benchmark results and estimated costs.
Long-horizon agents are moving from “fixing a bug” to hours of continuous terminal and coding work, but their reinforcement learning training is also particularly expensive. Frontier labs can scale RL across thousands of GPUs. For most teams, however, a single training sample is often a complete attempt lasting as long as three hours and involving more than a hundred rounds of tool calls. If anything goes wrong at any stage, hours of GPU time are wasted.
Recently, researchers including Wenbo Hu, Nanyun Peng, Dakuo Wang, and Kai-Wei Chang published FireFlash on the Agent Economics blog: a 300B-class terminal and coding agent trained with full-parameter reinforcement learning starting from GLM-5.3-Flash.
FireFlash achieves a Pass@1 of 46.2% on Terminal-Bench 4.0, putting it on the same level as Fable 5 and GPT-6 Sol, while its cost per task is less than one-thirtieth of that of Fable 5 at the highest reasoning effort. The improvement also transfers to two software engineering benchmarks, DeepSWE v1.1 and SWE-Bench Pro Verified. The entire training run used just 64 NVIDIA B300 GPUs and took less than five days. The team also released the full training recipe.
- Blog title: FireFlash: An Open Recipe for Long-Horizon Agentic RL Achieving the Performance-Cost Pareto Frontier
- Blog URL: https://agenteconomics.org/posts/agentic-rl-recipe
- Authors: Wenbo Hu, Jesse Cai, Po-nien Kung, Yuxuan Lu, Di Wu, Huimin Zeng, Nanyun Peng, Dakuo Wang, Kai-Wei Chang

Figure 1: Pass@1 versus average cost per task on Terminal-Bench 4.0, with cost shown on a logarithmic scale. The dashed line is the Pareto frontier, and the arrow shows FireFlash’s improvement over GLM-5.3-Flash. Because the team deployed the model itself, FireFlash’s costs are calculated using the public pricing for GLM-5.3-Flash.

Table 1: Pass@1 on three benchmarks, averaged over five trials. GLM-5.3-Flash results are its official scores on each benchmark, while FireFlash is evaluated in the team’s own harness.
With a cluster of around a hundred GPUs,
how do you reach the Pareto frontier?
The team starts from GLM-5.3-Flash, which has 321B total parameters and activates 17.4B per token, and performs full-parameter RL, training all 320B language parameters, including the MTP layers, while freezing the vision tower and DSA indexer. They argue that clusters on the scale of a hundred GPUs can also achieve frontier-level training efficiency. The key lies in three things: carefully selecting agentic RL environments so that each task supplies a reliable signal at the right level of difficulty; an RL recipe tailored to long, stale, low-precision rollouts; and a coding harness, or agent runtime framework, optimized for the model and shared between training and evaluation. Specifically, the team revisited and optimized five key parts of the post-training process:
① Infrastructure: GPUs do not wait for the slowest attempt. Training and rollouts each use a dedicated set of GPUs. Training can use rollouts up to six weight versions behind, and MTP speeds up decoding by a factor of 1.38. Each attempt runs in a separate microVM, reducing the share of rollout groups lost to infrastructure failures from 12% to 0.5%.
② Task filtering: every rollout group carries a signal. Only tasks with initial pass rates of 15%–85% are retained, measured from at least four samples under exactly the same conditions as training. The share of zero-signal rollout groups falls from 48% to 10.2%.
③ Rewards: give credit only for genuine solutions. Each task must pass nine validation gates before entering the pool, and calibrated terminal partial credit is used. An efficiency reward for shorter solutions reduces the number of tokens per successful solution to 0.84 times its original level, without reducing accuracy.
④ Harness: long-horizon tasks fit within the context, with consistency between training and evaluation. Context compression, redirecting output to files, and background execution reduce the cost per trial by approximately 33%. Training and evaluation share the same harness, which gives GLM-5.3-Flash a 4.4-point gain over its result using Claude Code even before any RL.
⑤ RL objective: stale FP8 samples can drive learning without drift. GRPO combines truncated importance sampling, top-k score centering, a success offset, and a loss floor to remain stable without a KL penalty or entropy bonus, with only 1%–3% of tokens clipped.
Infrastructure:
fully asynchronous RL
Key lesson 1: idle GPUs cost more than stale rollouts—let sampling and training each run at full speed.
Separate GPUs for training and sampling. Half the GPUs train in BF16 using the slime framework, while the other half run the SGLang inference engine with both weights and the KV cache in FP8. After every training step, the new weights are synchronized to the rollout engine through NCCL. Training and sampling do not block each other (Figure 2).
Train on stale rollouts. Because sampling continues uninterrupted, a given turn may be generated by weights several steps behind the trainer. It is discarded only if it comes from weights more than six versions old. The shift caused by policy staleness is small: the log-probability gap between the trainer and rollout is 0.065 when one version stale, rising only to 0.08 when four to six versions stale.
Fast, isolated rollouts. Speculative decoding using the model’s native multi-token prediction (MTP) head increases decoding speed by a factor of 1.38. Each rollout and its scoring are executed through AgentENV in a separate Firecracker microVM, isolating attempts from one another. The share of rollout groups lost to infrastructure errors falls from 12% to 0.5%.

Figure 2: fully asynchronous RL. Rollouts and training each occupy half the GPUs and do not wait for each other. The inference engine samples continuously, and each attempt runs in a separate microVM forked from its task’s parent VM, a process taking less than 100 milliseconds. Completed groups queue for the trainer to take batches. Groups in which every attempt receives the same score are discarded, and turns sampled from weights more than six versions old contribute no gradients. After each update, the trainer pushes the new weights to the inference engine.
Task filtering:
train only where the model is “unsure”
Key lesson 2: spend rollouts only on tasks where the model is uncertain, and measure that uncertainty under exactly the same conditions as training.
GRPO learns from relative differences between multiple attempts at the same task. A task that a model always solves, or can never solve, consumes an entire rollout group while providing only zero learning signal. The team therefore ran at least four baseline rollouts for each candidate task using the base model, retaining only tasks with initial pass rates between 15% and 85%. This baseline assessment strictly followed the training configuration—the same harness, reasoning effort, context window, turn budget, and sandbox—because a task’s pass rate depends on every one of those factors. This filtering reduced the share of zero-signal rollout groups from 48% to 10.2%. In the final training data, long-horizon agent tasks account for approximately 52%, and software engineering tasks approximately 48% (Figure 3).

Figure 3: composition of the training data. Orange denotes long-horizon agent tasks, totaling 52%: the team’s own long-horizon agent tasks (30%) and their difficult tier (11%), long-horizon coding skills (9%), and the public MiMo-TB and Tasksmith datasets (1% each). Blue denotes software engineering tasks, totaling 48%: the public MiMo-code dataset (18%) and the team’s own SWE tasks—18% primarily in Python, and 12% covering TypeScript, Go, Python, JavaScript, and Rust.
Graders and rewards:
validate graders before addressing reward hacking
Key lesson 3: tasks that the model never solves are often broken tasks—validate every grader before the reward reaches the model.
When reviewing tasks that had never been solved, the team found that nearly half were “broken” rather than “difficult”: the tasks themselves were flawed, relied on brittle tests that rejected correct solutions, or contained “protected file” traps. Some graders awarded partial credit simply for matching an output format, or crashed as soon as they encountered real agent outputs. To eliminate these problems, every new task must pass nine validation gates before entering the training pool (Figure 4), checking respectively that the task is solvable as stated, that the sandbox is closed and stable, and that the scores awarded by the grader genuinely reflect what they claim to measure.

Figure 4: the nine gates that new tasks must pass before entering the training pool. Blue denotes tasks (two gates): the reference solution passes inside the training sandbox through exactly the same training process; every requirement checked by the grader is stated in the task description. Green denotes sandboxes (three gates): they run offline; they start reliably every time without hanging; the environment does not leak answers. Orange denotes graders (four gates): attempts that do nothing or submit only boilerplate code receive zero; tests are not brittle, so any correct solution passes; even malformed real outputs can be scored without crashes; the same output always receives the same score.
Reward design. Each attempt is scored once, at its end, with a terminal reward in [0, 1]. A complete solution receives 1.0; incomplete attempts receive partial credit for the validation checks they pass, while software engineering tasks are scored according to the failing tests they fix. Successful attempts can also receive a length bonus of up to 0.2, scaled by the tokens saved relative to the longest solution in the same group. This reward shaping reduces the tokens used per successful solution to 0.84 times the original amount, without decreasing evaluation accuracy.
Harness:
built for long-horizon attempts, identical in training and evaluation
Key lesson 4: the harness is part of the model—train with whichever one you use for evaluation.
The team’s harness follows Claude Code’s conventions: four tools (Bash, Read, Write, Edit), native tool calling, preservation of the reasoning history, and context compression. Crucially, training rollouts and evaluation trials are driven by exactly the same harness, with automated unit tests ensuring that their code and prompts are consistent. Even before any RL, this harness gives GLM-5.3-Flash a score on Terminal-Bench 4.0 that is 4.4 points higher than its official result using Claude Code (Table 2).

Table 2: performance of the same model, GLM-5.3-Flash, on Terminal-Bench 4.0 using Claude Code (the official leaderboard result) versus the team’s harness. Standard time limits are used, and cost per trial and cost per successful solution are calculated using public pricing.
Long-horizon attempts must also be affordable. State-preserving context compression is triggered when usage reaches 85% of the context window. It preserves the prefix cache by appending a sectioned-summary prompt to the end of the existing conversation history. Commands write standard output to files, returning only a truncated preview with the filename. Long-running commands are moved to the background for asynchronous execution rather than being terminated on timeout. Together, these features reduce the cost per trial by approximately one-third. In addition, prompt conventions requiring efficient workflows—in-place edits, writing everything in one pass, and avoiding polling with sleep—save another 16%.
RL objective:
learn from stale samples without drifting
Key lesson 5: correct stale, low-precision samples rather than discarding them, and treat rising entropy as an early warning.
Rollouts are sampled in FP8 precision using weights up to six versions old, making them slightly different from the BF16 policy being trained. Rather than discarding these stale trajectories, the team corrects for them directly in the training objective. The core algorithm is GRPO, with 12 attempts per task and one optimizer update per step. The advantage of each attempt includes both a reward term and a length-bonus term:
A = (R′ − mean R′) / std R′ + (b − mean b) / 0.5
(The mean and standard deviation are calculated across the 12 attempts at the same task.)
R′ = 1.5 when the attempt solves the task; otherwise, R′ = 0.5 × R, where R is the terminal reward in [0, 1] described above.
b = 0.2 × (1 − tokens / maximum token count among successful attempts in the group), calculated for successful attempts when there are at least two successful attempts in the group; otherwise, it is 0.
Truncated importance sampling (TIS). Each token is weighted by the ratio of its probability under the BF16 trainer to its probability under the FP8 rollout. The ratio is clipped to [0.5, 2.0] to limit the influence of any individual token; only 1%–3% of tokens reach the clipping boundaries.
Score centering (SC). The rollout engine returns the top-32 log probabilities for each token. From each token’s policy-gradient score, the trainer subtracts the sampler’s expected score over those candidates. This eliminates the drift toward the stale FP8 sampler that clipping alone still leaves behind, at the cost of a 7.6% increase in time per step.
Success offset. A complete solution (R = 1.0) contributes 1.5 to the advantage, while unsuccessful attempts contribute half their partial credit. The best “near miss” (R = 0.5) counts for only 0.25, whereas a successful solution counts for 1.5. Partial credit can shape learning, but it is not placed on the same footing as a genuine solution.
Loss normalization floor. The loss for each attempt is normalized by its token count, with a minimum denominator of 2,048 tokens. This prevents degenerate rollouts containing only a handful of tokens from receiving excessive per-token weight and dominating the gradients.
With these corrections, training uses neither a KL penalty nor an entropy bonus. During healthy training, policy entropy slowly decreases from approximately 0.46 to 0.33; rising entropy is an early warning sign of training instability.
Experiments: improvements across all three benchmarks,
reaching the cost–performance frontier
FireFlash is evaluated in the same harness used during training and compared with the official scores of its starting model, GLM-5.3-Flash, and the public scores of other models (Figure 5). FireFlash outperforms the base model on all three benchmarks: it gains 10.4 points on Terminal-Bench 4.0, surpassing Fable 5 and its full-size sibling, GLM-5.3; gains 5.4 points on DeepSWE v1.1, surpassing Fable 5.1; and gains 5.1 points on SWE-Bench Pro Verified, surpassing Kimi K3 and GPT-5.6 Sol.

Figure 5: Pass@1 on three benchmarks. Orange denotes FireFlash, blue denotes the official scores of its starting model, GLM-5.3-Flash, and the rest are the public scores of the respective models.
Cost and performance
On Terminal-Bench 4.0, FireFlash lies on the cost–performance Pareto frontier (Figure 1). Of the more than 40 combinations of models and reasoning-effort settings in the figure, only four have a lower cost per trial, and none of them scores above 35.8%. Using the public pricing for GLM-5.3-Flash, FireFlash costs US$0.72 per trial, compared with US$22.02 for Fable 5 at the highest reasoning effort. The next point on the frontier, GPT-6.1 Terra, scores 55.6% at a cost of US$1.49. Every model scoring higher than FireFlash costs at least twice as much per trial. Its full-size sibling, GLM-5.3, costs US$8.27 per trial at the highest reasoning effort, yet scores only 41.8%.
Conclusion
FireFlash shows that targeted post-training can turn an open-weight model into a highly capable domain-specific agent, reaching frontier-level performance at a fraction of the inference cost. The authors argue that jointly optimizing the model, training environments, harness, and inference system offers another path to building powerful, efficient agents beyond simply increasing scale. FireFlash is a first step in this direction. Next, the team plans to extend this approach beyond coding and terminal tasks to more complex, longer-horizon work that requires repeated execution.
About the authors
Wenbo Hu is a PhD student in computer science at UCLA, advised by Professors Kai-Wei Chang and Nanyun Peng. His research is in agentic reinforcement learning (Agentic RL), with a focus on large language models, multimodality, and agents. His representative works include Tev, MQT-LLaVA, and 3DLLM-Mem.
The other authors of this article are Jesse Cai, Po-nien Kung, Yuxuan Lu, Di Wu, and Huimin Zeng, listed alphabetically by surname, as well as Professors Nanyun Peng, Dakuo Wang, and Kai-Wei Chang.
This article comes from “Synced,” and was written by “Wenbo Hu.”
Related topics
After reading
Join the AINRK community
Read how to join the community and connect with people working in AI.




