Meta’s AI researchers flipped the script on how machines learn to write faster code. Instead of settling for code that just works, they aimed for speed a challenge riddled with noisy measurements and sparse feedback signals. Their new approach shows a striking improvement, pushing some models' success rate by over 60%.
Cracking the speed code
When AI models learn to code, confirming correctness is straightforward. The output either runs correctly or not a clear yes-or-no signal. However, timing how fast that code runs introduces unpredictability. Run the same program twice, and milliseconds can vary wildly due to background tasks or CPU behaviors.
Meta’s team discovered that the widely used reinforcement learning algorithm, known as Generalized Reinforcement Policy Optimization (GRPO), is highly sensitive to this noise. The unstable signal causes the training process to falter. Adding to the trouble, speed improvements are often minimal, so the AI rarely receives strong positive feedback, making it harder to know which code tweaks actually help.
To overcome this, Meta created DMC-Optim a specialized training benchmark that pairs a controlled simulation environment with a tailored reward system balancing correctness and execution speed. This setup reduces the timing noise problem significantly, letting the AI learn more effectively.
The results speak volumes. The Qwen 2.5 7B model’s pass rate in generating functional, fast code soared from 18% to 31.3%, almost doubling its effectiveness. Another model, CWM 32B, went from 30.7% to an impressive 50.4%. On additional tests, models trained with this new method outpaced traditional approaches more than 80% of the time, even under deliberately challenging timing noise.
This breakthrough could reshape how AI tackles performance optimization, a key factor as programs grow more complex and demand snappier execution. Meta’s innovation reflects a clear trend of refining AI beyond accuracy, focusing deeply on real-world efficiency.
This material is informative and should not be considered financial advice.



