liveBook · Manning

Reprogramming

As explained in Time Series Forecasting Using Foundation Models

Reprogramming is the technique of adapting a pretrained language model's representations or processing so it can perform a different task such as forecasting.

Reprogramming adapts a pretrained language model so it can perform a different task, such as time-series forecasting. Time-LLM aligns numeric time-series patches with the text modality used by an LLM, then learns to produce numeric forecasts. section 9.1 section 9.6

A forecasting reprogramming pipeline typically:

  • Patches the raw time series and transforms the patches into representations aligned with the LLM’s text modality. section 9.1 section 9.6
  • Combines the reprogrammed patches with a natural-language prompt that supplies context about the series. section 9.1 section 10.2.8
  • Projects the LLM output and maps the resulting embedding through a linear layer to produce numeric forecasts. section 9.1
  • Trains the reprogramming and projection components with a loss function such as mean absolute error before prediction. section 9.2.2

Store sales and blog visits

Time-LLM forecasts weekly sales for multiple stores through neuralforecast, and it can receive a prompt describing weekly seasonality in daily blog visits. Cross-validation measures MAE and sMAPE. section 9.2.2 section 10.2.8 section 9.4

Figure 9.1 General architecture of Time-LLM. (Right) The raw series is fed to the framework and undergoes patching before entering the patch-reprogramming phase. (Left) A prompt is used to provide context about the data. The prompt and reprogrammed patches are joined as a patch embedding, which is sent to the LLM. Then the output is projected to create a forecast for our series.
A diagram of a patch

Description automatically generated

Use the architecture diagram to trace raw-series patching, prompt integration, LLM processing, projection, and numeric forecasting. section 9.1

How Time Series Forecasting Using Foundation Models covers it

How deep it goes
Explains patching, prompts, projection, training, and evaluation, but does not detail the reprogramming algorithm internally.
Examples
Uses store sales and daily blog visits, with seasonality prompts, neuralforecast listings, forecasts, and MAE-sMAPE comparisons.
What it assumes
Assumes time-series forecasting and LLM familiarity while showing the adaptation workflow and implementation with minimal code.
What you can do after
Apply it via neuralforecast to train an LLM-based forecasting model and evaluate predictions with MAE and sMAPE.
How it connects
Connects multimodality, time-series forecasting, language models, patching, prompting, cross-validation, and zero-shot forecasting.

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.