RAG Pipeline Context Partitioning for Long-Document LLM Reasoning

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering Contradiction Analysis

1Loss of information

If LLMs process long documents directly, then complete context is available, but performance drops due to attention span limitations

Engineering Contradiction:
Improvecontext completenessVSAvoidperformance accuracy
Core Design Contradiction:
Loss of informationVSReliability

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.

Inventive Principle:
Principle #1Segmentation

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.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Productivity

If documents are chunked for processing, then attention span is managed, but coherence and semantic continuity are lost

Engineering Contradiction:
Improveprocessing efficiencyVSAvoidsemantic coherence
Core Design Contradiction:
ProductivityVSStability of the object's composition

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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.

Inventive Principle:
Principle #23Feedback

3Adaptability or versatility

If traditional RAG systems are used, then retrieval is performed, but adaptation to different queries and documents is insufficient

Engineering Contradiction:
Improvequery adaptationVSAvoidretrieval accuracy
Core Design Contradiction:
Adaptability or versatilityVSMeasurement precision

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.

Inventive Principle:
Principle #15Dynamics

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.

Inventive Principle:
Principle #35Parameter changes

4Loss of information

If a single large LLM is used, then comprehensive knowledge is available, but computational resources and cost increase

Engineering Contradiction:
Improveknowledge coverageVSAvoidcomputational cost
Core Design Contradiction:
Loss of informationVSUse of energy by moving object

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.

Inventive Principle:
Principle #1Segmentation

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.

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS12405979B2Method and system for optimizing use of retrieval augmented generation pipelines in generative artificial intelligence applications
Publication Date: 2025.09.02 MADISETTI VIJAY
  • US12405979B2 patent drawing
  • US12405979B2 patent drawing
  • US12405979B2 patent drawing

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.