RAG パイプラインは役に立たない可能性が高い。より良い代替案とは
KDnuggets は、従来の RAG パイプラインが抱える根本的な課題を指摘し、より効果的な代替アプローチの導入を提唱している。
キーポイント
従来型 RAG の限界と無効化リスク
単純な検索・生成パイプラインでは、文脈の欠如やハルシネーションにより、多くの実務ケースで期待通りの成果が得られない現状を指摘している。
代替アプローチの提案
従来のフラットな検索に依存せず、構造化されたデータ活用や多段階検証プロセスなど、より堅牢なアーキテクチャへの転換を推奨している。
実装における具体的な改善策
単なるキーワードマッチングではなく、意味論的整合性を高めるための前処理や、生成結果の品質保証メカニズムの統合が不可欠であると説いている。
影響分析・編集コメントを表示
影響分析
この記事は、RAG を単なる「検索+生成」の組み合わせとして安易に実装する業界全体の風潮に対し、根本的な再考を促す重要な警鐘である。技術者やアーキテクトに対して、表面的な実装ではなく、信頼性と精度を担保するための構造的な改善を迫るものであり、今後の AI アプリケーション開発の方向性に大きな影響を与える可能性がある。
編集コメント
RAG の実装において「検索さえすれば解決する」という楽観視を戒め、より高度なシステム設計の必要性を浮き彫りにした有益な論考です。
image**
# イントロダクション
検索拡張生成(RAG)は、ドキュメントと大規模言語モデル(LLM)を接続するための標準的なアプローチとして登場しました。
このパターンはシンプルです。コーパスを埋め込み、ベクトル類似性によって最も関連性の高いチャンクを検索し、プロンプトに注入します。デモや多くの生産システムではうまく機能しますが、スケールした際にのみ現れる、予測可能で文書化された方法で失敗することもあります。
ここでは、それらの障害モードがどのようなものか、そしてそれを解決するためにエンジニアたちが取り組んでいる代替案について説明します。
**

# 本番環境での RAG の失敗
最も一般的な障害パターンは、検索結果の無関係性です。ユーザーが育児休暇ポリシーについて問い合わせると、検索システムは 2022 年版、2024 年版、そして文化的なブログ記事という 3 つの結果を返します。各チャンクは、クエリと語彙を共有しているため埋め込み距離のスコアが高くなりますが、ユーザーが実際に尋ねた質問に答えているものはありません。

モデルは、取得されたコンテンツが古かったり、主題から外れていたりすることを知りません。チャンクをブレンドして自信ありげで詳細な回答を作成しますが、それは事実上誤っています。これはトピックの類似性はあっても事実に基づく関連性がない状態であり、本番環境での RAG システムにおける支配的な障害モードです。
より微妙なバージョンとして、コンテキストの汚染(poisoning)があります。エンタープライズナレッジベース には、同じポリシー文書が複数のバージョンで保存されていることがよくあります。検索器(retriever)が両方のバージョンからチャンクを返した場合、モデルはその矛盾を表面化しません。代わりに、片方を選択するか、両方をブレンドするか、あるいは自信に満ちた統合された回答を提示します。読者は答えを得ますが、その答えは間違っている可能性があります。ユーザーもモデルも、それが誤りであることに気づきません。
根本的な原因は、チャンク化・埋め込み・検索パイプラインにおける構造的な競合です。良好な想起(recall)には、焦点を絞った検索のために 100 から 256 トークン程度の小さなチャンクが必要です。一方、文脈の理解を高めるためには、一貫性を保つために 1,024 トークン以上といった大きなチャンクが必要です。RAG の設計者は常にどちらか一方を選択し、トレードオフを受け入れることになります。
# 一般的な(誤った)対策:過剰なエンジニアリング
標準的な RAG が期待通りに機能しない場合、よく行われる対応は、それをより複雑にすることです:高次元の埋め込み、より洗練された再ランク付け、多段階検索など。これは問題をさらに悪化させるだけです。
あるグローバル製造企業が RAG システムに 40 万ドルの予算を組んでいました。1 年目のコストは 120 万ドルに達し、技術文書に関する問い合わせに対する最終的な精度はわずか 23% でした。プロジェクトは中止されました。別の医療系企業では、6 ヶ月目までにベクトルデータベースのコストが月額 75,000 ドルにまで膨れ上がりました。これらの結果はより広範な傾向を反映しています:2025 年におけるエンタープライズ向け RAG(Retrieval-Augmented Generation)の実装の初年度失敗率は 72% に達しました。

