experiment Β· evergreen

AST chunks vs. plain windows

Same repo, same questions: one question of recall, MRR +0.09 β€” almost all of it symbol ranking.

What does syntax-aware chunking actually buy? We indexed the same repo twice β€” once with tree-sitter units, once with blank-line windows of the same size β€” and ran the same 42 questions.

ChunkerRecall@8MRREN proseTR prosesymbol R / MRR
tree-sitter units0.7860.6900.842 / 0.7440.684 / 0.5701.0 / 1.0
blank-line windows0.7620.5980.895 / 0.7370.632 / 0.5180.75 / 0.32

Reading it honestly

  • Recall moved by one question. MRR moved by 0.09 β€” and almost all of it is symbol queries (0.32 β†’ 1.0) plus the Turkish slice.
  • On English prose the plain windows were equal or better.
  • So AST chunking does not find more. It puts the right piece on top and knows its name. That is worth having; it is not a 20-point lever.

The literature agrees

The cAST paper reports +1 to +4 points over same-size line windows. An independent controlled replication found β‰ˆ 0, and a third found the fixed windows slightly ahead. Naive function-per-chunk is reliably worse (βˆ’4 to βˆ’6 pp) β€” the value sits in merging small siblings and capping size, not in the syntactic boundary itself. Reranking and LLM-written context move retrieval 3–10Γ— more.

#ablation #chunking #cast

See this note on the whiteboard β†’

AST chunks vs. plain windows | Furkan Portakal