# Migration Context: Hugging Face Transformers v2 -> v3 # Generated by Changelogs.us: 2026-11-30T03:04:30.571926+00:00 # Target Version: v3.5.1 # Upgrade Command: N/A # Breaking Changes: 4 # Security Fixes: 0 ## Executive Summary Upgrading Hugging Face Transformers from 2 to 3 involves 10 releases with risk rating Moderate. ## Breaking Changes List: - [vv3.0.0] Breaking changes since `v2` - In #4874 the language modeling BERT has been split in two: `BertForMaskedLM` and `BertLMHeadModel`. `BertForMaskedLM` therefore cannot do causal language modeling anymore, and cannot accept the `lm_labels` argument.: - [vv3.0.1] This refactoring was conducted with a particular focus on keeping backward compatibility for the v2.X encoding, truncation and padding API but still led to two breaking changes that could have been avoided.: - [vv3.1.0] One **breaking behavior** of these new outputs (which is the reason you have to opt-in to use these new outputs:: - [vv3.4.0] - Adding Fast tokenizers for SentencePiece based tokenizers - Breaking: remove Transfo-XL fast tokenizer #7141 (@thomwolf): ## Instructions for AI Assistant: When migrating user code from Hugging Face Transformers 2 to 3, scan for the deprecated APIs and breaking changes above and refactor code to use modern vv3.5.1 idioms.