Defeating duplicates: A re-design of the LearnedSort algorithm

Ani Kristo, Kapil Vaidya, Tim Kraska
7/5/2021
cs.DS

Official code: anikristo/LearnedSort (81 stars, C++, GPL-3.0, last commit 2021-08-20).

Abstract

LearnedSort is a novel sorting algorithm that, unlike traditional methods, uses fast ML models to boost the sorting speed. The models learn to estimate the input's distribution and arrange the keys in sorted order by predicting their empirical cumulative distribution function (eCDF) values.

Show full abstract

LearnedSort has shown outstanding performance compared to state-of-the-art sorting algorithms on several datasets, both synthetic and real. However, given the nature of the eCDF model, its performance is affected in the cases when the input data contains a large number of repeated keys (i.e., duplicates). This work analyzes this scenario in depth and introduces LearnedSort 2.0: a re-design of the algorithm that addresses this issue and enables the algorithm to maintain the leading edge even for high-duplicate inputs. Our extensive benchmarks on a large set of diverse datasets demonstrate that the new design performs at much higher sorting rates than the original version: an average of 4.78x improvement for high-duplicate datasets, and 1.60x for low-duplicate datasets while taking the lead among sorting algorithms.

View on arXivView PDF

Code Implementations(1)

GPL-3.0

Learned Sort: a model-enhanced sorting algorithm

8112C++, ShellMar 27, 20195 years agoGPL-3.0
algorithmlinear-modelssorting-algorithms

Similar Papers

Cite this paper

@article{kristo2021defeating,
  title  = {Defeating duplicates: A re-design of the LearnedSort algorithm},
  author = {Ani Kristo and Kapil Vaidya and Tim Kraska},
  year   = {2021},
  eprint = {2107.03290},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2107.03290}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2107.03290.svg)](https://codeofpaper.com/paper/2107.03290)

Discussion