# Prompt Processing

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

## What is Prompt Processing?

**In one sentence:** Prompt processing is the model reading and understanding your input before it starts writing an answer.

It is another name for the prefill work. Speed is usually measured in prompt tokens per second, and it is often much faster than generation because tokens are handled in parallel.

![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 Prompt Processing?

A laptop might process prompts at 500 tokens per second but generate at only 30.

## Why does Prompt Processing matter?

Fast prompt processing matters for long documents and big chat histories.

## Related Concepts

- [Tokens Per Second (TPS)](https://getaimath.com/dictionary/tokens-per-second-tps/): Tokens per second is how many tokens a model produces, or processes, every second.
- [Token Generation](https://getaimath.com/dictionary/token-generation/): Token generation is the model producing new tokens one after another to form its answer.
- [Time to First Byte (TTFB)](https://getaimath.com/dictionary/time-to-first-byte-ttfb/): Time to First Byte is how long it takes from sending a request until the first bit of data comes back.
- [Autoregressive Generation](https://getaimath.com/dictionary/autoregressive-generation/): Autoregressive generation is creating output one step at a time, where every new token depends on all the tokens before it.
- [Inter-Token Latency (ITL)](https://getaimath.com/dictionary/inter-token-latency-itl/): Inter-token latency is the time gap between one generated token and the next.
- [KV Cache](https://getaimath.com/dictionary/kv-cache/): The KV cache is the model's short-term memory of the keys and values it already computed for earlier tokens.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/prompt-processing/)
