TL;DR
Training Large Language Models (LLMs) to code using Reinforcement Learning (RL) usually means choosing between deploying an expensive fleet of hyper-specialized models or settling for a single jack-of-all-trades model that suffers from tasks interfering with one another. ASTOR solves this by dynamically measuring "task utility"—how much a model is learning from a task and whether it helps or hurts other tasks—to adjust both what data the model sees and how cautiously its weights are updated on the fly. The result is a single, unified coding model that actually beats specialized, single-task models at their own games.
What Problem Does This Paper Address?
Software engineering isn't just writing code from scratch; it involves understanding logic, writing implementations, building unit tests, and drafting commit messages. Because code can be compiled and executed, it provides clean, verifiable reward signals, making RL a powerhouse for post-training coding LLMs.
However, training separate specialist models for every stage of the workflow means your memory and deployment costs scale linearly with the number of tasks. Yet, if you rely on just one specialist, its performance craters outside its comfort zone.
Multi-task RL (MTRL) tries to train one model on everything simultaneously, but existing approaches treat heterogeneous coding tasks uniformly. They typically mix tasks evenly or use a rigid, pre-set curriculum (what to learn), and apply the exact same optimization constraints across the board (how to learn). This causes severe task interference: a syntactically strict task like unit test generation gets broken by big policy updates, while a flexible natural-language task like writing commit messages gets overly restricted.
Methods
Think of how a skilled student studies for finals: you spend more time on subjects you haven't mastered yet, and you notice when studying linear algebra accidentally makes physics easier. The authors formalize this intuition into a unified signal called task utility, built on top of standard Group Relative Policy Optimization (GRPO).
Task utility combines two online metrics:
- Learning Potential: Measured by the variance in rewards across multiple attempts (rollouts) for a prompt. High variance means the model sometimes succeeds and sometimes fails—the sweet spot for learning.
- Cross-Task Synergy: Measured by the cosine similarity of compressed policy gradients between tasks. Positive similarity means updating the model on Task A also helps Task B; negative means they are fighting each other.
ASTOR uses this utility signal to coordinate two coupled modules:
- Hierarchical Utility-Routed Data Scheduling (What to learn): At each step, ASTOR divides the training batch budget across tasks using a softmax over their task utilities. Then, within each task, it prioritizes specific prompts that show high reward variance and recent historical improvement, avoiding wasting compute on problems that are already trivial or currently impossible.
- Adaptive Utility-Calibrated Policy Optimization (How to learn): In RL, KL regularization acts as a leash keeping the model from straying too far from its original behavior. Instead of one uniform leash, ASTOR gives each task a baseline KL penalty suited to its syntactic strictness, and dynamically scales it up or down based on real-time task utility. When a task gets a massive share of the batch budget (high utility), its KL leash tightens slightly so the shared model doesn't over-specialize toward it.
Datasets
The authors construct a multi-task suite spanning four distinct paradigms (no brand-new benchmarks are introduced, though custom training splits are curated from existing repositories):
- Code I/O Prediction: Trained on LeetCode (2,088 samples); evaluated on CRUXEval.
- Code Generation: Trained on LiveCodeBench and Codeforces (2,082 samples); evaluated on Aider-Polyglot-Python.
- Unit Test Generation: Trained on real-world open-source Java repositories with executable environments (1,148 samples); evaluated on Defects4J 2.0.
- Commit Message Generation: Trained on the MCMD dataset (2,446 samples); evaluated on MCMDEval+.
Key Insights and Ideas
- Unit testing is the "rebel" task: By tracking gradient similarities during training, the authors discovered that code I/O and commit message generation remain largely synergistic, whereas unit test generation exhibits persistent, sharp gradient conflicts with other tasks (similarity dropping below $-0.4$). Naive uniform mixing forces these conflicting gradients together, explaining why standard joint training degrades code generation performance so badly.
- Compressed gradients are plenty good enough: Computing full-parameter gradient cosine similarity across an 8B-parameter LLM on the fly is computationally infeasible. The authors compress gradients by summing over all dimensions except the last within each layer, yielding a compact vector that agrees in sign with full gradients 92.3% of the time (0.91 Spearman correlation).
- Sampling quotas and KL leashes are natural dance partners: Giving a high-utility task more data while simultaneously tightening its KL constraint sounds paradoxical at first, but it works brilliantly—it lets the model extract maximum signal from high-value data without letting that task hijack the shared weights.
Key Results
Evaluated on Qwen2.5-Coder-7B and Qwen3-8B, ASTOR dominates both single-task specialists and multi-task baselines (Joint Learning, Curriculum Learning, and TIES Model Merging):
- Beats the specialists: On average across all 10 metrics, the single ASTOR model outperforms the best single-task specialist by 9.0% on Qwen2.5-Coder-7B (scoring 38.65) and 9.5% on Qwen3-8B (scoring 44.29). In fact, on Qwen3-8B, the unified ASTOR model even beats the hypothetical ensemble of using four separate specialist models on their respective home turfs (44.29 vs. 43.29 average).
- Crushes MTRL baselines: ASTOR surpasses the strongest MTRL baseline (Joint Learning) by 12.8% on Qwen2.5-Coder-7B and 7.5% on Qwen3-8B.
- Every gear matters: Ablating either task allocation, prompt prioritization, or dynamic task-specific KL regularization causes immediate drops (e.g., removing hierarchical scheduling drops code generation Pass@1 by 23.1% on Qwen2.5-Coder-7B).
Limitations and Future Work
Not discussed in the paper. (Note: The authors explicitly state in the conclusion that limitations and future work are deferred to Appendix E, which is not included in the provided main text).
Summary updated