• bitcoinBitcoin(BTC)$83,229.00-3.04%
  • ethereumEthereum(ETH)$2,637.40-3.47%
  • tetherTether(USDT)$1.000.00%
  • binancecoinBNB(BNB)$766.40-2.13%
  • rippleXRP(XRP)$1.46-8.25%
  • usd-coinUSDC(USDC)$1.000.00%
  • solanaSolana(SOL)$112.94-3.80%
  • tronTRON(TRX)$0.338672-1.19%
  • zcashZcash(ZEC)$1,467.04-9.58%
  • Figure HelocFigure Heloc(FIGR_HELOC)$1.040.37%
  • HyperliquidHyperliquid(HYPE)$90.21-5.51%
  • dogecoinDogecoin(DOGE)$0.092109-7.66%
  • moneroMonero(XMR)$547.79-3.82%
  • whitebitWhiteBIT Coin(WBT)$83.27-3.44%
  • USDSUSDS(USDS)$1.00-0.02%
  • chainlinkChainlink(LINK)$12.16-5.64%
  • cardanoCardano(ADA)$0.234466-7.33%
  • RainRain(RAIN)$0.012017-6.90%
  • leo-tokenLEO Token(LEO)$8.92-0.63%
  • stellarStellar(XLM)$0.197861-8.38%
  • bitcoin-cashBitcoin Cash(BCH)$326.91-9.85%
  • uniswapUniswap(UNI)$8.92-11.74%
  • nearNEAR Protocol(NEAR)$4.19-7.14%
  • litecoinLitecoin(LTC)$66.485.96%
  • Ethena USDeEthena USDe(USDE)$1.000.00%
  • daiDai(DAI)$1.000.00%
  • avalanche-2Avalanche(AVAX)$10.06-10.16%
  • USD1USD1(USD1)$1.000.00%
  • CantonCanton(CC)$0.107087-4.74%
  • the-open-networkGram (prev. Toncoin)(GRAM)$1.40-3.16%
  • hedera-hashgraphHedera(HBAR)$0.088968-8.25%
  • suiSui(SUI)$0.94-6.88%
  • shiba-inuShiba Inu(SHIB)$0.000006-7.86%
  • Global DollarGlobal Dollar(USDG)$1.00-0.01%
  • BittensorBittensor(TAO)$280.11-9.66%
  • crypto-com-chainCronos(CRO)$0.060385-9.30%
  • MemeCoreMemeCore(M)$1.24-2.70%
  • BitwayBitway(BTW)$1.018.46%
  • paypal-usdPayPal USD(PYUSD)$1.00-0.01%
  • tether-goldTether Gold(XAUT)$4,256.07-1.51%
  • okbOKB(OKB)$117.79-4.61%
  • Circle USYCCircle USYC(USYC)$1.140.01%
  • Ripple USDRipple USD(RLUSD)$1.000.00%
  • BlackRock USD Institutional Digital Liquidity FundBlackRock USD Institutional Digital Liquidity Fund(BUIDL)$1.000.00%
  • Ondo US Dollar YieldOndo US Dollar Yield(USDY)$1.140.03%
  • mantleMantle(MNT)$0.66-3.13%
  • aaveAave(AAVE)$136.12-8.75%
  • OndoOndo(ONDO)$0.422517-3.24%
  • EthenaEthena(ENA)$0.201167-5.51%
  • AsterAster(ASTER)$0.70-3.09%
TradePoint.io
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop
No Result
View All Result
TradePoint.io
No Result
View All Result

HNSW, Flat, or Inverted Index: Which Should You Choose for Your Search? This AI Paper Offers Operational Advice for Dense and Sparse Retrievers

September 16, 2024
in AI & Technology
Reading Time: 5 mins read
A A
HNSW, Flat, or Inverted Index: Which Should You Choose for Your Search? This AI Paper Offers Operational Advice for Dense and Sparse Retrievers
ShareShareShareShareShare

