Research ·
Transformers Model Integration Contracts
Hugging Face introduced Model Integration Contracts (transformers-mic), a scheme pairing tiny shrunk model fixtures with frozen, human-reviewed output baselines, catching a UMT5 attention bug that survived two months in Transformers' main branch.

On July 30, 2026, enabling PyTorch's SDPA attention for T5 caused UMT5's decoder to attend to future tokens during training, letting it peek at answers it should predict. The bug raised no errors and stayed in main until September 28. Hugging Face found that a tiny UMT5 fixture running on CPU flagged it on every replayed commit.
The proposed transformers-mic standard has three parts: a fixture, a small model built from a real checkpoint's config with reduced sizes but all layer kinds, tokenizer and processor files kept byte for byte, published once and pinned; a usage path, a runnable Markdown example such as generation or a training step; and baselines, recorded outputs reviewed by a human. A contract holds if the fixture still reproduces the baselines. Contracts cover an architecture and usage path, not one checkpoint, and are pinned via a fleet dataset on the Hub. On PRs, MICs are selected based on which files the patch changes.
The experimental UMT5 fixture used 66 MB of weights versus 1,227 MB for the source checkpoint; an Llama 4 Scout fixture shrank 108.6B parameters to 44.7M. Replaying over five months of commits, the fixture flagged the regression throughout its lifetime, with label log-probabilities off by 1.22 and training loss by about 0.20. A key detail: the contract used SDPA, the default attention path; eager-only testing missed the bug. A reverted-fix demo failed the check in a 13.4-second CPU runner step. For builders, this offers a cheap way to catch regressions on PRs before they reach main, though fixtures complement rather than replace full integration tests.
References
- Hugging Face · huggingface.co
Read the full story at Hugging Face ↗Like, save or discuss on Buzz