• bitcoinBitcoin(BTC)$84,384.000.30%
  • ethereumEthereum(ETH)$2,682.480.85%
  • tetherTether(USDT)$1.00-0.02%
  • binancecoinBNB(BNB)$780.142.36%
  • rippleXRP(XRP)$1.520.37%
  • usd-coinUSDC(USDC)$1.000.00%
  • solanaSolana(SOL)$116.301.90%
  • tronTRON(TRX)$0.338955-0.17%
  • zcashZcash(ZEC)$1,518.05-2.78%
  • Figure HelocFigure Heloc(FIGR_HELOC)$1.040.85%
  • HyperliquidHyperliquid(HYPE)$93.700.81%
  • dogecoinDogecoin(DOGE)$0.0956762.98%
  • moneroMonero(XMR)$548.89-0.16%
  • whitebitWhiteBIT Coin(WBT)$84.33-0.14%
  • USDSUSDS(USDS)$1.00-0.01%
  • chainlinkChainlink(LINK)$12.754.44%
  • cardanoCardano(ADA)$0.2498085.03%
  • RainRain(RAIN)$0.012051-3.45%
  • leo-tokenLEO Token(LEO)$8.90-0.95%
  • stellarStellar(XLM)$0.2086632.81%
  • bitcoin-cashBitcoin Cash(BCH)$339.13-1.59%
  • nearNEAR Protocol(NEAR)$4.606.54%
  • litecoinLitecoin(LTC)$74.4625.00%
  • uniswapUniswap(UNI)$9.292.24%
  • Ethena USDeEthena USDe(USDE)$1.000.00%
  • avalanche-2Avalanche(AVAX)$10.400.67%
  • daiDai(DAI)$1.000.01%
  • USD1USD1(USD1)$1.00-0.02%
  • CantonCanton(CC)$0.1109863.36%
  • suiSui(SUI)$1.014.94%
  • hedera-hashgraphHedera(HBAR)$0.0920962.33%
  • the-open-networkGram (prev. Toncoin)(GRAM)$1.431.70%
  • shiba-inuShiba Inu(SHIB)$0.0000062.90%
  • BittensorBittensor(TAO)$291.470.20%
  • Global DollarGlobal Dollar(USDG)$1.000.00%
  • crypto-com-chainCronos(CRO)$0.0625932.19%
  • BitwayBitway(BTW)$1.0510.95%
  • MemeCoreMemeCore(M)$1.230.25%
  • paypal-usdPayPal USD(PYUSD)$1.00-0.01%
  • tether-goldTether Gold(XAUT)$4,258.81-0.59%
  • okbOKB(OKB)$119.631.32%
  • OndoOndo(ONDO)$0.5225.08%
  • 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.14-0.13%
  • mantleMantle(MNT)$0.684.56%
  • aaveAave(AAVE)$144.273.65%
  • EthenaEthena(ENA)$0.2175987.36%
  • polkadotPolkadot(DOT)$1.176.62%
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

New technique makes RAG systems much better at retrieving the right documents

October 9, 2024
in AI & Technology
Reading Time: 4 mins read
A A
New technique makes RAG systems much better at retrieving the right documents
ShareShareShareShareShare

Join our daily and weekly newsletters for the latest updates and exclusive content on industry-leading AI coverage. Learn More


Retrieval-augmented generation (RAG) has become a popular method for grounding large language models (LLMs) in external knowledge. RAG systems typically use an embedding model to encode documents in a knowledge corpus and select those that are most relevant to the user’s query.

YOU MAY ALSO LIKE

Bessemer: Anthropic Has Been Consistent on AI Safety

Apple Explores Screenless Fitness Tracker to Rival Whoop

However, standard retrieval methods often fail to account for context-specific details that can make a big difference in application-specific datasets. In a new paper, researchers at Cornell University introduce “contextual document embeddings,” a technique that improves the performance of embedding models by making them aware of the context in which documents are retrieved.

The limitations of bi-encoders

The most common approach for document retrieval in RAG is to use “bi-encoders,” where an embedding model creates a fixed representation of each document and stores it in a vector database. During inference, the embedding of the query is calculated and compared to the stored embeddings to find the most relevant documents.

Bi-encoders have become a popular choice for document retrieval in RAG systems due to their efficiency and scalability. However, bi-encoders often struggle with nuanced, application-specific datasets because they are trained on generic data. In fact, when it comes to specialized knowledge corpora, they can fall short of classic statistical methods such as BM25 in certain tasks.

“Our project started with the study of BM25, an old-school algorithm for text retrieval,” John (Jack) Morris, a doctoral student at Cornell Tech and co-author of the paper, told VentureBeat. “We performed a little analysis and saw that the more out-of-domain the dataset is, the more BM25 outperforms neural networks.”

