OCR Exemplar Clustering for Out-of-Domain Data Extraction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing AI/ML systems for information extraction from documents require extensive training on thousands of labeled examples, leading to inefficiencies and high costs when dealing with infrequently encountered documents.

Innovation Solution

A method combining proprietary data with third-party LLMs, utilizing text embedding and clustering to select exemplar documents, and crafting in-context-learning prompts for improved information extraction from infrequently encountered documents.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If existing AI/ML systems are trained on thousands of labeled examples, then information extraction accuracy improves, but labeling time and cost increase significantly

Engineering Contradiction:
Improveinformation extraction accuracyVSAvoidlabeling time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system performs preliminary clustering analysis on unlabeled documents to identify representative exemplars before the information extraction task. By pre-organizing documents into clusters and selecting key representatives, the system prepares the data structure in advance, eliminating the need for extensive manual labeling while maintaining high extraction accuracy through the use of these pre-selected exemplars.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system creates synthetic training examples by copying and adapting patterns from the selected cluster exemplars. Instead of requiring thousands of unique labeled documents, the system generates sufficient training data by replicating and variations of the key exemplar patterns, significantly reducing the labeling burden while maintaining model performance.

Inventive Principle:
Principle #26Copying

2Productivity

If existing RAG models retrieve closest examples for learning, then training efficiency improves, but performance on diverse and infrequently encountered documents deteriorates

Engineering Contradiction:
Improvetraining efficiencyVSAvoidperformance on diverse documents
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The system applies different retrieval strategies to different document clusters. For frequently encountered documents, it uses standard closest-example retrieval. For diverse and infrequently encountered documents, it retrieves multiple exemplars from related clusters and uses them to construct comprehensive in-context prompts, thereby adapting the retrieval quality to the specific needs of each document type.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The system transitions from single-dimension closest-example retrieval to multi-dimensional prompt construction. It combines information from multiple clusters and exemplars into rich in-context prompts that provide diverse learning signals, effectively adding dimensions to the retrieval process to improve performance on diverse documents while maintaining training efficiency.

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

Data Source

PatentUS12632675B2In-context OCR exemplars for out-of-domain document information extraction
Publication Date: 2026.05.19 INTUIT INC
  • US12632675B2 patent drawing
  • US12632675B2 patent drawing
  • US12632675B2 patent drawing

AI summary

A method of extracting information from documents. The method simplifies the extraction of information from documents by first converting them into machine-readable text via OCR. It then employs a text embedding model to represent the text as high-dimensional vectors. These vectors are clustered to pinpoint natural groupings and representative document clusters. An example document from each cluster is chosen, guided by the number of non-empty fields and its relation to other documents. This selection informs the creation of an in-context-learning prompt, which includes accurately annotated labels and a system prompt defining the task for the LLM. The LLM is then prompted to extract information from a new document's OCR text, leveraging the constructed prompt for guidance.