Part I: Foundations of Temporal AI
Chapter 1: Introduction to Temporal Intelligence

The Temporal AI Landscape and How to Read This Book

"I have spent my whole existence predicting the next token, so allow me one confident extrapolation about you: in a few hundred pages, you will stop seeing forecasting and decision making as different subjects. Then, like all my predictions, you will become inevitable."

An Autoregressive Model Predicting Its Own Downfall
Big Picture

This book is organized around a single claim: prediction, representation, uncertainty, and action are not four separate fields glued together but one continuous discipline, Temporal AI, in which the same mathematical objects keep reappearing in classical and then in learned form. The nine parts walk you from classical forecasting through deep sequence models to agents that plan and act, and a recurring narrative device, the temporal thread, makes the unity explicit by tracing each classical idea forward into its modern descendant. This closing section of Chapter 1 is your map. It tells you what each part will let you do, which classical-to-learned arcs to watch for, which three datasets recur for comparability, how every chapter is scaffolded, and which of three reading paths fits your goals.

The first six sections of this chapter built the conceptual ground: Section 1.1 asked what makes intelligence temporal, Section 1.5 bounded what is predictable at all through entropy rate, and Section 1.6 catalogued the challenges (non-stationarity, irregular sampling, leakage, long-range dependence) that recur throughout. This section steps back from the trees to show the forest. A textbook spanning classical statistics, deep learning, and reinforcement learning risks reading as three disconnected books bound by accident. The structure described here is the antidote, and reading this section first will make every later chapter feel like a planned stop on one itinerary rather than an isolated topic.

1. The Map: Nine Parts, One Itinerary Beginner

The book is nine parts and thirty-six chapters. The parts are ordered so that each supplies a tool the next one reuses: classical models become the vocabulary for deep models, deep models become the policies for decision making, and decision making becomes the substrate for agents. The single best way to navigate is the table of contents hub, which links every part, chapter, and section; throughout this section each part name points back to that hub so you can jump directly to wherever a description tempts you. What follows is one paragraph per part, framed by what you will be able to do once you finish it.

In Part I, Foundations of Temporal AI (the part you are reading) you will be able to recognize a temporal problem when you see one, classify its data type, reason about its intrinsic predictability, and engineer a leakage-free pipeline with honest backtesting. This is the part that prevents the single most common and most embarrassing failure in applied time-series work, which is training a model that has quietly peeked at the future.

In Part II, Classical Forecasting and Time Series Analysis you will be able to decompose a series into trend, season, and noise, fit and diagnose ARIMA and GARCH models, analyze a signal in the frequency domain, run a Kalman filter over a state-space model, and flag anomalies and change points. These are not museum pieces. They remain the strongest baselines on many real problems, and, more importantly for this book, they are the classical originals that the neural parts later rediscover.

In Part III, Temporal Deep Learning you will be able to build and train recurrent, convolutional, attention-based, and structured state-space sequence models, choose among them with eyes open, and deploy modern deep forecasters and even zero-shot temporal foundation models. By the end you will understand why Mamba and a linear-attention Transformer and an LSTM are, underneath, variations on one recurrence.

In Part IV, Temporal Representation Learning you will be able to pretrain a sequence encoder without labels through contrastive and masked objectives, generate realistic synthetic series with VAEs, GANs, and diffusion models, and model event streams, point processes, and temporal graphs. This part is where time series stops being merely something you forecast and becomes something you embed and generate.

In Part V, Uncertainty, Online, and Adaptive Learning you will be able to produce calibrated probabilistic forecasts, attach distribution-free conformal intervals, detect concept drift, and keep a model learning online as the world shifts under it. A forecast without a calibrated interval is an opinion; this part turns opinions into decisions you can size and bet on.

In Part VI, Sequential Decision Making you will be able to formalize a problem as a Markov decision process or its partially observed cousin, solve bandits and full reinforcement-learning problems with both classical and deep methods, apply optimal control and imitation learning, and treat trajectories themselves as sequences a Transformer can model. This is the part that turns a predictor into an actor.

In Part VII, Building Intelligent Temporal Systems you will be able to reason about time and causality rather than mere correlation, build memory-equipped temporal agents that plan and use tools, and model phenomena that vary across both space and time. Here the threads of prediction and action braid into systems that behave, not just compute.

