Zuhal Karadavut
Theme

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.

Gain in evidence recall@5, with the 95 % interval (points)
no differencevs fixed, 256 tokens+9.3results/comparisons.jsonvs fixed, 128 tokens+11.7results/comparisons.jsonvs recursive, 256 tokens+1.2results/comparisons.jsonvs recursive, 128 tokens+3.3results/comparisons.json

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
pytest

Runs 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.

The repository on GitHub

Limits

  • One domain (financial reports), one small embedding model, English only.
  • Retrieval only: no language model answers were scored.

Built with

  • Python
  • sentence-transformers
  • multilingual-e5-small
  • NumPy
  • GitHub Actions