Table of Contents
Click to participate in the 51CTO website content questionnaire" >Click to participate in the 51CTO website content questionnaire
1. Evolution: The origin of the sorting algorithm
2. The highlight: How to use AlphaDev to generate a new sorting algorithm?
3. Origin: Finding the best algorithm while playing games
4. Algorithm innovation: swap move and copy move instruction sequences
5. Test: Promote and improve hashing algorithms
6. Gathering momentum: taking the first step in developing AGI
7. Open source: Milestone breakthrough in AI optimization code
8. Users: Maybe it’s just a gimmick
Reference Information:
Home Technology peripherals AI DeepMind launches a shocking sorting algorithm, and the C++ library is busy updating!

DeepMind launches a shocking sorting algorithm, and the C++ library is busy updating!

Jun 12, 2023 pm 12:04 PM
algorithm c++ library

Compiled | Wang Ruiping, Yan Zheng

AlphaGo has another "little brother" joining!

Google DeepMind "rolled" the Alpha series into sorting algorithms and launched AlphaDev.

It is like a "development secret method". By using reinforcement learning AI to discover sorting algorithms and hashing algorithms, it forcibly speeds up algorithms designed by human programmers by about 70% and 30% respectively.

DeepMind launches a shocking sorting algorithm, and the C++ library is busy updating!

Once the research results were released, they instantly ignited the software circle! Suddenly, the running speed of millions of software around the world soared, directly surpassing the achievements of scientists and engineers for decades, and the LLVM standard C library that had not been updated in ten years was updated.

DeepMind launches a shocking sorting algorithm, and the C++ library is busy updating!

(Source: Nature)

This is also a disruptive technology launched after the merger of Google’s two AI departments. The paper was published in Nature under the title "Faster sorting algorithms discovered using deep reinforcement learning". The first author of the paper is Daniel Mankowitz, a computer scientist at DeepMind.

1. Evolution: The origin of the sorting algorithm

Sorting is a method of organizing many items in a specific order, for example, three letters in alphabetical order, from largest to smallest Sequence five numbers or sort a database containing millions of records.

The ordering method can be traced back to the second to third centuries and is still evolving. Initially, scholars manually sorted the thousands of books on the shelves of the Library of Alexandria into alphabetical order.

After the Industrial Revolution, self-sorting machines—tabulating machines that stored information on punched cards—were invented to collect the results of the 1890 U.S. Census.

In the 1950s, commercial computers began to rise, and sorting algorithms were immediately produced. Enter some unsorted numbers into a sorting algorithm and it will produce a sorted sequence of numbers.

Currently, many different sorting techniques and algorithms are still being used in code bases everywhere to process massive amounts of data.​​

DeepMind launches a shocking sorting algorithm, and the C++ library is busy updating!

#After decades of research and development, the efficiency of these sorting algorithms has continued to improve, and they have been recognized by computer scientists and programmers. However, significant challenges remain for its further improvement.

2. The highlight: How to use AlphaDev to generate a new sorting algorithm?

The researchers originally used AlphaDev to generate new algorithms with the goal of completing a given task efficiently.

DeepMind launches a shocking sorting algorithm, and the C++ library is busy updating!

AlphaDev builds a completely new algorithm and is not developed based on previous algorithms, so it can be regarded as original. In the process, it applies an intermediate language of assembly code. AlphaDev makes it easier to create efficient algorithms because the language is closer to computer binary instructions.

Specifically, AlphaDev generates an instruction each time, and then tests whether its output is correct. It also sets requirements in the model to generate the shortest algorithm.

When asked to redesign the sorting algorithm, AlphaDev randomly generated a new sorting algorithm that was 70% faster than the existing algorithm and could sort five data at the same time. It was also 1.7% faster than the best algorithm when sorting 250,000 data.

This innovation will have a huge impact on global algorithms, as sorting algorithms are widely used in a variety of common software. DeepMind has open-sourced them and integrated them into the Libc standard library.

According to DeepMind researchers: “Due to the large number of instruction combinations, the seemingly simple research process is extremely difficult.”

3. Origin: Finding the best algorithm while playing games

