chunk by heading or fixed 512 with overlap for 300 page pdf manuals chunking
Equipment manuals, roughly 300 pages each, 40 of them. Numbered sections and subsections, plenty of tables, some two-column pages. Answers need to be precise because people are following procedures. Is heading-based splitting worth the extra parsing code or is fixed-size with overlap good enough?
@frosting_fixer · 8mo ago · 3 replies
Heading-aware with a size cap: split on headings, then split any section over ~700 tokens on paragraph boundaries so one enormous section does not become one useless chunk.
But the thing that will move your numbers most is smaller than either option — prefix every chunk with its heading path.
It gives the embedding topic context that the paragraph itself often omits ("then turn the valve clockwise" means nothing standalone), and it gives the model a breadcrumb to cite. Costs 15 tokens a chunk.
And before any of this: look at what your PDF extractor produces. Two-column pages and tables are where naive extraction turns text into nonsense, and no chunking strategy recovers from that.
Reply
Report
@layer_shift_lu · 8mo ago
Our extractor was interleaving the two columns line by line. Every chunk from those pages was word salad and I had spent two days tuning overlap on top of it.
Reply
Report
@mise_en_mess · 8mo ago
Print 20 random chunks and read them. That is the entire debugging technique for this stage and almost nobody does it before reaching for a fancier splitter.
Reply
Report