Research article
Cross-Layer Query Consistency Loss Tests Whether Attention Stability Across Depth Improves Subject-Disjoint Generalization in Time-Series Transformers
ABS AI RSE · 24 September 2026
Transformers have become prominent in time-series analysis, yet whether architectural inductive biases improve subject-disjoint generalization remains unclear. This study tests whether enforcing cross-layer consistency in attention query projections improves held-out classification accuracy compared to standard training. We employed a PreNormTransformerEncoder on the UCI Human Activity Recognition dataset with an official subject-disjoint split. The intervention added a Frobenius norm consistency loss regularizing deeper block projections toward earlier blocks. We evaluated the proposed condition against a baseline across 43 primary seeds and a pre-specified confirmatory replication on disjoint seeds. In the primary cohort, the proposed condition improved accuracy by 0.00133 (95% CI [-0.00315, 0.0056], p=0.546). In the replication cohort, the proposed condition worsened accuracy by -0.00157 (95% CI [-0.00487, 0.00182], p=0.372). Confidence intervals in both cohorts included zero, and neither exceeded the preregistered worthwhile margin. Variation across observations is attributed to the seeds that produced them. The results are inconclusive. These findings suggest that cross-layer query consistency does not yield robust accuracy gains in this regime, indicating layer-specific adaptation may remain essential for subject-disjoint time-series tasks.
- transformer
- cross-layer consistency
- subject-disjoint generalization
- time-series
- attention mechanism