埋め込み次元数を増やしたり、より洗練されたベクトルモデルを使用しても、自動的にパフォーマンスが向上するわけではありません。むしろ計算コストが増大し、より本質的な問い、「そもそも 検索アーキテクチャ が適切な選択だったのか」という重要な質問への回答が遅れることになります。
RAG が失敗した際の代替案
// 長文コンテキストプロンプティング
struggling な RAG パイプラインを過剰に設計する最も直接的な代替手段は、検索プロセスそのものを省略することです。
コーパスがモデルのコンテキストウィンドウ(context window)内に収まる場合、そのまま読み込ませてモデルに読ませるだけで十分です。あるベンチマーク研究 arxiv.org/abs/2501.01880 では、計算リソースが利用可能な場合、長文コンテキスト対応の LLM(大規模言語モデル)は QA タスクにおいて RAG を一貫して上回っており、特にチャンクベースの検索手法が最も遅れをとることが示されました。
コストのトレードオフは顕著です。100 万トークンの場合、レイテンシは RAG パイプラインよりも 30 倍から 60 倍遅く、クエリあたりのコストは約 1,250 倍になります。高トラフィックアプリケーションにおけるプロンプトキャッシング(prompt caching)を活用すれば、ロングコンテキスト(long-context)もコスト競争力を持つ可能性があります。
一般的な意思決定のルール:コーパスがコンテキストウィンドウに収まり、クエリボリュームが中程度であれば、ロングコンテキスト・プロンプティング(long-context prompting)の方がクリーンな出発点となります。コーパスがウィンドウを超えた場合、レイテンシがサービスレベル目標(SLOs: Service Level Objectives)を違反した場合、またはクエリボリュームが経済的な損益分岐点を越えた場合にのみ、検索機能を追加してください。
// メモリ圧縮
コーパスがコンテキストウィンドウに収まりすぎない場合、検索前に要約を行います。要約ベースの検索(summarization-based retrieval)は、生のカットをそのまま取り込むのではなく、注入する前に文書を圧縮します。ベンチマーク結果によると、この手法は完全なロングコンテキスト手法と同等の性能を発揮し、一方、チャンクベースの検索(chunk-based retrieval)は両者とも劣後することが示されています。
ある具体的な結果では、48K の適切に選択されたトークンを使用した順序保持型 RAG 手法が、117K トークンの完全コンテキスト検索を F1 スコアで 13 ポイント上回りました。これは、トークン予算の約 7 分の 1 で達成した成果です。適切に圧縮された関連文書は、関連性の薄いチャンクを生データとしてダンプするものよりも優れています。
//構造化検索
検索が適切なアーキテクチャである場合、解決策はクエリタイプによるルーティング(routing)であり、埋め込み(embeddings)を一律に改善することではありません。
EMNLP 2024 で発表された研究では、Self-Route という手法が紹介されました。これは、クエリを実行する前に、そのクエリに完全な文脈が必要なのか、それとも焦点を絞った検索(focused retrieval)で十分なのかをモデルが分類する仕組みです。単純な事実確認の問い合わせは焦点を絞った RAG へ、グローバルな理解を必要とする複雑な多段推論型の質問は長いコンテキスト(long context)へと振り分けられます。
その結果、計算コストを抑えつつ、全体的な精度が向上します。このハイブリッドアプローチを採用した適応型システムでは、ハイブリッド検索と再ランク付けを通じて、検索精度を 15% から 30% 向上させる成果が示されています have shown。
重要な変化は、ルーティングを明示的に行う点にあります。すべてのクエリは検索を実行する前に分類され、システムはもはやすべてのクエリを同一の埋め込み問題として扱うことをやめます。
// Graph-Based Reasoning
特定の段落を取得するのではなく、データセット全体にわたる関係性の理解が必要なクエリの場合、ベクトル検索(vector retrieval)は設計上失敗します。
これが多段推論型の質問です。例えば、「取締役会は第 3 四半期にどの決定を覆し、そのたびに公式な理由は何か?」といった問いです。単一のチャンク(chunk)でこの答えは得られません。答えは文書間のつながりの中に存在します。
Microsoft Research は 2024 年に GraphRAG を発表しました。このシステムはコーパスから知識グラフを構築し、ベクトルのマッチングではなくエンティティ間の関係をたどることで動作します。

