PDF Handbook Answers: Tracing Citation Boundaries Across 500 and 1500 Tokens
Keep 500-token and 1500-token chunks as competing candidates, and make traceable evidence the release gate for answers over a folder of handbook PDFs. The deciding constraint is whether a reader can follow each answer back to the passage that supports it, including any qualification that changes what the answer means.
TL;DR: Neither chunk size earns a default win from the available research. Compare them on the same course-material questions, preserve document and page provenance, and withhold an answer when the retrieved material cannot support it. Choose the configuration whose cited passages support complete answers under your actual context budget.
For a developer-tools team building course material Q&A, the operational unit is a question, an answer, and the PDF evidence a learner can inspect. A green retrieval dashboard cannot establish that relationship. Before interpreting any aggregate score, ask what page fired: which PDF page supplied the assertion, which passage supplied its exception, and which evidence actually reached the generator?
What page fired when the answer lost its qualification?
Start the runbook with a hypothetical failure report: a learner asks whether a course exercise permits an alternative submission method, and the answer cites the general submission instructions without establishing whether an exception applies. This is a proposed diagnostic example, not a reported incident. The response may sound complete. Its citation still needs inspection.
Trace the evidence.
For this example, inspect the extracted PDF text around the general rule and the exception, then compare that text with the indexed chunks, retrieved candidates, final prompt context, and answer citations. A missing qualification could enter at any of those boundaries; changing the chunk size before locating the loss would leave the cause unresolved. If extraction omitted the relevant passage, neither candidate configuration has evidence from which to recover it. If the passage was indexed but excluded from the final context, investigate that selection separately.
The original retrieval-augmented generation paper describes generation conditioned on retrieved passages and evaluates knowledge-intensive tasks. It supplies a foundation for this architecture, but it does not settle a universal 500-versus-1500-token policy for a particular folder of PDFs. Treat the size choice here as a local design decision that requires evidence, rather than attaching the paper's authority to an unsupported numerical recommendation.
That distinction matters during a postmortem. A statement such as “the retriever returned a result” leaves unanswered whether that result supported the answer the learner received.
Should handbook chunk size be 500 or 1500 tokens?
Use two candidate indexes built from the same extracted documents: one targeting 500 tokens per chunk and one targeting 1500. Record the tokenizer, boundary policy, overlap policy, document revision, and extraction version beside each configuration. These are proposed experiment settings, not measurements. Without those records, the labels describe too little to explain a difference after deployment.
The trade-off to investigate is evidence locality. A smaller window may isolate the rule the question asks about while leaving its qualification outside the window; a larger one may include both while also admitting material that does not answer the question. Neither outcome follows from the number alone. Inspect where headings, tables, examples, and exceptions land in the actual PDFs before deciding whether either concern applies. Keep the search window and the displayed citation distinct in the data model. The generator can receive a selected window while the answer points to a narrower supporting passage, provided that passage is actually present in the supplied evidence. For a chunk crossing PDF pages, retain the page span and the mapping from extracted text to those pages. Don't turn a multi-page window into a citation to whichever page happened to start it.
Preserve the qualification.
This adds bookkeeping. It also gives the responder something concrete to inspect when a learner disputes an answer, whereas a chunk identifier alone requires reconstructing the index state before anyone can even locate the claim. The extra provenance is a deliberate operational trade-off.
Put a provenance gate before answer generation
The following Go example defines a small local boundary for accepting evidence. It checks that the selected chunk has a source revision, a valid page range, and an exact excerpt within its text. It does not tokenize PDFs, retrieve candidates, or establish that an excerpt logically supports a claim. Those responsibilities remain explicit so a successful structural check cannot masquerade as a grounding verdict.
package evidence import ( "errors" "strings" ) type Chunk struct { ID string Document string Revision string FirstPage int LastPage int Text string } type Citation struct { ChunkID string Excerpt string } func Validate(chunk Chunk, citation Citation) error { if chunk.ID == "" || citation.ChunkID != chunk.ID { return errors.New("citation does not identify this chunk") } if strings.TrimSpace(chunk.Document) == "" || strings.TrimSpace(chunk.Revision) == "" { return errors.New("missing source provenance") } if chunk.FirstPage < 1 || chunk.LastPage < chunk.FirstPage { return errors.New("invalid source page range") } if strings.TrimSpace(citation.Excerpt) == "" || !strings.Contains(chunk.Text, citation.Excerpt) { return errors.New("excerpt is absent from supplied evidence") } return nil } Use one documented page-number convention throughout this boundary and the reader interface; if printed page labels differ from PDF page positions, preserve the distinction. Validate against the exact evidence supplied for generation, not an unrelated current copy of the document. Otherwise a revision change can make a citation impossible to reproduce even though its identifier still resolves.
Rejecting an invalid citation should produce a bounded outcome: retry with supported evidence if the request budget allows, or return an insufficient-evidence response. Don't silently remove the citation and publish the same assertion. Require a separate check of whether the passage supports the answer, because a quote can exist in a source without establishing the claim attributed to it.
Keep the evidence trace available for debugging under the application's access rules. Record candidate identifiers, selected passages, source revisions, context truncation decisions, and citation-validation outcomes. A dashboard is useful for locating a request. The request's evidence is what explains it.
Verify the comparison under a fixed question set
Before release, prepare questions whose expected support a reviewer can locate in the course PDFs: a direct definition, a rule with an exception, a question requiring neighboring passages, and a question the folder cannot answer. These are test categories, not claims about a measured dataset. Include the hypothetical submission-method question only if the real documents contain the corresponding rule and qualification.
Run both chunking candidates against the same document snapshot and question set, holding the generation settings and context budget constant. Record how many chunks and tokens each run actually supplied. Equal candidate counts and equal context budgets answer different questions; a comparison that changes both without recording them cannot isolate the practical effect of the chunking policy.
Inspect complete answer support, citation correctness, and appropriate refusal separately. For each unsupported answer, identify whether the necessary passage survived extraction, appeared in the index, reached the generator, and was represented accurately in the response.
That sequence gives a failure a location.
An average score does not.
Also record latency and resource use, because a configuration that requires additional retrieval or a larger supplied context must fit the service's operating limits. No price estimate is needed to make that constraint visible. Keep observed measurements attached to this corpus and workload; don't publish them as a general law about token counts.
Choose after inspection.
If neither candidate preserves the necessary evidence, revise the boundary policy or passage selection and repeat the comparison. Accepting the less bad unsupported answer would defeat the release gate.
Roll back the evidence configuration as a unit
Release the selected configuration with an identifiable index snapshot, extraction settings, chunking policy, and citation mapping. Define the rollback trigger before rollout: for example, a reviewed answer whose citation omits a required qualification, or a citation that cannot resolve to its recorded source revision. Those are proposed triggers; the team must set its own latency and availability limits.
On a trigger, retain the affected request trace and restore the previous validated configuration as a unit. Replaying the failed question against both snapshots should establish whether the evidence path changed and where. If neither snapshot supports the answer, withhold that answer and repair the evidence path before reopening it.
The decision between 500 and 1500 tokens belongs at the end of that investigation. For handbook PDF questions, the defensible choice is the one that lets a learner verify a complete answer and lets the on-call engineer reconstruct why it was given.
References
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks: https://arxiv.org/abs/2005.11401