How it works
In static batching, a group of requests starts together and the batch stays fixed until every answer is finished. Short answers wait for long ones, and the hardware idles. Continuous batching, also called iteration-level or dynamic batching, checks after every step: when a sequence ends, a waiting request takes its place. Orca introduced the idea of scheduling at the granularity of an iteration instead of a request, together with selective batching of operations.
Hugging Face adds two supporting ideas. Ragged batching joins sequences end to end and uses attention masks so they do not interact, avoiding padding. Chunked prefill splits long prompts so that prompt processing and decoding can share a batch.
A small example: four requests need 20, 40, 80 and 160 tokens. A static batch runs 160 steps, and the slots that finish early sit idle, so only 300 of 640 slot-steps do useful work, or 47%. With continuous batching, each freed slot is refilled at once.