liveBook · Manning

Patch

As explained in Time Series Forecasting Using Foundation Models

A patch is a segment of consecutive time-series observations grouped as one model input unit.

A patch groups consecutive time-series observations into one token or model input unit. Grouping local points helps models learn nearby relationships while reducing the number of tokens sent to the embedding layer. section 6.1.1

Patching supports several implementation choices:

  • A patch length of two groups two observations before tokenization, rather than sending each observation separately. section 6.1.1
  • Moirai selects patch lengths according to data frequency, while Moirai-MoE uses one fixed length and nonoverlapping patches across series. section 6.2.1 section 6.1.1
  • Time-LLM normalizes and patches the series before embedding patches and translating them through learned text prototypes. section 9.1.1

Patch reprogramming example

A patch can receive descriptions such as “down steady” or “up short”; combining prototypes can describe a patch as “down steady then up short.” section 9.1.1

Figure 6.2 The process of patching. Typically, each data point (circle) is a token that’s sent to the embedding layer. With patching, we group data points, and each patch becomes a token that is sent to the embedding layer.
A diagram of a patch diagram

Description automatically generated

Shows how multiple time-series points become one token before entering the embedding layer. section 6.1.1

How Time Series Forecasting Using Foundation Models covers it

How deep it goes
Explains grouping, tokenization, embedding, token reduction, and frequency-dependent lengths, without presenting implementation code.
Examples
Demonstrates length-two patches, frequency-specific patch lengths, and text prototypes describing local trends.
What it assumes
Assumes basic time-series observations and transformer tokenization, while defining how grouped points become model tokens.
What you can do after
Apply patching before embedding to reduce token counts and retain local time-series information.
How it connects
Connects time-series forecasting with tokenization, embeddings, transformers, and text reprogramming.

Also explained in

Compare how 5 books explain patch →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Time Series Forecasting Using Foundation Models. The section links point to the parts of the book it draws on.