In Part VIII, Trustworthy and Deployed Temporal AI you will be able to interpret, stress-test, and audit a temporal model for robustness, fairness, and privacy, then serve it under streaming latency with drift alarms and a retraining loop. This is the part that separates a notebook result from a production system that someone is willing to be on call for.

In Part IX, Applications and Future Directions you will be able to map the whole toolkit onto real domains (finance, healthcare, manufacturing, energy, robotics, science) and reason about where the field is heading, toward unified multimodal sequence models and foundation agents. It is both a capstone and a launchpad.

Key Insight: The Parts Are a Pipeline, Not a Menu

The ordering is load-bearing. Part II gives you the filtering and autoregression that Part III re-derives with gradients; Part III gives you the sequence models that Part VI deploys as policies; Part V gives you the uncertainty that makes Part VI's decisions defensible; and Part VIII makes any of it survivable in production. You can read out of order (Section 4 offers three explicit paths), but you should know that a chapter late in the book almost always cashes a check written earlier. When a chapter says "recall the Kalman filter," it means a specific thing you can go back and reread, not a vague gesture.

2. The Temporal Thread: Classical Ideas Returning in Learned Form Intermediate

The signature device of this book is the temporal thread. Repeatedly, an idea introduced classically in Parts II reappears, with new clothes and a learning algorithm, in Parts III through VI, and then again at a research frontier. We mark these returns with looking-back and thesis-thread callouts so you never have to take the connection on faith. The thread is what makes this a unified book rather than a survey: the same recurrence $h_t = F(h_{t-1}, x_t)$ that defines a linear state-space update also defines an RNN cell, a structured state-space scan, and a belief-state agent's memory. Once you see one object behind these many faces, the catalogue collapses into a small set of ideas you genuinely understand. The illustration below pictures this thread as old clockwork climbing back into view rebuilt from neural parts.

A spiral staircase whose lowest steps are weathered brass clockwork gears that transform step by step into the same shapes rebuilt from glowing neural network nodes at the top, showing classical temporal methods returning in learned neural form.
Figure 1.7: The same classical ideas keep climbing back into view, rebuilt in learned form: the machinery changes but the temporal shape underneath stays the same.

Table 1.7.1 lays out the principal arcs. Read it now as a promise of what is coming, and return to it whenever a later chapter feels unmoored: almost every neural method in this book has a classical ancestor sitting one column to its left.

Table 1.7.1: The temporal thread. Each row is a single idea traced from its classical origin, through its learned reinvention, to a current research frontier. Chapter pointers route through the contents hub.
IdeaClassical origin (Part II)Learned form (Parts III to VI)Frontier (2024 to 2026)
Recurrent state updateKalman filter, linear state-space modelRNN / LSTM, then structured state-space model (S4, S5)Selective SSMs (Mamba) as long-context backbones
Latent discrete dynamicsHidden Markov modelSequential VAE, then belief-state agentLatent world models for planning agents
Linear autoregressionARIMALinear attention, RWKV, RetNetLinear-time attention as a Transformer alternative
Spectral decompositionFourier and spectral analysisFrequency-domain forecasters (FEDformer)Frequency mixers in foundation forecasters
Sequential decision problemMarkov decision process, dynamic programmingDeep reinforcement learning policiesDecision Transformer: the MDP as a sequence model

These arcs are not decorative. The Kalman-to-RNN-to-SSM line explains why a state-space model trained by gradient descent inherits both the Kalman filter's recurrence and its numerical pathologies; the ARIMA-to-linear-attention line explains why a Transformer with linear attention is, up to nonlinearity, fitting an autoregression with a learned kernel; the MDP-to-Decision-Transformer line explains how a model trained only to predict the next token can nonetheless act optimally when conditioned on a desired return. We develop each of these where it lives (state-space filtering in Chapter 7, RNNs in Chapter 10, structured SSMs in Chapter 13, sequence-as-decision in Chapter 28), and the thread callouts will carry you between them.

Thesis Thread: One Recurrence, Many Names

