RAG Pipeline Context Partitioning for Long-Document LLM Reasoning
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Large Language Models (LLMs) face challenges in processing long documents, maintaining coherence, and performing long-range reasoning, particularly in domains like legal, engineering, and healthcare, due to the 'attention span problem', which leads to performance drops with lengthy inputs. Current Retrieval-Augmented Generation (RAG) systems struggle with inefficient document chunking and lack sophisticated mechanisms for adapting to different queries and documents, resulting in sub-optimal retrieval and generation performance.
Innovation Solution
The system employs a multi-level approach using iterative attention focusing (LASER) to refine and condense document context, incorporates context-optimized retrieval (SCORE-RAG) for enhanced coherence, and utilizes Hierarchical Tokens (H-Tokens) to manage context across long documents, combining these with a network of smaller LLMs for improved performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of information
If LLMs process long documents directly, then complete context is available, but performance drops due to attention span limitations
Solution Approach 1:
The patent divides long documents into smaller chunks or segments that can be processed individually within the LLM's attention span. This segmentation allows the system to maintain context completeness for each segment while avoiding the performance degradation that occurs when processing entire long documents at once. The segmented approach enables manageable processing units that fit within model constraints.
Solution Approach 2:
The patent introduces a hierarchical dimension to document processing by creating multiple levels of context representation. Instead of processing the document in a single linear pass, the system creates layered representations (e.g., sentence-level, paragraph-level, section-level contexts) that can be combined. This dimensional approach allows complete context to be available through aggregation of hierarchical levels without overwhelming the attention mechanism at any single level.
2Productivity
If documents are chunked for processing, then attention span is managed, but coherence and semantic continuity are lost
Solution Approach 1:
The patent introduces intermediary elements such as embedding vectors, attention weights, or summary representations that act as mediators between document chunks. These intermediaries carry semantic information across chunk boundaries, allowing the system to maintain coherence while processing segments independently. The intermediary mechanisms enable context transfer without requiring the full document to be present in memory simultaneously.
Solution Approach 2:
The patent implements feedback mechanisms where processing results from one chunk inform the processing of subsequent chunks. Attention patterns, coherence scores, or semantic representations from previously processed segments are fed back into the system to guide further processing. This feedback loop ensures that semantic continuity is maintained across chunk boundaries while preserving processing efficiency benefits.
3Adaptability or versatility
If traditional RAG systems are used, then retrieval is performed, but adaptation to different queries and documents is insufficient
Solution Approach 1:
The patent implements dynamic retrieval mechanisms that adapt to different queries and documents in real-time. Instead of using fixed retrieval parameters, the system adjusts retrieval strategies based on query characteristics, document type, and context requirements. This dynamic approach allows the retrieval system to optimize for each specific interaction, improving both adaptability and precision by selecting appropriate retrieval methods for each case.
Solution Approach 2:
The patent changes key retrieval parameters such as similarity thresholds, chunk sizes, and search depths based on the specific query and document characteristics. By dynamically adjusting these parameters, the system achieves better adaptation to different scenarios while maintaining high retrieval accuracy. Parameter changes allow the retrieval process to be optimized for each specific case rather than using one-size-fits-all settings.
4Loss of information
If a single large LLM is used, then comprehensive knowledge is available, but computational resources and cost increase
Solution Approach 1:
The patent segments the knowledge processing task across multiple smaller LLMs or model instances, each handling specific aspects or domains. This segmentation allows comprehensive knowledge coverage through division of labor while reducing the computational burden on any single model. Each smaller model requires fewer resources than a single large model, yet collectively they provide equivalent or superior knowledge coverage.
Solution Approach 2:
The patent combines outputs from multiple smaller LLMs or processing instances to achieve comprehensive knowledge coverage. By merging results from specialized models or multiple processing passes, the system attains the knowledge breadth of a large model while using smaller, more resource-efficient components. The merging process synthesizes information from various sources to create a complete response without requiring a single large model to process everything.
Data Source
AI summary
A system and method of improving performance of LLMs including receiving a query, retrieving relevant documents for the query to form a combined context, partitioning the combined context in context partitions, generating intermediate results from the context partitions using a mapper prompt, and generating a final result from the intermediate results using a reducer prompt. The final result is transmitted to a user.


