atlas

Research map / Large language models / Language, safety and interpretability

Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads

ICML 2024 · Large language models › Language, safety and interpretability · approach: Parallel and early-exit decoding · 13 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Medusa adds multiple lightweight decoding heads to a frozen or jointly trained LLM, verifies tree-structured candidate continuations in one step with tree attention, and uses typical acceptance to speed up decoding by about 2.2-2.8x.

Problem

Autoregressive LLM decoding is memory-bandwidth-bound and sequential, so each token requires a full forward pass; speculative decoding needs a separately trained draft model that is hard to obtain and serve.

Approach

Attach K extra single-layer decoding heads to the last hidden state to predict future tokens in parallel, build candidate continuations as a Cartesian-product tree verified with a tree attention mask in one forward pass, and accept them via a typical acceptance criterion based on the original model's entropy-scaled threshold instead of rejection sampling.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add tree attention to Medusa heads (ablation)Medusa-1 on Vicuna-7B · MT-Bench writing and roleplayspeedup: $\sim$1.5x -> $\sim$1.9xHelped
Use an optimized tree configuration (ablation)Medusa on Vicuna-7B · MT-Bench writing and roleplayspeedup: $\sim$1.9x -> $\sim$2.2xHelped
Train heads jointly with the backbone using Medusa-2 (ablation)Medusa on Vicuna-7B · MT-Bench writing and roleplayspeedup: $\sim$2.2x -> $\sim$2.8xHelped
Use two-stage Medusa-2 fine-tuning instead of direct fine-tuning (ablation)Vicuna-7B · MT-Benchquality: 5.925 -> 6.18Helped
Use two-stage Medusa-2 fine-tuning instead of Medusa-1 (ablation)Vicuna-7B · MT-Benchspeedup: 2.18 -> 2.83Helped
Increase the typical-acceptance threshold ε (ablation)Medusa-2 on Vicuna-7B · MT-Bench writing and roleplayqualityHelped
Increase the typical-acceptance threshold ε (ablation)Medusa-2 on Vicuna-7B · MT-Bench writing and roleplayspeedupHurt
Use typical acceptance rather than rejection sampling (ablation)Medusa-2 · MT-BenchspeedupHelped
Use optimized sparse tree with 64 nodes rather than dense tree with 256 nodes (ablation)Medusa-2 on Vicuna-7B · MT-Bench writing and roleplayacceleration rateHelped
Increase the number of candidate tokens in the tree (ablation)Medusa-2 on Vicuna-7B · MT-Bench writing and roleplayspeedHurt
Use self-distillation for Medusa-2 training (ablation)Vicuna-33B · MT-Benchspeedup: 2.35Mixed

Surprising findings

Limitations

Experimental setup

Datasets: ShareGPT UltraChat Alpaca-eval

Benchmarks: MT-Bench AlpacaEval

Metrics: speedup acceleration rate overhead MT-Bench quality score tokens per second

Baselines: Speculative decoding (Llama-68M, Llama-160M, TinyLlama draft models) Huggingface default decoding

Builds on: speculative decoding Blockwise parallel decoding LoRA QLoRA truncation sampling (typical decoding)

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy