Skip to content

Parallel decoding skill covering draft models, Medusa heads, and Jacobi-based lookahead for faster LLM inference.

CCM score
55 of 100
skills.sh installs
1.1K
GitHub stars
14.9K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers three speculative approaches: draft-model decoding, Medusa multiple prediction heads, and Lookahead Decoding with Jacobi iteration
  • Includes quick-start code for transformers assisted generation, Medusa's medusa_generate, and a LookaheadDecoding class with window and n-gram parameters
  • Explains tree-based attention and the draft-then-verify acceptance loop, which keeps outputs equivalent to the target model
  • Designed for latency-sensitive serving and deployments with limited compute, where a claimed 1.5-3.6× speedup is the goal

Install

$ npx -y skills add orchestra-research/ai-research-skills --skill speculative-decoding -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Speculative Decoding: Accelerating LLM Inference

When to Use This Skill

Use Speculative Decoding when you need to:

  • Speed up inference by 1.5-3.6× without quality loss
  • Reduce latency for real-time applications (chatbots, code generation)
  • Optimize throughput for high-volume serving
  • Deploy efficiently on limited hardware
  • Generate faster without changing model architecture

Key Techniques: Draft model speculative decoding, Medusa (multiple heads), Lookahead Decoding (Jacobi iteration)

Papers: Medusa (arXiv 2401.10774), Lookahead Decoding (ICML 2024), Speculative Decoding Survey (ACL 2024)

Installation

# Standard speculative decoding (transformers)
pip install transformers accelerate

# Medusa (multiple decoding heads)
git clone https://github.com/FasterDecoding/Medusa
cd Medusa
pip install -e .

# Lookahead Decoding
git clone https://github.com/hao-ai-lab/LookaheadDecoding
cd LookaheadDecoding
pip install -e .

# Optional: vLLM with speculative decoding
pip install vllm

Quick Start

Basic Speculative Decoding (Draft Model)

from transformers import AutoModelForCausalLM, AutoTokenizer

Details

Repository
github.com/orchestra-research/ai-research-skills
Categories
AI Agents & LLM Apps, Research & Academic
First seen
Jun 3, 2026

Questions

What does the speculative-decoding skill do?

The speculative-decoding skill teaches an agent to speed up LLM inference by 1.5-3.6× without quality loss, using a small draft model, Medusa multiple decoding heads, or lookahead decoding. It covers tree-based attention, Jacobi iteration, parallel token generation and production deployment strategies.

Who should use the speculative-decoding skill?

The speculative-decoding skill suits developers who need lower latency for real-time applications such as chatbots or code generation, or who must serve models on limited compute. It also helps teams that want faster throughput for high-volume serving without changing the model architecture.

How do I install the speculative-decoding skill?

Run npx -y skills add orchestra-research/ai-research-skills --skill speculative-decoding -y inside a project to install the speculative-decoding skill. Once installed, the agent can apply draft model, Medusa and lookahead decoding techniques to inference code.

What does the speculative-decoding skill need to run?

The speculative-decoding skill depends on the transformers and torch packages, and its examples load Llama-2 and Vicuna models. Medusa and lookahead decoding need their own repositories installed with pip install -e, and vLLM is optional.

More from orchestra-research/ai-research-skills

All 92

Similar to Speculative Decoding

More AI Agents & LLM Apps