liveBook · Manning

Chain-of-thought prompting

As explained in Time Series Forecasting Using Foundation Models

Chain-of-thought prompting is a prompting technique that elicits intermediate reasoning steps before a model produces an answer.

Chain-of-thought prompting guides an LLM through an explicit evaluation procedure before producing task outputs. For forecasting, it frames numerical sequences as natural-language tasks; for anomaly detection, it demonstrates how to evaluate each value. section 8.1.2 section 8.5.1

A practical implementation typically:

  • Supplies the sequence and relevant statistics, such as the mean and quantile bounds. section 8.5
  • Shows examples that map values to explicit labels and requires a machine-readable output format. section 8.5
  • Processes long inputs in chunks and handles missing or malformed labels with fallback logic. section 8.5.1

Anomaly labels

Given bounds and values such as 900, 1800, 1000, 500, 1100, the prompt requests 0 for normal values and 1 for anomalies, producing 0,1,0,1,0. section 8.5

How Time Series Forecasting Using Foundation Models covers it

How deep it goes
Explains prompt structure, demonstrations, chunking, and output handling, but does not establish probabilistic forecasts.
Examples
Uses binary anomaly labels, statistical bounds, few-shot demonstrations, and chunked Python-style processing.
What it assumes
Assumes familiarity with sequences and basic statistics while explaining how to specify tasks and outputs for LLMs.
What you can do after
Apply it to anomaly detection by constructing prompts, parsing labels, and handling incomplete model output.
How it connects
Connects few-shot prompting with forecasting, anomaly detection, and LLMs.

Also explained in

Compare how 18 books explain chain-of-thought prompting →

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.