Skip to content

feat(dspark): add sampling-aware L1 loss - #10

Merged
Longxmas merged 1 commit into
inclusionAI:mainfrom
Longxmas:loss-sampling
Nov 11, 2026
Merged

Longxmas merged 1 commit into
inclusionAI:mainfrom
Longxmas:loss-sampling

Conversation

@Longxmas

@Longxmas Longxmas commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

DSpark currently computes L1 distillation using raw softmax distributions. This PR adds optional sampling transforms so the loss can reflect the target and draft sampling policies intended for inference.

  • Add independent temperature, top_p, and top_k settings through training.dspark_l1_target_* and training.dspark_l1_draft_*, separate from decode.*.
  • Apply temperature scaling and joint top-k/top-p filtering to the L1 distributions. Confidence targets and acceptance metrics use the same transformed distributions; hard-label CE still uses the original draft logits.
  • Preserve existing behavior with defaults of temperature=1, top_p=1, and top_k=-1, and record the settings in checkpoint metadata for exact-resume consistency.

Related to #6. This PR covers DSpark L1; other drafter losses and LM-head computation are unchanged.

Apply independent target and draft temperature, top-p and top-k transforms to DSpark L1 while keeping CE unchanged.

@zhouaihui zhouaihui 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

@Longxmas
Longxmas merged commit e852866 into inclusionAI:main Nov 11, 2026
2 checks passed
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.

2 participants