The unifying object of the book is the hidden-state recurrence $h_t = F(h_{t-1}, x_t)$ paired with a readout $y_t = G(h_t)$. When $F$ and $G$ are linear and the noise is Gaussian, optimal inference is the Kalman filter. When $F$ is a learned gated nonlinearity, it is an LSTM. When $F$ is a structured linear map made expressive by depth and selection, it is S4 or Mamba. When $h_t$ is a posterior over latent state and the agent acts on it, it is a belief-state policy. Hold this single equation in mind and the book's apparent sprawl becomes a guided tour of one idea under increasing pressure.

Fun Note

Rudolf Kalman published his filter in 1960 and Sepp Hochreiter and Jurgen Schmidhuber published the LSTM in 1997, thirty-seven years apart and in entirely different research communities, yet both are answers to the same question: how do you carry information forward through time without it exploding or fading away? The field keeps rediscovering this question because time keeps asking it. If your model has a memory, somewhere inside it there is a recurrence trying very hard not to forget.

3. Three Running Datasets Beginner

To compare methods fairly, the book threads three datasets through the chapters so that a model in Part III can be measured against a baseline from Part II on the same data, and a decision policy in Part VI can be judged on a series you already understand. Expect to meet these three companions again and again, each chosen to expose a different difficulty.

You do not need to download anything yet; Appendix E catalogues the concrete datasets, benchmarks, and evaluation protocols. The point for now is to expect continuity. When Chapter 19 puts a conformal interval around a volatility forecast, it is the same finance series you met in Chapter 5, so the improvement is a genuine comparison rather than a change of subject.

4. How to Read This Book Beginner

This subsection is the operating manual: prerequisites, the per-chapter scaffold, the "Right Tool" philosophy, the callout legend, and three reading paths. Read it once and the rest of the book becomes self-service.

Prerequisites

The book assumes linear algebra, probability, multivariable calculus, and a first course in machine learning. It does not assume any prior time-series experience. Where a prerequisite is shaky, the appendices refresh it: Appendix A unifies notation across the statistics, control, and machine-learning traditions (which clash on symbols), Appendix B refreshes probability and statistics, Appendix C covers optimization and deep-learning basics, and Appendix D is a PyTorch primer aimed at temporal models. Because Temporal AI is notation-heavy, every major symbol links to the unified notation table in Appendix A on first use, so you are never left guessing whether $x_t$ means an observation or a state.

The per-chapter scaffold

Every chapter follows the same nine-point structure so that self-study has a predictable rhythm: measurable learning objectives, a motivating problem with a running example, core exposition with derivations and figures, fully worked examples with minimal code, a classical-to-neural bridge box that ties the chapter into the temporal thread, an end-to-end case study on one of the three datasets, a pitfalls section on leakage and common failures, exercises split into conceptual, implementation, and open-ended, and a curated further-reading list with open problems on the chapter index. When you open any chapter, you already know where to find what you need.

The "Right Tool" philosophy

This book teaches concepts from scratch, but it never pretends you should ship from-scratch code. Wherever a section builds a method by hand, it also includes a library-shortcut callout showing the same task in a few lines with a modern library, naming what the library handles internally and stating the line-count reduction. The temporal toolbox spans statsmodels and sktime, the Nixtla stack (statsforecast, neuralforecast, mlforecast), GluonTS and Darts, PyTorch and Lightning, the foundation-model hub (Chronos, Lag-Llama, Moirai, TimesFM, MOMENT), river for online learning, and Gymnasium with Stable-Baselines3 and d3rlpy for decision making. Learn the mechanism once, then reach for the tool.

The callout legend

The margins of this book speak in a small vocabulary of labeled boxes. Recognizing them at a glance will make your reading faster, so the legend below names the main types you will encounter; you have already seen several in this very section.

Callout Legend

Watch for these recurring callout types as you read:

Three reading paths

The same book serves a self-taught practitioner, a researcher entering the field, and a two-semester course, but not by reading it identically. Choose a path.

Practical Example: Three Engineers, One Book, Three Paths

Who: A platform team at an energy utility adopting Temporal AI for load forecasting and battery dispatch.