BM25 achieves its flexibility by calculating the weight of each word in the context of the corpus it is indexing. For example, if a word appears in many documents in the knowledge corpus, its weight will be reduced, even if it is an important keyword in other contexts. This allows BM25 to adapt to the specific characteristics of different datasets.

“Traditional neural network-based dense retrieval models can’t do this because they just set weights once, based on the training data,” Morris said. “We tried to design an approach that could fix this.”

Contextual document embeddings

Contextual document embeddings Credit: arXiv

The Cornell researchers propose two complementary methods to improve the performance of bi-encoders by adding the notion of context to document embeddings.

“If you think about retrieval as a ‘competition’ between documents to see which is most relevant to a given search query, we use ‘context’ to inform the encoder about the other documents that will be in the competition,” Morris said.

The first method modifies the training process of the embedding model. The researchers use a technique that groups similar documents before training the embedding model. They then use contrastive learning to train the encoder on distinguishing documents within each cluster. 

Contrastive learning is an unsupervised technique where the model is trained to tell the difference between positive and negative examples. By being forced to distinguish between similar documents, the model becomes more sensitive to subtle differences that are important in specific contexts.

The second method modifies the architecture of the bi-encoder. The researchers augment the encoder with a mechanism that gives it access to the corpus during the embedding process. This allows the encoder to take into account the context of the document when generating its embedding.

The augmented architecture works in two stages. First, it calculates a shared embedding for the cluster to which the document belongs. Then, it combines this shared embedding with the document’s unique features to create a contextualized embedding.

This approach enables the model to capture both the general context of the document’s cluster and the specific details that make it unique. The output is still an embedding of the same size as a regular bi-encoder, so it does not require any changes to the retrieval process.

The impact of contextual document embeddings

The researchers evaluated their method on various benchmarks and found that it consistently outperformed standard bi-encoders of similar sizes, especially in out-of-domain settings where the training and test datasets are significantly different.

“Our model should be useful for any domain that’s materially different from the training data, and can be thought of as a cheap replacement for finetuning domain-specific embedding models,” Morris said.

The contextual embeddings can be used to improve the performance of RAG systems in different domains. For example, if all of your documents share a structure or context, a normal embedding model would waste space in its embeddings by storing this redundant structure or information. 

“Contextual embeddings, on the other hand, can see from the surrounding context that this shared information isn’t useful, and throw it away before deciding exactly what to store in the embedding,” Morris said.

The researchers have released a small version of their contextual document embedding model (cde-small-v1). It can be used as a drop-in replacement for popular open-source tools such as HuggingFace and SentenceTransformers to create custom embeddings for different applications.

Morris says that contextual embeddings are not limited to text-based models can be extended to other modalities, such as text-to-image architectures. There is also room to improve them with more advanced clustering algorithms and evaluate the effectiveness of the technique at larger scales.

VB Daily

Stay in the know! Get the latest news in your inbox daily

By subscribing, you agree to VentureBeat’s Terms of Service.

Thanks for subscribing. Check out more VB newsletters here.

An error occured.

Credit: Source link
ShareTweetSendSharePin

Related Posts

Bessemer: Anthropic Has Been Consistent on AI Safety
AI & Technology

Bessemer: Anthropic Has Been Consistent on AI Safety

September 24, 2026
Apple Explores Screenless Fitness Tracker to Rival Whoop
AI & Technology

Apple Explores Screenless Fitness Tracker to Rival Whoop

September 24, 2026
Razer’s Kiyo V2 Pro Webcam Can Capture 4K Video At 60 Fps
AI & Technology

Razer’s Kiyo V2 Pro Webcam Can Capture 4K Video At 60 Fps

September 24, 2026
How To Get Your Cut Of Apple’s 0 Million Siri Settlement
AI & Technology

How To Get Your Cut Of Apple’s $250 Million Siri Settlement

September 24, 2026
Next Post
Tallahassee avoids the worst of Hurricane Helene as the storm weakens

Tallahassee avoids the worst of Hurricane Helene as the storm weakens

Leave a Reply Cancel reply

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

Search

No Result
View All Result
Staten Island man struck by lightning and survives

Staten Island man struck by lightning and survives

September 20, 2026
Kelsey Mitchell sets WNBA season scoring record, fêted by Fever – ESPN

Kelsey Mitchell sets WNBA season scoring record, fêted by Fever – ESPN

September 19, 2026
How To Turn Your Old Windows PC Into A Chromebook For Free

How To Turn Your Old Windows PC Into A Chromebook For Free

September 21, 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!