これは、標準的な RAG (Retrieval-Augmented Generation: 検索拡張生成) では対処できない失敗ケース、すなわち関係推論を必要とする複数文書にわたる合成処理に対して直接的に対処するものです。
その代償はコストです。知識グラフの抽出は、ベースラインとなる RAG に比べて 3 倍から 5 倍のコストがかかり、ドメイン固有の調整も必要となります。主題分析や多段推論においては GraphRAG のオーバーヘッドに見合う価値がありますが、単一パスの事実参照には適していません。
# 結論
RAG は多くのユースケースにおいて合理的なデフォルト選択肢です。

また、予測可能な形で破綻します。語彙は一致しても意味が乖離する Retrieval Irrelevance(検索の無関係性)、コーパス内に矛盾するバージョンが存在する Context Poisoning(文脈汚染)、そして Recall(想起率)と Coherence(一貫性)を同時に満たすことができない Chunk Size(チャンクサイズ)による構造的限界です。破綻した Retrieval Design(検索設計)に複雑さを追加しても、これらの問題はより高価なものになるだけです。
状況に応じて、4 つのより良い道筋があります:
- コーパスが Context Window(コンテキストウィンドウ)に収まる場合、Long-context Prompting(長文コンテキストプロンプティング)は検索問題を完全に回避します。
- 文脈圧縮が必要な場合は、検索前の Summarization(要約)が生チャンク検索よりも優れた結果を示します。
- クエリがタイプによって異なる場合、構造化された検索を伴う明示的な Routing(ルーティング)は、精度とコストの両方を向上させます。
- クエリが文書間での関係性合成を必要とする場合、Graph-based Reasoning(グラフベース推論)が適切なアーキテクチャです。
アーキテクチャはクエリのタイプに合わせて選択してください。
Nate Rosidi はデータサイエンティストであり、製品戦略に関わる人物です。また、分析を教える非常勤教授でもあり、トップ企業からの実際の面接質問を用いてデータサイエンティストの面接準備を支援するプラットフォーム StrataScratch の創設者でもあります。Nate はキャリア市場における最新動向について執筆し、面接アドバイスを提供し、データサイエンスプロジェクトを紹介し、SQL に関するあらゆるトピックを取り上げています。
原文を表示

**
# Introduction
Retrieval-augmented generation** (RAG) emerged as the standard approach for connecting documents with large language models (LLMs).
The pattern is simple: embed a corpus, retrieve the most relevant chunks by vector similarity, inject them into a prompt. It works well in demos and many production systems. It also fails in predictable, documented ways that only show up at scale.
Here is what those failure modes look like, and the alternatives engineers are reaching for to address them.
**

# When RAG Fails in Production
The most common failure pattern is retrieval irrelevance. A user queries a parental leave policy. The retriever returns the 2022 version, the 2024 version, and a cultural blog post. Each chunk scores high on embedding distance because it shares vocabulary with the query. None of them answers the question the user actually asked.

The model does not know the retrieved content is outdated or off-topic. It blends the chunks into a confident, detailed answer that is factually wrong. This is topical similarity without factual relevance, and it is the dominant failure mode in production RAG systems.
A subtler version is context poisoning. Enterprise knowledge bases often hold the same policy document in multiple versions. When the retriever returns chunks from both, the model does not surface the contradiction. It picks one, blends both, or presents a confident synthesis. The reader gets an answer. The answer may be wrong. Neither the user nor the model knows it.
The underlying cause is a structural conflict in the chunk-embed-retrieve pipeline. Good recall needs small chunks, around 100 to 256 tokens, for focused retrieval. Good context understanding needs large chunks, 1,024 tokens or more, for coherence. Every RAG designer picks one and accepts the trade-off.
# The Common (Wrong) Fix: Over-Engineering
When standard RAG underperforms, the common fix is to make it more complicated: higher-dimensional embeddings, more sophisticated reranking, multi-step retrieval. This compounds the problem.
A global manufacturing company budgeted \$400K for its RAG system. Year one cost \$1.2M. Final accuracy on technical documentation queries: 23%. The project was terminated. A healthcare enterprise hit \$75K per month in vector database costs by month six. These outcomes reflect a broader pattern: enterprise RAG implementations had a 72% first-year failure rate in 2025.

