Hugging Face Catches Regression on CPU with Shrunk Models: Lessons from a UMT5 Attention Vulnerability Lurking for Nearly Two Months
The Transformers library, an open-source AI platform by Hugging Face, supports over 750 models and includes more than 88,000 CPU tests and 200,000 GPU tests. However, the scale of testing means not all tests can run on every pull request (PR). In July 2026, a change enabling Scaled Dot-Product Attention (SDPA) for T5 inadvertently allowed the UMT5 decoder to "peek" at training targets. This bug lurked in the main branch for nearly two months. The Hugging Face team's "Model Integration Contract" (MIC) approach shrinks real checkpoints into fixtures that preserve all layer types and code paths, running regression tests quickly on inexpensive CPUs. This method ultimately flagged the vulnerability during commit replays.
On July 30, 2026, the Transformers library enabled PyTorch's scaled dot-product attention (SDPA) for T5 models. While this change did not introduce errors itself, it had a side effect: UMT5's decoder could now attend to future tokens. During training, the model could peek at the answers it was supposed to predict. The program did not crash, no tests failed, and the bug quietly lurked in the main branch for nearly two months.
The issue was not a lack of tests. Transformers supports over 750 model types, and its test suite is extensive, including more than 88,000 CPU tests and over 200,000 GPU tests covering pipelines, training, distributed execution, quantization, and attention kernels. However, integration tests require loading real checkpoints and running them on real hardware; executing all of these on every PR would keep many GPUs busy all day, which is impractical. By the time scheduled tasks detected a regression, the code might already be merged into main.
The Hugging Face team's response was to shrink the models themselves. They created something called a "fixture": starting from the configuration of a real checkpoint, they reduced the number of layers and width while preserving every type of layer present in the model, along with unchanged tokenizer and processor files. This shrunk model is published once and then reused. The team runs "fast integration tests" against it on inexpensive CPUs. The UMT5 fixture weights are only 66 MB, compared to the source checkpoint's 1,227 MB.