Manuscript Offprint

arXiv:2610.31522

Beyond Causal Masks: Auditing and Localizing Hidden Future-Token Leakage in Adaptive Sequence Models

Huiting Liu, Jinsong Wu

Abstract

Hidden future-token leakage can create false architectural gains: an autoregressive model may appear substantially better under teacher-forced evaluation while its free-running generation deteriorates. We investigate this failure in an adaptive residual-routing decoder whose sequence-level routing summary exposes prefix positions to future tokens despite a correct causal attention mask. An anomalous 24-layer checkpoint reduces validation loss from the baseline's 3.5958 to 1.4259, yet it fails a prefix-invariance audit and has substantially higher reference-model perplexity during generation. Layer-wise diagnostics and implementation inspection trace the violation to a full-sequence summary broadcast through the dynamic routing-query path. Two independently trained 12-layer causal repairs eliminate detectable leakage and return validation loss and reference perplexity to the control scale, removing the large apparent advantage. As diagnostic tools, we use the established prefix-invariance contract, maximum prefix-output discrepancy (LeakScore), complementary behavioral metrics, and layer-wise profiles. Supporting experiments cover six synthetic implementation pairs spanning five module families, clean pretrained controls, controlled fault injection, and cache consistency across numerical precisions. These results illustrate how hidden future-token access can produce misleading claims of architectural progress and why lower teacher-forced loss should be interpreted together with whole-model causal checks and free-running evaluation.

Keywords: autoregressive models, causal masking, leakage detection, sequence modeling

*Corresponding author. Email address: wujs@ieee.org

1. Introduction

In decoder-only Transformers, causal self-attention restricts the output at position t to information from the prefix x1:tx_{1:t}. The same restriction must hold for every operation contributing to that output. Sequence-level pooling, temporal convolution, state aggregation, routing, and cross-time normalization can create additional information paths outside of masked attention. Prior work on linear attention and recurrent-style sequence compression likewise makes autoregressive behavior depend on prefix-consistent state aggregation [1]. Adaptive computation and selective state updates further motivate checking the complete dependency structure [2, 3].

We use hidden future-token leakage to describe suffix influence on prefix outputs through an auxiliary operation outside standard masked self-attention, despite a correct attention mask. Such access can lower teacher-forced validation loss without improving valid autoregressive prediction. Broader studies of leakage have shown how invalid information access can inflate empirical performance claims [4]; here we examine this risk within the model's computation. The practical concern is a false architectural gain: an apparent improvement that depends on information unavailable during causal generation.

Figure 1 illustrates the dependency structure. At position i, the causal path uses only x1:ix_{1:i}, while a non-causal auxiliary operation introduces an additional dependency on xi+1:Tx_{i+1:T}. The auxiliary operation may also use past and present inputs; the violation is the future-to-prefix dependency, not the presence of the auxiliary module itself.

Our motivation comes from a follow-up implementation of CDR-AttnRes (Content-Conditioned Depth Routing for Attention Residuals), a residual-routing decoder variant inspired by Attention Residuals [5]. A full-sequence summary was broadcast as a low-rank correction to the depth-routing query. An unusually low teacher-forced validation loss suggested a strong improvement, but causal auditing detected leakage and free-running generation had substantially higher reference-model perplexity than the controls. Localization and code inspection identified the query path; independently trained 12-layer repairs removed detectable leakage and the large apparent advantage. Section 7 distinguishes the anomalous 24-layer trigger from the 12-layer repair comparisons.

Our diagnostic framework uses the established prefix-invariance principle: changing the suffix should leave shared-prefix outputs unchanged. We denote

Figure

Figure 1: Mechanism of hidden future-token leakage. Solid paths represent permitted dependencies on past and present inputs, while the orange dashed path highlights a forbidden dependency on future inputs through a non-causal auxiliary operation. This is a schematic dependency diagram rather than a particular architecture: pooling, temporal mixing, state aggregation, routing, and cross-time normalization can introduce such paths when implemented non-causally.

the maximum prefix-output discrepancy by LeakScore, supplement it with behavioral metrics, and inspect layer-wise profiles to guide implementation review. Controlled module comparisons and pretrained-model checks support interpretation of these diagnostics.

The main contributions are threefold. First, we document a false architectural gain in a real adaptive architecture: a large teacher-forced loss advantage accompanies detectable leakage and generation degradation, and disappears once the non-causal path is repaired. Second, we provide cross-module diagnostic evidence across six implementation pairs spanning five module families, together with clean controls and fault-injected pretrained models. Third, we use layer-wise localization to support root-cause analysis: FirstLeakLayer identifies the first monitored layer with detectable suffix in-fluence and guides inspection of the CDR query path. Prefix invariance and LeakScore serve as diagnostic tools rather than a new causal contract.

Sections 3–4 define the problem and audit. Sections 5–6 present supporting experiments, followed by the CDR case in Section 7 and practical implications in Section 8.

References (24)