Brief IA

RAG in Danger: Alternatives for Language Models

🤖 Models & LLM·Tom Levy·

RAG in Danger: Alternatives for Language Models

RAG in Danger: Alternatives for Language Models
Key Takeaways
1The RAG method, while popular, shows notable weaknesses in production, particularly in terms of relevance.
2Companies are investing heavily in RAG, but costs often skyrocket without guaranteeing better results.
3Alternatives like long-context prompting and graph-based reasoning offer more effective solutions.
💡Why it mattersThese alternatives improve accuracy and reduce costs in the use of language models in business.
Le brief IA que lisent les pros

Le brief IA que les pros lisent chaque soir

Les 7 actus IA du jour, décryptées en 5 min. Gratuit.

Inclus dès l'inscription : notre sélection des meilleurs guides & comparatifs IA.

Choisis ton rythme

Gratuit · Pas de spam · Désabonnement en 1 clic

📄
Full Analysis

The Rise and Limits of RAG

Retrieval-Augmented Generation (RAG) has emerged as a preferred method for linking documents to language models (LLMs). The process is relatively straightforward: it involves integrating a dataset, retrieving the most relevant segments via vector similarity, and then incorporating them into a prompt. This method performs well in demonstrations and in some production systems. However, it exhibits notable failures, especially when deployed at scale.

Engineers are actively seeking to understand these failures and explore viable alternatives that could overcome these limitations.

The Flaws of RAG in Production

One of the most common issues with RAG is retrieval irrelevance. For instance, when a user asks a question about parental leave policy, the system might return versions from 2022 and 2024, along with a cultural blog post, simply because these documents share similar vocabulary with the query. None of these documents actually answer the question posed.

The model, unable to discern contextual relevance, mixes this information to produce a response that seems confident but is factually incorrect. This phenomenon of thematic similarity without factual relevance is a major problem in RAG systems in production.

Another issue is contextual contamination. In enterprise knowledge bases, the same document may exist in multiple versions. If the system retrieves pieces from different versions, the model may either choose one version or mix the information, potentially producing an incorrect response without either the user or the model realizing it.

The fundamental problem lies in the structural conflict of the chunk-embed-retrieve pipeline. For effective retrieval, it is necessary to use small chunks, on the order of 100 to 256 tokens. However, for good contextual understanding, larger chunks of 1,024 tokens or more are needed. RAG designers must therefore make a difficult choice between these two requirements.

The Temptation of Over-Engineering

In the face of RAG's disappointing performance, a common solution is to complicate the system: using higher-dimensional embeddings, more sophisticated reranking, or multi-step retrieval. However, this only exacerbates the problem.

For example, a global manufacturing company initially budgeted $400,000 for its RAG system but ended up spending $1.2 million in the first year, with a final accuracy of only 23% on technical documentation queries. The project was canceled. Similarly, a healthcare company saw its vector database costs reach $75,000 per month in just six months. These cases illustrate a broader pattern: by 2025, enterprise RAG implementations failed 72% of the time in their first year.

Increasing the dimensions of embeddings and using more sophisticated vector models do not automatically improve performance. On the contrary, they increase computational costs and delay the crucial question: is the retrieval architecture really the right solution?

Exploring Viable Alternatives

Long-Context Prompting

A direct alternative to over-engineering a failing RAG pipeline is to completely eliminate the retrieval step. If the corpus can be integrated into the model's context window, it is sufficient to load it and let the model process the information. Studies have shown that long-context LLMs consistently outperform RAG in question-answering tasks when computational resources are available.

However, the cost trade-off is significant. With 1 million tokens, the latency is 30 to 60 times slower than a RAG pipeline, and the cost per query is about 1,250 times higher. Nevertheless, by using prompt caching for high-traffic applications, long-context prompting can become economically viable.

A common decision rule is as follows: if the corpus fits within the context window and the query volume is moderate, long-context prompting is the best option. Retrieval should only be added when the corpus exceeds the window, when latency does not meet service level objectives (SLO), or when the query volume exceeds the profitability threshold.

Memory Compression

When the corpus is too large for the context window, one solution is to summarize the documents before retrieval. Summary-based retrieval compresses documents before injecting them, rather than retrieving raw chunks. Benchmarks show that this approach is comparable to complete long-context methods, while chunk-based retrieval is consistently inferior to both.

A concrete example: a RAG approach using 48,000 well-chosen tokens outperformed full-context retrieval with 117,000 tokens by 13 F1 points, while using one-seventh of the token budget. A well-compressed relevant document is more effective than a raw spill of tangentially related chunks.

Structured Retrieval

When retrieval is the right architecture, the solution is to route by query type rather than uniformly applying better embeddings.

Research presented at EMNLP 2024 introduced Self-Route, which allows the model to classify whether a query requires full context or targeted retrieval before executing it. Simple factual queries are directed to targeted RAG, while complex questions requiring a holistic understanding are oriented towards long context.

The result is better overall accuracy at a lower computational cost. Adaptive systems using this hybrid approach have shown retrieval accuracy improvements of 15 to 30% through hybrid search and reranking.

The key change is to make routing explicit. Each query is classified before any retrieval is performed, and the system stops treating all queries as identical integration problems.

Graph-Based Reasoning

For queries requiring an understanding of relationships across a dataset, rather than retrieving a specific passage, vector retrieval fails by design.

These are multi-hop questions: for example, what decisions did the board overturn in Q3, and what was the stated reason each time? No single chunk can answer this. The answer lies in the connections between documents.

Microsoft Research introduced GraphRAG in 2024. This system builds a knowledge graph from the corpus and then explores the relationships between entities rather than matching vectors.

This approach directly addresses the failure case that standard RAG cannot handle: synthesis across multiple documents requiring relational reasoning.

The trade-off is cost. Knowledge graph extraction is 3 to 5 times more expensive than basic RAG and requires domain-specific tuning. GraphRAG is justified for thematic analysis and multi-hop reasoning, but not for single-pass factual searches.

Conclusion

RAG remains a reasonable default choice for many use cases, but it has predictable weaknesses: retrieval irrelevance when vocabulary matches but semantics diverge, contextual contamination with conflicting versions, and structural limits when chunk sizes cannot satisfy both retrieval and coherence. Adding complexity to a failing retrieval design makes these problems more costly.

Four alternatives stand out depending on the situation:

  • If the corpus fits within the context window, long-context prompting completely avoids the retrieval problem.
  • If context compression is necessary, summarization before retrieval outperforms raw chunk retrieval.
  • If queries vary by type, explicit routing with structured retrieval improves both accuracy and cost.
  • If queries require relational synthesis across documents, graph-based reasoning is the right architecture.

Adapt the architecture to the type of query to optimize performance and costs.

Brief IA — L'actualité IA en français

L'essentiel de l'actualité de l'intelligence artificielle, décrypté et expliqué chaque jour.