# Inference Pipeline

- **Canonical URL:** https://getaimath.com/dictionary/inference-pipeline/
- **Topics:** [LLM Inference: Prefill & Decode](https://getaimath.com/dictionary/category/llm-inference-prefill-and-decode/)
- **Last updated:** 2026-11-25

## What is Inference Pipeline?

**In one sentence:** An inference pipeline is the full chain of steps from receiving a request to returning the model's answer.

It can include checking the input, tokenizing, retrieving documents, running the model, applying safety filters, and formatting the output. Each step adds a little time.

![How an AI Replies: 1. Read Your Question → 2. Type the Answer — Simple two-step cartoon: Step 1 (Prefill) shows the AI scanning your entire question in one flash (causing the brief pause before it starts talking); Step 2 (Decode) shows it typing out the reply one word at a time.](https://getaimath.com/diagrams/llm-inference-prefill-and-decode.png)
*Napkin Diagram (LLM Inference: Prefill & Decode): Every AI reply has two halves: gulping down your whole prompt at once, then speaking the answer one word at a time.*

## What is an example of Inference Pipeline?

A chatbot pipeline might be: user message → safety check → search knowledge base → LLM → format answer → send.

## Why does Inference Pipeline matter?

Speeding up an AI app often means improving the whole pipeline, not just the model.

## Related Concepts

- [Inference Engine](https://getaimath.com/dictionary/inference-engine/): An inference engine is software built to run trained AI models quickly and efficiently.
- [Prefill](https://getaimath.com/dictionary/prefill/): Prefill is the first step of answering, where the model reads your whole prompt at once and builds its memory of it.
- [Inference](https://getaimath.com/dictionary/inference/): Inference is when a trained AI model is actually used to give answers, instead of still learning.
- [Decode](https://getaimath.com/dictionary/decode/): Decode is the second step of answering, where the model writes its reply one token at a time.
- [Time to First Token (TTFT)](https://getaimath.com/dictionary/time-to-first-token-ttft/): Time to First Token is how long you wait between sending a request and seeing the first token of the answer.
- [Time Per Output Token (TPOT)](https://getaimath.com/dictionary/time-per-output-token-tpot/): Time Per Output Token is the average time it takes to generate each new token after the first one.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/inference-pipeline/)
