Skip to main content
QUICK REVIEW

[논문 리뷰] Accelerating LLM Inference with Staged Speculative Decoding

Benjamin Spector, Chris Ré|arXiv (Cornell University)|2023. 08. 08.
Topic ModelingComputer Science인용 수 9
한 줄 요약

이 논문은 트리 구조의 추측 배치와 2단계 초안 모델을 결합한 계단식 추측 디코딩(staged speculative decoding)을 도입하여 소형 배치의 디바이스 상 LLM 추론을 가속하면서 출력 품질을 유지합니다. GPT-2-L에서 최대 3.16배의 속도향상을 달성합니다.

ABSTRACT

Recent advances with large language models (LLM) illustrate their diverse capabilities. We propose a novel algorithm, staged speculative decoding, to accelerate LLM inference in small-batch, on-device scenarios. We address the low arithmetic intensity of small-batch inference by improving upon previous work in speculative decoding. First, we restructure the speculative batch as a tree, which reduces generation costs and increases the expected tokens per batch. Second, we add a second stage of speculative decoding. Taken together, we reduce single-batch decoding latency by 3.16x with a 762M parameter GPT-2-L model while perfectly preserving output quality.

연구 동기 및 목표

  • 디바이스에서의 소형 배치 LLM 추론의 저산술 집약도 문제를 해결한다.
  • 모델 분포의 충실성을 희생하지 않으면서 처리량을 증가시키기 위해 추측 디코딩을 확장한다.
  • 지연 민감성과 프라이버시 보장을 요하는 응용 분야에서 실용적인 디바이스 상 LLM 성능을 향상시킨다.

제안 방법

  • 추측 배치를 트리로 재구성하여 배치당 기대 토큰 수를 늘리고 병렬성을 가능하게 한다.
  • 디코딩 가속을 위해 draft 2 모델을 추가하여 추측의 두 번째 단계를 도입한다.
  • 트리 구조의 배치를 사용하여 오라클, 드래프트, 드래프트-2 모델 간에 샘플링 및 디코딩을 수행하여 잎 수를 최대화하고 KV 캐시를 재사용한다.
Figure 1: A roofline plot for single-query GPT-2-L inference on an RTX 4090. At small batch sizes, inference is completely memory bandwidth bound. Thus this plot shows that the only way to significantly increase performance is to increase the arithmetic intensity of inference.
Figure 1: A roofline plot for single-query GPT-2-L inference on an RTX 4090. At small batch sizes, inference is completely memory bandwidth bound. Thus this plot shows that the only way to significantly increase performance is to increase the arithmetic intensity of inference.

실험 결과

연구 질문

  • RQ1트리 구조의 추측 배치가 소형 배치 LLM 추론에서 배치당 토큰 수를 증가시키고 대역폭을 줄일 수 있는가?
  • RQ2두 번째 단계의 드래프트 모델을 추가하면 출력 분포를 바꾸지 않고 디코딩 속도를 더 높일 수 있는가?
  • RQ3기준 및 표준 추측 디코딩과 비교했을 때, staged speculative decoding의 관찰된 속도향상과 대역폭 감소는 무엇인가?

주요 결과

  • 계단식 추측 디코딩은 GPT-2-L(762M)에서 RTX-4090을 대상으로 결정론적 디코딩에 대해 기준 단일 배치 추론 대비 평균 3.16배의 속도향상을 달성한다.
  • 계단식 추측 디코딩은 메모리 대역폭을 기본값 및 표준 추측 디코딩 대비 감소시킨다(결정론적: 0.23x vs 1.00 baseline; Baseline 대비 0.31x vs 0.23x staged; Topk: 0.35x staged 대 0.48x speculative).
  • 상위-k 샘플링(k=50, T=1)에서 계단식 추측은 기준 대비 평균 1.98배, 표준 추측 디코딩 대비 1.36배의 속도향상을 제공한다.
  • 이 방식은 난이도가 다양한 HumanEval 프롬프트에서 처리량 향상을 보여주며, 이점이 콘텐츠 엔트로피에 따라 달라짐을 강조한다.
Figure 2: Relative performance distribution over different problems in the HumanEval dataset. (A) shows greedy decoding, whereas (B) shows Topk decoding. Problem indices are sorted by staged speculative performance for clarity.
Figure 2: Relative performance distribution over different problems in the HumanEval dataset. (A) shows greedy decoding, whereas (B) shows Topk decoding. Problem indices are sorted by staged speculative performance for clarity.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.