DiffusionGemma

DiffusionGemma

DiffusionGemma는 Google의 uniform-state(renoise) 블록 확산 언어 모델이에요. 인코더가 인과 컨텍스트를 만들고, 디코더가 canvas_length 토큰 길이의 고정 길이 양방향 캔버스를 디노이즈해요. Gemma4Renoise 샘플러는 캔버스 위에서 max_denoising_steps 번의 역방향 단계를 실행하며, 이전 단계의 logits를 self-conditioning으로 피드백하고 처리된 logits의 greedy argmax를 출력해요.

26B-A4B 모델은 MoE(Mixture-of-Experts) 구조로 효율적인 추론을 지원하며 텍스트와 이미지 입력을 받아 텍스트를 생성해요. 이 문서는 SGLang으로 DiffusionGemma를 배포하고 호출하는 방법과 벤치마크 결과를 설명해요.

출처: 문서

본문

1. 모델 소개

DiffusionGemma는 Google의 uniform-state(renoise) 블록 확산 언어 모델이에요. 인코더가 인과 컨텍스트를 만들고, 디코더가 canvas_length 토큰 길이의 고정 길이 양방향 캔버스를 디노이즈해요. Gemma4Renoise 샘플러는 캔버스 위에서 max_denoising_steps 번의 역방향 단계를 실행하며, 이전 단계의 logits를 self-conditioning으로 피드백하고 처리된 logits의 greedy argmax를 출력해요.

주요 특징:

  • Uniform-State Renoising: 캔버스는 무작위 토큰에서 시작해 각 단계마다 신뢰도 높은 위치를 수용하고 나머지를 re-noise해 정제해요. 마스크 토큰이 없어요.
  • 인코더 / 디코더 캔버스: 인코더가 인과 컨텍스트 KV를 만들고, 디코더가 캔버스 위에서 양방향으로 어텐션해요.
  • 셀프-컨디셔닝: 각 단계가 이전 단계의 logits를 조건으로 사용해요.
  • EntropyBound 수용: 각 단계가 엔트로피 예산 내에서 가장 낮은 엔트로피의 캔버스 위치를 수용하고 나머지를 re-noise해요.
  • StableAndConfident 중단: 캔버스가 안정적이고 확신이 생기면 일찍 멈춰요.
  • MoE 구조: 26B-A4B 모델은 효율적인 추론을 위해 Mixture-of-Experts 구조를 사용해요.
  • 멀티모달 입력: 텍스트와 이미지 입력(~550M 비전 인코더 경유)을 받아 텍스트 출력을 생성해요.

제공 모델:

모델 구조 파라미터
google/diffusiongemma-26B-A4B-it MoE, uniform-state diffusion (text + image) 25.2B total / 3.8B active

구조 사양:

사양
총 파라미터 25.2B
활성 파라미터 3.8B
레이어 30
슬라이딩 윈도우 1024 토큰
컨텍스트 길이 최대 256K 토큰
캔버스 길이 256
어휘 크기 262K
전문가 8 active / 128 total + 1 shared
지원 모달리티 텍스트, 이미지
비전 인코더 ~550M 파라미터

라이선스:

라이선스 세부사항은 모델 카드를 참고하세요.

2. SGLang 설치

설치 안내는 공식 SGLang 설치 가이드를 참고하세요.

체크포인트는 자체 모델링 코드를 포함하므로 서빙 시 --trust-remote-code가 필요해요.

3. 모델 배포

3.1 기본 구성

필요한 런타임 설정은 Gemma4Renoise에 대해 자동 적용되어요(Triton 어텐션 백엔드, eager 모드, unchunked prefill — 전체 어텐션 head_dim이 512이고 캔버스가 양방향 어텐션을 사용하므로 필요), 그래서 기본 실행이 동작해요:

sglang serve \
  --model-path google/diffusiongemma-26B-A4B-it \
  --dllm-algorithm Gemma4Renoise \
  --trust-remote-code \
  --host 0.0.0.0 \
  --port 30000

3.2 구성 팁

dLLM 전용 파라미터:

