Retrieval-augmented generation (RAG) has a language model answer from passages fetched out of a document store. It splits documents into short pieces, called chunks, so they can be embedded and searched. That split cuts sentences off from the things they depend on. A retrieved chunk that says "he was appointed in 1998" or "the limit in this section is 5 MHz" arrives without the paragraph that names "he" or the header that says which section. The model then guesses the missing link, and it often guesses wrong. This proposal treats the repair as a database operation. For every retrieved chunk, we perform a small, typed context join that attaches the specific neighbors it depends on (the antecedent sentence, the section header, the table header row, the parent section) before generation. Here a join simply means matching each retrieved chunk to its related records. We then make that join cheap at cluster scale by borrowing the oldest trick from distributed databases: store each chunk on the same machine as its neighbors, so the join happens locally and nothing crosses the network.
The claim has two parts, and each can fail. First, a large share of RAG hallucinations on evidence-dense documents come from dependencies that sit in a few structurally typed neighbors of chunks the retriever already found. Attaching just those neighbors should cut entity-swap and bridging errors more than spending the same number of extra tokens on bigger chunks or more retrieved chunks. Second, in a sharded vector store (an index split across many machines), co-partitioning chunks by document makes both this join and hierarchical "auto-merge" exact and shard-local. It removes the gather step these methods currently need, and it fixes a quiet quality bug: each shard keeps only its own top-scoring chunks, and that cutoff drops sibling chunks that auto-merge would have counted.
Where this sits
Three pieces of prior work motivate the proposal. Factuality Enhanced Language Models for Open-Ended Text Generation shows that fragmentation in training data separates facts from their subjects and causes named-entity errors. Its fix is to prepend the document topic to every chunk (TOPICPREFIX), which lowered the named-entity error rate from 33.3% to 14.5% on a 530B model. That work is parametric and open-ended and never touches retrieval. We ask the same question at inference time over retrieved context. HiChunk names fragmentation as a cause of hallucination in evidence-dense question answering. It restores scope with Auto-Merge, which returns the parent section when several of its children are retrieved. EnSI-RAG avoids mechanical chunking by building entity-centered passages from LLM-extracted tuples and reports 78.24 average accuracy on Loong and Oolong. Both run on one machine, and both need expensive LLM passes over the corpus: HiChunk reports 1.5 seconds per Qasper document for structuring. Our join uses cheap structural links, namely coreference chains from a small parser, header scope, and table membership. It does not rewrite the corpus, and it is built to run distributed.
Two other works supply methods we reuse rather than compete with. Late Chunking contextualizes chunk embeddings by encoding the whole document before pooling, reporting a ~3.6% relative nDCG@10 gain on BeIR. It improves which chunk is found, but the chunk handed to the generator is still cut off, and the method never measures hallucination. Embedding-Based Context-Aware Reranker (EBCAR) adds document-ID and position signals to rerank candidates, reaching 64.92 nDCG@10 on ConTEB at 29.33 queries per second. It assumes every candidate has been gathered onto one GPU, and it also leaves generation unevaluated.
The systems side supplies the execution design. A comparison of join algorithms for log processing in MapReduce shows that a broadcast join, which copies a small table to every worker, beats a shuffle-based join when one side is small. CoHadoop shows that placing related files on the same nodes enables map-only joins, reporting up to 60% speedup over partitioned-only Hadoop. CoHadoop also warns that co-location increases storage imbalance, which constrains our design. RORS broadcasts a small schema table against large instance data for OWL reasoning. We copy that same split: small, global metadata is broadcast and large neighbor text is co-partitioned. KVLink repairs cross-chunk attention between precomputed caches with link tokens. It fixes the model's view of fragments, not the fragments themselves, and it is complementary to our work.
Research Program
The first step is a diagnosis, and it can stop the project. On HiCBench's multi-chunk-dense tier and on ConTEB-derived question-answer sets, we run a standard chunked RAG pipeline and extract atomic claims from the answers. For each unsupported claim, we check whether the supporting evidence exists in the document and, if so, where it sits relative to the retrieved chunks. The possible locations are: the antecedent of a coreference, the governing header, the table header or row, a sibling chunk under the same parent, or somewhere unrelated. If most failures fall in the "unrelated" category, fragmentation is not the main cause, and the typed join is the wrong fix.
The second step is the join itself. At ingestion, each chunk gets a compact dependency record: pointers to the chunk holding each unresolved mention's antecedent, its header path, its table header, and its parent section ID. Building this record takes a small coreference and layout parser, not an LLM rewrite. At query time, each retrieved chunk is expanded along its pointers under a token budget $B$. A small learned scorer, trained on the diagnosis labels from step one, decides which pointer types to follow. Auto-merge becomes a group-by over parent IDs among the hits.
The third step is placement. Chunks are partitioned by document, and oversized documents are split at section boundaries. Each document's chunks, dependency records, and structural tree live on one shard. The small table of document titles and header paths is broadcast to all shards, so cross-section header lookups for split documents never shuffle. Each shard runs retrieval, the context join, and auto-merge locally. It then returns already-repaired evidence units instead of bare chunks. We measure storage skew directly and compare section-level splitting against CoHadoop-style whole-file co-location.
Baselines
The naive reference point is chunked RAG over a vector index sharded by chunk hash. It uses the same embedder, the same generator, and the same total context tokens as our system, and it performs no context repair. Everything is reported relative to this pipeline.
The simplest strong competitor is ingest-time denormalization. Following TOPICPREFIX from Factuality Enhanced Language Models, it prepends the document title and full header path to every chunk's text before embedding. This baseline is cheap and may capture most header-type fragmentation, so it runs at the same token budget. Beating it means lower unsupported-claim rates on the coreference and table subsets while staying within one point on header-only questions.
The strongest existing fragmentation method on hierarchical documents is HiChunk's Auto-Merge, run centrally with a full gather of per-shard hits. It uses HiChunk's own trees. The file reports HiChunk's highest fact-coverage and evidence recall on HiCBench's dense tiers, but no reported result found on Lacuna for an absolute HiCBench answer-quality number. We therefore rerun it under our generator and budget. On Loong and Oolong, the strongest reported number is EnSI-RAG's 78.24 average accuracy (EnSI-RAG). We run it with its LLM extraction cost counted as indexing compute. Matching it within two points at a small fraction of its indexing cost would count as success, and exceeding it is not required. For retrieval-only comparisons on ConTEB, the reference is EBCAR's 64.92 nDCG@10, and we also combine Late Chunking embeddings with our join to test whether the gains add.
Three ablations isolate the key ingredients. The first replaces typed pointers with an untyped window of adjacent chunks at equal tokens. It tests whether structure, rather than simply more nearby text, is what helps. The second runs the identical join on hash-sharded storage with a central lookup. Answer quality should match, so this isolates the placement effect on network bytes and latency. We also run hash-sharded auto-merge with per-shard top-k truncation, to measure how many sibling hits truncation loses. The third holds everything else fixed and enlarges chunk size or retrieval depth to spend the same tokens.
Why not just…?
Why not just prepend titles and headers to every chunk at ingestion? This is the real threat, and we expect it to win on questions whose only missing context is a header. It cannot resolve a pronoun whose antecedent sits three paragraphs back. It cannot attach a table header row when the relevant row can be anywhere. Any header change also requires re-embedding every affected chunk. The diagnosis step will show what fraction of failures each approach can address in principle. If header-type failures dominate, we will report that denormalization is sufficient and narrow the claim to coreference-heavy and tabular corpora.
Why not just retrieve bigger chunks or more of them? Bigger chunks spend tokens on text that does not help, and they push evidence into the middle of long prompts. The file notes that even frontier models suffer "lost in the middle" degradation (EnSI-RAG). Landmark Embedding shows targeted retrieval beating full context with roughly 2,190 versus 15,500 tokens. The equal-token ablation tests this directly. If larger windows match the typed join, the join adds nothing, and we will say so.
Why not just gather hits centrally and fetch neighbors from a document store? For a single interactive query with top-20 retrieval, this is nearly free, and we do not claim otherwise. The case for shard-local execution rests on two regimes. The first is batch RAG over millions of queries, such as evaluation sweeps or synthetic data generation. There, the neighbor fetch becomes a large join, and the join literature shows shuffle cost dominating (A comparison of join algorithms). The second is the exactness of auto-merge under per-shard truncation. The hash-sharded ablation measures both effects. If quality loss from truncation is negligible and batch savings are small, the systems half of the claim fails, while the hallucination half stands on its own.
Why not just fix it at decoding time? Factual-nucleus sampling trades diversity for fewer entity errors (Factuality Enhanced Language Models). It also cannot recover a referent that is absent from the context (Siren's Song in the AI Ocean). We report it as an orthogonal add-on rather than a competitor.
Proposed Experiments and Decisive Checks
The benchmarks are the HiCBench dense tiers ($T_1$, $T_2$), the ConTEB domains (for both retrieval and derived question answering), and Loong and Oolong for multi-document aggregation. We also run FACTUALITYPROMPTS in a retrieval setting, where the generator draws on chunked Wikipedia. This lets us use its named-entity error rate as a direct entity-swap metric in RAG (code). The 33.3%→14.5% figure from that paper is parametric, so it is context only, not a target. Hallucination is measured as the rate of claims unsupported by the gold document, broken down by failure type. Because automatic faithfulness checkers are known to diverge from expert judgment, human annotators audit 300 answers per benchmark. Systems cost is measured as network bytes per query, end-to-end latency, batch throughput, and storage skew across 8, 32, and 128 shards.
Three results decide the project. The diagnosis must attribute a majority of unsupported claims to typed neighbors of retrieved chunks. Otherwise, we abandon the join. The typed join must beat both denormalization and equal-token window expansion on the coreference and table subsets. Otherwise, structure is not the ingredient that matters. Finally, co-partitioned execution must match centrally gathered quality while cutting network bytes by a large factor in batch mode, with shard skew kept within a bound we fix in advance. Otherwise, the distributed contribution reduces to an engineering note.
References
- Factuality Enhanced Language Models for Open-Ended Text Generation
- HiChunk: Evaluating and Enhancing Retrieval Augmented Generation with Hierarchical Chunking
- EnSI-RAG: Entity-Structure-Indexed Retrieval-Augmented Generation for Long-Document Question Answering
- Late Chunking: Contextual Chunk Embeddings Using Long-Context Embedding Models
- Embedding-Based Context-Aware Reranker
- A comparison of join algorithms for log processing in MaPreduce
- CoHadoop: Flexible Data Placement and Its Exploitation in Hadoop
- RORS: Enhanced Rule-Based OWL Reasoning on Spark
- KVLink: Accelerating Large Language Models via Efficient KV Cache Reuse
- Landmark Embedding: A Chunking-Free Embedding Method For Retrieval Augmented Long-Context Large Language Models
- Siren's Song in the AI Ocean: A Survey on Hallucination in Large Language Models