Change8

Migrating to Transformers v5.2.0

Version v5.2.0 introduces 2 breaking changes. This guide details how to update your code.

Released: 2/16/2026

2
Breaking Changes
2
Migration Steps
17
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

AttnModernBERTconvert_rope_params_to_dictAutoTokenizerTrainerDeepSpeedQwen3VL ProcessorgptossEncoderDecoderCachepe_audio_videoLlama4DETR modelsxLSTMGlmMoeDsaConfigMistralCommonBackendJambaSwanLab callback

Breaking Changes

Issue #1

The attention mask interface has been updated everywhere, requiring review if custom attention logic was used.

Issue #2

ModernBERT's default attention implementation no longer uses FA (Flash Attention), which might affect performance or behavior if FA was implicitly relied upon.

Migration Steps

  1. 1
    Review and update any custom attention logic due to the new attn mask interface.
  2. 2
    If relying on ModernBERT's default attention implementation, be aware it no longer uses FA.

Release Summary

This release introduces several major new models including VoxtralRealtime, GLM-5, and Qwen3.5, alongside significant internal refactoring, particularly around attention mechanisms and trainer stability.

Need More Details?

View the full release notes and all changes for Transformers v5.2.0.

View Full Changelog