Skip to content

[distillation] - fix: add unit tests for distillation losses and training - #90

Merged
JulesBelveze merged 1 commit into
mainfrom
fix/distillation-losses
Jul 23, 2026
Merged

[distillation] - fix: add unit tests for distillation losses and training#90
JulesBelveze merged 1 commit into
mainfrom
fix/distillation-losses

Conversation

@JulesBelveze

Copy link
Copy Markdown
Owner

Summary

Fixes distillation KL loss so student logits are compared against teacher logits on the right axis.

Seq2seq training now ignores masked targets, keeps all-ignored batches safe for backpropagation, and runs teacher
inference without gradients.

Adds unit coverage plus an offline two-step Trainer.fit smoke test for seq2seq distillation.

Testing

  • pytest -q tests/test_distillation_losses.py tests/test_seq2seq_distillation_training.py

 - Implement tests to verify the correctness of KL divergence loss calculations between student and teacher models.
 - Ensure that the seq2seq distillation process correctly handles masked tokens and differentiable zero loss scenarios.
@JulesBelveze
JulesBelveze merged commit 16032ce into main Jul 23, 2026
9 checks passed
@JulesBelveze
JulesBelveze deleted the fix/distillation-losses branch July 23, 2026 17:02
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.

1 participant