arXiv:2611.08160stat.MLNov 2026

Manuscript Offprint

arXiv:2611.08160

Patch Attention Wisely: Understanding Patch Length in Attention-Based Forecasting

Junyu Chen, Likai Chen, Weining Wang

Abstract

Attention-based time series forecasters commonly group consecutive observations into patches. Patch length is known to have a substantial impact on forecasting performance, yet its selection remains largely empirical. We develop a theoretical framework that explains why patch length matters for forecasting accuracy and provides a principled basis for its selection. For linear state-space models, we derive an exact factorization of the forecasting coefficient matrix that separates forecast dynamics from filtering dynamics. We show that dominance of a single forecast component at long horizons does not generally imply a rank-one representation. This explains why longer horizons alone need not reduce representational complexity. We combine the factorization with estimation bounds to develop a patch-selection criterion that balances representation and estimation errors under temporal dependence. Our analysis establishes conditions under which balanced patching is justified and clarifies how predictive structure, head count, training sample size, and long-run dependence enter the selection criterion.

1 INTRODUCTION

Patching has become a basic design choice in attention-based time-series forecasting. A history of length LL can be presented as LL point tokens or as N=L/pN = L/p non-overlapping patches of length pp. Increasing pp shortens the token sequence and can make long contexts computationally feasible. Within one attention head, a shared linear value map applies the same pp within-patch weights to every patch, and the query-key scores only rescale this pattern from patch to patch. Patch length is therefore not only a computational choice: it also determines which forecasts a fixed number of heads can express and how many coefficients must be learned from data. With limited data or long histories, an unsuitable patch length can leave too many coefficients to estimate or too little flexibility to fit the target, even when it reduces attention cost.

Prior work has established that patch tokens can be both accurate and efficient. PatchTST (Nie et al., 2023) showed that patching preserves local temporal structure, reduces the number of tokens, and permits longer look-back windows, and patch tokenization is now used in large pretrained forecasters such as TimesFM (Das et al., 2024). It has also shown that a single temporal resolution need not suffice: MTST (Zhang et al., 2024) uses parallel patch scales, Pathformer (Chen et al., 2024) combines scales through adaptive pathways, and TimeSqueeze (Ankireddy et al., 2026) moves patch boundaries according to local signal complexity. Complementary studies compare point-wise, patch-wise, and variate-wise tokens (Chen et al., 2025), and a controlled analysis finds that adaptive patching should be compared against carefully tuned uniform patches (Zucchi et al., 2026). These works explain how to build effective tokenizers and when they perform well empirically.

Most existing work on patching is algorithmic and empirical: it proposes tokenization schemes and compares their accuracy and computational cost, but it provides no statistical theory for choosing a fixed patch length for a given forecasting model. Prediction errors alone cannot isolate the effect of patch length, because changing pp also changes the number of tokens, how parameters are shared across time, the number of coefficients to estimate, the optimization problem, and the computational cost. Multiscale and adaptive architectures face the same ambiguity. Moreover, non-overlapping patching does not discard any observation

*Correspondence to: junyu.chen@rug.nl.

but only regroups the observations into patches, so any loss of forecasting power must come from the model applied after this regrouping. A statistical theory of patch selection must therefore first characterize how patch length changes that model and then determine when one patch length should be preferred.

We provide such a characterization for a multi-head linear attention model. Each head applies one set of within-patch weights, and its query-key scores determine how strongly these weights are used in each patch. Summed over heads, these contributions form an N×pN \times p coefficient matrix that contains the weight on every observation in the history, and with mm heads this matrix has rank at most mm. When the attention weights do not depend on the input and every patch position has its own learnable key, the model can represent exactly the coefficient matrices of rank at most mm. Choosing pp therefore reshapes the same length-LL linear forecast into a different matrix, which can change both the rank needed to represent it and the difficulty of estimating it. This reduction to reduced-rank regression isolates the effect of patch length without claiming to describe every component of a full Transformer.

A central difficulty is that a long horizon does not make the forecast simple to represent. In a partially observed dynamical system, a long-horizon forecast may be dominated by one slowly evolving state component, and it is tempting to conclude that one weighting pattern then suffices. We show that this is not true, because the forecaster must first recover that slow component from observations contaminated by faster latent dynamics and measurement noise. Using a linear state-space model, we factor the optimal forecast coefficients into horizon-dependent weights and horizon-independent filtering patterns. The factorization shows that the component dominating the distant future can still require several filtering patterns to recover. It also identifies patch aliasing, in which a patch length makes two different filtering patterns produce identical weights across patches. Consequently, the best low-rank approximation can keep a positive relative error as the horizon grows.

We relate the infinite-past coefficients to the best forecast from a finite window and bound the error of rank-constrained least squares fitted to overlapping windows of one dependent series. The bound separates approximation error from an estimation term governed by the dimension of the rank-constrained coefficient class. When the rank constraint is active, this dimension is m(L/p+p−m)m(L/p + p - m), which is smallest when the patch length and the number of patches are equal. This suggests patch lengths near L\sqrt{L} when approximation errors are comparable, although with enough data a less balanced reshape can be preferable if it

represents the target more accurately.

In summary, we contribute (i) an exact identity linking head count and patch length to the coefficient class of the model, (ii) a state-space factorization and a long-horizon floor on the relative approximation error, which separate the components that drive the forecast from the filtering patterns needed to recover them, (iii) finite-window and dependent-data bounds that expose the approximation-estimation tradeoff in patch selection, and (iv) a mixture setting in which input-dependent attention weights can improve the forecast because the observed history reveals which system generated it. Simulations show that intermediate patch lengths near L\sqrt{L} help most when training data are scarce, and that their advantage narrows as the sample grows.

Related work. Our question differs from showing that attention can implement a Kalman filter or learn an autoregressive rule in context (Goel and Bartlett, 2024; Sander et al., 2024; Lu and Yang, 2025): we study how a specified forecasting model distributes coefficients over a patched history. The non-overlapping coefficient reshape is related to Page-matrix methods, which use low-rank structure for time-series estimation and prediction (Damen et al., 1982; Agarwal et al., 2018), and contrasts with the overlapping Hankel matrices common in realization theory (Glover, 1984). Spectral learning of dynamical systems provides complementary low-dimensional descriptions of long-memory predictors (Hazan et al., 2017; Rashidinejad et al., 2020). We combine these structural ideas with reduced-rank regression (Izenman, 1975; Velu and Reinsel, 1987) and dependent time-series estimation (Basu and Michailidis, 2015). The new link is that the rank constraint is induced directly by attention heads and changes shape with the patch length.