A significant challenge in information retrieval today is determining the most efficient method for nearest-neighbor vector search, especially with the growing complexity of dense and sparse retrieval models. Practitioners must navigate a wide range of options for indexing and retrieval methods, including HNSW (Hierarchical Navigable Small-World) graphs, flat indexes, and inverted indexes. These methods offer different trade-offs in terms of speed, scalability, and quality of retrieval results. As datasets become larger and more complex, the absence of clear operational guidance makes it difficult for practitioners to optimize their systems, particularly for applications requiring high performance, such as search engines and AI-driven applications like question-answering systems.

Traditionally, nearest-neighbor search is handled using three main approaches: HNSW indexes, flat indexes, and inverted indexes. HNSW indexes are commonly used for their efficiency and speed in large-scale retrieval tasks, particularly with dense vectors, but they are computationally intensive and require significant indexing time. Flat indexes, while exact in their retrieval results, become impractical for large datasets due to slower query performance. Sparse retrieval models, like BM25 or SPLADE++ ED, rely on inverted indexes and can be effective in specific scenarios but often lack the rich semantic understanding provided by dense retrieval models. The main limitation across these approaches is that none are universally applicable, with each method offering different strengths and weaknesses depending on the dataset size and retrieval 

YOU MAY ALSO LIKE

Contrastive-LM Releases CLM-8B: An Open System One Model That Scores Agent Actions Up to 9× Faster Than Jev

A Coding Guide to TypeSafe AI Jev: Typed Decisions, Calibrated Confidence, and Speculative Fan-Out with a System One Model

Researchers from the University of Waterloo introduce a thorough evaluation of the trade-offs between HNSW, flat, and inverted indexes for both dense and sparse retrieval models. This research provides a detailed analysis of the performance of these methods, measured by indexing time, query speed (QPS), and retrieval quality (nDCG@10), using the BEIR benchmark dataset. The researchers aim to give practical, data-driven advice on the optimal use of each method based on the dataset size and retrieval requirements. Their findings indicate that HNSW is highly efficient for large-scale datasets, while flat indexes are better suited for smaller datasets due to their simplicity and exact results. Additionally, the study explores the benefits of using quantization techniques to improve the scalability and speed of the retrieval process, offering a significant enhancement for practitioners working with large datasets.

The experimental setup utilizes the BEIR benchmark, a collection of 29 datasets designed to reflect real-world information retrieval challenges. The dense retrieval model used is BGE (Base General Embeddings), with SPLADE++ ED and BM25 serving as the baselines for sparse retrieval. The evaluation focuses on two types of dense retrieval indexes: HNSW, which constructs graph-based structures for nearest-neighbor search, and flat indexes, which rely on brute-force search. Inverted indexes are used for sparse retrieval models. The evaluations are conducted using the Lucene search library, with specific configurations such as M=16 for HNSW. Performance is assessed using key metrics like nDCG@10 and QPS, with query performance evaluated under two conditions: cached queries (precomputed query encoding) and ONNX-based real-time query encoding.

The results reveal that for smaller datasets (under 100K documents), flat and HNSW indexes show comparable performance in terms of both query speed and retrieval quality. However, as dataset sizes increase, HNSW indexes begin to significantly outperform flat indexes, particularly in terms of query evaluation speed. For large datasets exceeding 1 million documents, HNSW indexes deliver far higher queries per second (QPS), with only a marginal decrease in retrieval quality (nDCG@10). When dealing with datasets of over 15 million documents, HNSW indexes demonstrate substantial improvements in speed while maintaining acceptable retrieval accuracy. Quantization techniques further boost performance, particularly in large datasets, offering notable increases in query speed without a significant reduction in quality. Overall, dense retrieval methods using HNSW prove to be far more effective and efficient than sparse retrieval models, particularly for large-scale applications requiring high performance.

