Demonstration 1 of 1
A patch-token stand-in against a feature baseline, by patch length
Does patching beat a feature baseline at the same forward origins, and how does the patch length change the answer and the token count?
Short patches keep the local shape of a pulse, so the embedded tokens expose the oscillation that predicts the rebound. Long patches average that shape away inside one token, and with few tokens the model sees little more than a coarse summary, which the feature baseline also provides. Shorter patches cost more tokens, and attention cost grows with the square of the token count.
Scroll sideways for the whole equation
T is the window length (96), P the patch length, S the stride (P/2) and the number of tokens without padding is floor((T - P)/S) + 1. MAE is the mean absolute forecast error, so lower is better.
Predict first. With a patch length of 24 steps, how does the patch-token model compare with the feature baseline?
Choose an example
Scroll sideways for the whole figure
Constructed example: six seeded sets of 30 synthetic series, a patch-token stand-in with gradient boosting, measured by the chapter activity.
Calculated values
- Patch-token MAE
- 0.414
- Feature baseline MAE
- 0.447
- Raw window MAE
- 0.409
- Seasonal naive MAE
- 0.653
- Tokens per window
- 15
With patches of 12 steps (stride 6) each 96-step window becomes 15 tokens, floor((96 - 12) / 6) + 1 = 15. The patch model scores an MAE of 0.414 and beats the feature baseline at 0.447, so 0.447 - 0.414 = 0.033 separates them. The raw 96-step window scores 0.409 and the seasonal-naive forecast 0.653. Attention would relate 225 pairs of tokens per window.
Worked steps
- Tokens: floor((96 - 12) / 6) + 1 = 15.
- Feature baseline minus patch model: 0.447 - 0.414 = +0.033 (positive means patching is better).
- Raw window minus patch model: 0.409 - 0.414 = -0.005.
- Token pairs for attention: 15 x 15 = 225.
Use the idea
Compare a patch model with a feature baseline and the raw window on identical forward origins, pick the patch length from the duration of the events that matter, and check the token count and cost before a long run.
Where the conclusion applies
A stand-in, not PatchTST: patches share a PCA projection and feed gradient boosting, with no positional encoding, attention or end-to-end training, because the neural library is not installed here. The rebound makes the target depend on local pulse shape by construction, which favours a representation that sees shape; a signal that is a pure cycle gives the patch and feature models no such gap. One window length, one horizon and six sets; the raw-window comparator already uses all 96 values.
Check your understanding: A patch length of 4 scores best here. Why is that not simply the answer to use?
Chapter 57 source: section "PatchTST vs. Feature-Engineered GBM: When to Use Each".