Upload folder using huggingface_hub
Browse filesFiles changed (6)
- .gitattributes+1
- LICENSEAdded+21
- README.md+181-1
- assets/ubtree_pipeline.pngAdded
- config.jsonAdded+98
- model.safetensorsAdded+3
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textassets/ubtree_pipeline.png filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021MIT License
Copyright (c) 2026 The DeepSpec Authors
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.123---license: apache-2.0---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183---library_name: sglangpipeline_tag: text-generationlicense: mitbase_model:- Qwen/Qwen3.8-27Btags:- speculative-decoding- tree-speculative-decoding- ubtree- dflash- sglang- qwen3.8- arxiv:2609.39972language:- zh- en---# Qwen3.8-27B-UBTree-B16[Website](https://www.inclusion-ai.org/ubtree) · [Paper](https://www.inclusion-ai.org/ubtree/UBTree.pdf) · [Code](https://github.com/inclusionAI/ubtree) · [Target model](https://huggingface.co/Qwen/Qwen3.8-27B)**Qwen3.8-27B-UBTree-B16** accelerates [Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B)with a five-layer parallel draft network and a trainable bigram selector.The draft produces candidate tokens, the selector connects them into a tree,and Qwen3.8-27B checks the proposed continuations.Load this checkpoint together with its target model, which supplies thetokenizer, token embeddings, and language-model head. The draft alone doesnot provide a text-generation service. This model card covers text inference.## How UBTree works*UBTree pipeline*UBTree uses unigram predictions to propose tokens and bigram scores to choosebranches:1. Predict candidates for several future positions in one parallel draft pass.2. Estimate how well neighbouring candidates fit together with the selector.3. Assemble a candidate tree up to the requested node budget.4. Run target verification and append the accepted tokens to the output.The draft backbone starts from DFlash training, then learns jointly with theselector. Method details and tree-native supervision are described in the[paper](https://arxiv.org/abs/2609.39972).## Model specifications| Item | Value ||---|---|| Target model | [Qwen/Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B) || Draft architecture | `Qwen3UBTreeModel` || Draft backbone | 5 full-attention Transformer layers || Parameters stored in this checkpoint | 1,841,887,774 (1.842B) || Weight dtype | BF16 || Hidden size | 5,120 || Attention heads / KV heads | 24 / 4 || Target auxiliary feature layers (zero-based) | 5, 19, 33, 47, 61 || Draft block size | 16, including the anchor || Candidate top-k | 64 per draft position || Default verification tree budget | 64 non-root nodes + 1 anchor || Serving tree budget below | 32 nodes, including the anchor || Training | DFlash warm start, followed by joint backbone and selector training |The distributed weights are the **raw step 12,314** checkpoint. Its parametercount excludes the embeddings and output head loaded from the target.**B16** specifies the draft block size; the serving tree budget is configuredseparately. The serving profile overrides the checkpoint's 65-node defaultwith a 32-node tree.## Serving with SGLangInstall the inference component from the [UBTree project](https://github.com/inclusionAI/ubtree)in a dedicated environment:```bashgit clone https://github.com/inclusionAI/ubtree.gitcd ubtreepython3.12 -m venv .venv-inferencesource .venv-inference/bin/activatepython -m pip install --upgrade pippython scripts/install.py inference```Use the bundled SGLang source, pinned to commit`329c30b65946a51c46c60bb197419cbf3c44ecf6` of[`xiaoqiu/ubtree_qwen38_recent`](https://github.com/AsaHIXx/sglang/tree/xiaoqiu/ubtree_qwen38_recent).The [installation guide](https://github.com/inclusionAI/ubtree/blob/main/docs/installation.md)lists CUDA, build-tool, and dependency requirements.Point the launcher at your downloaded target and draft folders:```bashCUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \python scripts/serve.py qwen38-27b \--target-model-path /path/to/Qwen3.8-27B \--draft-model-path /path/to/Qwen3.8-27B-UBTree-B16-release```This profile uses **TP8, concurrency 1, B16, and 32 verification nodes**, withBF16 weights, FP32 SSM states, FA3, full decode CUDA Graphs, and a 16K context.It enables the optimized UBTree tree-construction and GDN verification paths.The server listens on `http://127.0.0.1:30000` by default.From another terminal in the same environment, send an xhigh-thinking request:```bashpython examples/chat.py qwen38-27b \--target-model-path /path/to/Qwen3.8-27B \--prompt "What is 17 times 23?" --max-new-tokens 8192```The model folder also includes `serve.sh` for direct launch after installingthe same inference source. Run `sha256sum -c SHA256SUMS` in that folder tocheck the release files.## Benchmark resultsThe comparison below uses **TP8 on 8 × NVIDIA L20X (SM90)**, concurrency 1,BF16 weights, FP32 SSM states, FA3, full decode CUDA Graphs, greedy decoding,and **xhigh thinking**. UBTree uses **B16 / 32 nodes**; DFlash2 uses**B8 / 8 nodes**. Both methods share the runtime, dependency environment, andinput prompts.Across the six datasets, UBTree's TPS ratio over DFlash2 has a**geometric mean of 1.277× (+27.7%)**.Each cell shows **acceptance length / TPS (tok/s)**.| Dataset | UBTree | DFlash2 ||---|---:|---:|| GSM8K | **7.562 / 890.98** | 4.994 / 677.64 || MATH-500 | **7.133 / 926.78** | 4.599 / 676.14 || AIME 2025 | **6.230 / 830.40** | 4.318 / 650.52 || HumanEval | **6.666 / 882.16** | 4.580 / 683.21 || MBPP | **6.175 / 804.58** | 4.760 / 695.92 || LiveCodeBench | **5.523 / 736.15** | 3.866 / 582.52 || **Avg. (6 datasets)** | **6.548 / 845.18** | 4.520 / 660.99 |TPS is returned output tokens divided by client HTTP wall time, coveringprefill, thinking, and answer generation. Acceptance length is averaged overdecoding rounds and includes the root/bonus token. The Avg. row is thearithmetic mean of the six reported per-dataset values. The headline TPSratio is the geometric mean of the six ratios, with each dataset weightedequally.Each method completed one measured pass: **670 requests** across six datasets.Warmup covered 312 input lengths and the first prompt of each dataset; thoserequests are excluded from the measurements. Generation uses natural EOSwith an 8,192-token cap, which some requests reached.These are end-to-end measurements of the two draft configurations, includingtheir different generation trajectories. Accuracy was not evaluated in thisrun, and the table does not establish strict token agreement with AR.The recorded runtime commit is `389ee80ca4`; these results were not remeasuredon the packaged runtime above. See [benchmark_results_tp8.json](benchmark_results_tp8.json)for the protocol, reported values, and truncation counts.## CitationIf UBTree supports your research, please cite:```bibtex@article{liang2026ubtree,title = {UBTree: Parallel Tree Drafting via Unigram and Bigram Models for Speculative Decoding},author = {Liang, Chumeng and Wang, Linxuan and Peng, Xinyu and Liu, Huabin and Chen, Yuxin and Liu, Ge and Lin, Guang and Song, Qifan and Li, Jianguo},journal = {arXiv preprint arXiv:2609.39972},year = {2026},url = {https://arxiv.org/abs/2609.39972}}```## LicenseThe draft weights use the **MIT License** in `LICENSE`. The target is distributedseparately under **Apache 2.0**; a copy is retained in`licenses/Qwen3.8-27B-APACHE-2.0.txt`.The diagram reproduces [Liang et al., Figure 2](https://arxiv.org/html/2609.39972v1#S2.F2)under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798{ "architectures": [ "Qwen3UBTreeModel" ], "attention_bias": false, "attention_dropout": 0.0, "block_size": 16, "bos_token_id": 248044, "dflash_config": { "block_size": 16, "contract": "flashflow_anchor_inclusive_v1", "mask_token_id": 248319, "num_target_layers": 64, "target_layer_ids": [ 5, 19, 33, 47, 61 ] }, "dflash_contract": "flashflow_anchor_inclusive_v1", "dtype": "bfloat16", "enable_confidence_head": false, "eos_token_id": 248044, "head_dim": 256, "hidden_act": "silu", "hidden_size": 5120, "initializer_range": 0.02, "intermediate_size": 17408, "layer_types": [ "full_attention", "full_attention", "full_attention", "full_attention", "full_attention" ], "markov_rank": 0, "mask_token_id": 248319, "max_position_embeddings": 262144, "max_window_layers": 28, "model_type": "qwen3", "num_anchors": 512, "num_attention_heads": 24, "num_hidden_layers": 5, "num_key_value_heads": 4, "num_target_layers": 64, "pad_token_id": null, "partial_rotary_factor": 1.0, "rms_norm_eps": 1e-06, "rope_parameters": { "partial_rotary_factor": 1.0, "rope_theta": 10000000, "rope_type": "default" }, "rope_theta": 10000000.0, "self_conditioning": false, "sliding_window": null, "target_layer_ids": [ 5, 19, 33, 47, 61 ], "tie_word_embeddings": false, "transformers_version": "5.12.1", "ubtree_config": { "adds_unary_logits": true, "architecture": "cp", "candidate_k": 64, "candidate_source": "frozen_dflash_unary_topk_ids_only", "depth_condition_count": 15, "depth_conditioning": "unary_correction_two_scale", "depth_scale_parameterization": "exp_log_scale", "factorizer_hidden_width": 512, "hidden_projection_depth_count": 15, "hidden_projection_type": "shared", "inference_hidden_projection": "materialized_per_depth_affine", "kl_temperature": 1.0, "objective": "kl", "rank": 256, "target_embedding_dim": 5120, "token_factorizer": "target_embedding_mlp", "train_backbone": true, "trained": true, "training_mode": "joint_backbone_selector", "tree_budget": 64, "tree_builder": "pruned", "tree_depth_bonus": 0.0, "tree_supertree_width": 12, "type": "residual_bigram", "version": 1 }, "use_cache": true, "use_sliding_window": false, "vocab_size": 248320}123version https://git-lfs.github.com/spec/v1oid sha256:e99c84ca72249032ab608029cecb3b1b5366a9566a522453cf058cbf84fb6d3dsize 3683782908.gitattributes+1
LICENSEAdded+21
README.md+181-1
assets/ubtree_pipeline.pngAdded

Large File Pointer Details
- SHA256: 3233e0c7a3d9be0edf8e93a303f662a97d0b5f6eb92fa4fe3857eca11a4225e7
- Pointer size: 131 Bytes
- Size of remote file: 231 kB
config.jsonAdded+98
model.safetensorsAdded+3