Skip to content
Sign in

What is Chunking?

Chunking is the process of breaking large datasets, documents, or files into smaller, fixed-size or semantically meaningful segments. It is a common data preprocessing step in AI/ML pipelines to manage memory and enable efficient processing.

Chunking splits data according to rules such as byte limits, token counts, sentence boundaries, or topic shifts. The resulting pieces are easier to store, index, and feed into models that have context-length restrictions.

In practice, chunking often includes overlap between adjacent chunks to preserve context across boundaries. Overlap size and chunk size are tunable hyperparameters that trade off between completeness and computational cost.

The technique supports parallel processing, streaming, and retrieval operations because each chunk can be handled independently by different workers or stored in vector databases.

Example

A 100-page PDF report is split into 500-word chunks with 50-word overlaps so each chunk can be embedded and stored separately for a retrieval system.

Why it matters

Modern AI systems routinely handle data volumes far larger than model context windows or single-machine memory, making chunking essential for scalable training, fine-tuning, and retrieval-augmented generation.

Frequently asked questions

Tokenization breaks text into individual tokens or subwords, while chunking groups those tokens into larger segments for processing or storage.