AI NewsDev toolsAnnouncement

Hugging Face transformers 5.24 renames past_key_values to cache

Hugging Face released transformers 5.24.0 on 21 November. The library renames past_key_values and cache_params to cache across every model. The old names still work, with a warning, until later versions.

AI News

Editorial2 min read

LinkedInX
Hugging Face transformers release notes

Why it mattersA team that runs its own fine-tuning or inference on top of transformers will see this warning this week. The old names will stop working at a later version.

A team that fine-tunes its own models on top of Hugging Face transformers has past_key_values in a lot of places: the call to forward, the shape passed to generate, the field read off a ModelOutput. Hugging Face renamed that field on 21 November 2026. In transformers 5.24.0, past_key_values and cache_params both became cache.

The release notes are on GitHub at huggingface/transformers v5.24.0. The library is released under Apache 2.0. The release was signed off by the maintainer Cyrilvallez.

What the rename touches

Hugging Face says the new field name cache replaces the two older names across the whole library. It appears in model forward signatures and in the generate function. It also appears in prepare_inputs_for_generation, in the masking utilities, and in every ModelOutput class. Multimodal models now share one output class in place of a per-model one.

The old names still work for now. Each call that uses one of them shows a one-time deprecation warning. Hugging Face says forward and prepare_inputs_for_generation will keep accepting the old names until version 5.40.0. The generate function will keep them longer, until version 6.0.0.

What else changed in the same release

Hugging Face now requires peft version 0.22.0 or newer. A team that upgrades transformers will reinstall peft to match. The old file modeling_attn_mask_utils.py is gone and its code lives in transformers.masking_utils. LayoutLMv3 can now use SDPA and flex attention through the standard attention interface.

Eight model families are new in this release. Inkling 2 Mini and Apertus 1.5 are multimodal. WavTokenizer encodes audio as tokens. NVIDIA's Dory is a looped language model. Hunyuan's HY4-VL takes mixed text and image input. Meta's Omnilingual ASR covers 1,600 languages. Lara Mini is a 7.2B-parameter model with hybrid attention and recurrent layers. Sarvam AI's SarvamMLA and SarvamMoE are mixture-of-experts models at 105B and 30B. EXAONE is the family from LG AI Research. The release notes carry each one's architecture summary.

How to act on it

A team can keep its code the way it is today. The warnings will show up in logs until a code change picks up the new names. A search for past_key_values and cache_params across the repository finds every call site. A team that handles the rename this week pays the cost once. A team that leaves it tracks the warnings against a growing list of merges. The cleanup then has to happen under a hard version cut later.

Source

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project