liveBook · Manning

Multi-step reasoning

As explained in Machine Learning Platform Engineering

A multistep reasoning chain is an orchestrated sequence of intermediate operations that transforms a user query into a final model response.

An LLM application may need more than one model call to answer a query. In a retrieval-augmented generation (RAG) system, a query can trigger document retrieval, context assembly, response generation, and output validation. These operations form a multi-step reasoning chain: an orchestrated path from the user’s question to the final response. Unlike a simple data-in, prediction-out workflow, a failure anywhere along that path can degrade the answer. section 12.1.1 section 13.4.6

Make the path observable so a poor answer can be traced to a stage rather than treated as one opaque model failure:

  • Inspect which documents retrieval returned and which of them influenced the response. section 12.4
  • Inspect how context and the prompt were assembled before generation, then compare them with the model’s output. section 12.1.1 section 12.4
  • Track timing and token usage by stage; check whether an error began in retrieval, context assembly, or generation. section 12.4.4

Tracing a documentation answer

Suppose a documentation assistant returns an irrelevant answer. A trace of its retrieval, augmentation, and generation stages can help distinguish irrelevant retrieved documents from poorly assembled context or a generation failure. Langfuse span tracking can show the query’s path, with timing and token usage at each step. This is visibility into the application’s operations, not a claim that a trace reveals every internal decision of the model. section 12.0 section 12.4.4

How Machine Learning Platform Engineering covers it

How deep it goes
Explains the component sequence and stage-level tracing, but does not specify an implementation of the orchestration.
Examples
Uses a documentation-query RAG application and Langfuse spans across retrieval, augmentation, and generation.
What it assumes
Builds on traditional ML workflows and monitoring while introducing the distinct stages and debugging needs of LLM applications.
What you can do after
Diagnose/debug with Langfuse spans to locate failures and inspect timing and token usage across RAG stages.
How it connects
Links retrieval-augmented generation, prompt engineering, observability, error propagation, and token monitoring.

Also explained in

Compare how 10 books explain multi-step reasoning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Platform Engineering. The section links point to the parts of the book it draws on.