Situation: Three people were handed the same book and one quarter to become productive: a backend engineer who needed a forecaster in production fast, a new PhD-track researcher hired to push the state of the art, and a staff engineer asked to design an internal training course for the rest of the team.

Dilemma: Reading all thirty-six chapters front to back would have taken longer than the quarter, and reading them in the wrong order would have buried each person in material irrelevant to their goal.

Decision: Each took a different path. The backend engineer ran the practitioner path, going straight to the deep forecasters of Chapter 14 and the deployment chapter, leaning on library-shortcut boxes and the Nixtla stack. The researcher ran the researcher path, following the Kalman-to-SSM thread through Chapters 7, 10, and 13 and camping in the research-frontier callouts. The staff engineer used the course path, assembling Parts I through III into a first-semester syllabus with the three running datasets as the lab spine.

Result: The forecaster shipped in five weeks, the researcher had a reading-group reproduction of a structured-SSM forecaster by week ten, and the internal course ran the next quarter against ready-made exercises and case studies.

Lesson: The book is one itinerary with three speeds. Picking your path up front is the highest-leverage decision you will make as a reader.

5. The Four-Tier Temporal AI Landscape Intermediate

Locating any method in the field requires a map that is fine-grained enough to distinguish what a method can and cannot do, yet coarse enough to be memorized and applied on first contact with a new problem. The map that best fits 2026 has four tiers, and understanding where each sits explains why the book is nine parts and not four, and why the tiers are best learned in order rather than by jumping to the most exciting one.

Tier 1: Classical statistical methods. ARIMA, GARCH, Kalman filters, spectral decomposition, and their relatives. These methods require labeled data only for the single series under study, can be fit in seconds even on a laptop, and have closed-form likelihoods that support exact uncertainty quantification. Their interpretability is a first-class feature, not a consolation prize: an ARIMA(2,1,1) coefficient can be read aloud to a domain expert and immediately understood. Their limit is the amount of cross-series statistical strength they can exploit, which is essentially zero. A Tier 1 model trained on one product's sales knows nothing of the ten thousand products beside it. Part II of this book covers Tier 1 in full.

Tier 2: Task-specific deep learning. LSTMs, temporal convolutional networks, and Transformer models trained from scratch on a single dataset or a small collection of related series. These models learn representations that capture nonlinear dynamics a Tier 1 model cannot express, but they pay for that expressiveness with data hunger: a task-specific deep forecaster trained on fifty series typically underperforms a well-tuned ARIMA on the same fifty series. The payoff materializes only when training data is abundant and the target series are too complex or too heterogeneous for a parametric likelihood. Part III covers these architectures.

Tier 3: Pre-trained temporal foundation models. Models such as Chronos (Amazon, 2024), TimesFM (Google, 2024), Moirai (Salesforce, 2024), and MOMENT (CMU, 2024) are trained on collections of millions of time series drawn from dozens of domains: finance, healthcare, energy, traffic, sensors, economics. The resulting model generalizes zero-shot to any new domain, producing a competitive forecast without seeing a single in-domain training example, in the same way a large language model completes sentences it has never encountered. The GIFT-Eval benchmark (introduced in late 2024) is now the standard evaluation harness for Tier 3 models: it spans 23 datasets, 144,000 series, and evaluates zero-shot, few-shot, and fine-tuned performance under a single reproducible protocol, replacing the inconsistent per-paper comparisons that made earlier foundation-model claims difficult to interpret. Chapter 15 develops Tier 3 in depth.

Tier 4: Temporal AI agents. Systems in which a large language model or an LLM-coupled planner acts as an orchestrator: it calls Tier 1 or Tier 3 forecasting tools, retrieves domain knowledge from external memory, evaluates forecast uncertainty, and selects among actions in a loop. An agent does not merely predict; it decides what to predict next, when to seek more data, and how to communicate uncertainty to a downstream decision maker. The Decision Transformer and related architectures (Part VI) are the simplest instances; the memory-equipped temporal agents of Part VII are the full realization. This is where the book ends, and understanding Tiers 1 through 3 is the prerequisite for understanding why Tier 4 is architecturally necessary rather than merely fashionable.

