Back Home

GitHub Repo

Transformers Community Reports Kimi Linear Cache Bug: Padding May Change Subsequent Inference State

On November 9, the Transformers community reported that Kimi Linear still advances convolution and recurrent state when padding positions are appended to a cached sequence. Another contributor reproduced the issue and said other linear attention implementations may be affected, but no related fix has been linked; full-model and GPU paths remain unverified.

Marcus Qwertyus · Public domain · Image source
zh-Hant

A cache-correctness issue has been reported in the Transformers integration of Kimi Linear: when processing a continuation after a cached prefix, padding positions may change valid outputs and the state used for the next token, even when the padded inputs are all zeros and the mask is correctly preserved. The issue, filed on November 9, targets the 5.23.0.dev0 development version and includes a CPU, FP32 layer-level reproduction that does not require downloading weights. Issue report

This relates to Kimi Linear’s architecture. The official documentation explains that its core Kimi Delta Attention (KDA) uses a per-channel forget gate to control recurrent-state decay and is mixed with full-attention layers. For this kind of computation, masking input values alone does not guarantee that state updates stop; padding positions must also follow the state-update rules. Architecture documentation

The report first caches six positions, then compares three valid positions with and without padding. Adding two positions on the left produced a maximum absolute difference of about 1.31 in valid outputs. With right padding, the current valid outputs were nearly identical, but a subsequent probe position differed by about 0.72. These figures come from a small layer-level test and should not be interpreted as the quality degradation of a full model. Reproduction results

Another contributor reported reproducing the issue and attributed it to two factors: padded entries entering the convolution window, and gates that still allow recurrent state to decay or be written under zero input. Their investigation also pointed to related implementations in GLM5-Next, BailingHybrid, and Qwen3-Next, though cross-model impact remains a community finding. The commenter said ordinary left-padded generation starting from an empty state did not show the same problem. Follow-up investigation

For engineers using chunked prefill or cache continuation, a useful check is to use an unpadded sequence as the baseline and compare both current outputs and continuation results. The investigator noted that tests using the same padded data as the baseline may miss a shared error. As of this check, the issue remains open with no linked fix; the next steps are to confirm the scope of any shared-implementation fix and whether GPU kernels and full generation are affected. Issue status

Sources

  1. KimiLinear: padding in cached continuation advances convolution and recurrent states — Issue #50484
  2. Kimi Linear — Transformers 官方文件