Request-level batching runs until the longest sequence ends. Iteration-level batching gives a finished slot a new request on the next decode step.
Each worker runs an inference engine. How the engine forms decode batches decides how much of the GPU does useful work.
Request-level batching runs a batch until every sequence in it finishes. Slots that finished early sit idle.
Iteration-level scheduling, from the Orca paper (OSDI 2022), runs the model one step at a time, and the batch can change between steps. The vLLM paper says it plainly: after each step, finished requests leave the batch and new ones join. You'll also hear it called continuous batching.
Put a number on it:
That's request-level batching. At the iteration level, each finished slot takes a new request on the next step, so the slots stay busy.
That's also what makes batch filler possible. A batch request can join a running decode batch at the next step, and be evicted at a step boundary.
In the editor, write request_level(lengths, slots) and iteration_level(lengths, slots): the decode steps to finish every request, one way and the other. Each length is one request's tokens, and slots is how many sequences the decode batch holds.