Skip to content

fix(dspine): correct training objective details - #1004

Closed
A-Gentle-Cat wants to merge 3 commits into
sgl-project:codex/pr942-09-dspinefrom
A-Gentle-Cat:dspine-reference-objective
Closed

A-Gentle-Cat wants to merge 3 commits into
sgl-project:codex/pr942-09-dspinefrom
A-Gentle-Cat:dspine-reference-objective

Conversation

@A-Gentle-Cat

Copy link
Copy Markdown

Stacked on #965 (base: codex/pr942-09-dspine). @jiapingW

Modifications

I am one of the authors of DSpine. This PR fixes several details of the DSpine training objective:

  1. code loss averaged over draft layers;
  2. last-write refinement as decay-weighted means over covered and eligible rows, scaled by the number of supervised rows, per micro-batch;
  3. normalization by the number of sequences;
  4. a code-loss ramp that follows the LR warmup (alignment_warmup_steps, when set, fixes the ramp length).

The corresponding recipe change for #967 is proposed as a review suggestion there.

Validation

Open-PerfectBlend with Qwen3-8B, identical recipe and data, one run per configuration, 3,000 steps (about 0.36 epoch):

  • The training curves (loss terms, gradient norm, training acceptance length) match those of our own training runs in all 29 100-step bins.
  • Acceptance length at step 3,000 (SGLang, 7 benchmarks), without vs. with this change: 5.49 vs. 5.64 at T = 0 and 4.98 vs. 5.13 at T = 1; higher on all 7 benchmarks.
  • DSpine unit tests pass (test_dspine, test_dspine_accumulation, test_dspine_distributed, test_dspine_liger, test_dspine_optimizations, test_builtin_providers, test_ddp_accumulation).

@jiapingW jiapingW left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@jiapingW
jiapingW force-pushed the codex/pr942-09-dspine branch from b326574 to dbacebb Compare October 22, 2026 03:03
@jiapingW
jiapingW requested a review from zyksir as a code owner October 22, 2026 03:03
@jiapingW
jiapingW force-pushed the codex/pr942-09-dspine branch 5 times, most recently from addf84e to 7b5493b Compare October 22, 2026 06:52
@jiapingW

Copy link
Copy Markdown
Collaborator

Can you help to rebase your code and test it for several epochs? @A-Gentle-Cat

- Code loss: mean of the per-layer alignment losses.
- Last-write refinement: ce_weight x CE averaged over rows whose label
  lies in the candidate set, plus (1 - ce_weight) x L1 averaged over rows
  whose candidate mass exceeds candidate_mass_threshold. Both averages
  are decay-weighted, scaled by the number of supervised rows, and
  computed per micro-batch.
- Normalization: the objective is divided by the number of sequences.
- Schedule: the code-loss weight ramps up over the LR warmup;
  alignment_warmup_steps, when set, fixes the ramp length.
@A-Gentle-Cat
A-Gentle-Cat force-pushed the dspine-reference-objective branch from 1dd1b62 to f872a96 Compare October 23, 2026 06:43
@A-Gentle-Cat

Copy link
Copy Markdown
Author

Rebased and tested with a 1,000-step training run. The results are similar to the previous aligned run.

@maocheng23
maocheng23 deleted the branch sgl-project:codex/pr942-09-dspine October 27, 2026 23:06
@maocheng23 maocheng23 closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants