r/slatestarcodex • u/fortist • Jun 07 '23
Faster sorting algorithms discovered using deep reinforcement learning
https://www.nature.com/articles/s41586-023-06004-9
45
Upvotes
2
u/A_Light_Spark Jun 07 '23
What a great paper. The branching solution is interesting because it confirms the principle of dynamic programming of memoization, but in this case it's not just for remembering the states but gives performance benefits as well.
The AlphaDev-S result is as expected, but AlphaDev could be deployed over many algorithms to further optimize them. The real ingenious part imk is using transformer on algorithms as sets of instructions. I kinda want to see the code implementation but that is going to be dense.
69
u/ChiefExecutiveOcelot How The Hell Jun 07 '23
From HN:
They found a sequence of assembly that saves... one MOV. That's it. And it's not even novel, it's simply an unrolled insertion sort on three elements. That their patch for libc++ is 70% faster for small inputs is only due to the library not having an efficient implementation with a branchless sorting network beforehand. Those are not novel either, they already exist, made by humans.
I'm happy for the researchers that the reinforcement learning approach worked, and that it gave good code. But the paper and surrounding press release is self-aggrandizing in both its results and impact. That this is the first change to 'this part' of the sorting routine in a decade is also just completely cherry-picked. For example, I would say that my 2014 report and (ignored patch of) the fact that the libc++ sorting routine was QUADRATIC (https://bugs.llvm.org/show_bug.cgi?id=20837) finally being fixed late 2021 https://reviews.llvm.org/D113413 is quite the notable change. If anything it shows that there wasn't a particularly active development schedule on the libc++ sorting routine the past decade.
https://news.ycombinator.com/item?id=36231147