News Report Technology
June 20, 2023

DeepMind’s AlphaZero Learns Efficient Sorting Algorithms in Neural Network Optimization

In Brief

DeepMind’s AlphaZero learns efficient sorting algorithms by playing a sorting game using reinforcement learning techniques.

DeepMind has once again made an advancement in the machine learning. Following their success in using reinforcement learning (RL) to teach AlphaZero more efficient matrix multiplication algorithms, they have now turned their attention to sorting algorithms, with promising results.

DeepMind's AlphaZero Learns Efficient Sorting Algorithms in Neural Network Optimization
deepmind.com

Sorting is a fundamental operation used in numerous computer programs. The efficiency of sorting arrays, performing the task in the fewest operations possible, holds great importance. Traditionally, researchers have devised various efficient sorting algorithms for different scenarios based on array sizes and data characteristics. However, DeepMind decided to explore a novel approach: teaching a neural network to solve this problem.

To accomplish this, DeepMind introduced the task of sorting an array as a game to AlphaZero. Through RL techniques, they trained AlphaZero to play this sorting game. The resulting model, known as AlphaDev, showcased remarkable capabilities in learning efficient sorting algorithms.

The sorting game operates by representing the environment’s state as a pair, where P denotes the current sorting algorithm generated in assembly language, and Z represents the state of memory and registers. At each time step, the AlphaZero agent takes the current state as input and performs an action, which involves adding a new instruction to the assembler language algorithm, such as mov.

DeepMind’s AlphaZero Learns Efficient Sorting Algorithms in Neural Network Optimization

Step by step, AlphaZero constructs the final sorting algorithm in assembly language. The model’s reward at each step is determined by two factors: the correctness of the algorithm obtained and its latency. Correctness is evaluated based on predefined input-output pairs, where the input represents an unsorted array, and the output represents the same array but sorted.

The process of generating the sorting algorithm continues for a predetermined number of steps. If a final working algorithm is not obtained within this timeframe, the generation process starts anew.

DeepMind’s AlphaZero Learns Efficient Sorting Algorithms in Neural Network Optimization

The trained model was tasked with producing sorting algorithms for sequences of length 3, 4, and 5. It’s worth noting that there are two types of sorting algorithms: fixed sort, which sorts arrays of a specific length, and variable sort, which can handle arrays of different lengths. In both cases, AlphaZero surpassed existing algorithms commonly used in programs. AlphaZero achieved improvements in sorting arrays of length 3 and 5 for fixed sort, and it discovered an intriguing approach to sort arrays of length 4 for variable sort.

For a more comprehensive understanding of the sorting algorithms discovered by AlphaDev, refer to the Nature article titled “AlphaDev: AlphaZero’s Journey into Efficient Sorting Algorithms”.

Read more about AI:

Disclaimer

In line with the Trust Project guidelines, please note that the information provided on this page is not intended to be and should not be interpreted as legal, tax, investment, financial, or any other form of advice. It is important to only invest what you can afford to lose and to seek independent financial advice if you have any doubts. For further information, we suggest referring to the terms and conditions as well as the help and support pages provided by the issuer or advertiser. MetaversePost is committed to accurate, unbiased reporting, but market conditions are subject to change without notice.

About The Author

Damir is the team leader, product manager, and editor at Metaverse Post, covering topics such as AI/ML, AGI, LLMs, Metaverse, and Web3-related fields. His articles attract a massive audience of over a million users every month. He appears to be an expert with 10 years of experience in SEO and digital marketing. Damir has been mentioned in Mashable, Wired, Cointelegraph, The New Yorker, Inside.com, Entrepreneur, BeInCrypto, and other publications. He travels between the UAE, Turkey, Russia, and the CIS as a digital nomad. Damir earned a bachelor's degree in physics, which he believes has given him the critical thinking skills needed to be successful in the ever-changing landscape of the internet. 

More articles
Damir Yalalov
Damir Yalalov

Damir is the team leader, product manager, and editor at Metaverse Post, covering topics such as AI/ML, AGI, LLMs, Metaverse, and Web3-related fields. His articles attract a massive audience of over a million users every month. He appears to be an expert with 10 years of experience in SEO and digital marketing. Damir has been mentioned in Mashable, Wired, Cointelegraph, The New Yorker, Inside.com, Entrepreneur, BeInCrypto, and other publications. He travels between the UAE, Turkey, Russia, and the CIS as a digital nomad. Damir earned a bachelor's degree in physics, which he believes has given him the critical thinking skills needed to be successful in the ever-changing landscape of the internet. 

Hot Stories
Join Our Newsletter.
Latest News

The Calm Before The Solana Storm: What Charts, Whales, And On-Chain Signals Are Saying Now

Solana has demonstrated strong performance, driven by increasing adoption, institutional interest, and key partnerships, while facing potential ...

Know More

Crypto In April 2025: Key Trends, Shifts, And What Comes Next

In April 2025, the crypto space focused on strengthening core infrastructure, with Ethereum preparing for the Pectra ...

Know More
Read More
Read more
Interlace Is Powering the Future of Crypto Payments—and Taking On the Banks
Hack Seasons Interview Business Markets Technology
Interlace Is Powering the Future of Crypto Payments—and Taking On the Banks
May 16, 2025
Fluence Is Building the Future of Decentralized Compute — One Market at a Time
Hack Seasons Interview Markets Technology
Fluence Is Building the Future of Decentralized Compute — One Market at a Time
May 16, 2025
What Makes f(x)Protocol the Smart Bet for Stablecoin Holders
Hack Seasons Interview Business Markets Technology
What Makes f(x)Protocol the Smart Bet for Stablecoin Holders
May 16, 2025
Bitget Wallet Announces Integration With Believe, Enabling Access To Early-Stage Token Trading
News Report Technology
Bitget Wallet Announces Integration With Believe, Enabling Access To Early-Stage Token Trading
May 16, 2025