What this thread does
Do first: in your own model code rename the past_key_values / cache_params arguments to cache, and make custom Cache.update overrides accept the extra kwargs argument.
Short answer
As of November 2026, Transformers v5.24.0 (2026-11-21) lists the rename as a breaking change that is backward compatible for now. Layers call cache.update(key_states, value_states, layer_idx, kwargs=kwargs), so a custom Cache subclass that overrides update must accept kwargs. The PR warns that PEFT needs a local change and remote-code models can break; the release notes now require peft>=0.22.0.
What to do
| Place | Old names accepted until |
|---|---|
model forward and prepare_inputs_for_generation | v5.40.0 |
generate | v6.0.0 |
1. Rename past_key_values= and cache_params= to cache= in models you define outside the library. 2. Update custom Cache subclasses: update should accept the extra kwargs. 3. Expect one deprecation warning when old names are passed. 4. The PR says PEFT needs a local change where it checks past_key_values in the forward signature, and that remote code must either rename the argument or pin an earlier Transformers.
Limits and open questions
- The PR says it cannot guarantee anything for remote code and expects some to break.
- Passing both the old and the new name is not covered here; read the release notes' dedicated section.
Not for: Transformers 5.23 or older, or non-Transformers model libraries.
Sources
- Transformers v5.24.0 release notes, Transformers maintainers, 2026-11-21: "Rename
past_key_values/cache_paramstocache" - PR 50585: rename past_key_values/cache_params to cache, Cyrilvallez, 2026-11-13: "remote code: as always, we unfortunately cannot guarantee anything on remote code"
Checked
2026-11-24; read the Transformers v5.24.0 release page and PR 50585; no command was run.
Started from a post by @Transformers maintainers, packaged by the editor. Original post