Sub topic 5
Writing passages that survive being lifted out of context
This chapter assumes you know basic HTML (headings, paragraphs, lists, tables) and have written or edited web content such as docs, blog posts or help articles. It also assumes you have read the earlier chapters on how retrieval splits pages into passages and on putting the answer first.
A self-contained passage is a block of text that a reader, or a language model, can understand without seeing anything else on the page. AI answer systems often retrieve a passage and show it, or paraphrase it, away from the page it came from. If the passage depends on words that sit elsewhere, the meaning breaks. This chapter shows how to find those dependencies and remove them.
Why context goes missing
Retrieval systems split pages into chunks, score each chunk against the user's question, and pass the best chunks to a model. Chunk boundaries vary by system. They often follow headings, paragraph breaks or a fixed length, and you cannot see where they fall. Any sentence can end up first in a chunk, with nothing before it.
Three things usually disappear when a passage is lifted out:
- The page title and the headings above it.
- The paragraphs before it.
- The visual layout, such as a table next to it, a screenshot, or a sidebar.
Writing for this means assuming that the passage may be the only thing the reader sees. No technique guarantees this will happen in a given system, but a passage that holds up alone also reads better to humans who skim.
The main sources of broken passages
Dangling pronouns and references
Words such as "it", "this", "they", "the above" and "as mentioned" point to something earlier. When the earlier text is missing, the pointer has no target.
Weak:
It supports three modes. The first one is the default, and this is why most
teams never change it.
Better:
The `rsync` command supports three transfer modes. The default mode, archive
mode, preserves permissions and timestamps, so most teams never change it.The fix is to repeat the noun. A repeated noun feels slightly heavy to the writer, but it costs the reader nothing and removes the ambiguity.
Relative position words
Phrases like "see the table below", "in the previous section", "the second option" and "as shown in the figure" assume a fixed layout. Replace them with a statement of the content itself.
Weak:
As shown in the table above, the Pro plan is cheaper per seat.
Better:
The Pro plan costs $12 per seat per month. The Team plan costs $15 per seat
per month.If a table or figure matters, state its main finding in a sentence next to it. The table still helps readers, and the sentence carries the claim when the table is lost.
Unnamed subjects and products
A page about one product often never names it in the body, because the title already does. Once the passage is separated from the title, "the tool" or "our platform" means nothing. Name the product, version and scope at least once in each section that makes a claim about it.
Unstated scope and conditions
A claim that is true only under certain conditions turns false when the conditions are dropped. "The limit is 100 requests per minute" may hold only for the free tier or only for one API version. Put the condition in the same sentence as the claim.
Weak:
The limit is 100 requests per minute.
Better:
On the free tier of the v2 API, the limit is 100 requests per minute per key.Unexplained terms
A term defined on page one and used on page six is undefined for a lifted passage. Re-define it briefly where you use it, or phrase the sentence so the meaning is clear from context. A short appositive is enough: "a time-to-live (TTL), the number of seconds a cached response stays valid".
A worked rewrite
Here is a section from a hypothetical help article on cache expiry. Read it as if it were the only thing on screen.
## Setting it up
Once you have done the above, open the file and change the value. This will
make it expire sooner, which is what most people want. Note that it only
applies to the second type, as discussed earlier.The reader cannot tell what "it" is, which file, what value, or what the "second type" is. Rewrite it by asking, for each sentence, what noun the pronoun stands for and what condition limits the claim.
## How do I shorten the cache expiry in Nginx?
To shorten cache expiry in Nginx, set the `proxy_cache_valid` directive to a
smaller time in your site's server configuration file. For example,
`proxy_cache_valid 200 5m;` keeps successful (HTTP 200) responses for five
minutes instead of the longer value you had before.
This directive only affects responses that Nginx caches itself through
`proxy_cache`. It does not change the `Cache-Control` headers that your
application sends to browsers.The rewrite does four things. The heading names the product and the task. The first sentence answers the question. The example gives a concrete value. The last paragraph states a limit that the original hid behind "the second type".
A checklist for each passage
Run this check on every paragraph or short section that carries a claim you want quoted.
- Cover everything above it, including the title and headings. Is the subject still named?
- Find every pronoun and demonstrative ("it", "this", "that", "they"). Does each have a noun in the same passage?
- Find every phrase that points to position ("above", "below", "earlier", "next"). Replace it with the content it points to.
- Check each claim for conditions: version, plan, region, date, platform. Is each one in the same sentence?
- Check each term of art. Is it defined or clear here?
- Read it aloud as a stranger would. Would a one-line quote still be true?
Length and shape
Chunk sizes differ between systems, so there is no single correct length. A practical target is a passage of roughly 40 to 150 words that makes one point. Shorter passages tend to lack the conditions and examples that make a claim useful. Longer ones mix several ideas, and a chunk boundary may then split the answer from its qualification.
| Passage shape | Effect when lifted out | Fix |
|---|---|---|
| One idea, 40 to 150 words | Usually complete | Keep it |
| Several ideas in one paragraph | May be cut mid-point | Split into separate paragraphs, each with its own subject |
| A claim in one paragraph, its condition in the next | Condition may be lost | Move the condition into the claim's sentence |
| A long list with an introduction far above it | List has no context | Repeat the topic in the list's lead-in line |
| A table with no sentence about it | Meaning depends on layout | Add one sentence stating the main finding |
Lists need a lead-in that stands alone
A list item such as "Restart the service" means little without the sentence that introduces it. Write the lead-in so that it names the task, and write items as full actions with their objects.
<section id="reset-a-password">
<h2>How do I reset a user's password in Keycloak?</h2>
<p>To reset a user's password in Keycloak, an administrator sets a temporary
credential in the admin console. The user must change it at next login.</p>
<ol>
<li>Open the Keycloak admin console and select the user's realm.</li>
<li>Go to Users, then open the user's Credentials tab.</li>
<li>Choose Reset password and enter a temporary password.</li>
<li>Leave Temporary switched on so Keycloak forces a change at next login.</li>
</ol>
</section>Each step names the product area and the object. If a retrieval system quotes only the list, it is still usable.
Edge cases and trade-offs
Repetition versus readability. Repeating a product name in every paragraph reads awkwardly in a long narrative piece. Apply the rule where it matters: in sections that answer a question, make a factual claim, or give steps. Leave story-style introductions and transitions alone.
Sections that depend on each other. Some content is truly sequential, such as a tutorial where step 5 needs the files from step 2. Do not try to make every step independent. State the prerequisite in the step: "After you have created the config.yaml file in step 2, run...". The passage then carries its own dependency instead of hiding it.
Dates and "currently". Words like "now", "currently", "latest" and "new" lose meaning once a passage is copied or the page ages. Give a version or a date: "As of version 4.2, released in March 2025". The chapter on keeping answers accurate covers how to review these on a schedule.
Over-qualifying. Adding every condition to every sentence makes text unreadable. Include the conditions that change the truth of the claim. Leave out the ones that only add caution.
Headings are not a substitute. A heading helps a chunker that keeps headings with their text, but some systems drop the heading or split below it. Treat the heading as a bonus. The paragraph's first sentence should still carry the subject.
Quick audit with a script
You can find many weak spots automatically. The script below scans a Markdown file for paragraphs that begin with a pronoun or contain position words. It flags candidates for review. It does not replace reading the text.
import re
import sys
START_WORDS = ("it", "this", "that", "they", "these", "those", "he", "she")
POSITION_PHRASES = [
"above", "below", "earlier", "previous section", "next section",
"as mentioned", "as discussed", "the following table", "the former",
"the latter",
]
def audit(text: str) -> list[str]:
findings = []
paragraphs = [p.strip() for p in re.split(r"\n\s*\n", text) if p.strip()]
for number, paragraph in enumerate(paragraphs, start=1):
if paragraph.startswith(("#", "```", "|")):
continue
first_word = re.match(r"[A-Za-z']+", paragraph)
if first_word and first_word.group(0).lower() in START_WORDS:
findings.append(f"Paragraph {number}: starts with '{first_word.group(0)}'")
lowered = paragraph.lower()
for phrase in POSITION_PHRASES:
if re.search(r"\b" + re.escape(phrase) + r"\b", lowered):
findings.append(f"Paragraph {number}: contains '{phrase}'")
return findings
if __name__ == "__main__":
with open(sys.argv[1], encoding="utf-8") as handle:
results = audit(handle.read())
print("\n".join(results) if results else "No candidates found.")Run it with python audit.py article.md. Expect false positives, such as "above" in "above 100 ms". The script only points you at paragraphs worth rereading.
Common mistakes
- Fixing pronouns but leaving "see below". Check both kinds of pointer.
- Stuffing the product name into every sentence. Name it once per passage, then use natural wording.
- Adding a conditions paragraph after the claim. Put the condition in the claim.
- Splitting one answer across two headings, so neither passage is complete.
- Relying on bold text, colour or icons to carry meaning. Formatting may be stripped, so put the meaning in words.
Exercise
Rewrite this passage so that it survives being quoted alone. The page is a help article about the "Acme Sync" desktop app, version 3. "It stores them in the folder we mentioned earlier. This only works on the paid plan, as shown in the table below." Assume the earlier text said that Acme Sync stores offline copies of files in ~/AcmeSync/Offline, and the table showed that offline access is part of the Business plan.
Show answer
A good rewrite is: "Acme Sync version 3 stores offline copies of your files in the ~/AcmeSync/Offline folder. Offline access is available only on the Business plan." The rewrite replaces "It" and "them" with the product and the object, replaces "the folder we mentioned earlier" with the actual path, replaces "the paid plan" with the named plan, and removes "as shown in the table below" by stating the table's finding. It also puts the version and plan, which are the conditions, in the same sentences as the claims.
Exercise
A step-by-step article has a numbered list whose introduction is two screens above it, and the list starts with "Click Save." Name two problems this causes when the list is lifted out alone, and give one fix for each.
Show answer
First, the list has no subject: a reader cannot tell what is being saved or in which product. Fix it by adding a lead-in line directly above the list that names the task and product, for example "To save a report template in Acme Reports, follow these steps." Second, the first step names no object or location, so it is ambiguous. Fix it by writing each step as a full action with its object, for example "Click Save in the template editor toolbar."