# US 12,216,717 B1 · Methods and systems for implementing large language models and smart caching with zero shot

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,216,717 B1
- Document ID: US12216717B1
- Status: Granted
- Kind: B1
- Application number: 18/611,549
- Filed: 2024-03-20
- Granted: 2025-02-04
- Earliest claimed: 2024-03-20
- Assignees: Intuit Inc.
- Applicants: Intuit Inc.
- Inventors: Itay Margolin; Eilon Sheetrit; Ido Joseph Farhi
- Web page: https://patentgrep.com/patent/US12216717B1

## CPC

- G06F 16/93: Document management systems
- G06F 12/0875: with dedicated cache, e.g. instruction or stack
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A Large Language Model (LLM) for classifying documents by identifying indicators within the documents. A smart caching mechanism stores document classifications and associated indicators output from the LLM. The database contains document details, classifications, and associated indicators. A classification module classifies a new document by analyzing it for indicators, checking the cache for a match, and querying the database for the indicators if no match is found. The module applies a majority vote based on the classifications associated with the indicators.

## Claims

### Claim 1

A document classification system, comprising:
a large language model (LLM) configured to classify documents by identifying indicators in the documents;
a smart caching mechanism configured to store classifications of documents and associated indicators from the LLM;
a database containing document details, classifications, and associated indicators; and
a classification module configured to classify a new document by analyzing the new document for indicators and checking for a match in the cache based on the indicators, querying the database for the indicators when no match for the new document is found in the cache, and applying a majority vote based on the classifications associated with the indicators.

### Claim 2 (depends on 1)

The document classification system of claim 1, wherein the LLM is a transformer-based model.

### Claim 3 (depends on 1)

The document classification system of claim 1, wherein the smart caching mechanism is configured to store the classifications of the documents and the associated indicators in a hash table.

### Claim 4 (depends on 1)

The document classification system of claim 1, wherein the database is a relational database management system (RDBMS).

### Claim 5 (depends on 1)

The document classification system of claim 1, wherein the classification module is further configured to:
classify the new document by checking for at least one of a partial match, a semantic match, or a syntactic match in the cache;
identify the indicators in the new document based on the match;
query the database for the indicators; and
apply a majority vote based on the classifications associated with the indicators.

### Claim 6 (depends on 1)

The document classification system of claim 1, wherein the classification module is further configured to:
query the database for each indicator in the new document;
collect classification results associated with each indicator;
count a frequency of each classification; and
determine the majority classification based on the counted frequencies.

### Claim 7 (depends on 1)

The document classification system of claim 1, wherein the classification module is further configured to:
determine a majority decision from a list of potential classifications, and
query the LLM for classification of the new document if there is a tie in the majority decision.

### Claim 8 (depends on 1)

The document classification system of claim 1, wherein the classification module is further configured to determine whether the classification corresponds to a new class of document not previously recognized, and update a database schema to incorporate the new class and associate relevant indicators with the new class.

### Claim 9 (depends on 1)

The document classification system of claim 1, wherein the classification module is further configured to perform a substring check for each sentence in the new document against the database, and add the classification of the document to a list of potential classifications for the new document when a sentence from the new document is a substring of a document in the database.

### Claim 10 (depends on 1)

The document classification system of claim 1, wherein the classification module is further configured to query the LLM for a classification using a natural language prompt listing an identity of the new document and a list of possible classifications.

### Claim 11

A document classification method, comprising:
classifying, by a large language model (LLM), documents by identifying indicators in the documents;
storing, by a smart caching mechanism, classifications of documents and associated indicators from the LLM;
storing, by a database, document details, classifications, and associated indicators; and
classifying, by a classification module, a new document by analyzing the new document for the indicators and checking for a match in the cache based on the indicators, querying the database for the indicators when no match for the new document is found in the cache, and applying a majority vote based on the classifications associated with the indicators.

### Claim 12 (depends on 11)

The document classification method of claim 11, wherein the LLM is a transformer-based model.

### Claim 13 (depends on 11)

The document classification method of claim 11, further comprising:
storing, by the smart caching mechanism, the classifications of the documents and the associated indicators in a hash table.

### Claim 14 (depends on 11)

The document classification method of claim 11, wherein the database is a relational database management system (RDBMS).

### Claim 15 (depends on 11)

The document classification method of claim 11, further comprising:
classifying, by the classification module, the new document by:
checking for at least one of a partial match, a semantic match, or a syntactic match in the cache;
identifying the indicators in the new document based on the match;
querying the database for the indicators; and
applying the majority vote based on the classifications associated with the indicators.

### Claim 16 (depends on 11)

The document classification method of claim 11, further comprising:
querying, by the classification module, in the database for each indicator in the new document;
collecting, by the classification module, classification results associated with each indicator;
counting, by the classification module, a frequency of each classification; and
determining, by the classification module, a majority classification based on the counted frequencies.

### Claim 17 (depends on 11)

The document classification method of claim 11, further comprising:
determining, by the classification module, a majority decision from a list of potential classifications, and
querying the LLM for classification of the new document if there is a tie in the majority decision.

### Claim 18 (depends on 11)

The document classification method of claim 11, further comprising:
determining, by the classification module, whether the classification corresponds to a new class of document not previously recognized; and
updating a database schema to incorporate the new class and associate relevant indicators with the new class.

### Claim 19 (depends on 11)

The document classification method of claim 11, further comprising:
performing, by the classification module, a substring check for each sentence in the new document against the database; and
adding the classification of the document to a list of potential classifications for the new document when a sentence from the new document is a substring of a document in the database.

### Claim 20 (depends on 11)

The document classification method of claim 11, further comprising:
querying, by the classification module, the LLM for a classification using a natural language prompt listing an identity of the new document and a list of possible classifications.