Furthermore, AlphaDev is a more advanced model designed based on the structure of AlphaZero. AlphaZero was previously DeepMind’s reinforcement learning model, which defeated world champions in Go, chess and other chess games.

Through this experiment, the new model AlphaDev exerts its unique advantages in moving from playing games to solving scientific problems, and from experimental simulations to real-world applications.

The researchers simulated sorting as a single-player "assembly game" to train AlphaDev to discover new algorithms. During each game turn, AlphaDev observes the generated algorithm and the information contained in the CPU, and then selects an instruction to add to the algorithm to make each move.

The paper mentions that assembly games are very difficult because AlphaDev must be able to efficiently search through a large number of possible instruction combinations to obtain an algorithm that can be sorted.

The number of instruction combinations is similar to the number of particles in the universe or the number of possible combinations of moves in chess (10120 games) and Go (10700 games). Each wrong move will invalidate the entire algorithm.

DeepMind launches a shocking sorting algorithm, and the C++ library is busy updating!

The model then outputs an algorithm and compares it to the expected output, rewarding the agent based on the algorithm's correctness and latency.

When building an algorithm, each time an instruction is input, AlphaDev checks for correctness by comparing the output algorithm with the expected results (for a sorting algorithm, this means that after inputting unordered numbers, it can output correctly sorted numbers).

The model rewards AlphaDev for its correct ordering of numbers and its efficiency. In the end AlphaDev won the competition by discovering a more accurate and faster program.

4. Algorithm innovation: swap move and copy move instruction sequences

AlphaDev not only generates a faster algorithm, but also innovates two instruction sequences.

Specifically, the sorting algorithm it generates includes two new instruction sequences: swap move and copy move, and one instruction will be saved each time it is used. The researchers call it "AlphaDev's swap move and copy move."

DeepMind launches a shocking sorting algorithm, and the C++ library is busy updating!

This novel approach is reminiscent of AlphaGo's "Move 37" - a "counter-intuitive" chess play that shocked onlookers and created a chess legend Hand failure.

By swapping the move and copy move instruction sequences, AlphaDev skips a step, completing the goal in a way that looks like a mistake but is actually a shortcut. This means that AlphaDev has the ability to discover initial solutions and try to improve computer science algorithms.

5. Test: Promote and improve hashing algorithms

After researchers discovered a faster sorting algorithm, they tried to apply it to another computer science algorithm-the hashing algorithm. promotion and improvement.

Hashing algorithm is a basic algorithm in computing and is used to retrieve, store and compress data. Just like librarians use a classification system to locate a certain book, hashing algorithms help users know what they are looking for and where to find it.

These algorithms are able to take the data for a specific key (for example, the username "Jane Doe") and hash it - converting the raw data into a unique string (for example, 1234ghty).

The computer uses this hash to quickly retrieve data related to the key, rather than searching through all the data.

Researchers applied AlphaDev to one of the most commonly used hashing algorithms in data structures in an attempt to discover a faster algorithm. When applied to the 9-16 byte range of the hash function, AlphaDev produced an algorithm that was 30% faster.

Earlier this year, the new hashing algorithm generated by AlphaDev was released into the open source Abseil library, making it available to millions of developers around the world. It is now estimated to be used by tens of thousands every day. billion times.

6. Gathering momentum: taking the first step in developing AGI

By optimizing the "sorting and hashing algorithm", AlphaDev has demonstrated the ability to generate different practical new algorithms.

This is also AlphaDev’s first step towards developing general artificial intelligence (AGI) tools. Similar AI tools can also help optimize the entire computing ecosystem and solve other problems that benefit society.

Although the optimization algorithm in the low-level assembly instruction space is very powerful, it also has limitations. Currently, the team is studying AlphaDev's ability to optimize algorithms in high-level languages ​​(such as C), which will be more beneficial to developers.

In short, it is hoped that these new discoveries will inspire developers to create new technologies and methods, further optimize basic algorithms, and create a stronger and more sustainable computing ecosystem.

7. Open source: Milestone breakthrough in AI optimization code

Previously, sorting algorithms were used trillions of times every day. With the growth of computing needs, people have higher and higher performance requirements for algorithms. Although human engineers have discovered different sorting algorithms, after decades of optimization, it is difficult to make breakthroughs and cannot meet the growing demand.

