


"By swapping and copy-moving, AlphaDev skips a step, connecting items in a way that seems wrong, but is actually a shortcut." This unprecedented and counterintuitive thought cannot help but It reminds me of the spring of 2016.
Seven years ago, AlphaGo defeated the human world champion at Go, and now AI has taught us another lesson in programming.
Early this morning, two sentences from Google DeepMind CEO Hassabis detonated the computer field: "AlphaDev has discovered a new and faster sorting algorithm, and we have open sourced it into the main C library for developers to use. This is just the beginning of AI's progress in improving code efficiency."
This time , Google DeepMind's new reinforcement learning system AlphaDev discovered a hash algorithm that is faster than ever before, which is a basic algorithm in the field of computer science. The results of AI have now been incorporated into the LLVM standard C library Abseil and open source.
How important is this result? "We estimate that the sorting and hashing algorithms it discovered are called trillions of times every day around the world," said Daniel J. Mankowitz, one of AlphaDev's lead authors and a research scientist at Google DeepMind.
These algorithms improve the LLVM libc sorting library. For shorter sequences, the sorting library is 70% faster. For sequences of more than 250,000 elements, the speed is also 70%. It can be increased by about 1.7%. Google DeepMind says this is the first change to this part of the sequencing library in more than a decade. It seems that now AI can not only help people write code, but also help us write better code.
In the latest blog, the authors of the new system introduced AlphaDev in detail.
New algorithms will change the foundation of computing
Digital societies drive growing demands for computing and energy. Over the past fifty years, the digital age has relied on improvements in hardware to keep up with demand. But as microchips approach their physical limits, improving the code that runs on them becomes critical. This is especially important for algorithms contained in code that are run trillions of times every day.
This research by Google DeepMind was born out of this. The related paper has been published in "Nature". AlphaDev is an AI system that uses reinforcement learning to discover algorithms, even beyond The result of decades of work by scientists and engineers.
Overall, AlphaDev discovered a faster sorting algorithm. Although billions of people use these algorithms every day, no one realizes that there is room for optimization. Sorting algorithms are used in a wide range of applications, from online search results, social post sorting, to various data processing on computers and mobile phones, all of which are inseparable from sorting algorithms. Using AI to generate better algorithms will change the way humans program computers and will have a significant impact on an increasingly digital society.
By open-sourcing the new sorting algorithm in a major C library, millions of developers and companies around the world can now leverage artificial intelligence in industries as diverse as cloud computing, online shopping, and supply chain management. Use it in smart applications. This is the first change to the ranking library in more than a decade, and the first time algorithms designed with reinforcement learning have been added to the library. Consider this an important milestone in using artificial intelligence to progressively optimize the world's code.
About sorting
The sorting algorithm is a method of arranging certain tasks in a specific order. For example, sort three letters alphabetically, arrange five numbers from largest to smallest, or sort a database of millions of records.
This algorithm has been around for a long time and has evolved well. One of the earliest examples of ordering dates back to the 2nd and 3rd centuries AD, when scholars alphabetized thousands of books by hand on the shelves of the Library of Alexandria. With the advent of the Industrial Revolution came machines that could help people sort, with tabulating machines storing information using punched cards that were used to collect the results of the U.S. 1890 census.
With the rise of commercial computers in the 1950s, the earliest computer science algorithms for sorting began to develop. Today, there are many different sorting techniques and algorithms used in code bases around the world to process massive amounts of online data.
Input a series of unsorted numbers into the algorithm and output sorted numbers.
After decades of research by computer scientists and programmers, the current sorting algorithm is already so efficient that it is difficult to achieve further improvements. This is somewhat similar to Trying to find a new way to save power or be more efficient with mathematics, and these algorithms are the cornerstone of computer science.
Explore new algorithms: assembly instructions
AlphaDev explores faster algorithms from scratch instead of based on existing algorithms. In addition, AlphaDev can also be used Looking for an area that most people don't get involved in: computer assembly instructions.
Assembly instructions can be used to create binary code that the computer executes. Developers write code in a high-level language such as C, but must translate it into "low-level" assembly instructions that the computer understands.
Google DeepMind believes there is much room for improvement at this level that may be difficult to detect in higher-level programming languages. At this level, computers are more flexible in their storage and operations, which means there are more potential possibilities for improvements that could have a greater impact on speed and energy use.
Code is usually written in a high-level programming language such as C. The compiler then converts this into low-level CPU instructions, called assembly instructions. The assembler converts assembly instructions into executable machine code so that the computer can run.
Figure A: Example of C algorithm that can sort up to two elements ; Figure B: Corresponding assembly representation.
Using AlphaGo’s method to find the best algorithm
AlphaDev is based on a previous achievement of Google DeepMind: defeating games such as Go, chess and chess The world champion reinforcement learning model AlphaZero. And AlphaDev shows how this model transfers from games to scientific challenges, and from simulations to real-world applications.
To train AlphaDev to discover new algorithms, the team turned sorting into a single-player "assembly game." At each turn, AlphaDev observes the algorithm it produces and the information contained in the CPU, and then makes its next move by selecting an instruction to add to the algorithm.
Assembly games are very difficult because AlphaDev must search efficiently through a large number of possible instruction combinations to find an algorithm that can be sorted and faster than the current best algorithm. The number of possible combinations of instructions is similar to the number of particles in the universe, or the number of possible combinations of moves in chess (10^120 games) and Go (10^700 games), and one wrong move can bring down the entire algorithm.
Figure A: Assembly game. The player AlphaDev receives as input the state of system st and plays chess by selecting an assembly instruction to add to the currently generated algorithm. Figure B: Reward calculation. After each move, the resulting algorithm is fed a test input sequence—for sort3, this corresponds to all combinations of three element sequences. The algorithm then produces an output that is compared to the expected output of the sorted sequence given the sorting situation. Agents are rewarded based on algorithm correctness and latency.
#When building an algorithm, one instruction at a time, AlphaDev checks that the algorithm's output is correct by comparing it to the expected result. For a sorting algorithm, this means that unordered numbers go in and correctly sorted numbers come out. The team rewards AlphaDev for correctly sorting numbers as well as the speed and efficiency of the sorting, and AlphaDev then wins the game by discovering the correct, faster program.
It discovered faster sorting algorithms
AlphaDev discovered new sorting algorithms that resulted in improvements to the LLVM libc sorting library: The sequencing library is 70% faster for shorter sequences and about 1.7% faster for sequences over 250,000 elements.
# Among them, the Google DeepMind team is more focused on improving the short sequence sorting algorithm of three to five elements. These algorithms are among the most widely used because they are often called multiple times as part of a larger sorting function, and improving these algorithms can increase the overall speed of sorting any number of items.
#To make the new sorting algorithms more useful to people, the team reverse-engineered the algorithms and translated them into C, which is the most commonly used by developers. One of the popular programming languages.
Currently, these algorithms are provided in the LLVM libc standard sorting library (https://reviews.llvm.org/D118029) and are used by millions of people around the world Used by developers and companies.
"Exchange and copy actions", the hand of God reappears?
In fact, AlphaDev not only discovered faster algorithms, but also discovered new methods. Its sorting algorithm consists of a new sequence of instructions that saves an instruction every time it is applied - which obviously has a huge impact, since these algorithms are used trillions of times every day. They call these "AlphaDev swap and copy actions."
This novel method is reminiscent of AlphaGo's "Step 37" - at that time, this counter-intuitive method stunned onlookers and led to the legendary Lee Sedol The Go player was defeated. By swapping and copying actions, AlphaDev skips a step, connecting items in a way that looks like a mistake but is actually a shortcut. This demonstrates AlphaDev’s ability to uncover original solutions and challenge the way humans think about how to improve computer science algorithms.
Left picture: min (A,B,C) original sort3 implementation; right picture: AlphaDev Swapping moves - AlphaDev discovered that you only need min (A,B).
Left: Original implementation using max(B,min(A,C,D)) in a larger sorting algorithm for sorting eight elements; Right: AlphaDev discovery , when using its copy action, only max(B, min(A, C)) is required.
Scaling Ability Test: From "Sort" to "Hash"
After discovering a faster sorting algorithm, the team tested whether AlphaDev could generalize and improving a different computer science algorithm: hashing.
Hashing is a basic algorithm used in computing to retrieve, store, and compress data. Just like a librarian who uses a classification system to locate a particular book, hashing algorithms help users know what they are looking for and where to find it. These algorithms take data for a specific key (e.g. username “Jane Doe”) and hashes it – a process that converts the raw data into a unique string (e.g. 1234ghfty). The computer uses this hash to quickly retrieve data related to the key instead of searching through all the data.
The team 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 hash functions in the 9-16 byte range, AlphaDev found a 30% improvement in algorithm speed.
This year, AlphaDev’s new hashing algorithm has been released into the open source Abseil library, making it available to millions of developers around the world. It is now used probably every day Used trillions of times.
Open source address: https://github.com/abseil/abseil-cpp/commit/74eee2aff683cc7dcd2dbaa69b2c654596d8024e
Conclusion
Google DeepMind By optimizing and launching improved sorting and hashing algorithms for use by developers around the world, AlphaDev demonstrates its ability to generalize and discover new algorithms with real-world impact. AlphaDev can be seen as a step toward developing general-purpose AI tools that can help optimize the entire computing ecosystem and solve other problems for the benefit of society.
Although it is very powerful to optimize in the low-level assembly instruction space, AlphaDev still has limitations as the algorithm grows, and the team is currently exploring its direct optimization in high-level languages such as C. The ability to optimize algorithms, which is more useful for developers.
AlphaDev's discoveries, such as swap and copy actions, show not only that it can improve algorithms but also find new solutions. These findings may inspire researchers and developers to create technologies and methods that can further optimize underlying algorithms to create a more robust and sustainable computing ecosystem.
The above is the detailed content of AI rewrites the sorting algorithm, 70% faster: DeepMind AlphaDev innovates the computing foundation, calling trillions of library updates every day. For more information, please follow other related articles on the PHP Chinese website!
![[Ghibli-style images with AI] Introducing how to create free images with ChatGPT and copyright](https://img.php.cn/upload/article/001/242/473/174707263295098.jpg?x-oss-process=image/resize,p_40)
The latest model GPT-4o released by OpenAI not only can generate text, but also has image generation functions, which has attracted widespread attention. The most eye-catching feature is the generation of "Ghibli-style illustrations". Simply upload the photo to ChatGPT and give simple instructions to generate a dreamy image like a work in Studio Ghibli. This article will explain in detail the actual operation process, the effect experience, as well as the errors and copyright issues that need to be paid attention to. For details of the latest model "o3" released by OpenAI, please click here⬇️ Detailed explanation of OpenAI o3 (ChatGPT o3): Features, pricing system and o4-mini introduction Please click here for the English version of Ghibli-style article⬇️ Create Ji with ChatGPT

As a new communication method, the use and introduction of ChatGPT in local governments is attracting attention. While this trend is progressing in a wide range of areas, some local governments have declined to use ChatGPT. In this article, we will introduce examples of ChatGPT implementation in local governments. We will explore how we are achieving quality and efficiency improvements in local government services through a variety of reform examples, including supporting document creation and dialogue with citizens. Not only local government officials who aim to reduce staff workload and improve convenience for citizens, but also all interested in advanced use cases.

Have you heard of a framework called the "Fukatsu Prompt System"? Language models such as ChatGPT are extremely excellent, but appropriate prompts are essential to maximize their potential. Fukatsu prompts are one of the most popular prompt techniques designed to improve output accuracy. This article explains the principles and characteristics of Fukatsu-style prompts, including specific usage methods and examples. Furthermore, we have introduced other well-known prompt templates and useful techniques for prompt design, so based on these, we will introduce C.

ChatGPT Search: Get the latest information efficiently with an innovative AI search engine! In this article, we will thoroughly explain the new ChatGPT feature "ChatGPT Search," provided by OpenAI. Let's take a closer look at the features, usage, and how this tool can help you improve your information collection efficiency with reliable answers based on real-time web information and intuitive ease of use. ChatGPT Search provides a conversational interactive search experience that answers user questions in a comfortable, hidden environment that hides advertisements

In a modern society with information explosion, it is not easy to create compelling articles. How to use creativity to write articles that attract readers within a limited time and energy requires superb skills and rich experience. At this time, as a revolutionary writing aid, ChatGPT attracted much attention. ChatGPT uses huge data to train language generation models to generate natural, smooth and refined articles. This article will introduce how to effectively use ChatGPT and efficiently create high-quality articles. We will gradually explain the writing process of using ChatGPT, and combine specific cases to elaborate on its advantages and disadvantages, applicable scenarios, and safe use precautions. ChatGPT will be a writer to overcome various obstacles,

An efficient guide to creating charts using AI Visual materials are essential to effectively conveying information, but creating it takes a lot of time and effort. However, the chart creation process is changing dramatically due to the rise of AI technologies such as ChatGPT and DALL-E 3. This article provides detailed explanations on efficient and attractive diagram creation methods using these cutting-edge tools. It covers everything from ideas to completion, and includes a wealth of information useful for creating diagrams, from specific steps, tips, plugins and APIs that can be used, and how to use the image generation AI "DALL-E 3."

Unlock ChatGPT Plus: Fees, Payment Methods and Upgrade Guide ChatGPT, a world-renowned generative AI, has been widely used in daily life and business fields. Although ChatGPT is basically free, the paid version of ChatGPT Plus provides a variety of value-added services, such as plug-ins, image recognition, etc., which significantly improves work efficiency. This article will explain in detail the charging standards, payment methods and upgrade processes of ChatGPT Plus. For details of OpenAI's latest image generation technology "GPT-4o image generation" please click: Detailed explanation of GPT-4o image generation: usage methods, prompt word examples, commercial applications and differences from other AIs Table of contents ChatGPT Plus Fees Ch

How to use ChatGPT to streamline your design work and increase creativity This article will explain in detail how to create a design using ChatGPT. We will introduce examples of using ChatGPT in various design fields, such as ideas, text generation, and web design. We will also introduce points that will help you improve the efficiency and quality of a variety of creative work, such as graphic design, illustration, and logo design. Please take a look at how AI can greatly expand your design possibilities. table of contents ChatGPT: A powerful tool for design creation


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
