lightseekorg/kimi-k3-dspark

Model

2

stars

4

commits

4

linked in READMEs

Aug 21, 2026

updated

dspark
k3_dspark
kimi-k3
safetensors
speculative-decoding
text-generation
tokenspeed
torchspec
Browse cluster: Speculative Decoding for LLM Inference

README

Kimi-K3 DSpark

Kimi-K3 DSpark is a speculative draft model for accelerating Kimi-K3. It was trained with TorchSpec, using online target-model inference and FSDP draft-model training. The architecture follows DSpark: Confidence-Scheduled Speculative Decoding with Semi-Autoregressive Generation.

The draft uses a five-layer MLA backbone, five target hidden-state taps, a low-rank Markov head, and a confidence head. It proposes up to seven draft tokens per speculative decoding step.

Training recipe

The training recipe was adapted from deepseek-ai/DeepSpec for online Kimi-K3 target inference and distributed TorchSpec training.

Due to limited compute resources, we trained on only approximately 150K selected and regenerated samples. We selected the prompts from lightseekorg/kimi-mtp-dataset and regenerated the responses with Kimi-K3. Regeneration is important for speculative decoding because the draft must learn the token-level distribution of the exact target model it accelerates.

The regenerated mix covers general instruction following, reasoning, coding and software engineering, tool use, Chinese, and multilingual prompts. Training used the Kimi-K3 renderer with assistant-only loss on sequences up to 32K tokens.

SettingValue
Training epochs5
Optimizer steps6,891
Global batch size128
Maximum sequence length32,768
Learning rate5e-5, cosine schedule
Warmup4%
Loss objectiveDecayed DSpark loss, gamma=4.0
Token loss weightsCross-entropy=0.1, L1=0.9
Confidence-head loss weight1.0
Draft layers5
Target hidden-state layers7, 31, 47, 63, 87
Speculative tokens7

Compute cost

The end-to-end online training run used 40 NVIDIA GB200 GPUs: 8 GPUs for FSDP training and 32 GPUs for online Kimi-K3 inference, equivalent to approximately 1,104 GB200 GPU-hours.

Performance

The primary metric is acc_len, defined as 1 + accepted_draft_tokens / draft_steps. Higher is better. Evaluation used num_speculative_tokens=7 and Kimi-K3 thinking mode.

BenchmarkSamplesGreedy draft, t=0Probabilistic draft, t=1.0, top_p=0.95
GSM8K1,3195.4645.290
HumanEval1644.9544.555
SPEED-Bench coding804.2994.024
SPEED-Bench RAG803.5333.475
SPEED-Bench multilingual803.4523.503
MATH-5005003.2543.201
SPEED-Bench QA803.1133.017
MT-Bench803.0472.864
SPEED-Bench writing802.7222.589
AIME 2026302.5722.352

Requests were sent through /v1/chat/completions with:

{
  "thinking": true,
  "thinking_effort": "max"
}

Launch with TokenSpeed

This checkpoint uses native DSpark support in TokenSpeed. The auxiliary AttnRes stream must be enabled for this training contract.

export TOKENSPEED_DFLASH_AUX_STREAM=attn_res

tokenspeed serve moonshotai/Kimi-K3 \
  --served-model-name moonshotai/Kimi-K3 \
  --tensor-parallel-size 16 \
  --distributed-executor-backend ray \
  --trust-remote-code \
  --max-model-len 131072 \
  --gpu-memory-utilization 0.92 \
  --speculative-config '{"method":"dspark","model":"lightseekorg/kimi-k3-dspark","num_speculative_tokens":7,"attention_backend":"FLASHINFER_MLA","draft_sample_method":"greedy","rejection_sample_method":"block"}' \
  --host 0.0.0.0 \
  --port 8000

Use "draft_sample_method":"greedy" for temperature-zero workloads. For sampled generation, launch a separate endpoint with "draft_sample_method":"probabilistic". The draft sampling method is a server-level setting.

Important serving notes

  1. The collected target hidden states must be captured after the attention residual (attn_res) has been applied and before the following pre-normalization. Set TOKENSPEED_DFLASH_AUX_STREAM=attn_res; using another residual stream changes the draft model's input distribution.
  2. This checkpoint's config declares fc_norm. Each collected hidden-state tap must pass through its corresponding fc_norm before the five taps are concatenated and passed to the linear context projection. Skipping this step is incompatible with the training contract.

TokenSpeed support for both requirements is implemented in lightseekorg/tokenspeed#1016.

Citation

