AI Engineer Professional

Book Profile

Time Series Forecasting Using Foundation Models

Marco Peixeiro · 2025

A hands-on practitioner's guide to understanding, applying, fine-tuning, and comparing foundation models—from TimeGPT to LLM-based approaches—for time-series forecasting and anomaly detection.

Get the book →

Time Series Forecasting Using Foundation Models demystifies the rapidly evolving world of large time models by guiding readers from first principles through real-world deployment. Author Marco Peixeiro, an active developer of TimeGPT at Nixtla, begins by unpacking the transformer architecture from a forecasting lens and then walks readers through building their own tiny foundation model with N-BEATS to viscerally experience concepts like pretraining, transfer learning, and fine-tuning. From there, the book systematically covers every major open and proprietary foundation forecasting model—TimeGPT, Lag-Llama, Chronos, Moirai, and TimesFM—explaining each model's architecture, pretraining corpus, hyperparameters, and optimal use cases before applying it to a consistent weekly store-sales benchmark. The book then ventures into LLM territory, showing how Flan-T5 and Llama-3.2 can be prompted for forecasting and how Time-LLM reprograms LLMs through patch reprogramming and Prompt-as-Prefix. A capstone project ties everything together by racing all methods—including classical SARIMA—against real blog-traffic data and comparing both accuracy and inference latency, leaving readers with a rigorous, reusable model-selection protocol they can apply to any forecasting challenge.

What it argues

A causal framework describing how design levers (model architecture choices, pretraining corpus properties, fine-tuning decisions, input configuration, and prompt engineering) combine with contextual conditions (dataset characteristics, hardware resources) to shape intermediate psychological and behavioral practitioner states, which in turn drive forecasting accuracy and operational outcomes.

Key ideas it contributes