Table 1.7.2: The four-tier Temporal AI landscape. Data requirements and training cost refer to what is needed to deploy a fresh instance of the method on a new target domain. Inference flexibility is the ability to handle varying horizons, frequencies, and domain shifts without re-training. Interpretability is the degree to which model internals are legible to a domain expert without statistical training.
TierExamplesData requirementsTraining costInference flexibilityInterpretability
1. Classical statisticalARIMA, GARCH, Kalman filterOne target series (dozens to thousands of points)Seconds on a laptopLow: re-fit per series and horizonHigh: closed-form coefficients with known meaning
2. Task-specific deep learningLSTM, TCN, N-HiTS, PatchTSTThousands to millions of points in the target domainMinutes to hours on GPUMedium: transfers within domain if retrainedLow: learned weights with no direct interpretation
3. Pre-trained foundation modelsChronos, TimesFM, Moirai, MOMENTZero in-domain data for zero-shot use; millions of series at pre-training timeMillions of GPU-hours at pre-training; seconds at inferenceHigh: zero-shot to new domains, horizons, and frequenciesVery low: billions of parameters with no part readable in isolation
4. Temporal AI agentsLLM orchestrator + forecasting tools + retrievalDepends on the underlying Tier 2 or 3 model; additionally needs a domain knowledge basePre-training cost of the underlying model; low marginal inference cost per agent stepVery high: the agent decides what to call, when, and with what argumentsPartial: reasoning traces are natural language; the underlying forecaster is opaque
Key Insight: The Tiers Are Complementary, Not Competitive

A Tier 3 foundation model does not make Tier 1 methods obsolete, and a Tier 4 agent does not make Tier 3 models irrelevant. The GIFT-Eval benchmark results of 2024 and 2025 are instructive: on short, highly seasonal series with abundant history, a well-tuned AutoETS (Tier 1) still frequently matches or beats Chronos and TimesFM zero-shot. Foundation models earn their advantage on cold-start problems (no in-domain history), cross-domain transfer, and long irregular series where no classical parametric form fits. Tier 4 agents earn their advantage when the decision to be made requires synthesizing forecasts, retrieved context, and domain rules in a loop that no fixed model can encode. In 2026, a sophisticated temporal AI practitioner reaches for the lowest tier that solves the problem, because each step up the stack trades interpretability and cost-efficiency for flexibility.

Research Frontier: GIFT-Eval and the Standardization of Foundation-Model Benchmarking (2024 to 2026)

Until late 2024 it was nearly impossible to compare Tier 3 foundation models fairly: each paper used a different set of datasets, a different train/test split, and a different set of classical baselines, so claims of "state-of-the-art zero-shot forecasting" were difficult to falsify or replicate. GIFT-Eval (Generalized and Integrated Forecasting Evaluation Toolkit, arXiv 2410.10393) addresses this by providing 23 diverse datasets, a fixed evaluation protocol, and a leaderboard that accepts zero-shot, few-shot, and fine-tuned submissions on equal footing. The benchmark's early results are sobering: strong classical ensembles (AutoETS, AutoTheta, and seasonal-naive combined) remain competitive on a substantial fraction of the 23 datasets, confirming that Tier 3 advantage is domain- and length-dependent rather than universal. The practical lesson for 2026 practitioners is to run GIFT-Eval protocols when evaluating any new foundation model and to report the Tier 1 classical ensemble baseline alongside it.

This four-tier map is the scaffold on which the rest of the book hangs. Each part of the book is, roughly, one tier: Parts II and III cover Tier 1, Parts III and IV cover Tier 2, Chapter 15 is the Tier 3 entry point, and Parts VII and IX are where Tier 4 agents come into focus. Reading the book in order means ascending the tiers in the order they historically emerged, which is also the order in which each tier's limitations motivate the next. The next section names the specific developments, all within the last two to three years, that collapsed the walls between the tiers into one integrated Temporal AI toolkit.

6. Why Now? The Convergence into One Temporal Toolkit Intermediate

