Discovering Data Structures: Nearest Neighbor Search and Beyond
Abstract
We propose a general framework for end-to-end learning of data structures. Our framework adapts to the underlying data distribution and provides fine-grained control over query and space complexity. Crucially, the data structure is learned from scratch, and does not require careful initialization or seeding with candidate data structures/algorithms. We first apply this framework to the problem of nearest neighbor search. In several settings, we are able to reverse-engineer the learned data structures and query algorithms. For 1D nearest neighbor search, the model discovers optimal distribution (in)dependent algorithms such as binary search and variants of interpolation search. In higher dimensions, the model learns solutions that resemble k-d trees in some regimes, while in others, they have elements of locality-sensitive hashing. The model can also learn useful representations of high-dimensional data and exploit them to design effective data structures. We also adapt our framework to the problem of estimating frequencies over a data stream, and believe it could also be a powerful discovery tool for new problems.
BibTeX
@inproceedings{salemohamed2025discovering,
author = {Omar Salemohamed and Laurent Charlin and Shivam Garg and Vatsal Sharan and Gregory Valiant},
title = {{Discovering Data Structures: Nearest Neighbor Search and Beyond}},
booktitle = {Advances in Neural Information Processing Systems},
year = {2025},
url = {https://openreview.net/forum?id=DOaqwuhEjc},
}Ask Althea to put this paper to the test.
| Learning Space Partitions for Nearest Neighbor Search | IEEE Data Eng. Bull · 2023 |
| Progressive Neural Index Search for Database System | arXiv · 2019 |
| Learning-Augmented Search Data Structures | ICLR · 2025 |
| Learning Sublinear-Time Indexing for Nearest Neighbor Search | arXiv · 2019 |
| Dynamic Index Construction with Deep Reinforcement Learning | Data Sci. Eng · 2022 |
| NeuroDB: A Neural Network Framework for Answering Range Aggregate Queries and Beyond | arXiv · 2021 |