HackerPapers

arXiv:1712.01208cs.DB

The Case for Learned Index Structures

Tim Kraska, Alex Beutel, Ed H. Chi, Jeffrey Dean, Neoklis Polyzotis

Abstract

Indexes are models: a B-Tree-Index can be seen as a model to map a key to the position of a record within a sorted array, a Hash-Index as a model to map a key to a position of a record within an unsorted array, and a BitMap-Index as a model to indicate if a data record exists or not. In this exploratory research paper, we start from this premise and posit that all existing index structures can be replaced with other types of models, including deep-learning models, which we term learned indexes. The key idea is that a model can learn the sort order or structure of lookup keys and use this signal to effectively predict the position or existence of records. We theoretically analyze under which conditions learned indexes outperform traditional index structures and describe the main challenges in designing learned index structures. Our initial results show, that by using neural nets we are able to outperform cache-optimized B-Trees by up to 70% in speed while saving an order-of-magnitude in memory over several real-world data sets. More importantly though, we believe that the idea of replacing core components of a data management system through learned models has far reaching implications for future systems designs and that this work just provides a glimpse of what might be possible.

arXiv comments
Journal reference
DOI
Subjects
cs.DBDatabases cs.DSData Structures and Algorithms cs.NENeural and Evolutionary Computing

On Hacker News

