r/Python • u/100GB-CSV • Jun 10 '23
News Faster sorting algorithms discovered using deep reinforcement learning
https://www.nature.com/articles/s41586-023-06004-9145
u/Rukapul Jun 10 '23
The authors did not discover faster algorithms. They discovered faster implementations.
Different level of abstraction and achievement.
71
u/anupam128 Jun 10 '23
I wish they would have named the paper more precisely. It is not finding new “algorithms”, it is producing better optimized assembly code. Still crazy impressive!
5
Jun 10 '23
Here’s the key section:
Here we show how artificial intelligence can go beyond the current state of the art by discovering hitherto unknown routines. To realize this, we formulated the task of finding a better sorting routine as a single-player game. We then trained a new deep reinforcement learning agent, AlphaDev, to play this game. AlphaDev discovered small sorting algorithms from scratch that outperformed previously known human benchmarks. These algorithms have been integrated into the LLVM standard C++ sort library.
2
u/safely_beyond_redemp Jun 10 '23
Very cool. Trying to understand what happened in layman's terms, the AI found inefficiencies in the code where an output could have been assumed shorter (output abc when c was already eliminated as an option) but wasn't, which required one additional operation to solve for the shortened output.
4
u/tRfalcore Jun 10 '23
computing inefficiencies. not new algorithms per se.
| by optimizing for actual measured latency at the CPU instruction level, by more efficiently searching and considering the space of correct and fast programs compared to previous work.
1
u/Grouchy-Friend4235 Jun 11 '23
"We need something to reclaim our position as a leader in AI. Anything!"
1
u/Ordinary-Tooth-5140 Jun 11 '23
Im pretty sure it's provable that it's impossible for a sorting algorithm to be faster than O(nlog(n)), so for very big datasets the difference should be very little. Still impressive.
2
1
-3
u/marvelmon Jun 10 '23
How long before this method is used for hacking algorithms?
6
u/fraud_93 Jun 10 '23
People already use AI to crack games DRM.
0
Jun 10 '23
[deleted]
1
u/krynawi Jun 11 '23
Whole point of captcha is to generate labeled data for free to train these networks, while providing a free service to identify people.
That's why the captcha keep changing and getting more complex. Free labeling for supervised training.
24
u/100GB-CSV Jun 10 '23 edited Jun 10 '23
I’m planning to apply it to sort billions of rows using only 32GB of memory. Previously I had completed algorithm for billion-row Distinct, GroupBy, Filter and JoinTable. Sorting is the last one I cannot solve at the moment. Most recent achievement I solved auto-detected sub-queries that can be combined automatically. So I feel exciting to record this demo video and github