cs.LGNov 24, 2026

LEGOSpec: A Composable and Efficient Framework for Speculative Draft Design and Training

Authors: Hanzhen Wang, Jiaming Xu, Guohao Dai

Organizations: Shanghai Jiao Tong University · SII · Infinigence AI

Abstract

Speculative decoding accelerates large language model (LLM) generation using a lightweight draft. Existing methods evaluate complete recipes under different training configurations, leaving component effects, interactions, and composition benefits unclear. Therefore, we present LEGOSpec, a composable framework for speculative draft design and training. LEGOSpec decomposes draft models into Context, Backbone, Proposal, and Objective components that share a unified training infrastructure. Using LEGOSpec, we systematically vary components and evaluate selected combinations under matched training conditions to isolate their effects and interactions. These experiments reveal three findings: (1) Different workloads favor different backbones, depending on context length and memory budget, with within-block dependency modeling particularly important for long contexts. (2) Proposal design must balance acceptance and latency. (3) The training objective should match token distributions locally and optimize acceptance length across the block. These findings guide workload-aware configurations and DFlux, a balanced general-purpose draft combining a convolution-equipped SWA--GQA hybrid backbone, Residual Corrector, and hierarchical supervision. Across Qwen and Gemma models, DFlux improves acceptance length over the strongest baseline by up to 13.7% on regular benchmarks and 34.7% on long-context workloads. To support efficient training, LEGOSpec integrates metadata-aware scheduling and asynchronous execution, increasing training throughput by up to 79% and accelerating offline supervision preparation by up to 3.11×3.11\times over SpecForge.

Figures & tables

Appendix figures & tables3 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. DeLS-Spec: Decoupled Long-Short Contexts for Parallel Speculative Drafting

    Jul 8, 2026Hong-Kai Zheng, Piji LiSpeculative DecodingLLM Inference Acceleration

  2. SpecForge: A Flexible and Efficient Open-Source Training Framework for Speculative Decoding

    Mar 19, 2026Shenggui Li, Chao Wang, Yikai Zhu +14Speculative DecodingLLM Inference Acceleration

  3. Acceptance-Aware Draft Model Training for Speculative Decoding

    Sep 21, 2026Tianhua Xia, Mugilan Ganesan, Yifei Feng +3Speculative DecodingLLM Inference Acceleration