Linked by 20 identifiable commenters in 27 comments across 26 threads, from Dec 2017 to Jun 2026. Found in 9 HN submissions from Dec 2017 to Dec 2017. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments26 threads

  1. They’re made out of weights 1 comment
    • The LLM is still a "normal algorithm", just one with a fairly large dataset to use. Assigning the algorithm part of LLMs magical properties hinders understanding. The work needed to pick the next output token is very much a classical algorithm. Algorithms can be based on…

      yencabulatorView on HNParent context

    • When NPU will become available in most systems, we will see learned indexes like in https://arxiv.org/pdf/1712.01208v1 on client side. If file search indexes and such will be replaced by neural networks, this will be small but measurable improvement in battery life, speed and…

      hamilyon2View on HNParent context

    • In theory, you can treat the objects as i.i.d. giving them a uniform prior. In practice, of course only the inputs are inputs and if you were to take that into account then you could avoid collisions, but as you say, you can't really know that ahead of time. Unless you can, such…

      kevindammView on HNParent context

    • Also, Learned Indexes Structures: The Case for Learned Index Structures: https://arxiv.org/abs/1712.01208 Learned Indexes for a Google-scale Disk-based Database: https://arxiv.org/abs/2012.12501 And Noms/Dolt Prolly Trees: How to Chunk Your Database into a Merkle Tree…

      robertsdionneView on HNParent context

  2. B-tree Path Hints 1 comment
    • > we'll see another explosion in practical CPU throughput, combined with a little help from algs and data structures The learned index[1] is basically a variation of this sort of "hint" which relies on getting the right answer most of the time, but from learning the distribution…

      gopalvView on HNParent context

    • The Case for Learned Index Structures Tim Kraska, Alex Beutel, Ed H. Chi, Jeffrey Dean, Neoklis Polyzotis "Our initial results show, that by using neural nets we are able to outperform cache-optimized B-Trees by up to 70% in speed while saving an order-of-magnitude in memory…

      emayljamesView on HNParent context

    • Could you have someone walk towards the camera with a focus test card and form a map between the sensor and the focus data from the lens itself (FFT, etc)? It would be something analogous to the 'learned indexes' paper. You could then provide any tweening function to give you…

      seg_lolView on HNParent context

    • > OTOH the standard library sort can be improved if you know the distribution of the numbers you're sorting (e.g., small numbers can bucket sort, small lists can use a sorting network, etc). If this thing can efficiently almost-correctly-sort because it's better at these types…

      malisperView on HNParent context

    • > One big downside is that is has a margin of error which is very often unacceptable. You should look at the paper they mention The Case for Learned Index Structures[0]. It covers B-Tree-Index and how to use Hybrid Indexes to bound the errors so that "bad" answers from the model…

      ndrView on HNParent context

    • This article represents an ongoing trend that we've seen over the last 3 years as a resurgence in optimization techniques for directly modeling tasks which historically were considered "not amenable to optimization techniques." We saw this last year as well with the landmark…

      KirinDaveView on HNParent context

    • Gosh, I have a few! Fistly, wavelet trees! Wavelet trees with something like RRR encoding for the bit vectors lets you work with massive datasets in positively tiny space and constant time. They're not even expensive to construct! My favorite introduction to the whole space of…

      KirinDaveView on HNParent context

    • Interesting stuff. I thought one of the most interesting papers at NIPS this year was using GPU or TPU for intelligent indexes. https://arxiv.org/abs/1712.01208 Paper is from Jeff Dean and a worth while read, IMO.

      glenrivardView on HNParent context

    • Most interesting thing I have seen for for database indexes is this paper. https://www.arxiv-vanity.com/papers/1712.01208v1/ Using a Neural Network in place of a B-tree. What is interesting is a NN can use many processors at the same time versus you can not with a B-tree. In the…

      jacksmith21006View on HNParent context

    • This seems like a fairly natural generalization of the idea in "The Case for Learned Index Structures" [1]: speed up some classical algorithm based on heuristics by modeling the data with a neural network that can be tuned to the specific task that the general algorithm is…

      yorwbaView on HNParent context

    • All comes down to the cost. We can see that the TPUs were about 1/2 as much as using Nvidia before the TPU 3.0. This is based on doing the same task with the TPUs versus Nvidia with AWS. But it might be a bigger difference and Google taking margins. Could have been the other way…

      jacksmith21006View on HNParent context

    • Google completely gave away K8s including even the brand. So not sure what you think Google will do? They are giving away everything they learned with Borg and you somehow take it as a negative? Really? Do think from a business standpoint not sure why Google would give up the…

      jacksmith21006View on HNParent context

    • The new Google Speech solution is the perfect example on why Google had to do their own silicon. Doing speech with 16k samples a second through a NN and keep at a reasonable cost is really, really difficult. The old way was far more power efficient and if you are going to use…

      jacksmith21006View on HNParent context

    • Would say Google has a couple gems. DeepMind comes to mind. Also Google Brain has done some pretty interesting things. Probably my favorite of late is from Jeff Dean https://arxiv.org/abs/1712.01208 We just got YouTube TV recently and also something that is pretty impressive by…

      jacksmith21006View on HNParent context

    • Thought one of the more interesting ideas is the Jeff Dean paper on using the TPU for more traditional CS operations like an index lookup. Like to see this progress and get more data on the difference is power required using a CPU and traditional algorithms versus using a TPU…

      jacksmith21006View on HNParent context

    • I highly recommend people give this paper a read. I think it points the way to a radical redesign of fundamental parts of the system stack over the next 5-10 years. If you work in systems and you aren’t thinking about this stuff, you’re about to be lapped. The Case for Learned…

      sulamView on HNParent context

    • On the one hand, DeepZip does neural net based compression. On the other hand, in "The Case for Learned Index Structures" [1] paper, they replace B-Trees with neural nets: > by using neural nets we are able to outperform cache optimized B-Trees by up to 70% in speed while saving…

      visargaView on HNParent context

  3. My Favorite Papers of 2017 1 comment
    • Well, "big new" sounds like a destructive qualification. Why can't it be "big" and "old"? https://arxiv.org/pdf/1712.01208.pdf

      mfukarView on HNParent context

    • It looks like this paper has more information: https://arxiv.org/pdf/1712.01208v1.pdf

      larelliView on HNParent context

    • Under some assumptions it does handle inserts. From [1]: Finally, assume that the inserts follow roughly a similar pattern as the learned CDF; [...] Under these assumptions the model might not need to be retrained at all. [1] https://www.arxiv-vanity.com/papers/1712.01208v1/

      pg314View on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.