Re:The case for a learned sorting algorithm
by 0-_-0 on Monday October 19, 2020 @02:16PM
(#24829152)
I remember learning as part of my CS degree that knowing the distribution of your data allows you to sort it in N log(log(N)) instead of N log(N) (which assumes a comparison based sort), although back then it wasn't given such a fashionable name as "learned sort", and determining the distribution wasn't called "training"
Re:The case for a learned sorting algorithm
by qsort on Monday October 19, 2020 @04:08PM
(#24830396)
If you know the distribution of your data (in the sense that you are guaranteed that each datapoint is iid with a distribution described by some known PDF f : R -> R), you can sort in O(N) with probability 1.
Re:The case for a learned sorting algorithm
by 0-_-0 on Monday October 19, 2020 @05:00PM
(#24830969)
Let's say you draw 1 million samples from a uniform distribution between 0 and 1. I'm saying that if you know the distribution you can sort in O(N log(log(N))). Are you claiming you can sort them in O(N)?
Re:The case for a learned sorting algorithm
by qsort on Monday October 19, 2020 @05:15PM
(#24831101)
Assuming "1 million" is a proxy for taking the limit to infinity, i.e. the usual asymptotic setting, if you are willing to accept that the algorithm will "only" work with probability 1, then yes, I can.
Let N be the size of the array. Create N new empty lists, numbered from 0 to N-1. Divide [0, 1) in N equal brackets B0 = [0, 1/n); B1 = [1/n, 2/n]... BN-1 = [(n-1)/n, 1). For each element, determine the bracket it falls in and append it to the corresponding list. Sort each list.
Because of the uniformity hypothesis, for n -> infinity, the probability that each bracket contains O(1) elements goes to 1, therefore the running time is O(N) with probability 1.
Re:The case for a learned sorting algorithm
by qsort on Monday October 19, 2020 @07:22PM
(#24832179)
It's really dead simple, look at my other comment in the same thread. The only caveat is that all those fancy words before are actually necessary minimal hypotheses, not just fancy words.
Re:The case for a learned sorting algorithm
by smusamashah on Monday October 19, 2020 @08:55AM
(#24825865)
>The results show that our approach yields an average 3.38x performance improvement over C++ STL sort, which is an optimized Quick- sort hybrid, 1.49x improvement over sequential Radix Sort, and 5.54x improvement over a C++ implementation of Tim- sort, which is the default sorting function for Java and Python.
Re:The case for a learned sorting algorithm
by glebshevchuk on Monday October 19, 2020 @03:42PM
(#24830087)
Can this approach be made more robust so it could be used in critical programs? Is there a way to formally verify performance of an approach like this?
Re:The case for a learned sorting algorithm
by edejong on Monday October 19, 2020 @07:57AM
(#24825507)
Is the paper "NN-sort: Neural Network based Data Distribution-aware Sorting" [1] not a year prior to the cited paper? It seems to discuss the same approach.
Re:The case for a learned sorting algorithm
by Chirono on Monday October 19, 2020 @09:19AM
(#24826077)
The paper in this post doesn't use neural networks at all. It also includes the time to train the model in the sorting time, which the paper you linked doesn't. NN-sort trains on historic data to sort future data, which requires the distribution to be roughly the same, whearas this algorithm learns online.
Re:The case for a learned sorting algorithm
by vbarrielle on Monday October 19, 2020 @09:52AM
(#24826336)
This paper does not look like a strong paper, in particular it's very terse when describing the way the neural network is trained, which fails to convince that they did not train the neural network model on the sorted input. They are also not clear on their timings, it's not sure they include the training time in their benchmarks. For these reasons, it does not look very reproducible, and there's no obligation to cite non-reproducible work.
Re:The case for a learned sorting algorithm
by tokai on Monday October 19, 2020 @08:15AM
(#24825620)
That paper has not been published. You can't claim a paper is prior, just because a draft was available earlier. Incidently it was send to the same conference as the OP paper. But it seems like it wasn't accepted, while the OP paper was.
Re:The case for a learned sorting algorithm
by currymj on Monday October 19, 2020 @09:31AM
(#24826191)
that’s not how things work. lots of well-regarded papers are initially rejected in peer review but are commonly discussed and cited while in the submission process at other venues.
Let N be the size of the array. Create N new empty lists, numbered from 0 to N-1. Divide [0, 1) in N equal brackets B0 = [0, 1/n); B1 = [1/n, 2/n]... BN-1 = [(n-1)/n, 1). For each element, determine the bracket it falls in and append it to the corresponding list. Sort each list. Because of the uniformity hypothesis, for n -> infinity, the probability that each bracket contains O(1) elements goes to 1, therefore the running time is O(N) with probability 1.
This is a lot
[1] NN-sort: Neural Network based Data Distribution-aware Sorting: https://arxiv.org/pdf/1907.08817.pdf