ggml-org/llama.cpp 저장소에 PR #27694가 병합되면서, 모델 기반 드래프트(draft-simple, MTP)에서 확률적 샘플링과 거부 샘플링(rejection sampling)을 도입했다. 기존에는 드래프트 모델이 그리디하게 상위 1개 토큰만 제안하고, 타깃 모델이 정확히 일치할 때만 수락하는 방식이라 온도가 올라갈수록 수락률이 급격히 떨어졌다. 이번 변경으로 드래프트는 확률적으로 토큰을 뽑고(q(x)), 타깃은 min(1, p(x)/q(x)) 확률로 수락해 출력 분포를 그대로 보존하면서 수락 길이를 늘린다. PR 작성자(praneshgo)에 따르면 "Argmax-and-match accepts a draft token only when the target's top pick happens to equal the draft's, while min(1, p/q) accepts it with probability p/q, so more tokens survive per verification step and the target runs fewer forward passes."라고 설명한다.
새 플래그 --spec-draft-sampling이 추가돼 드래프트 샘플링 방식을 greedy(기본값) 또는 probabilistic으로 선택할 수 있다. 이는 vLLM의 draft_sample_method와 같은 규칙을 따른다. PR 작성자는 "This matches vLLM's convention, where draft_sample_method takes the same two values and also defaults to greedy."라고 밝혔다. 거부 샘플링 단계는 현재 호스트(CPU)에서 수행되며, GPU 백엔드 샘플링(-bs 플래그)과는 독립적으로 동작한다. 작성자는 "With -bs on, I see the same accepted length and 1-2% change in throughput, which is consistent with what is observed on the master branch with -bs enabled."라고 테스트 결과를 전했다.
벤치마크는 RTX 5090과 DGX Spark 두 플랫폼에서 8개 모델 구성, 온도 0.0~1.0(11단계), 프롬프트 12개(각 256 토큰), --spec-draft-n-max 3 조건으로 수행됐다. 온도 0.0에서는 양쪽 모두 동일한 토큰을 내므로 수락 길이 변화는 +0.00%로 기준선이 된다. 주요 결과는 다음과 같다.
RTX 5090에서 Llama-3.1-8B + 3B-Q8_0(draft-simple) 조합은 온도 0.1~1.0 평균 수락 길이 +8.07%, 처리량 +8.60%를 기록했다. 온도 0.5~1.0 구간 평균은 수락 길이 +12.47%, 처리량 +12.95%로 더 컸다. 같은 모델의 Q4_K_M 양자화에서는 0.1~1.0 평균 +7.87%/+8.02%, IQ2_XS에서는 +5.38%/+5.55%로 나타났다. MTP 모드인 Qwen3.5-4B는 0.1~1.0 평균 +3.81%/+3.57%, Qwen3.5-9B는 +6.46%/+5.64%, Ornith-1.5-9B는 +4.01%/+3.07%였다. 더 큰 모델인 Qwen3.6-27B, Qwen3.6-35B-A3B도 각각 +4.79%/+4.11%, +4.37%/+4.20% 개선을 보였다.
DGX Spark에서는 Llama-3.1-8B + 3B-Q8_0(draft-simple)이 0.1~1.0 평균 +6.64%/+6.50%, Q4_K_M은 +8.38%/+8.74%, IQ2_XS는 +5.35%/+5.52%였다. MTP 쪽에서는 Qwen3.5-4B +5.72%/+6.25%, Qwen3.5-9B +7.78%/+7.24%, Ornith-1.5-9B +4.24%/+3.75%, Qwen3.6-27B +2.71%/+2.83%, Qwen3.6-35B-A3B +4.28%/+2.87%로 나타났다. 전체적으로 온도가 높을수록, 그리고 프로즈(generation of prose) 작업에서 이득이 뚜렷했다.
PR 작성자는 Eagle3는 아직 평가되지 않았고, DFlash는 구조적 차이 때문에 이 변경으로 이득이 없거나 실험적으로 확인되지 않았다고 밝혔다. "DFlash reads every position of its block out of a single forward pass with no re-decode between them, so the positions are predicted jointly rather than conditioned on one another. Substituting a sampled token at one position leaves the rest of the block continuing from a token that was never drafted."라는 설명이다. 또 GPU 백엔드에서 거부 샘플링을 구현하면 추가 성능 향상이 있을 수 있으나, 별도 PR로 분리해 검토하겠다고 덧붙였다.
이 변경은 2026년 10월 2일 병합됐으며, r/LocalLLaMA 커뮤니티에서 /u/Dreeew84가 "Reminder: try probabilistic MTP if you missed it. Decode +14% on prose"라는 제목으로 공유했다. 원문 게시물은 "Optimal draft-n-max / draft-p-min seem to be in line with greedy sampling. Main gain seems to be on prose generation. Tests above ran with thinking off, ngram-mod off."라고 부연했다. 실제 처리량 향상은 하드웨어, 백엔드 샘플링 설정, 모델 조합에 따라 달라질 수 있다.

출처: r/LocalLLaMA
댓글
댓글 쓰기