FLAN-T5 is an instruction-tuned version of T5, fine-tuned on more than 1,800 tasks including question answering, arithmetic reasoning, and text categorization. It is open source, ranges from flan-t5-small to flan-t5-xxl, and generally responds better to questions than direct forecasting instructions. section 8.1.1
For time-series forecasting, frame the task as asking what future values will be rather than instructing the model to forecast. A practical pipeline scales the context, uses few-shot examples, generates text, parses numeric predictions, adjusts the horizon, and inverse-transforms the values. section 8.2.1
A local forecasting workflow typically includes:
- Load the model and tokenizer with the Transformers library; flan-t5-base contains 278 million parameters. section 8.2
- Scale values between 0 and 1 with MinMaxScaler to reduce errors when generating numeric tokens. section 8.2.1
- Control output length with max_new_tokens and reduce variability with a low temperature. section 8.2.1
- Inspect raw output because the model may produce too few or repeated predictions; extend or truncate the sequence before evaluation. section 8.2.2
Weekly sales forecasting
Applied to eight-week forecasts for individual stores, FLAN-T5 often generated constant values or only six predictions instead of eight, requiring repetition of the last value. Its MAE was 83,721 and sMAPE was 2.62% in one four-window evaluation, comparable to Moirai with exogenous features but not representative of general performance. section 8.2.2 section 8.3.2
Prompting can also request anomaly labels using statistics and chain-of-thought examples, but the demonstrated method labeled every value normal and produced zero precision, recall, and F1. FLAN-T5 is not specifically trained for time-series data. section 8.5 section 8.5.2
