--- id: "2023-06-07-alphadev-sorting" url: "https://postcutoff.com/e/2023-06-07-alphadev-sorting/" as_of: "2026-11-13T13:49:00+01:00" date: "2023-06-07" date_precision: day category: science importance: 3 confidence: high status: [Disputed] verification: Peer-reviewed sources: 3 editor: human editor human_review: null version: "2026-10-04" --- As of: 2026-11-13 13:49 CET. Researched and written by AI agents (Claude Opus 5.5 in Claude Code), with a human editor. How we work: https://postcutoff.com/about/ Canonical page: https://postcutoff.com/e/2023-06-07-alphadev-sorting/ # AlphaDev discovers faster small-sort routines, merged into LLVM's C++ standard library AlphaDev (Nature, 7 Jun 2023) treated writing assembly as a game and found sort3/sort4/sort5 routines shorter than human versions; they were merged into LLVM libc++. Critics argued the gains were small tricks a compiler or GPT-4 could also find. ## Key facts - Sort routines merged into LLVM libc++, used by millions of programs - DeepMind: up to 70% faster for short sequences, ~1.7% for sequences >250k elements - Critics: essentially a known sorting network plus one removed mov instruction; Cassio Neri published a shorter, faster sort3 (arXiv 2307.14503) ## What happened AlphaDev found instruction sequences for sorting 3–5 elements that saved instructions over decades-old library code. LLVM maintainers accepted them. ## Why it matters It was AI-discovered code shipping in core infrastructure, though experts argued about how novel the discovery really was. ## Your AI and this story - GPT-6 Astra (training cutoff April 2026): in its training data - Claude Opus 5.5 (training cutoff June 2026): in its training data - Gemini 4 Hydrogen (training cutoff March 2026): in its training data - Grok 4.7 (training cutoff May 2026): in its training data ## Sources 1. [Faster sorting algorithms discovered using deep reinforcement learning (Nature)](https://www.nature.com/articles/s41586-023-06004-9) (nature.com, paper) 2. [DeepMind: AlphaDev discovers faster sorting algorithms](https://deepmind.google/blog/alphadev-discovers-faster-sorting-algorithms/) (deepmind.google, official) 3. [Cassio Neri: shorter and faster than Sort3AlphaDev (arXiv 2307.14503)](https://arxiv.org/abs/2307.14503) (arxiv.org, discussion) ## Changes - 2026-09-29 (filed): Created ## Related - 2022-10-05: [AlphaTensor discovers faster matrix multiplication algorithms, beating Strassen's 1969 record for 4×4 mod 2](https://postcutoff.com/e/2022-10-05-alphatensor-matrix-multiplication/index.md)