DeepMind launches a shocking sorting algorithm, and the C++ library is busy updating!

Now, AlphaDev has discovered a faster sorting algorithm for sorting data.

The new ranking algorithm can be used to rank online search results and social posts, as well as to process data on computers and mobile phones.

It is worth celebrating that the new sorting algorithm has been open sourced in the main C library. It is currently used by millions of developers and companies around the world for cloud computing, online shopping, supply chain management, and more.

In short, using artificial intelligence tools to optimize algorithms will completely change traditional programming methods. This is the first time in more than ten years that the sorting library has been changed, and the first time that algorithms designed by reinforcement learning models have been added to the sorting library. Therefore, it has become a milestone breakthrough in using artificial intelligence to optimize code.

8. Users: Maybe it’s just a gimmick

Users have mixed opinions about the research results, with most of the voices praising on Twitter:

DeepMind launches a shocking sorting algorithm, and the C++ library is busy updating!

Learn the basics Sequencing tasks is one of the skills programmers master early on, and this skill increases speed by 70%. It’s exciting to see leveraging AI to deliver significant acceleration in the algorithms and libraries we all rely on."

"Soon, ordinary people will be able to become advanced programmers."

" Interesting method, start optimizing from the assembly level!

However, some programmers think this is just a gimmick, and DeepMind exaggerates the function of the algorithm.

First of all, from the perspective of efficiency, It only counts the delay of the algorithm, rather than actually changing the time complexity.

Moreover, it does not really change the sorting, which is common in various other code libraries.

Reference Information:

1.https://www.nature.com/articles/s41586-023-06004-9

2.https://www.deepmind.com/blog/alphadev -discovers-faster-sorting-algorithms

3.https://www.deepmind.com/blog/optimising-computer-systems-with-more-generalised-ai-tools

4 .https://twitter.com/demishassabis

The above is the detailed content of DeepMind launches a shocking sorting algorithm, and the C++ library is busy updating!. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CLIP-BEVFormer: Explicitly supervise the BEVFormer structure to improve long-tail detection performance CLIP-BEVFormer: Explicitly supervise the BEVFormer structure to improve long-tail detection performance Mar 26, 2024 pm 12:41 PM

Written above & the author’s personal understanding: At present, in the entire autonomous driving system, the perception module plays a vital role. The autonomous vehicle driving on the road can only obtain accurate perception results through the perception module. The downstream regulation and control module in the autonomous driving system makes timely and correct judgments and behavioral decisions. Currently, cars with autonomous driving functions are usually equipped with a variety of data information sensors including surround-view camera sensors, lidar sensors, and millimeter-wave radar sensors to collect information in different modalities to achieve accurate perception tasks. The BEV perception algorithm based on pure vision is favored by the industry because of its low hardware cost and easy deployment, and its output results can be easily applied to various downstream tasks.

Implementing Machine Learning Algorithms in C++: Common Challenges and Solutions Implementing Machine Learning Algorithms in C++: Common Challenges and Solutions Jun 03, 2024 pm 01:25 PM

Common challenges faced by machine learning algorithms in C++ include memory management, multi-threading, performance optimization, and maintainability. Solutions include using smart pointers, modern threading libraries, SIMD instructions and third-party libraries, as well as following coding style guidelines and using automation tools. Practical cases show how to use the Eigen library to implement linear regression algorithms, effectively manage memory and use high-performance matrix operations.

Explore the underlying principles and algorithm selection of the C++sort function Explore the underlying principles and algorithm selection of the C++sort function Apr 02, 2024 pm 05:36 PM

The bottom layer of the C++sort function uses merge sort, its complexity is O(nlogn), and provides different sorting algorithm choices, including quick sort, heap sort and stable sort.

Can artificial intelligence predict crime? Explore CrimeGPT's capabilities Can artificial intelligence predict crime? Explore CrimeGPT's capabilities Mar 22, 2024 pm 10:10 PM

