ALL INTELLIGENCE
蚂蚁 inclusionAI 官方仓库T1·Open Source

inclusionAI Open-Sources UBTree Parallel Tree Drafting for Speculative Decoding

By inclusionAIOriginal title: ⭐ inclusionAI/ubtree (0 stars)
58AI Score

inclusionAI has open-sourced UBTree, which pairs a parallel unigram proposer with a learned bigram selector to build candidate token trees for speculative decoding, verified by the target model. The repo ships SpecForge training, native SGLang inference, and ready-made serving profiles for Ling-3.0-tiny, Ling-3.0-flash, and Qwen3.8-27B.

Full Report

Contents6 sections

Parallel Tree Drafting via Unigram and Bigram Models for Speculative Decoding

Website · Paper · Models · Quick start · Benchmarks · Demos · Training · Installation guide

UBTree combines a parallel unigram proposer with a learned bigram selector to build candidate token trees for speculative decoding. The target model verifies the tree and returns the accepted continuation.

This repository includes SpecForge training, native SGLang inference, and ready-made serving profiles for Ling3 Tiny, Ling3 Flash, and Qwen3.8-27B.

Models

Target modelUBTree draftServing profile
Ling-3.0-tinyHF model card & weights1 GPU · TP1 · 49 nodes
Ling-3.0-flashHF model card & weights4 GPUs · TP4 · 32 nodes
Qwen3.8-27BHF model card & weights8 GPUs · TP8 · 32 nodes

Each draft runs with its matching target. Weights are distributed separately from the code. All supplied profiles use BF16, an unquantized B16 draft, FA3, full decode CUDA Graphs, and one concurrent request. Tree node counts include the root. See checkpoints for revisions and hashes and serving profiles for the complete settings.

Quick start

Start with Ling3 Tiny on one GPU. Use Linux, Python 3.11+, and an NVIDIA GPU/CUDA toolchain supported by the bundled FA3 runtime. The native SGLang build also requires Rust/Cargo; see the installation guide for pinned dependencies and build requirements.

1. Install inference

BASH
git clone https://github.com/inclusionAI/ubtree.git
cd ubtree
python3.12 -m venv .venv-inference
source .venv-inference/bin/activate
python -m pip install --upgrade pip
python scripts/install.py inference

Training uses a separate environment. The inference installer installs the bundled SGLang source as an editable Python package.

2. Download the draft and start the server

BASH
python scripts/doctor.py ling3-tiny
python scripts/download_checkpoints.py ling3-tiny
CUDA_VISIBLE_DEVICES=0 python scripts/serve.py ling3-tiny

The launcher loads the matching target from HF if it is not already cached. The server listens on http://127.0.0.1:30000 by default.

3. Send a request

Once loading finishes, open another terminal in the project directory and activate the same environment:

BASH
source .venv-inference/bin/activate
python examples/chat.py ling3-tiny --prompt "What is 17 times 23?"

Use --target-model-path and --draft-model-path to select local model folders. For command overrides and request options, see the serving guide. The validation scope documents completed checks; fresh-environment installation and GPU generation have not been revalidated on this pinned runtime.

Run Flash or Qwen3.8

Use the same inference environment as above.

<details> <summary><strong>Ling3 Flash · 4 GPUs</strong></summary>
BASH
python scripts/doctor.py ling3-flash
python scripts/download_checkpoints.py ling3-flash
CUDA_VISIBLE_DEVICES=0,1,2,3 python scripts/serve.py ling3-flash

In another terminal, activate the environment and run:

BASH
python examples/chat.py ling3-flash --prompt "What is 17 times 23?"
</details> <details> <summary><strong>Qwen3.8-27B · 8 GPUs</strong></summary>
BASH
python scripts/doctor.py qwen38-27b
python scripts/download_checkpoints.py qwen38-27b
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python scripts/serve.py qwen38-27b

In another terminal, activate the environment and run:

BASH
python examples/chat.py qwen38-27b \
  --prompt "What is 17 times 23?" --max-new-tokens 8192

The Qwen profile enables the optimized tree-construction and GDN verification paths. See its model card for the recorded TP8 comparison with DFlash2 and its measurement conditions.

</details>

Ling3 request examples disable thinking; Qwen3.8 uses xhigh thinking. Inspect a launch command without starting a server with python scripts/serve.py qwen38-27b --dry-run.

(注:更多技术实现细节与完整 API 文档请查阅原项目 README)