LLM 생성 및 귀속을 위한 최근접 이웃 추론 디코딩
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
초록
대형 언어 모델(LLMs)은 종종 환각(hallucination)을 일으키고 생성 결과에 대한 출처를 제공하는 능력이 부족합니다. kNN-LM과 같은 반파라메트릭 언어 모델은 이러한 한계를 해결하기 위해 비파라메트릭 데이터 저장소에서 가장 가까운 이웃 매칭을 사용하여 주어진 프롬프트에 대한 언어 모델의 출력을 개선합니다. 그러나 이러한 모델은 종종 느린 추론 속도를 보이고 비유창한 텍스트를 생성합니다. 본 논문에서는 임의 길이의 실제 텍스트 스팬을 언어 모델 생성에 통합하고 그 출처를 제공할 수 있는 새로운 반파라메트릭 언어 모델링 접근 방식인 Nearest Neighbor Speculative Decoding(NEST)를 소개합니다. NEST는 각 추론 단계에서 토큰 수준 검색을 수행하여 반파라메트릭 혼합 분포를 계산하고 코퍼스 내에서 유망한 스팬 연속을 식별합니다. 그런 다음 검색된 스팬의 접두사를 수락하거나 새로운 토큰을 생성하는 근사 스펙티브 디코딩 절차를 사용합니다. NEST는 다양한 지식 집약적 작업에서 기본 언어 모델의 생성 품질과 출처 제공률을 크게 향상시키며, 기존의 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