Data and Knowledge SystemsKnowledge representation and evidenceStaff
When should a retrieval system embed individual sentences instead of larger passages?
By Amit Kumar4 min readWorked answer includedReviewed 26 Sept 2026
The question
Interview question
You maintain a retrieval-augmented generation system that answers questions from technical manuals. In a small evaluation, retrieving individual sentences finds more labeled answers than retrieving paragraphs. Would you adopt sentence embeddings for the full corpus? Explain how you would preserve the evidence needed for a correct answer, measure the cost, and evaluate the change. Scanned documents then produce twice as many sentence records after optical character recognition.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
A sentence can be an excellent search target without being enough evidence for an answer. “The limit is 30 days” might match a query perfectly, while the heading says it applies only to trial accounts. The design needs to solve two related problems: find the relevant text, then give the answering model enough surrounding information to interpret it correctly.
An embedding represents text as a vector, a list of numbers used to compare it with a query. A short sentence can isolate one idea that a paragraph embedding mixes with several others. That can help when a user asks about a specific error or threshold. The same isolation removes context such as a subject, unit, exception or product version. Better sentence retrieval therefore does not establish that the final answer is better.
Consider a hypothetical manual with the heading “Enterprise accounts,” the sentence “Cancellation is allowed within 30 days,” and a following paragraph excluding custom contracts. Retrieving only the sentence can produce a confident answer for the wrong customer. A useful design retrieves the small span but expands it to a coherent parent section before generation. Each sentence record carries a stable document identity, revision, section identity and source offsets. Expansion uses that same revision, so an old sentence cannot silently acquire a new parent.
This separates the retrieval unit from the answer context. The vector index may contain sentences, while the model receives paragraphs, table headers and relevant exceptions. Expansion must preserve current access rules. A permitted sentence does not authorize disclosing its whole parent document. If adjacent text has different permissions, the system needs a permitted expansion or must explain that the available evidence is incomplete.
I would compare three designs on the same source snapshot: the existing paragraph index, a repaired paragraph splitter, and sentence retrieval with parent expansion. The repair matters because the apparent sentence advantage may come from a paragraph parser that cuts tables or joins unrelated headings. Google's Document AI layout parser documentation illustrates preserving headings, tables and their contextual relationships. That is a concrete extraction approach, not evidence that one vendor or chunk size will win on this corpus.
The evaluation should distinguish finding an answer-bearing span from merely finding a topical document. Hold the query set, permissions, candidate budget and latency allowance constant. Track whether the final context contains the rule and its necessary qualifiers, whether each answer claim has support, and how often the assistant should abstain. Include questions requiring several sentences, tables, exact identifiers, exceptions and multiple document versions. A test set made entirely of single-sentence facts favors sentence retrieval by construction.
Cost also needs a mechanical estimate. Suppose, hypothetically, a million documents contain 20 paragraph records or 100 sentence records each. The new design grows from 20 million to 100 million vectors before duplication or overlap. That is five times the record count. It is not automatically five times the hardware bill, since vector size, compression, metadata, index structure and batching affect cost differently. Measure embedding work, storage, index build time, update latency and query latency. Count the larger expanded context sent to the model as well.
Now optical character recognition, or OCR, doubles the sentence records. Inspect the extracted text before purchasing more index capacity. Repeated page headers, broken punctuation and individual table cells may be mistaken for sentences. Record extraction quality and maintain a path to the original page. Remove verified duplication and repair malformed boundaries, but do not silently discard a damaged page that might contain the governing exception. A missing source should remain visible as an evidence limitation.
Sentence records can also crowd out useful diversity. Ten matches from one paragraph may occupy all the candidate slots. Collapse overlapping spans by source revision and expand them once, leaving room for a different source or exception. A per-document cap can help, but it should allow several passages when the question actually needs them. Otherwise the deduplication rule creates a new form of evidence loss.
I would approve a limited, reversible experiment if it improves supported answers within the operating budget. A mixed design may be best: sentence or line retrieval for error codes, structured extraction for tables, and section retrieval for policy questions. Keep the previous index available for comparison and rollback. The decision depends on how much usable evidence reaches the answerer, including its conditions, rather than on the smallest unit that wins a recall chart.
Related questions
- How should an assistant resolve conflicting policy sources when the authoritative source is unavailable?Staff
- How should a RAG pipeline preserve table cells, headers and footnotes for accurate numerical answers?Staff
- How would you build an evidence-backed impact graph for consumers of a changing event schema?Principal
Keep practising data and knowledge systems
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux