Có gì mới
DiffusionGemma là model open experimental 26B Mixture of Experts (active 3.8B params lúc inference), Apache 2.0 license, sinh text bằng text diffusion thay vì autoregressive token-by-token. Trên GPU dedicated, inference nhanh hơn Gemma 4 autoregressive 4x.
Build trên Gemma 4 family với head diffusion mới được tune để tối ưu speed. Tác giả nói rõ: standard Gemma 4 vẫn là choice cho production output quality cao, DiffusionGemma dành cho researcher và developer làm speed-critical interactive local workflow — in-line editing, rapid iteration, sinh non-linear text structure.
Tính năng chính
- Inference cực nhanh: bottleneck chuyển từ memory-bandwidth sang compute. 1000+ tokens/s trên một NVIDIA H100, 700+ tokens/s trên RTX 5090.
- Hardware accessible: 26B total MoE, chỉ activate 3.8B parameter khi inference. Fit trong 18GB VRAM của GPU consumer high-end khi quantize.
- Bi-directional attention: sinh 256 token song song mỗi forward pass, mỗi token attend được tất cả token khác. Lợi thế lớn cho non-linear domain — in-line editing, code infilling, amino acid sequence, mathematical graph.
- Self-correction: model iteratively refine output, đánh giá nguyên block text một lúc để fix lỗi real-time.
- Experimental status: output quality thấp hơn Gemma 4 chuẩn vì ưu tiên speed và parallel layout. Application đòi maximum quality nên deploy Gemma 4.
Cách hoạt động
Giống image diffusion bắt đầu từ noise và refine ra image rõ, text diffusion hoạt động tương tự:
- Canvas: model bắt đầu với canvas gồm placeholder token random.
- Iterative refinement: nhiều pass, lock các token đúng và dùng chúng làm context để refine phần còn lại.
- Final polish: text converge thành output chất lượng cao.
Vì model xử lý nguyên paragraph khi generate, mở ra pattern mới — đóng markdown complex hoàn hảo, sinh và render code gần real-time.
Khi nào không nên dùng
DiffusionGemma được design cho local và low-concurrency inference. Trong cloud serving high-QPS, model autoregressive saturate compute hiệu quả, parallel decoding của DiffusionGemma diminishing returns và có thể tốn cost hơn. Throughput advantage mạnh nhất ở batch size thấp-trung bình trên single accelerator.
Nếu bạn serve cho hàng ngàn user qua API, stick với Gemma 4 autoregressive.
Cách bắt đầu
- Tải weights: Apache 2.0 trên Hugging Face (
google/diffusiongemma-26B-A4B-it). - Tooling: MLX, vLLM (Red Hat integration), Hugging Face Transformers, NVIDIA NeMo, Unsloth. llama.cpp support sắp ra.
- Quantization: NVFP4 (4-bit FP) cho RTX 5090/4090 (consumer) và Hopper/Blackwell (enterprise). Tốc độ cao hơn với accuracy near-lossless.
- Fine-tuning: tutorial dùng Hackable Diffusion (JAX modular toolbox), Unsloth, NVIDIA NeMo. Ví dụ Unsloth fine-tune model giải Sudoku — task mà autoregressive struggle vì mỗi token phụ thuộc token tương lai, còn bi-directional attention của DiffusionGemma giải dễ.
- Deploy nhanh: Gemini Enterprise Agent Platform Model Garden hoặc NVIDIA NIM.
Khi nào nên thử
- Prototype real-time UI cần phản hồi dưới 100ms.
- Agent loop nhiều turn ngắn trên máy local.
- Code infilling/editing inline cần xét context hai chiều.
- Domain non-linear (math, sinh học sequence).
Không nên dùng nếu cần quality production hay serve high-QPS qua API.