大規模言語モデルの生成と帰属のための最近傍推測デコード
Nearest Neighbor Speculative Decoding for LLM Generation and Attribution
May 29, 2024
著者: Minghan Li, Xilun Chen, Ari Holtzman, Beidi Chen, Jimmy Lin, Wen-tau Yih, Xi Victoria Lin
cs.AI
要旨
大規模言語モデル(LLM)は、しばしば幻覚を起こし、生成内容の出典を提示する能力に欠けることがあります。kNN-LMのような半パラメトリック言語モデルは、非パラメトリックなデータストア内での最近傍マッチングを用いて、与えられたプロンプトに対するLMの出力を改善することで、これらの制限にアプローチします。しかし、これらのモデルは推論速度が遅く、非流暢なテキストを生成することが多いです。本論文では、Nearest Neighbor Speculative Decoding(NEST)を紹介します。これは、現実世界の任意の長さのテキストスパンをLMの生成に組み込み、その出典を提示できる新しい半パラメトリック言語モデリング手法です。NESTは、各推論ステップでトークンレベルの検索を行い、半パラメトリックな混合分布を計算し、コーパス内で有望なスパン継続を特定します。その後、検索されたスパンのプレフィックスを受け入れるか、新しいトークンを生成する近似推測デコーディング手順を使用します。NESTは、様々な知識集約型タスクにおいて、ベースLMの生成品質と出典提示率を大幅に向上させ、従来のkNN-LM手法を凌駕し、コンテキスト内検索拡張と競争力のある性能を発揮します。さらに、NESTは生成速度を大幅に改善し、Llama-2-Chat 70Bに適用した場合、推論時間で1.8倍の高速化を達成します。
English
Large language models (LLMs) often hallucinate and lack the ability to
provide attribution for their generations. Semi-parametric LMs, such as kNN-LM,
approach these limitations by refining the output of an LM for a given prompt
using its nearest neighbor matches in a non-parametric data store. However,
these models often exhibit slow inference speeds and produce non-fluent texts.
In this paper, we introduce Nearest Neighbor Speculative Decoding (NEST), a
novel semi-parametric language modeling approach that is capable of
incorporating real-world text spans of arbitrary length into the LM generations
and providing attribution to their sources. NEST performs token-level retrieval
at each inference step to compute a semi-parametric mixture distribution and
identify promising span continuations in a corpus. It then uses an approximate
speculative decoding procedure that accepts a prefix of the retrieved span or
generates a new token. NEST significantly enhances the generation quality and
attribution rate of the base LM across a variety of knowledge-intensive tasks,
surpassing the conventional kNN-LM method and performing competitively with
in-context retrieval augmentation. In addition, NEST substantially improves the
generation speed, achieving a 1.8x speedup in inference time when applied to
Llama-2-Chat 70B.Summary
AI-Generated Summary