Rewriting a chunk so it can stand alone
A chunk comes back that reads: “This does not apply if the account was created before the change described above.” Every word in it depends on text in a different chunk. As a retrieval target it is nearly invisible, and as an answer it is worse than nothing.
Prose is written to be read in order. Chunking removes the order. The gap between those two facts is filled by pronouns, acronyms introduced once, and references to things “above” — and you can close some of it by rewriting the chunk before you embed it.
Four kinds of dangling reference
They fail differently and they need different repairs.
Anaphora. “It,” “they,” “this approach,” “the former.” The antecedent was in the previous paragraph. This is the most common by a wide margin and the easiest to fix mechanically.
Definitional dependence. An acronym or defined term introduced once at the top of the document and used bare for forty pages. The chunk containing “the RPO must be under four hours” is unfindable by anyone searching for “recovery point objective,” and unreadable by anyone who does not already know.
Positional reference. “Above,” “below,” “in the previous section,” “see Figure 3,” “as noted.” These point at a location that no longer exists once the document is a set of chunks.
Elision. The subject is simply omitted because context supplied it. Headings do this constantly —
under ## Rate limits, every following sentence says “the limit” and none says “rate limit.”
The split, shown
One paragraph of a policy document, cut small, then the same chunks rewritten.
=== AS SPLIT ===
--- chunk 7 ---
The window is measured from the delivery date, not the order
date.
--- chunk 8 ---
It does not apply to items marked final sale. Those follow
the rules described above.
--- chunk 9 ---
Where the RMA is approved, the refund is issued within the
period stated in section 4.
=== REWRITTEN FOR INDEXING ===
--- chunk 7 ---
[Returns Policy → Return window]
The 30-day return window is measured from the delivery date,
not the order date.
--- chunk 8 ---
[Returns Policy → Return window → Exclusions]
The return window does not apply to items marked final sale.
Final-sale items follow the standard exchange rules.
--- chunk 9 ---
[Returns Policy → Refunds]
Where the return merchandise authorisation (RMA) is approved,
the refund is issued within the period stated in the Refund
Timing section.
Chunk 8 was two sentences that named nothing. It is now searchable for “return window” and “final sale,” and a reader who receives only this chunk knows what it is about. Chunk 9 gained “return merchandise authorisation,” which is what a person would actually type.
Note the ordering of effort. The bracketed heading path did most of the work for free. The rewriting did the rest.
The repairs, cheapest first
1. Prepend the heading path. Not a rewrite at all, and it resolves elision outright — the chunk
under Return window no longer needs the phrase in its body. Do this before anything else; it is
the field with the best return in the whole metadata
set.
2. Expand acronyms and defined terms. Build a per-document glossary during the first pass: every pattern of the form Long Form (ABC) or “ABC” means …. Then, in each chunk, expand the first occurrence of each term to long form (ABC) and leave the rest. Deterministic, auditable, and it catches the case that costs you most, because acronyms are high-value query terms.
3. Rewrite positional references to named ones. “Section 4” becomes the section’s title, taken from the document’s own heading tree. “Above” and “below” become the nearest enclosing heading. You cannot resolve all of them and you can resolve the numbered ones exactly.
4. Resolve pronouns in the first sentence only. The first sentence of a chunk is where a dangling pronoun does the most damage, because it sets the topic. Later sentences usually have an antecedent inside the chunk. Restricting rewriting to the opening sentence gets most of the benefit for a fraction of the effort and the risk.
5. Prepend a generated context sentence. One or two sentences, written by a model, stating what this chunk is and how it relates to its document — then the original text verbatim underneath. This is the most capable option and the most dangerous, for reasons below.
Steps 1 to 3 are string manipulation over structures you already extracted. Step 5 is a model call per chunk at index time. Step 4 sits in between depending on how you do it.
What rewriting breaks
Quotation stops being quotation. If you embed the rewritten text and store it as the chunk, then whatever is shown to a user or fed to a model is not what the document says. A citation that points at a paraphrase is a citation you cannot defend, and in a policy or legal corpus that is a correctness problem, not a nicety.
The fix is structural: store the original text and the rewritten text as separate fields. Embed the rewritten one. Display, quote and cite the original. Anything else and your corpus quietly stops being a record of your documents.
Generated context can be confidently wrong. A model asked to explain what a chunk is about will answer even when the chunk is uninformative, and a wrong explanation distorts the vector more than no explanation would. Sample the output across document types before running it over a corpus, and keep the prompt and model version stored with the chunk so you know what produced what.
Pronoun resolution is genuinely hard. “It” in a paragraph with three candidate antecedents is ambiguous to a parser and sometimes to a human. Resolving it wrongly does not produce an error; it produces a chunk that is confidently about the wrong subject. This is why restricting the rewrite to the first sentence, where the antecedent is usually the section topic, is the conservative choice.
Cost scales with the corpus, and recurs. Every rewrite that involves a model call has to be redone whenever the document changes, and the rewriting stage becomes a dependency of your index.
Over-expansion dilutes. Expand every acronym on every occurrence and a chunk about recovery objectives becomes forty repetitions of the same long phrase. The vector now represents the phrase rather than the content. Expand the first occurrence, then stop.
What it does not fix
Cross-references to material that genuinely lives elsewhere. Rewriting “see the pricing table in Appendix B” to name Appendix B makes the reference legible; it does not put the table in the chunk. Answers that require both spans are not chunking problems and no amount of enrichment makes them one.
Documents whose whole argument is sequential. A proof, a narrative, a step-by-step procedure — each part depends on the last in a way that a context prefix summarises rather than supplies.
And it is not a substitute for cutting in the right place. A chunk that begins mid-clause needs a better boundary, not a better preamble. Fix where the cut falls first; enrich afterwards.
How to tell if it worked
The test is the one the technique is named for. Take fifty chunks, show a person only the chunk, and ask two questions: what is this about, and what document is it from. If they can answer both, the chunk stands alone. Do this on the same sample before and after, and count how many moved from “no idea” to “clear.”
Then check the damage in the other direction. Diff the rewritten text against the original for a hundred chunks and read the diffs. You are looking for changed meaning, not changed wording: a resolved pronoun that picked the wrong noun, an expanded acronym that was the wrong expansion, a generated preamble that asserts something the chunk does not say. If you find those at any appreciable rate, pull back to the deterministic repairs and keep the model out of it.