SubGCache: Accelerating Graph-based RAG with Subgraph-level KV Cache

要約

グラフベースの検索された生成(RAG)により、大規模な言語モデル(LLM)は、グラフ取得を介してコンテキスト入力として構造化された知識を組み込むことができ、より正確でコンテキスト認識の推論を強化します。
さまざまなクエリについて、プロンプトと同様のサブグラフを取得できるため、同様の構造プロンプト(つまり、サブグラフ)でクエリ全体で計算を再利用することで推論潜時を減らすことを目的としています。
具体的には、サブグラフの埋め込みに基づいてサブガッチクラスタークエリをクエリし、各クラスターの代表的なサブグラフを構築し、代表的なサブグラフのキー価値(kV)キャッシュを事前に互換性を示します。
クラスター内に検索されたサブグラフを使用した各クエリについて、計算を保存するためにKVテンソルを再度計算せずに、クラスターの代表的なサブグラフの事前に計算されたKVキャッシュを再利用します。
複数のLLMバックボーンとグラフベースのRAGフレームワークにわたる2つの新しいデータセットでの実験は、サブガチャチが、同等の、さらには改善された生成品質で推論の遅延を一貫して低下させ、最大6.68 $ \ Times $削減(TTTFT)で最大6.68 $ \ Times $削減を達成することを示しています。

要約(オリジナル)

Graph-based retrieval-augmented generation (RAG) enables large language models (LLMs) to incorporate structured knowledge via graph retrieval as contextual input, enhancing more accurate and context-aware reasoning. We observe that for different queries, it could retrieve similar subgraphs as prompts, and thus we propose SubGCache, which aims to reduce inference latency by reusing computation across queries with similar structural prompts (i.e., subgraphs). Specifically, SubGCache clusters queries based on subgraph embeddings, constructs a representative subgraph for each cluster, and pre-computes the key-value (KV) cache of the representative subgraph. For each query with its retrieved subgraph within a cluster, it reuses the pre-computed KV cache of the representative subgraph of the cluster without computing the KV tensors again for saving computation. Experiments on two new datasets across multiple LLM backbones and graph-based RAG frameworks demonstrate that SubGCache consistently reduces inference latency with comparable and even improved generation quality, achieving up to 6.68$\times$ reduction in time-to-first-token (TTFT).

arxiv情報

著者 Qiuyu Zhu,Liang Zhang,Qianxiong Xu,Cheng Long,Jie Zhang
発行日 2025-05-19 17:51:26+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.LG パーマリンク