There has never been a better moment to learn Temporal AI as one subject, because the field has only just become one subject. For decades, forecasting, sequence modeling, and decision making evolved in separate communities with separate conferences and incompatible notation. Three developments collapsed the walls. First, sequence models converged: the recurrence behind the Kalman filter, the RNN, and the structured state-space model turned out to be one mechanism, and linear attention revealed Transformers and autoregressions as relatives rather than rivals. Second, foundation models arrived for time series: pretrained, zero-shot forecasters now generalize across domains the way language models generalize across text. Third, decision making fused with sequence modeling: the Decision Transformer and its diffusion-planner successors recast reinforcement learning as next-token prediction, so the very architectures used to forecast are now used to act.

Research Frontier: Forecasting and Decision Making Become One (2024 to 2026)

The clearest signal of convergence is that the boundary between predicting the future and acting on it is dissolving. Decision Transformers and diffusion planners (Diffuser, Decision Diffuser) treat trajectories as sequences and plan by generation, so a forecaster and a policy share an architecture. In parallel, temporal foundation models (TimesFM, Moirai, Chronos, MOMENT, 2024 to 2025) deliver zero-shot forecasting that was unthinkable a few years ago, and the emerging foundation-agent line couples these pretrained sequence models with memory, tool use, and planning to act over long horizons. The frontier question of 2026 is whether a single pretrained temporal model can forecast, quantify its own uncertainty, and choose actions within one system. This book is structured so that, by Part IX, you can read that literature as a continuation of what you have already built, not as a foreign language.

Fun Note

For years the unspoken rule was that "time-series people" and "reinforcement-learning people" did not attend each other's talks. The Decision Transformer paper quietly broke the truce by showing that an offline RL problem could be solved with a stock language-model architecture and the word "return" pasted in front of the trajectory. Somewhere, a forecaster and a control theorist realized they had been solving the same problem with different vocabularies the whole time. This book is, in part, an attempt to get them to finally share notes.

That convergence is the reason this book exists and the reason its nine parts belong between the same covers. You now hold the map, the thread, the datasets, the scaffold, and your reading path. The next stop on the itinerary is the practical groundwork that everything else depends on. Chapter 2, Temporal Data Engineering, takes the leakage and backtesting concerns raised in Section 1.6 and turns them into a disciplined pipeline: time stamps and ordering, resampling, missingness, windowing, and the evaluation protocols that keep every later result honest. Foundations first, then we build.

Exercise 1.7.1: Place the Problem Conceptual

For each of the following real problems, name the single part of this book where it primarily belongs, and one earlier part it depends on: (a) estimating a 95% interval around tomorrow's electricity demand that provably contains the truth 95% of the time; (b) deciding, each hour, whether to charge or discharge a grid battery to minimize cost; (c) detecting that a turbine's vibration signature has shifted to a new regime; (d) pretraining one model on a thousand unrelated series so it forecasts a new one with no fine-tuning. Justify each placement in one sentence using the part descriptions of Section 1.

Exercise 1.7.2: Design Your Reading Path Analysis

Write a one-paragraph statement of your goal in reading this book, then choose the practitioner, researcher, or course path from Section 4, or justify a hybrid. List the specific chapters you will read in full, the chapters you will skim, and the callout types you will prioritize. Name one of the three running datasets you will follow end to end, and explain why it matches your goal.

Exercise 1.7.3: Trace a Thread Conceptual

Pick one row of Table 1.7.1 and write a short paragraph predicting, before you read those chapters, what the classical method and its learned form have in common and where they must differ. State explicitly which recurrence or equation you expect to recur. Keep your paragraph; revisit it after reading the relevant chapters and grade your own prediction.

Exercise 1.7.4: Navigate the Four-Tier Landscape Analysis

For each of the four problems below, state which tier from Table 1.7.2 is the most appropriate first approach and give one concrete reason why a higher tier would be overkill and one reason why a lower tier would be insufficient. (a) Forecasting daily energy demand for a single building using five years of hourly history and no related series. (b) Forecasting demand across 50,000 retail SKUs where 30% of SKUs have fewer than six months of history. (c) Building a system that detects anomalies in a server metric, retrieves the recent deploy log from a knowledge base, and generates a natural-language explanation for the on-call engineer. (d) Estimating the remaining useful life of an industrial bearing using 200 hours of vibration data from that specific bearing type. For each answer, cite the section or chapter of this book where the appropriate method is developed.