Structure-Preserving RAG for Machine Learning Document Queries
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing machine learning-based query processing systems struggle with handling tabular data structures due to limitations in prompt size and inability to comprehend and maintain the structural format of tables, leading to incorrect answers and loss of data structure during extraction.
Innovation Solution
Implementing an enhanced Retrieval Augmented Generation (RAG) approach with table comprehension that includes indexing and formatting tabular data structures, allowing them to be inserted into and extracted from Large Language Models (LLMs) while maintaining their format, and using prompt engineering to ensure relevant tables are included in the answers.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If tabular data structures are extracted and processed using conventional machine learning systems, then the processing speed is improved, but the structural format of tables is lost and data integrity deteriorates
Solution Approach 1:
The system segments tabular data into distinct components (table headers, table body, formatting elements) and processes each segment separately using appropriate methods, then reassembles them to maintain structural integrity while achieving processing efficiency
Solution Approach 2:
The patent introduces an intermediary processing layer that acts as a mediator between the extraction phase and the machine learning processing phase. This intermediary maintains tabular structure representations and ensures they are preserved through the processing pipeline, preventing data structure loss while enabling efficient processing
2Measurement precision
If prompt size is increased to include more contextual information for better query understanding, then the accuracy of answers is improved, but the prompt exceeds system size limitations
Solution Approach 1:
The system extracts only the most relevant contextual information and tabular data needed to answer the query, removing unnecessary content from the prompt. This extraction process maintains answer accuracy by including critical information while keeping the prompt within size limitations
Solution Approach 2:
The patent applies partial action by including only the portion of contextual information that is necessary for answering the query, rather than providing complete or excessive context. This selective inclusion optimizes the balance between prompt comprehensiveness and size constraints
3Productivity
If conventional extraction methods are used to retrieve tabular data, then the extraction speed is improved, but the ability to comprehend and maintain table structure deteriorates
Solution Approach 1:
The system performs preliminary actions by pre-processing and structuring tabular data before the main extraction and processing phases. This includes creating structured representations of tables with preserved formatting and relationships, enabling both fast extraction and reliable structure comprehension during subsequent processing
Data Source
AI summary
An apparatus comprises at least one processing device configured to obtain a query comprising search text and a context identifying documents including tabular data structures to be searched using the search text, and to generate document chunks by parsing the documents, the tabular data structures being replaced in the document chunks with tabular data structure representations that maintain tabular formatting of the tabular data structures. The at least one processing device is further configured to select a subset of the document chunks based at least in part on determining a similarity between the document chunks and the search text, to generate a prompt for input to a machine learning system comprising the selected document chunks, and to provide an answer to the query that comprises content from at least one of the tabular data structures based at least in part on an output of the machine learning system.