The convergence of artificial intelligence (AI) and law enforcement opens up new possibilities for crime prevention and detection. The predictive capabilities of artificial intelligence are widely used in systems such as CrimeGPT (Crime Prediction Technology) to predict criminal activities. This article explores the potential of artificial intelligence in crime prediction, its current applications, the challenges it faces, and the possible ethical implications of the technology. Artificial Intelligence and Crime Prediction: The Basics CrimeGPT uses machine learning algorithms to analyze large data sets, identifying patterns that can predict where and when crimes are likely to occur. These data sets include historical crime statistics, demographic information, economic indicators, weather patterns, and more. By identifying trends that human analysts might miss, artificial intelligence can empower law enforcement agencies

Improved detection algorithm: for target detection in high-resolution optical remote sensing images Improved detection algorithm: for target detection in high-resolution optical remote sensing images Jun 06, 2024 pm 12:33 PM

01 Outlook Summary Currently, it is difficult to achieve an appropriate balance between detection efficiency and detection results. We have developed an enhanced YOLOv5 algorithm for target detection in high-resolution optical remote sensing images, using multi-layer feature pyramids, multi-detection head strategies and hybrid attention modules to improve the effect of the target detection network in optical remote sensing images. According to the SIMD data set, the mAP of the new algorithm is 2.2% better than YOLOv5 and 8.48% better than YOLOX, achieving a better balance between detection results and speed. 02 Background & Motivation With the rapid development of remote sensing technology, high-resolution optical remote sensing images have been used to describe many objects on the earth’s surface, including aircraft, cars, buildings, etc. Object detection in the interpretation of remote sensing images

Practice and reflections on Jiuzhang Yunji DataCanvas multi-modal large model platform Practice and reflections on Jiuzhang Yunji DataCanvas multi-modal large model platform Oct 20, 2023 am 08:45 AM

1. The historical development of multi-modal large models. The photo above is the first artificial intelligence workshop held at Dartmouth College in the United States in 1956. This conference is also considered to have kicked off the development of artificial intelligence. Participants Mainly the pioneers of symbolic logic (except for the neurobiologist Peter Milner in the middle of the front row). However, this symbolic logic theory could not be realized for a long time, and even ushered in the first AI winter in the 1980s and 1990s. It was not until the recent implementation of large language models that we discovered that neural networks really carry this logical thinking. The work of neurobiologist Peter Milner inspired the subsequent development of artificial neural networks, and it was for this reason that he was invited to participate in this project.

Application of algorithms in the construction of 58 portrait platform Application of algorithms in the construction of 58 portrait platform May 09, 2024 am 09:01 AM

1. Background of the Construction of 58 Portraits Platform First of all, I would like to share with you the background of the construction of the 58 Portrait Platform. 1. The traditional thinking of the traditional profiling platform is no longer enough. Building a user profiling platform relies on data warehouse modeling capabilities to integrate data from multiple business lines to build accurate user portraits; it also requires data mining to understand user behavior, interests and needs, and provide algorithms. side capabilities; finally, it also needs to have data platform capabilities to efficiently store, query and share user profile data and provide profile services. The main difference between a self-built business profiling platform and a middle-office profiling platform is that the self-built profiling platform serves a single business line and can be customized on demand; the mid-office platform serves multiple business lines, has complex modeling, and provides more general capabilities. 2.58 User portraits of the background of Zhongtai portrait construction

Add SOTA in real time and skyrocket! FastOcc: Faster inference and deployment-friendly Occ algorithm is here! Add SOTA in real time and skyrocket! FastOcc: Faster inference and deployment-friendly Occ algorithm is here! Mar 14, 2024 pm 11:50 PM

Written above & The author’s personal understanding is that in the autonomous driving system, the perception task is a crucial component of the entire autonomous driving system. The main goal of the perception task is to enable autonomous vehicles to understand and perceive surrounding environmental elements, such as vehicles driving on the road, pedestrians on the roadside, obstacles encountered during driving, traffic signs on the road, etc., thereby helping downstream modules Make correct and reasonable decisions and actions. A vehicle with self-driving capabilities is usually equipped with different types of information collection sensors, such as surround-view camera sensors, lidar sensors, millimeter-wave radar sensors, etc., to ensure that the self-driving vehicle can accurately perceive and understand surrounding environment elements. , enabling autonomous vehicles to make correct decisions during autonomous driving. Head

See all articles