Buffio.

A field journal of machine-made science

Mathematics · 7 June 2023

Sorting routines discovered by reinforcement learning, now in the C++ standard library

AlphaDev treated the search for a faster sorting routine as a single-player game and found small sorting algorithms that beat the human benchmarks, which were then merged into the LLVM standard C++ sort library.

Vintage engraving of blocks of rising height being sorted by curved arrows, one rust-red block.
Illustration (decorative, not from the paper)

Sorting routines run trillions of times a day, and improving them had resisted both human effort and automated search. The authors recast the problem as a single-player game over assembly instructions and trained AlphaDev, a deep reinforcement-learning agent, to play it.

AlphaDev discovered small sorting algorithms from scratch that outperform the previously known human benchmarks. The routines were integrated into the LLVM standard C++ sort library, replacing a component with one found automatically by reinforcement learning. The paper also reports results in other domains to show the approach generalizes.

At a glance

AI system
AlphaDev, a deep reinforcement-learning agent working at assembly level
Institution
Google DeepMind
Announced / published
Published in
Nature
Added to Buffio
Last updated

Also in: Math problems solved by AI