Faster Maximum Inner Product Search in High Dimensions (2212.07551v3)
Abstract: Maximum Inner Product Search (MIPS) is a ubiquitous task in machine learning applications such as recommendation systems. Given a query vector and $n$ atom vectors in $d$-dimensional space, the goal of MIPS is to find the atom that has the highest inner product with the query vector. Existing MIPS algorithms scale at least as $O(\sqrt{d})$, which becomes computationally prohibitive in high-dimensional settings. In this work, we present BanditMIPS, a novel randomized MIPS algorithm whose complexity is independent of $d$. BanditMIPS estimates the inner product for each atom by subsampling coordinates and adaptively evaluates more coordinates for more promising atoms. The specific adaptive sampling strategy is motivated by multi-armed bandits. We provide theoretical guarantees that BanditMIPS returns the correct answer with high probability, while improving the complexity in $d$ from $O(\sqrt{d})$ to $O(1)$. We also perform experiments on four synthetic and real-world datasets and demonstrate that BanditMIPS outperforms prior state-of-the-art algorithms. For example, in the Movie Lens dataset ($n$=4,000, $d$=6,000), BanditMIPS is 20$\times$ faster than the next best algorithm while returning the same answer. BanditMIPS requires no preprocessing of the data and includes a hyperparameter that practitioners may use to trade off accuracy and runtime. We also propose a variant of our algorithm, named BanditMIPS-$\alpha$, which achieves further speedups by employing non-uniform sampling across coordinates. Finally, we demonstrate how known preprocessing techniques can be used to further accelerate BanditMIPS, and discuss applications to Matching Pursuit and Fourier analysis.
- To Index or Not to Index: Optimizing Exact Maximum Inner Product Search. In 2019 IEEE 35th International Conference on Data Engineering (ICDE), pages 1250–1261, April 2019. ISSN: 2375-026X.
- Approximate Nearest Neighbor Search Small World Approach. 2011.
- Reverse Maximum Inner Product Search: How to efficiently find users who would like to buy my item? Fifteenth ACM Conference on Recommender Systems, pages 273–281, September 2021. Conference Name: RecSys ’21: Fifteenth ACM Conference on Recommender Systems ISBN: 9781450384582 Place: Amsterdam Netherlands Publisher: ACM.
- Approximate similarity search in metric spaces using inverted files. In Ronny Lempel, Raffaele Perego, and Fabrizio Silvestri, editors, 3rd International ICST Conference on Scalable Information Systems, INFOSCALE 2008, Vico Equense, Italy, June 4-6, 2008, page 28. ICST / ACM, 2008.
- Practical and optimal LSH for angular distance. In C. Cortes, N. Lawrence, D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in neural information processing systems, volume 28. Curran Associates, Inc., 2015.
- Reward Optimizing Recommendation using Deep Learning and Fast Maximum Inner Product Search. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, KDD ’22, pages 4772–4773, New York, NY, USA, August 2022. Association for Computing Machinery.
- Best arm identification in multiarmed bandits. In In 23rd Annual Conference on Learning Theory, 2010.
- The inverted multi-index. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, pages 3069–3076, June 2012. ISSN: 1063-6919.
- Speeding up the Xbox recommender system using a euclidean transformation for inner-product spaces. In Proceedings of the 8th ACM Conference on Recommender Systems, RecSys ’14, pages 257–264, New York, NY, USA, October 2014. Association for Computing Machinery.
- Bandit-based monte carlo optimization for nearest neighbors. IEEE Journal on Selected Areas in Information Theory, 2(2):599–610, 2021.
- Medoids in almost-linear time via multi-armed bandits. In International Conference on Artificial Intelligence and Statistics, pages 500–509, 2018.
- Adaptive monte-carlo optimization. arXiv:1805.08321, 2018.
- Approximate function evaluation via multi-armed bandits. In International Conference on Artificial Intelligence and Statistics, pages 108–135. PMLR, 2022.
- Ultra fast medoid identification via correlated sequential halving. In Advances in Neural Information Processing Systems, pages 3650–3659, 2019.
- Diamond Sampling for Approximate Maximum All-Pairs Dot-Product (MAD) Search. In 2015 IEEE International Conference on Data Mining, pages 11–20, Atlantic City, NJ, USA, November 2015. IEEE.
- Concentration inequalities for sampling without replacement. Bernoulli, 21(3):1361–1385, August 2015.
- The Netflix Prize. In In KDD Cup and Workshop in Conjunction with KDD, 2007.
- Erik Bernhardsson. Annoy: Approximate Nearest Neighbors in C++/Python, 2018. Python package version 1.13.0.
- Improving Language Models by Retrieving from Trillions of Tokens. In Proceedings of the 39th International Conference on Machine Learning, pages 2206–2240. PMLR, June 2022.
- Concentration Inequalities: A Nonasymptotic Theory of Independence. February 2013.
- Engineering efficient and effective non-metric space library. In Nieves R. Brisaboa, Oscar Pedreira, and Pavel Zezula, editors, Similarity Search and Applications - 6th International Conference, SISAP 2013, A Coruña, Spain, October 2-4, 2013, Proceedings, volume 8199 of Lecture Notes in Computer Science, pages 280–293. Springer, 2013.
- Learning to prune in metric and non-metric spaces. In Christopher J. C. Burges, Léon Bottou, Zoubin Ghahramani, and Kilian Q. Weinberger, editors, Advances in Neural Information Processing Systems 26: 27th Annual Conference on Neural Information Processing Systems 2013. Proceedings of a meeting held December 5-8, 2013, Lake Tahoe, Nevada, United States, pages 1574–1582, 2013.
- Off the beaten path: Let’s replace term-based retrieval with k-nn search. In Snehasis Mukhopadhyay, ChengXiang Zhai, Elisa Bertino, Fabio Crestani, Javed Mostafa, Jie Tang, Luo Si, Xiaofang Zhou, Yi Chang, Yunyao Li, and Parikshit Sondhi, editors, Proceedings of the 25th ACM International Conference on Information and Knowledge Management, CIKM 2016, Indianapolis, IN, USA, October 24-28, 2016, pages 1099–1108. ACM, 2016.
- E. Oran Brigham. The Fast Fourier Transform and Its Applications. 1988.
- Pure exploration in finitely-armed and continuous-armed bandits. Theoretical Computer Science, 412(19):1832–1852, April 2011.
- Carsten. 400+ crypto currency pairs at 1-minute resolution, 2022.
- Olivier Catoni. Challenging the empirical mean and empirical variance: a deviation study. In Annales de l’IHP Probabilités et statistiques, volume 48, pages 1148–1185, 2012.
- Effective proximity retrieval by ordering permutations. IEEE Trans. Pattern Anal. Mach. Intell., 30(9):1647–1658, 2008.
- FINGER: Fast Inference for Graph-based Approximate Nearest Neighbor Search, June 2022. arXiv:2206.11408 [cs].
- Performance of recommender algorithms on top-n recommendation tasks. In Proceedings of the fourth ACM conference on Recommender systems, pages 39–46, 2010.
- Norm-Explicit Quantization: Improving Vector Quantization for Maximum Inner Product Search. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 51–58, April 2020. ISSN: 2374-3468, 2159-5399 Issue: 01 Journal Abbreviation: AAAI.
- Sanjoy Dasgupta. Random projection trees and low dimensional manifolds. pages 537–546, May 2008.
- Fast, Accurate Detection of 100,000 Object Classes on a Single Machine. In 2013 IEEE Conference on Computer Vision and Pattern Recognition, pages 1814–1821, Portland, OR, USA, June 2013. IEEE.
- A Fast Sampling Algorithm for Maximum Inner Product Search. In Proceedings of the Twenty-Second International Conference on Artificial Intelligence and Statistics, pages 3004–3012. PMLR, April 2019. ISSN: 2640-3498.
- High-confidence near-duplicate image detection. In Horace Ho-Shing Ip and Yong Rui, editors, International Conference on Multimedia Retrieval, ICMR ’12, Hong Kong, China, June 5-8, 2012, page 1. ACM, 2012.
- Sparse Solution of Underdetermined Systems of Linear Equations by Stagewise Orthogonal Matching Pursuit. IEEE Transactions on Information Theory, 58(2):1094–1121, February 2012.
- Polysemous Codes. In Bastian Leibe, Jiri Matas, Nicu Sebe, and Max Welling, editors, Computer Vision – ECCV 2016, Lecture Notes in Computer Science, pages 785–801, Cham, 2016. Springer International Publishing.
- PAC Bounds for Multi-armed Bandit and Markov Decision Processes. In Jyrki Kivinen and Robert H. Sloan, editors, Computational Learning Theory, Lecture Notes in Computer Science, pages 255–270, Berlin, Heidelberg, 2002. Springer.
- Action Elimination and Stopping Conditions for the Multi-Armed Bandit and Reinforcement Learning Problems. The Journal of Machine Learning Research, 7:1079–1105, December 2006.
- Action elimination and stopping conditions for the multi-armed bandit and reinforcement learning problems. In Journal of Machine Learning Research, volume 7, pages 1079–1105, 2006.
- Reinforcement Routing on Proximity Graph for Efficient Recommendation. ACM Transactions on Information Systems, 41(1):8:1–8:27, January 2023.
- Optimized Product Quantization for Approximate Nearest Neighbor Search. pages 2946–2953, June 2013.
- New Loss Functions for Fast Maximum Inner Product Search. ArXiv, August 2019.
- Accelerating large-scale inference with anisotropic vector quantization. In Proceedings of the 37th International Conference on Machine Learning, ICML’20, pages 3887–3896. JMLR.org, July 2020.
- The movielens datasets: History and context. ACM Trans. Interact. Intell. Syst., 5(4), dec 2015.
- Solving Diversity-Aware Maximum Inner Product Search Efficiently and Effectively. In Proceedings of the 16th ACM Conference on Recommender Systems, RecSys ’22, pages 198–207, New York, NY, USA, September 2022. Association for Computing Machinery.
- Query-aware locality-sensitive hashing for approximate nearest neighbor search. Proceedings of the VLDB Endowment, 9(1):1–12, September 2015.
- Accurate and Fast Asymmetric Locality-Sensitive Hashing Scheme for Maximum Inner Product Search. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD ’18, pages 1561–1570, New York, NY, USA, July 2018. Association for Computing Machinery.
- Approximate nearest neighbors: Towards removing the curse of dimensionality. In Proceedings of the Thirtieth Annual ACM Symposium on Theory of Computing, STOC ’98, pages 604–613, New York, NY, USA, May 1998. Association for Computing Machinery.
- Active learning for large multi-class problems. In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pages 762–769, June 2009.
- Lil’ UCB : An Optimal Exploration Algorithm for Multi-Armed Bandits. In Proceedings of The 27th Conference on Learning Theory, pages 423–439. PMLR, May 2014.
- Best-arm identification algorithms for multi-armed bandits in the fixed confidence setting. In 2014 48th Annual Conference on Information Sciences and Systems (CISS), pages 1–6, March 2014.
- Non-stochastic Best Arm Identification and Hyperparameter Optimization. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, pages 240–248. PMLR, May 2016.
- Thorsten Joachims. Training linear svms in linear time. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 217–226, 2006.
- Cutting-plane training of structural svms. Machine learning, 77(1):27–59, 2009.
- Billion-scale similarity search with GPUs. IEEE Transactions on Big Data, 7(3):535–547, 2019.
- Product Quantization for Nearest Neighbor Search. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(1):117–128, January 2011. Conference Name: IEEE Transactions on Pattern Analysis and Machine Intelligence.
- Searching in one billion vectors: Re-rank with source coding. Acoustics, Speech, and Signal Processing, 1988. ICASSP-88., 1988 International Conference on, February 2011.
- PAC subset selection in stochastic multi-armed bandits. In Proceedings of the 29th International Coference on International Conference on Machine Learning, ICML’12, pages 227–234, Madison, WI, USA, June 2012. Omnipress.
- Almost optimal exploration in multi-armed bandits. In Proceedings of the 30th International Conference on International Conference on Machine Learning - Volume 28, ICML’13, pages III–1238–III–1246, Atlanta, GA, USA, June 2013. JMLR.org.
- Matrix Factorization Techniques for Recommender Systems. Computer, 42(8):30–37, August 2009.
- Asymptotically efficient adaptive allocation rules. Advances in applied mathematics, 6(1):4–22, 1985.
- Understanding and Improving Proximity Graph Based Maximum Inner Product Search. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 139–146, April 2020. ISSN: 2374-3468, 2159-5399 Issue: 01 Journal Abbreviation: AAAI.
- A bandit approach to maximum inner product search. In Proceedings of the Thirty-Third AAAI Conference on Artificial Intelligence and Thirty-First Innovative Applications of Artificial Intelligence Conference and Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, AAAI’19/IAAI’19/EAAI’19, pages 4376–4383, Honolulu, Hawaii, USA, January 2019. AAAI Press.
- A Unified Optimization View on Generalized Matching Pursuit and Frank-Wolfe. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, pages 860–868. PMLR, April 2017.
- Revisiting Wedge Sampling for Budgeted Maximum Inner Product Search (Extended Abstract). In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, pages 4789–4793, Montreal, Canada, August 2021. International Joint Conferences on Artificial Intelligence Organization.
- D.G. Lowe. Object recognition from local scale-invariant features. In Proceedings of the Seventh IEEE International Conference on Computer Vision, pages 1150–1157 vol.2. IEEE, 1999.
- AdaLSH: Adaptive LSH for Solving c-Approximate Maximum Inner Product Search Problem. IEICE Transactions on Information and Systems, E104.D(1):138–145, 2021.
- Sampling for Approximate Maximum Search in Factorized Tensor. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, pages 2400–2406, Melbourne, Australia, August 2017. International Joint Conferences on Artificial Intelligence Organization.
- Learning Sparse Binary Code for Maximum Inner Product Search. In Proceedings of the 30th ACM International Conference on Information & Knowledge Management, CIKM ’21, pages 3308–3312, New York, NY, USA, October 2021. Association for Computing Machinery.
- Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs. arXiv e-prints, page arXiv:1603.09320, March 2016.
- Approximate nearest neighbor algorithm based on navigable small world graphs. Inf. Syst., 45:61–68, 2014.
- [Invited Paper] A Survey of Product Quantization. ITE Transactions on Media Technology and Applications, 6:2–10, January 2018.
- Empirical Bernstein Bounds and Sample Variance Penalization, 2009.
- S. Morozov and Artem Babenko. Non-metric Similarity Graphs for Maximum Inner Product Search. 2018.
- Non-metric Similarity Graphs for Maximum Inner Product Search. In Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018.
- Learning and Inference via Maximum Inner Product Search. In Proceedings of The 33rd International Conference on Machine Learning, pages 2587–2596. PMLR, June 2016.
- Permutation search methods are efficient, yet faster search is possible. CoRR, abs/1506.03163, 2015.
- On Symmetric and Asymmetric LSHs for Inner Product Search. In Proceedings of the 32nd International Conference on Machine Learning, pages 1926–1934. PMLR, June 2015.
- Ninh Pham. Sublinear maximum inner product search using concomitants of extreme order statistics. CoRR, abs/2012.11098, 2020.
- Ninh Pham. Simple Yet Efficient Algorithms for Maximum Inner Product Search via Extreme Order Statistics. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, KDD ’21, pages 1339–1347, New York, NY, USA, August 2021. Association for Computing Machinery.
- Ninh D. Pham. Sublinear Maximum Inner Product Search using Concomitants of Extreme Order Statistics. ArXiv, December 2020.
- Comparative Analysis of Data Structures for Approximate Nearest Neighbor Search. August 2014.
- Asymmetric LSH (ALSH) for Sublinear Time Maximum Inner Product Search (MIPS). In Advances in Neural Information Processing Systems, volume 27. Curran Associates, Inc., 2014.
- Improved Asymmetric Locality Sensitive Hashing (ALSH) for Maximum Inner Product Search (MIPS). October 2014.
- Improved asymmetric locality sensitive hashing (ALSH) for Maximum Inner Product Search (MIPS). In Proceedings of the Thirty-First Conference on Uncertainty in Artificial Intelligence, UAI’15, pages 812–821, Arlington, Virginia, USA, July 2015. AUAI Press.
- J. Sivic and A. Zisserman. Video Google: A Text Retrieval Approach to Object Matching in Videos. volume 2, pages 1470–1477 vol.2, November 2003.
- ProMIPS: Efficient High-Dimensional c-Approximate Maximum Inner Product Search with a Lightweight Index. In 2021 IEEE 37th International Conference on Data Engineering (ICDE), pages 1619–1630, April 2021. ISSN: 2375-026X.
- Accelerating Frank-Wolfe Algorithm using Low-Dimensional and Adaptive Data Structures. 2022. Publisher: arXiv Version Number: 1.
- Automating Nearest Neighbor Search Configuration with Constrained Optimization, January 2023. arXiv:2301.01702 [cs].
- Norm Adjusted Proximity Graph for Fast Inner Product Retrieval. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, KDD ’21, pages 1552–1560, New York, NY, USA, August 2021. Association for Computing Machinery.
- On Efficient Retrieval of Top Similarity Vectors. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 5236–5246, Hong Kong, China, November 2019. Association for Computational Linguistics.
- Banditpam: Almost linear time k-medoids clustering via multi-armed bandits. Advances in Neural Information Processing Systems, 33:10211–10222, 2020.
- H2SA-ALSH: A Privacy-Preserved Indexing and Searching Schema for IoT Data Collection and Mining. Wireless Communications and Mobile Computing, 2022:e9990193, April 2022. Publisher: Hindawi.
- Local Orthogonal Decomposition for Maximum Inner Product Search. ArXiv, March 2019.
- GAIPS: Accelerating Maximum Inner Product Search with GPU. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR ’21, pages 1920–1924, New York, NY, USA, July 2021. Association for Computing Machinery.
- Breaking the Linear Iteration Cost Barrier for Some Well-known Conditional Gradient Methods Using MaxIP Data-structures. In Advances in Neural Information Processing Systems, volume 34, pages 5576–5589. Curran Associates, Inc., 2021.
- Norm-Ranging LSH for Maximum Inner Product Search. In Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018.
- A Greedy Approach for Budgeted Maximum Inner Product Search. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
- Adaptive Monte Carlo Multiple Testing via Multi-Armed Bandits. In Proceedings of the 36th International Conference on Machine Learning, pages 7512–7522. PMLR, May 2019.
- Adaptive monte carlo multiple testing via multi-armed bandits. In International Conference on Machine Learning, pages 7512–7522, 2019.
- GraSP: Optimizing Graph-based Nearest Neighbor Search with Subgraph Sampling and Pruning. In Proceedings of the Fifteenth ACM International Conference on Web Search and Data Mining, WSDM ’22, pages 1395–1405, New York, NY, USA, February 2022. Association for Computing Machinery.
- Möbius Transformation for Fast Inner Product Search on Graph. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.