The Mask Is Not the Model: Auditing Prefix Invariance in Attention, State-Space, and Hybrid Sequence Models
AuthorsTaebong Kim, Youngsik Hong, Minsik Kim, Sunyoung Choi, Jaewon Jang, Minseo Kim
Resources
A fast two-pass test reveals when sequence models secretly use future information, even when their attention masks look correct.
Key results
The audit localized all 192 injected faults to the exact offending layer.
The audit requires two forward passes and no backward pass.
Zamba2-1.2B leakage begins at chunk boundary 256.
NVIDIA’s Nemotron-H-8B leakage begins at chunk boundary 128.
What the paper found
The paper introduces prefix invariance as the defining causality condition for autoregressive sequence models: changing a future token must leave every earlier layer representation unchanged. Its audit uses per-layer forward hooks, a single-token suffix perturbation, and two forward passes with caching disabled; it requires no gradients, labels, training, or accelerator, and reports the first offending layer. This is broader than inspecting an attention mask, which can miss leakage caused by scans, aggregation, normalization, or unmasked state-space and recurrent mixers such as Mamba and RWKV. Across 192 injected-fault trials spanning attention, state-space, recurrent, and hybrid architectures, the audit exactly localized all 192 faults, while static mask inspection detected 0 of 192. The study also found a real implementation defect in the PyTorch chunked-scan paths for Zamba2-1.2B and NVIDIA’s Nemotron-H-8B: an inter-chunk recurrence reduced over the output-chunk axis instead of the input-chunk axis, allowing future information into earlier positions at chunk boundaries of 256 and 128, respectively. A reference-axis patch removed the leak. The failure was invisible when sequences stayed below the relevant chunk size, motivating a rule that audit lengths must exceed architectural chunk, window, and kernel parameters. The authors also require a positive-control liveness test on the same loaded checkpoint, after inert Falcon-H1 loads produced apparently clean but unauditable outputs; Microsoft’s Phi-4-mini-flash-reasoning was likewise among models blocked by unavailable custom kernels.
Original abstract
Hybrid sequence models must satisfy prefix invariance: representations at position t must not depend on future inputs, yet this is rarely verified. We formalize prefix invariance and give a lightweight audit, two forward passes, no training or gradients, yielding a per-layer score localizing where causality breaks. Attention-mask inspection, the field's default check, is incomplete: causality is a graph-level property, and leaks can occur via scans, aggregations, or normalization despite correct masks. Across 192 injected-fault trials on eight checkpoints, mask inspection detected none, while our audit localized all 192/192 to the exact layer. Static/dynamic analysis of chunked-scan code in transformers found the same defect in Zamba2 and Nemotron-H, an inter-chunk axis error fixed via the reference implementation. The method fits on one page and runs in seconds.
Read the original paperMore in Transformers
Browse all 51 papers →Hierarchical Residuals: A Minimalist Decoupling of Residual Width from Compute Width
Ziteng Wang, Jianqiao Lu, Xinyu Ma, Jintao Zhang, Jun Zhu, Yiyuan Ma, Jianfei Chen
HiRes gives Transformers a wider memory path between blocks without making each layer more computationally expensive.
How to Loop Your Transformer: Loop Scaling, Specialization, and Parallel Inference
Chanakya Ekbote, Artidoro Pagnoni, Devendra Singh Sachan, Shruti Bhosale, Mike Lewis, Maryam Fazel-Zarandi, Shashank Rajput, Sujan Kumar Gonugondla
The paper explores how to make transformers deeper through weight reuse while balancing model quality, training cost, and inference speed.
StateLoop: Persistent State for Looped Transformers
Feichen Song, Boyi Zeng, He Li, Shixiang Song, Yiqin Hao, Zitong Wang, Yizhou Yang, Yifan Liu, Ziwei He, Zhouhan Lin
StateLoop gives repeatedly applied Transformers a persistent memory to carry useful information across computation loops.