@misc{cheng2026dspark,
  title={DSpark: Confidence-Scheduled Speculative Decoding with Semi-Autoregressive Generation},
  author={Xin Cheng and others},
  year={2026},
  eprint={2607.05147},
  archivePrefix={arXiv},
  primaryClass={cs.AI},
  url={https://arxiv.org/abs/2607.05147}
}

@misc{torchspec2026,
  title={TorchSpec: An Online Speculative Decoding Training Framework},
  url={https://github.com/torchspec-project/TorchSpec},
  year={2026}
}

Contributors

lightseek

2 commits

LI
lightseekorg

1 commits

ybybybw

1 commits

lightseekorg/kimi-k3-dspark

Model

2

stars

4

commits

4

linked in READMEs

Aug 21, 2026

updated

dspark
k3_dspark
kimi-k3
safetensors
speculative-decoding
text-generation
tokenspeed
torchspec
Browse cluster: Speculative Decoding for LLM Inference

README

Kimi-K3 DSpark

Kimi-K3 DSpark is a speculative draft model for accelerating Kimi-K3. It was trained with TorchSpec, using online target-model inference and FSDP draft-model training. The architecture follows DSpark: Confidence-Scheduled Speculative Decoding with Semi-Autoregressive Generation.

The draft uses a five-layer MLA backbone, five target hidden-state taps, a low-rank Markov head, and a confidence head. It proposes up to seven draft tokens per speculative decoding step.

Training recipe

The training recipe was adapted from deepseek-ai/DeepSpec for online Kimi-K3 target inference and distributed TorchSpec training.

Due to limited compute resources, we trained on only approximately 150K selected and regenerated samples. We selected the prompts from lightseekorg/kimi-mtp-dataset and regenerated the responses with Kimi-K3. Regeneration is important for speculative decoding because the draft must learn the token-level distribution of the exact target model it accelerates.

The regenerated mix covers general instruction following, reasoning, coding and software engineering, tool use, Chinese, and multilingual prompts. Training used the Kimi-K3 renderer with assistant-only loss on sequences up to 32K tokens.

SettingValue
Training epochs5
Optimizer steps6,891
Global batch size128
Maximum sequence length32,768
Learning rate5e-5, cosine schedule
Warmup4%
Loss objectiveDecayed DSpark loss, gamma=4.0
Token loss weightsCross-entropy=0.1, L1=0.9
Confidence-head loss weight1.0
Draft layers5
Target hidden-state layers7, 31, 47, 63, 87
Speculative tokens7

Compute cost

The end-to-end online training run used 40 NVIDIA GB200 GPUs: 8 GPUs for FSDP training and 32 GPUs for online Kimi-K3 inference, equivalent to approximately 1,104 GB200 GPU-hours.

Performance

The primary metric is acc_len, defined as 1 + accepted_draft_tokens / draft_steps. Higher is better. Evaluation used num_speculative_tokens=7 and Kimi-K3 thinking mode.

BenchmarkSamplesGreedy draft, t=0Probabilistic draft, t=1.0, top_p=0.95
GSM8K1,3195.4645.290
HumanEval1644.9544.555
SPEED-Bench coding804.2994.024
SPEED-Bench RAG803.5333.475
SPEED-Bench multilingual803.4523.503
MATH-5005003.2543.201
SPEED-Bench QA803.1133.017
MT-Bench803.0472.864
SPEED-Bench writing802.7222.589
AIME 2026302.5722.352

Requests were sent through /v1/chat/completions with:

{
  "thinking": true,
  "thinking_effort": "max"
}

Launch with TokenSpeed

This checkpoint uses native DSpark support in TokenSpeed. The auxiliary AttnRes stream must be enabled for this training contract.

export TOKENSPEED_DFLASH_AUX_STREAM=attn_res

tokenspeed serve moonshotai/Kimi-K3 \
  --served-model-name moonshotai/Kimi-K3 \
  --tensor-parallel-size 16 \
  --distributed-executor-backend ray \
  --trust-remote-code \
  --max-model-len 131072 \
  --gpu-memory-utilization 0.92 \
  --speculative-config '{"method":"dspark","model":"lightseekorg/kimi-k3-dspark","num_speculative_tokens":7,"attention_backend":"FLASHINFER_MLA","draft_sample_method":"greedy","rejection_sample_method":"block"}' \
  --host 0.0.0.0 \
  --port 8000

Use "draft_sample_method":"greedy" for temperature-zero workloads. For sampled generation, launch a separate endpoint with "draft_sample_method":"probabilistic". The draft sampling method is a server-level setting.

Important serving notes

  1. The collected target hidden states must be captured after the attention residual (attn_res) has been applied and before the following pre-normalization. Set TOKENSPEED_DFLASH_AUX_STREAM=attn_res; using another residual stream changes the draft model's input distribution.
  2. This checkpoint's config declares fc_norm. Each collected hidden-state tap must pass through its corresponding fc_norm before the five taps are concatenated and passed to the linear context projection. Skipping this step is incompatible with the training contract.

TokenSpeed support for both requirements is implemented in lightseekorg/tokenspeed#1016.

Citation

@misc{cheng2026dspark,
  title={DSpark: Confidence-Scheduled Speculative Decoding with Semi-Autoregressive Generation},
  author={Xin Cheng and others},
  year={2026},
  eprint={2607.05147},
  archivePrefix={arXiv},
  primaryClass={cs.AI},
  url={https://arxiv.org/abs/2607.05147}
}

@misc{torchspec2026,
  title={TorchSpec: An Online Speculative Decoding Training Framework},
  url={https://github.com/torchspec-project/TorchSpec},
  year={2026}
}

Contributors

lightseek

2 commits

LI
lightseekorg

1 commits

ybybybw

1 commits