Fast Best-of-N Decoding via Speculative Rejection

Hanshi Sun, Momin Haider, Ruiqi Zhang, Huitao Yang, Jiahao Qiu, Ming Yin, Mengdi Wang, Peter L. Bartlett, Andrea Zanette

arXiv:2410.20290 · 2026-07-27 공개 · arXiv · PDF

inference-time llm-alignment best-of-n reward-model llm-deployment speculative-rejection decoding-strategy alignment-method

Abstract

The safe and effective deployment of Large Language Models (LLMs) involves a critical step called alignment, which ensures that the model's responses are in accordance with human preferences. Prevalent alignment techniques, such as DPO, PPO and their variants, align LLMs by changing the pre-trained model weights during a phase called post-training. While predominant, these post-training methods add substantial complexity before LLMs can be deployed. Inference-time alignment methods avoid the complex post-training step and instead bias the generation towards responses that are aligned with human preferences. The best-known inference-time alignment method, called Best-of-N, is as effective as the state-of-the-art post-training procedures. Unfortunately, Best-of-N requires vastly more resources at inference time than standard decoding strategies, which makes it computationally not viable. In this work, we introduce Speculative Rejection, a computationally-viable inference-time alignment algorithm. It generates high-scoring responses according to a given reward model, like Best-of-N does, while being between 16 to 32 times more computationally efficient.

한국어 요약

한 줄 요약

Speculative Rejection은 Best-of-N 대비 16~32배 효율적인 추론 시 정렬 알고리즘으로, 높은 품질 응답을 유지하면서 GPU 사용량을 대폭 줄인다.

핵심 기여도

핵심 아이디어

Best-of-N은 N개의 응답을 생성한 후 보상 모델을 사용해 최고 품질 응답을 선택하는 방식으로, 정렬 효과는 우수하지만 N이 커질수록 계산 비용이 급증한다. 이에 반해, Speculative Rejection은 응답 생성 중간에 보상 점수가 낮은 후보를 조기에 제거함으로써 GPU 메모리 소모를 줄이고 효율성을 높인다.

핵심 통찰은 "부분 응답의 보상 점수와 최종 응답의 점수는 긍정적으로 상관관계가 있다"는 것이다. 이는 생성 중간에 낮은 점수를 받는 응답은 최종적으로도 높은 점수를 받을 가능성이 낮다는 의미로, 이를 기반으로 생성 중단 결정을 내리는 알고리즘이 가능하다는 점이다.

기술적 접근법

주요 결과

의의 및 한계

Speculative Rejection은 추론 시 정렬 알고리즘의 효율성을 획기적으로 개선하여, 대규모 응답 생성이 필요한 상황에서 GPU 자원을 대폭 절감할 수 있다. 이는 특히, 정렬 알고리즘을 복잡한 post-training 없이 단순한 decoding 전략으로 구현할 수 있다는 점에서 학술적·실용적 의의가 있다.

그러나, 이 알고리즘은 보상 모델의 평가 결과에 크게 의존하며, 보상 모델의 정확도가 낮아지면 성능이 저하될 수 있다. 또한, 생성 중간의 보상 점수와 최종 점수 간의 상관관계가 모든 데이터셋에서 동일하게 유지되지 않을 가능성도 있다.

실용적 활용

Speculative Rejection은 대규모 언어 모델의 추론 시 정렬을 요구하는 산업 현장 (예: 챗봇, 고객 지원 시스템)에서 GPU 자원을 절감하면서도 높은 품질의 응답을 제공할 수 있다. 또한, 생성 모델의 확률 최대화나 다른 목적 최적화에도 적용 가능하다.