LLM inference, evaluation and retrieval
table-aware-chunking
Does a chunker that keeps tables whole find the evidence for a question more often than one that cuts by length, at the same size budget and with the same embedding model?
Answer
Against fixed token windows, yes: +9.3 recall@5 points at 256 tokens (95 % interval +5.7 to +13.0) and +11.7 at 128 tokens (+8.1 to +15.3), on all 1,147 FinQA test questions. Against a recursive splitter it depends on the size: no measurable gain at 256 tokens (+1.2, interval -0.6 to +3.1), +3.3 at 128 tokens.
How it was measured
- Three chunkers at the same budgets: fixed token windows, a recursive splitter that prefers paragraph and line breaks, and a structure-aware chunker that keeps each table whole or splits it into groups of whole rows with the header repeated.
- Same embedding model for all (multilingual-e5-small), searched against all 2,789 pages. Evidence recall@5: the share of a question's annotated evidence found in the top five chunks.
- Comparisons are paired per question. The intervals are bootstrap intervals clustered by page, because questions on the same page are not independent.
- The comparisons were planned before the run. One more comparison, the variant with a context sentence before each table piece against the recursive splitter, is marked in the results as added after the run.
Proof
Every file is pinned to the commit the numbers come from, so the links cannot drift.
Reproduce it
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements-dev.txt
python -m tachunk all
pytestRuns on a CPU. The command fetches and checks FinQA, chunks, embeds, searches, compares and prints every table. CI runs the tests and a small smoke run on every push.
Limits
- One domain (financial reports), one small embedding model, English only.
- Retrieval only: no language model answers were scored.