CourseTransformers: From Attention to Trained, Served and Interpreted Models · Module 10: Efficiency and Long Context · part 76 of 111
Part 76 · Module 10: Efficiency and Long Context

Incident: A sliding window that opened the future

16 min read·
Module 10 · Incident file · About 35 minutes

What happened

ONE MASK, TWO WEEKS (SOURCES CITED) 27 Sep 2025 issue #41184: 202 pairs, not fewer 29 Sep triaged: maintainer tagged 30 Sep PR #41228 opened and merged, with a test 30 Sep reply: the window mask is off 13 Oct 2025 issue closed by #41228
The report (red) came with its own reproduction, so the fix and its test (green) landed three days later; the issue closed on 13 October 2025.

On 27 September 2025 a user with the GitHub name NixGD opened issue #41184 on Hugging Face's transformers library, titled "Continuous Batching sliding window attention mask is wrong" (github.com/huggingface/transformers/issues/41184). They were running a development build (4.57.0.dev0) and reported: "Using Continuous Batching with gpt-oss gives meaningless results. I believe this is the reason."

Their reproduction was eight lines. It built two masks for one 16-token sequence with the library's build_attention_mask function: a full causal mask, and a mask with a sliding window of 4. Then it counted the query-key pairs each mask allowed. The output was:

text
Key/Query pairs the model can attend to (full mask): 136
Key/Query pairs the model can attend to (window mask): 202

A window should allow fewer pairs than causal attention, not more. In the reporter's words, "the window-attention should be _more_ restrictive."

PAIRS A QUERY MAY READ, 16 TOKENS full causal 136 window of 4 202 a window should open fewer pairs, not more
The reporter's eight-line script found the window mask (red) opening 202 query-key pairs where full causal attention (blue) opens 136.

The response was quick. On 30 September remi-or, the collaborator the reporter had tagged, opened pull request #41228, "Fix sliding window attn mask", and merged it under two hours later (github.com/huggingface/transformers/pull/41228). It changed two lines, added a long docstring with drawn masks, and added a test "so it does not happen again". remi-or replied in the issue: "Good catch, it seems the sliding window mask is off." The issue was closed on 13 October 2025. The issue does not say how many users ran the affected path; the cost on record is a model giving meaningless output.

The rest of this part opens with an account

Signing up is free and takes one email. Nothing to pay, and nothing renews.