RepoJournal
Hugging Face

@huggingface

Transformers, Datasets, and the open AI-model layer

Keep up with Hugging Face in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.

One email a day. Unsubscribe in one click.

Pick a date

Topics: Python AI / ML Full archive →

The Wire · Showcase

DISTILLATION TRAINER GRADIENT ACCUMULATION BUG FIXED, LEROBOT IMAGE STATS OVERFLOW PATCHED

By RepoJournal · Filed · About Hugging Face

TRL's distillation trainers were silently miscalculating loss under gradient accumulation, and LeRobot's image statistics were overflowing to zero for valid data.

The GKDTrainer, GOLDTrainer, and DistillationTrainer accepted `num_items_in_batch` in their loss computation but never used it [1], causing JSD distillation loss to normalize by local microbatch token count instead of global count. Under gradient accumulation, this breaks the gradient scaling that transformers' base Trainer expects, silently producing wrong gradients. This is a critical fix for anyone training distilled models at scale [2]. In parallel, LeRobot's image statistics computation was promoting uint8 samples to float *after* squaring them in RunningQuantileStats, causing uint8 overflow that made computed variance negative and clamped to zero [3], so stats.json reported `std=0` for non-constant image data [4]. Both fixes are merged and ready. TRL also patched the GLM-4-MoE chat template to properly terminate assistant turns with role markers instead of missing end-of-turn tokens [5]. Routine dependency bumps across trl and ml-intern [6], [7]. Chat-UI increased MiniMax-M3's max_tokens to 65536 to prevent the router from truncating reasoning-heavy outputs at 2048 tokens [8].

One email a day. Unsubscribe in one click.

Action items

References

  1. [1] Normalize JSD distillation loss by num_items_in_batch for gradient accumulation ↗ huggingface/trl
  2. [2] Normalize JSD distillation loss by num_items_in_batch for gradient accumulation (#6006) huggingface/trl
  3. [3] fix(datasets): avoid uint8 overflow in image stats (#3697) huggingface/lerobot
  4. [4] fix(datasets): avoid uint8 overflow in image stats ↗ huggingface/lerobot
  5. [5] [fix] GLM-4-MoE template: turn-terminating token to the turn itself ↗ huggingface/trl
  6. [6] Bump the actions group with 4 updates ↗ huggingface/trl
  7. [7] Bump the actions group with 4 updates ↗ huggingface/ml-intern
  8. [8] Set max_tokens 65536 for MiniMax-M3 huggingface/chat-ui

Quick answers

What shipped in Hugging Face on June 14, 2026?
TRL's distillation trainers were silently miscalculating loss under gradient accumulation, and LeRobot's image statistics were overflowing to zero for valid data. In total, 5 commits and 6 pull requests landed.
Who contributed to Hugging Face on June 14, 2026?
4 developers shipped this update, including behroozazarkhalili, Altman-conquer, qgallouedec, and dependabot[bot].
What were the notable Hugging Face updates?
Normalize JSD distillation loss by num_items_in_batch for gradient accumulation, Normalize JSD distillation loss by num_items_in_batch for gradient accumulation (#6006), and fix(datasets): avoid uint8 overflow in image stats (#3697).

More from @huggingface

Daily updates, in your inbox

Follow Hugging Face

Keep up with Hugging Face in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.

or

One email a day. Unsubscribe in one click. Read a past issue →

Elsewhere on the wire

Want every project, not just this one?

We use privacy-friendly analytics (Google Analytics, IP-anonymized) to see which pages help readers. No ads, and we never sell your data. See our Privacy Policy.