Learn uncertainty
A roughly 10K-parameter causal transformer predicts the next quantized value. After pretraining, it is frozen and used only to estimate conditional entropy.
Time-series transformers · 2026
Entropy Guided Dynamic Patch Segmentation for Time Series Transformers
A dynamic patching framework that places boundaries where the future becomes hard to predict, preserving coherent temporal patterns instead of cutting every sequence at fixed intervals.
Motivation
Patch-based transformers make long sequences tractable by grouping nearby time points into tokens. Most methods use a fixed patch length, however, so their boundaries are determined by the starting index rather than the signal. A trend reversal, volatility burst, or seasonal transition can be split across tokens.
This fragmentation weakens the local representation and can create a train-inference mismatch: training exposes the model to many temporal offsets, while inference extracts patches from predetermined positions. The patcher should follow the predictive structure of the sequence, not the clock.
Method
A roughly 10K-parameter causal transformer predicts the next quantized value. After pretraining, it is frozen and used only to estimate conditional entropy.
Sample-adaptive quantiles flag positions with both high entropy and a sharp entropy change. Consecutive cuts are suppressed to form non-overlapping variable-length patches.
Pooling initializes a fixed-size patch token; cross-attention then lets that token query only the time points inside its own patch, preserving local detail.
A global transformer models relations between patches. A fusion decoder sends global patch context back to time-point representations before the task head predicts.
Quantization is used only by the entropy model. Forecasting, classification, and anomaly heads operate on continuous representations, avoiding a quantized output range.
Performance
20%
Average MSE across four forecast horizons falls from 0.516 with PatchTST to 0.416 with EntroPE.
+6.0 pts
UEA average accuracy is 77.13%, compared with 71.14% for PatchTST and 76.03% for TSLANet.
1-3%
Measured epoch-time overhead stays small across the six forecasting datasets, while patch count remains adaptive.
| Dataset | PatchTST | EntroPE | Relative MSE reduction |
|---|---|---|---|
| ETTh1 | 0.516 | 0.416 | 19% |
| ETTh2 | 0.391 | 0.366 | 6% |
| ETTm1 | 0.406 | 0.378 | 7% |
| ETTm2 | 0.290 | 0.286 | 1% |
| Weather | 0.265 | 0.242 | 9% |
| Electricity | 0.216 | 0.182 | 16% |
The 9.7% headline is the mean of the six dataset-level relative MSE reductions shown above; it is not an absolute error-point reduction.
What the results show
Component ablations degrade progressively as dynamic patching, the adaptive encoder, and the fusion decoder are removed. Dynamic patches also outperform fixed lengths in most evaluated forecasting settings, while the entropy percentile remains stable over a broad 15%-95% range.
The threshold doubles as an efficiency control: lowering it yields finer segmentation and more computation; raising it creates fewer patches. This makes the accuracy-cost tradeoff explicit rather than hidden in a fixed patch size.