• bitcoinBitcoin(BTC)$83,734.00-0.84%
  • ethereumEthereum(ETH)$2,660.05-0.48%
  • tetherTether(USDT)$1.000.00%
  • binancecoinBNB(BNB)$777.351.33%
  • rippleXRP(XRP)$1.50-1.80%
  • usd-coinUSDC(USDC)$1.000.00%
  • solanaSolana(SOL)$114.79-0.09%
  • tronTRON(TRX)$0.339631-0.15%
  • zcashZcash(ZEC)$1,497.99-6.84%
  • Figure HelocFigure Heloc(FIGR_HELOC)$1.040.54%
  • HyperliquidHyperliquid(HYPE)$91.85-3.05%
  • dogecoinDogecoin(DOGE)$0.094248-0.63%
  • moneroMonero(XMR)$546.74-0.84%
  • whitebitWhiteBIT Coin(WBT)$83.87-0.94%
  • USDSUSDS(USDS)$1.00-0.01%
  • chainlinkChainlink(LINK)$12.471.07%
  • cardanoCardano(ADA)$0.2454962.35%
  • RainRain(RAIN)$0.012052-3.68%
  • leo-tokenLEO Token(LEO)$8.90-0.67%
  • stellarStellar(XLM)$0.205471-0.24%
  • bitcoin-cashBitcoin Cash(BCH)$336.36-1.35%
  • nearNEAR Protocol(NEAR)$4.51-2.75%
  • uniswapUniswap(UNI)$9.10-3.64%
  • litecoinLitecoin(LTC)$72.3719.32%
  • Ethena USDeEthena USDe(USDE)$1.000.02%
  • daiDai(DAI)$1.000.02%
  • avalanche-2Avalanche(AVAX)$10.24-1.77%
  • USD1USD1(USD1)$1.00-0.01%
  • CantonCanton(CC)$0.1087320.08%
  • hedera-hashgraphHedera(HBAR)$0.0926591.13%
  • suiSui(SUI)$0.991.22%
  • the-open-networkGram (prev. Toncoin)(GRAM)$1.41-0.01%
  • shiba-inuShiba Inu(SHIB)$0.0000060.07%
  • Global DollarGlobal Dollar(USDG)$1.00-0.01%
  • BittensorBittensor(TAO)$286.51-5.11%
  • crypto-com-chainCronos(CRO)$0.061997-0.40%
  • BitwayBitway(BTW)$1.038.58%
  • MemeCoreMemeCore(M)$1.221.51%
  • paypal-usdPayPal USD(PYUSD)$1.000.00%
  • tether-goldTether Gold(XAUT)$4,260.20-0.84%
  • okbOKB(OKB)$119.040.23%
  • Circle USYCCircle USYC(USYC)$1.140.01%
  • OndoOndo(ONDO)$0.49166017.49%
  • 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.150.02%
  • mantleMantle(MNT)$0.672.58%
  • aaveAave(AAVE)$141.750.08%
  • EthenaEthena(ENA)$0.2155704.75%
  • MorphoMorpho(MORPHO)$2.828.76%
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

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

Revolut Is Piloting Facial Recognition At Store Checkouts In The UK

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

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
Revolut Is Piloting Facial Recognition At Store Checkouts In The UK
AI & Technology

Revolut Is Piloting Facial Recognition At Store Checkouts In The UK

September 24, 2026
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
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
Tech elites launch college alternative for next generation of AI geniuses, raises M

Tech elites launch college alternative for next generation of AI geniuses, raises $42M

September 22, 2026
Oil deal gives Venezuelans reluctant hope for a better future

Oil deal gives Venezuelans reluctant hope for a better future

September 21, 2026
Lindsay Clancy jury deadlocked again as judge orders jurors to keep deliberating

Lindsay Clancy jury deadlocked again as judge orders jurors to keep deliberating

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