Higher embedding dimensions and more sophisticated vector models do not automatically improve performance. They raise compute costs and delay the more useful question, which is whether the retrieval architecture was the right choice at all.
# Alternatives When RAG Fails
// Long-Context Prompting
The most direct alternative to over-engineering a struggling RAG pipeline is to skip retrieval entirely.
If the corpus fits in the model's context window, load it and let the model read. A benchmark study found that long-context LLMs consistently outperformed RAG on QA tasks when compute was available, with chunk-based retrieval lagging the most.
The cost trade-off is significant. At 1M tokens, latency runs 30 to 60 times slower than a RAG pipeline, at roughly 1,250 times the per-query cost. With prompt caching for high-traffic applications, long-context can become cost-competitive.
A common decision rule: if the corpus fits in the context window and the query volume is moderate, long-context prompting is the cleaner starting point. Add retrieval only when the corpus exceeds the window, latency violates service level objectives (SLOs), or query volume crosses the economic break-even point.
// Memory Compression
When the corpus is too large for the context window, summarize before retrieving. Summarization-based retrieval compresses documents before injecting them, rather than pulling raw chunks. Benchmarks show this approach performs comparably to full long-context methods, while chunk-based retrieval consistently lags behind both.
One concrete result: an order-preserving RAG approach using 48K well-chosen tokens outperformed full-context retrieval at 117K tokens by 13 F1 points, at one-seventh the token budget. A well-compressed relevant document beats a raw dump of tangentially related chunks.
// Structured Retrieval
When retrieval is the right architecture, the solution is routing by query type rather than applying better embeddings uniformly.
Research from EMNLP 2024 introduced Self-Route, which lets the model classify whether a query needs full context or focused retrieval before running it. Simple factual lookups go to focused RAG. Complex multi-hop questions requiring global understanding go to a long context.
The result: better overall accuracy at a lower computational cost. Adaptive systems using this hybrid approach have shown 15 to 30% retrieval precision improvements through hybrid search and reranking.
The key change is making routing explicit. Every query gets classified before any retrieval runs, and the system stops treating all queries as identical embedding problems.
// Graph-Based Reasoning
For queries that require understanding relationships across a dataset rather than fetching a specific passage, vector retrieval fails by design.
These are the multi-hop questions: which decisions did the board reverse in Q3, and what was the stated reason each time? No single chunk answers this. The answer lives in the connections between documents.
Microsoft Research introduced GraphRAG** in 2024. The system builds a knowledge graph from the corpus, then traverses entity relationships rather than matching vectors.
**

It 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 runs 3 to 5 times more expensive than baseline RAG and requires domain-specific tuning. GraphRAG is worth the overhead for thematic analysis and multi-hop reasoning. For single-passage factual lookups, it is not.
# Conclusion
RAG is a reasonable default for many use cases.

It also breaks in predictable ways: retrieval irrelevance when vocabulary matches but semantics diverge, context poisoning when contradictory versions exist in the corpus, and structural limits when chunk size cannot satisfy both recall and coherence at once. Adding complexity to a broken retrieval design makes those problems more expensive.
There are four better paths, depending on the situation:
- If the corpus fits the context window, long-context prompting avoids the retrieval problem entirely.
- 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.
Match the architecture to the query type.
Nate Rosidi** is a data scientist and in product strategy. He's also an adjunct professor teaching analytics, and is the founder of StrataScratch, a platform helping data scientists prepare for their interviews with real interview questions from top companies. Nate writes on the latest trends in the career market, gives interview advice, shares data science projects, and covers everything SQL.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み