What is structure-based chunking?
Structure-based chunking is a chunking method that splits content according to the explicit organization already present in the source document.
Instead of deciding boundaries only by length or semantic similarity, it uses structural signals such as headings, sections, slides, table boundaries, or HTML elements.
How structure-based chunking works
A parser first identifies the document's structural elements.
Possible boundaries include:
- Chapters
- Headings
- Subheadings
- Paragraph groups
- Markdown sections
- HTML sections
- Slides
- Tables
- FAQ entries
- Code sections
Each logical unit can then become a chunk or a starting point for further splitting.
Simple example
Suppose a technical document contains:
Authentication
API Keys
OAuth
Billing
Invoices
RefundsA structure-based chunker can keep the authentication content separate from billing because the headings already define meaningful boundaries.
Large sections may still need further splitting
A document section can be structurally correct but too large for efficient retrieval.
In that case, a common approach is:
Split by document structure
↓
Section fits target size?
↙ ↘
Yes No
↓ ↓
Keep it Split further by
paragraphs, sentences,
or another strategyThis means structure-based chunking is often combined with recursive or size-based splitting.
Preserve the heading path
When a subsection becomes a chunk, keep its parent hierarchy as metadata.
For example:
Security > Authentication > Token ExpirationThis gives the retrieved chunk context even when it is separated from the rest of the document.
Advantages
Structure-based chunking can:
- Preserve the author's original organization
- Keep related content together
- Reduce arbitrary splits
- Improve chunk interpretability
- Preserve useful hierarchy for retrieval and citations
- Work naturally with structured formats such as HTML, Markdown, DOCX, PPTX, and well-parsed PDFs
Limitations
It depends on the quality of the source structure and parsing.
Problems can occur when:
- Headings are missing or inconsistent
- PDF structure is not detected correctly
- Sections are extremely large
- Formatting does not reflect real semantic boundaries
For poorly structured documents, recursive or semantic chunking may provide better fallback behavior.
Structure-based vs semantic chunking
Structure-based chunking follows explicit document organization.
Semantic chunking detects changes in meaning, even when no heading or structural marker exists.
The two approaches can also be combined.
When is structure-based chunking useful?
It is especially useful for:
- Technical documentation
- Policies and manuals
- Markdown files
- Web documentation
- Presentations
- Reports with clear headings
- Documents containing tables or distinct sections
For the meaning-based alternative, see “What is semantic chunking?”.
In short, structure-based chunking uses the source document's existing organization to create meaningful retrieval units, while applying smaller fallback splits when a structural section is still too large.
Learning Sequence
Retrieval-Augmented Generation Curriculum
Explore Related Questions
Deepen your understanding across related Retrieval-Augmented Generation topics.