Skip to content
AI360XpertBeta
Glossary
Definition

Sequence Packing

A training data optimization where multiple short sequences are concatenated into a single context window to eliminate wasted padding tokens.

Think of It Like This

Like tightly packing multiple small packages into a single large shipping container so the cargo ship doesn't waste any empty space.

Without packing, a GPU processing a sequence length of 4096 would waste massive amounts of compute simply padding a 500-token document with zeros. Packing maximizes hardware utilization. A special attention mask is applied to prevent tokens from one document from incorrectly paying attention to tokens in an unrelated packed document.