파라미터 설명 권장값
--dllm-algorithm 확산 디코딩 알고리즘 Gemma4Renoise
--trust-remote-code 체크포인트의 모델링 코드를 로드하는 데 필요 항상 활성화
--dllm-algorithm-config renoise 스케줄을 오버라이드하는 선택적 YAML 체크포인트 기본값

어텐션 백엔드, eager 모드, unchunked prefill은 Gemma4Renoise에 대해 자동 선택되므로 명령줄에 전달할 필요가 없어요.

샘플링은 renoise 스케줄에 의해 결정돼요. 요청 수준의 logprobs, 페널티, logit_bias, 문법/구조화 출력(json_schema / regex / ebnf / structural_tag)은 적용되지 않으며 400으로 거부돼요. 핵심 샘플링 제어(temperature, top_k, top_p)는 수용되지만 효과가 없어요. 스트리밍은 블록 수준이에요: 청크당 완전히 디노이즈된 캔버스 하나예요.

Gemma4Renoise Config (기본값은 체크포인트의 generation_config.json을 따름):

# Number of reverse denoising steps per canvas.
max_denoising_steps: 48
# Optional. Makes the renoise sampling reproducible (also shared across TP ranks).
seed: 1234
sampler_config:
  # Entropy budget. Accept the lowest-entropy canvas positions within this bound each step (the rest are re-noised).
  entropy_bound: 0.1
# Linear temperature schedule applied over the denoising steps.
temperature_schedule:
  t_min: 0.4
  t_max: 0.8
# Stop early once the canvas is stable and confident.
stopping_config:
  confidence_threshold: 0.005
  stability_threshold: 1

4. 모델 호출

4.1 배포

섹션 3.1의 명령으로 서버를 시작하세요.

4.2 기본 사용법

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:30000/v1",
    api_key="EMPTY"
)

response = client.chat.completions.create(
    model="google/diffusiongemma-26B-A4B-it",
    messages=[
        {"role": "user", "content": "What are the key differences between TCP and UDP?"}
    ],
    max_tokens=1024
)

print(response.choices[0].message.content)

4.3 스트리밍

스트리밍은 청크당 완전히 디노이즈된 캔버스 하나를 출력해요.

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:30000/v1",
    api_key="EMPTY"
)

response = client.chat.completions.create(
    model="google/diffusiongemma-26B-A4B-it",
    messages=[
        {"role": "user", "content": "Write a Python function to compute the Fibonacci sequence."}
    ],
    max_tokens=2048,
    stream=True
)

for chunk in response:
    if chunk.choices and len(chunk.choices) > 0:
        delta = chunk.choices[0].delta
        if delta.content:
            print(delta.content, end="", flush=True)

print()

5. 벤치마크

5.1 속도 벤치마크

속도로는 벤치마크되지 않았어요.

5.2 정확도 벤치마크

전체 테스트 분할, 모든 항목 채점(실패한 요청 제외 없음). 텍스트 MCQ 벤치마크는 greedy generate-and-parse를 사용하고, MATH는 boxed-answer 추출 + sympy 동치를 사용해요. MMLU, ARC-Challenge, MATH-500은 두 번의 독립 서버 실행의 평균이에요.

벤치마크 점수
GSM8K 95.4%
ARC-Challenge 91.6%
HumanEval 92.7% pass@1
MMLU 76.2%
MMLU-Pro 73.7%
GSM-Symbolic 92.2%
MATH-500 72.1%
AIME-2026 10.0%
HMMT-Feb-2025 10.0%
GPQA-main 59.2%

멀티모달, 작업별 전체 표준 분할(MMMU / MMMU-Pro / MMStar / AI2D는 객관식, MathVista는 testmini, DocVQA는 ANLS, ChartQA는 relaxed accuracy):

멀티모달 벤치마크 점수
MMMU (val, MC) 64.9%
MMMU-Pro (standard 10-opt, MC) 57.3%
MathVista (testmini) 68.4%
DocVQA (val) 85.9%
ChartQA (test) 61.7%
AI2D (test) 78.7%
MMStar (val) 65.9%

더 알아보기 (Learn more)