This research offers essential guidance for practitioners in dense and sparse retrieval, providing a comprehensive evaluation of the trade-offs between HNSW, flat, and inverted indexes. The findings suggest that HNSW indexes are well-suited for large-scale retrieval tasks due to their efficiency in handling queries, while flat indexes are ideal for smaller datasets and rapid prototyping due to their simplicity and accuracy. By providing empirically-backed recommendations, this work significantly contributes to the understanding and optimization of modern information retrieval systems, helping practitioners make informed decisions for AI-driven search applications.


Check out the Paper. All credit for this research goes to the researchers of this project. Also, don’t forget to follow us on Twitter and join our Telegram Channel and LinkedIn Group. If you like our work, you will love our newsletter..

Don’t Forget to join our 50k+ ML SubReddit

⏩ ⏩ FREE AI WEBINAR: ‘SAM 2 for Video: How to Fine-tune On Your Data’ (Wed, Sep 25, 4:00 AM – 4:45 AM EST)


Aswin AK is a consulting intern at MarkTechPost. He is pursuing his Dual Degree at the Indian Institute of Technology, Kharagpur. He is passionate about data science and machine learning, bringing a strong academic background and hands-on experience in solving real-life cross-domain challenges.

⏩ ⏩ FREE AI WEBINAR: ‘SAM 2 for Video: How to Fine-tune On Your Data’ (Wed, Sep 25, 4:00 AM – 4:45 AM EST)


Credit: Source link

ShareTweetSendSharePin

Related Posts

Contrastive-LM Releases CLM-8B: An Open System One Model That Scores Agent Actions Up to 9× Faster Than Jev
AI & Technology

Contrastive-LM Releases CLM-8B: An Open System One Model That Scores Agent Actions Up to 9× Faster Than Jev

September 24, 2026
A Coding Guide to TypeSafe AI Jev: Typed Decisions, Calibrated Confidence, and Speculative Fan-Out with a System One Model
AI & Technology

A Coding Guide to TypeSafe AI Jev: Typed Decisions, Calibrated Confidence, and Speculative Fan-Out with a System One Model

September 24, 2026
Everything Announced At Meta Connect 2026
AI & Technology

Everything Announced At Meta Connect 2026

September 24, 2026
Meta Put Muse In A Tamagotchi Like ‘Charm’ Device
AI & Technology

Meta Put Muse In A Tamagotchi Like ‘Charm’ Device

September 24, 2026
Next Post
Trump allies worry his ties to Laura Loomer could cost him votes in battleground states

Trump allies worry his ties to Laura Loomer could cost him votes in battleground states

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

No Result
View All Result
The Disclosure Dilemma: Oversharing (With Leslie John)

The Disclosure Dilemma: Oversharing (With Leslie John)

September 21, 2026
Sen. Darline Graham thanks Trump after winning GOP Senate primary runoff in S.C.

Sen. Darline Graham thanks Trump after winning GOP Senate primary runoff in S.C.

September 23, 2026
OpenAI, Anthropic Safety Talks Stir Startup Concerns

OpenAI, Anthropic Safety Talks Stir Startup Concerns

September 20, 2026

About

Learn more

Our Services

Legal

Privacy Policy

Terms of Use

Bloggers

Learn more

Article Links

Contact

Advertise

Ask us anything

©2020- TradePoint.io - All rights reserved!

Tradepoint.io, being just a publishing and technology platform, is not a registered broker-dealer or investment adviser. So we do not provide investment advice. Rather, brokerage services are provided to clients of Tradepoint.io by independent SEC-registered broker-dealers and members of FINRA/SIPC. Every form of investing carries some risk and past performance is not a guarantee of future results. “Tradepoint.io“, “Instant Investing” and “My Trading Tools” are registered trademarks of Apperbuild, LLC.

This website is operated by Apperbuild, LLC. We have no link to any brokerage firm and we do not provide investment advice. Every information and resource we provide is solely for the education of our readers. © 2020 Apperbuild, LLC. All rights reserved.

No Result
View All Result
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop

© 2023 - TradePoint.io - All Rights Reserved!