IP Library Granted Patent US 12,259,913
Granted Patent B1
US 12,259,913 · App. 18/441,863 · Granted Mar 25, 2025

Caching large language model (LLM) responses using hybrid retrieval and reciprocal rank fusion

Inventors: Brien H Muschett (Palm Beach Gardens, FL); Justin G Odom (Jupiter, FL)
Assignee: Inventus Holdings, LLC
G06F16/3326G06F16/3329G06F16/3347G06F16/335G06F16/38
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,259,913
App. No.
18/441,863
Granted
Mar 25, 2025
Kind
B1
Abstract

A system and method for improving computer functionality by retrieving answers/responses to questions/input from a cache such as those used with chatbots and generative AI systems. Disclosed is a multi-layered caching strategy that focuses on the relevance of a cache hit by improving the quality of the answer. The approach demonstrates that response latency is significantly reduced when using caching and how a caching strategy could be applied in various layers of increasing relevance for a simple Question-and-Answer system with the possibility of extending to more complex generative AI interactions.

Claims (48)

1. A method for improving computer functionality by retrieving answers to questions from a cache, the method comprising:

using a hardware processor communicatively coupled to memory to perform accessing a question stored in primary storage communicatively coupled to a cache, in a text format;

accessing metadata associated with the question in the text format;

vectorizing the question in the text format into a high dimensional vector using a text embedding algorithm, wherein the high dimensional vector is greater than or equal to 1024 dimensions;

using the high dimensional vector to search a question portion of the cache using a plurality of retriever types to create a hybrid search, in which the hybrid search combines one or more text format queries using the metadata with one or more high dimensional vector queries in a single search request;

performing query filtering with the metadata associated with the question to provide a semantic layer set of semantic answers in a text format with metadata associated with an answer and semantic relevance values;

using the question in the text format to search an answer portion of the cache and performing query filtering with the metadata associated with the question to provide a lexical layer set of lexical answers in the text format with the metadata associated with the answer and lexical relevance values;

using the semantic layer set in order of the semantic relevance values from highest to lowest and the lexical layer set from highest to lowest; and

applying a reciprocal rank fusion algorithm to compute a combined ranking set for the semantic answers in the text format and the lexical answers in the text format to provide an identified answer.

2. The method of claim 1 , further comprising:

in response to the semantic relevance values being above a settable value, returning the semantic answers in the text format with the highest semantic relevance values and, otherwise, sending the question in the text format to create a prompt.

3. The method of claim 1 , further comprising: in response to the combined ranking set being above a settable value, returning the identified answer and, otherwise, sending the question in the text format to create a prompt.

4. The method of claim 1 , wherein the performing query filtering with the metadata associated with the question provides an exact match result, wherein the high dimensional vector to search the question portion of the cache provides an approximate match ranked by the semantic relevance values.

5. The method of claim 1 , wherein the performing query filtering with Q-metadata provides an exact match result, wherein the question in the text format to search a question portion of the cache provides an approximate match ranked by the lexical relevance values.

6. The method of claim 1 , further comprising:

in response to a subsequent question is received, the cache is first checked to see if a similar request has already been made and, in response, retrieving the answer from the cache.

7. The method of claim 1 , wherein the accessing a question in a text format includes accessing a question that originated from a human user or from a computer process.

8. A method for improving relevancy of a cache hit, the method comprising:

operating a cache communicatively coupled to primary storage in an information retrieval system;

accessing a question in a text format;

accessing metadata associated with the question in text format;

vectorizing the question in the text format into a high dimensional vector using a text embedding algorithm, wherein the high dimensional vector is greater than or equal to 1024 dimensions;

using the high dimensional vector to search a question portion of the cache using a plurality of retriever types to create a hybrid search, in which the hybrid search combines one or more text format queries using the metadata with one or more high dimensional vector queries in a single search request;

performing query filtering with the metadata associated with the question to provide a semantic layer set of semantic answers in a text format with metadata associated with an answer and semantic relevance values;

using question in the text format to search an answer portion of the cache and performing query filtering with the metadata associated with the question to provide a lexical layer set of lexical answers in the text format with the metadata associated with the answer and lexical relevance values;

using the semantic layer set in order of the semantic relevance values from highest to lowest and the lexical layer set from highest to lowest;

applying a reciprocal rank fusion algorithm to compute a combined ranking set for the semantic answers in the text format and the lexical answers in the text format to provide an identified answer; and

in response to the combined ranking set being above a settable value, returning the identified answer and, otherwise, sending the question in the text format to create a prompt.

9. The method of claim 8 , wherein the performing query filtering with the metadata associated with the question provides an exact match result, wherein the high dimensional vector to search the question portion of the cache provides an approximate match ranked by the semantic relevance values.

10. The method of claim 9 , wherein the performing query filtering with the metadata associated with the question provides an exact match result, wherein the high dimensional vector to search a question portion of the cache provides an approximate match ranked by the lexical relevance values.

11. A system for improving computer functionality by retrieving answers to questions from a cache, the system comprising

the cache communicatively coupled to primary storage in an information retrieval system;

memory;

at least one processor communicatively coupled to memory and the information retrieval system, programmed to perform;

accessing metadata associated with the question in text format;

vectorizing the question in the text format into a high dimensional vector using a text embedding algorithm, wherein the high dimensional vector is greater than or equal to 1024 dimensions;

using the high dimensional vector to search a question portion of the cache using a plurality of retriever types to create a hybrid search, in which the hybrid search combines one or more text format queries using the metadata with one or more high dimensional vector queries in a single search request;

performing query filtering with the metadata associated with the question to provide a semantic layer set of semantic answers in a text format with metadata associated with an answer and semantic relevance values;

using the question in the text format to search an answer portion of the cache and performing query filtering with the metadata associated with the question to provide a lexical layer set of lexical answers in the text format with the metadata associated with the answer and lexical relevance values;

using the semantic layer set in order of the semantic relevance values from highest to lowest and the lexical layer set from highest to lowest; and

applying a reciprocal rank fusion algorithm to compute a combined ranking set for the semantic answers in the text format and the lexical answers in the text format to provide an identified answer.

12. The system of claim 11 , further comprising:

in response to the semantic relevance values being above a settable value, returning the semantic answers in the text format with the highest semantic relevance values and, otherwise, sending the question in the text format to create a prompt.

13. The system of claim 11 , further comprising: in response to the combined ranking set being above a settable value, returning the identified answer and, otherwise, sending the question in the text format to create a prompt.

14. The system of claim 11 , wherein the performing query filtering with the metadata associated with the question provides an exact match result, wherein the high dimensional vector to search the question portion of the cache provides an approximate match ranked by the semantic relevance values.

15. The system of claim 11 , wherein the performing query filtering with Q-metadata provides an exact match result, wherein the question in the text format to search a question portion of the cache provides an approximate match ranked by the lexical relevance values.

16. The system of claim 15 , further comprising:

in response to a subsequent question is received, the cache is first checked to see if a similar request has already been made and, in response, retrieving the answer from the cache.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 15, 2024
From: MUSCHETT, BRIEN H, MR.; ODOM, JUSTIN G, MR.
To: INVENTUS HOLDINGS, LLLC
Reel/Frame 066467/0185 →
References Cited (45)
US 6457020B1 · Carey et al. · 2002 [cited by applicant]
US 8539457B2 · Hamby et al. · 2013 [cited by applicant]
US 9318027B2 · Byron et al. · 2016 [cited by applicant]
US 9529848B2 · Patel et al. · 2016 [cited by applicant]
US 9870415B2 · Meyles et al. · 2018 [cited by applicant]
US 9886390B2 · Allen et al. · 2018 [cited by applicant]
US 10572801B2 · Mars et al. · 2020 [cited by applicant]
US 11216459B2 · Zhang et al. · 2022 [cited by applicant]
US 11593364B2 · Nahamoo et al. · 2023 [cited by applicant]
US 11741139B2 · Zhuo et al. · 2023 [cited by applicant]
US 11853381B2 · Li et al. · 2023 [cited by applicant]
US 20150081279A1 · Suleman · 2015 [cited by examiner]
US 20160055156A1 · Li et al. · 2016 [cited by applicant]
US 20190163691A1 · Brunet et al. · 2019 [cited by applicant]
US 20210216576A1 · Staub et al. · 2021 [cited by applicant]
US 20210382923A1 · Gragnani · 2021 [cited by examiner]
US 20220156298A1 · Mahmoud · 2022 [cited by examiner]
US 20220310084A1 · Brdiczka et al. · 2022 [cited by applicant]
US 20220327128A1 · Xu et al. · 2022 [cited by applicant]
US 20220358295A1 · Nair et al. · 2022 [cited by applicant]
US 20220366333A1 · Lollo · 2022 [cited by examiner]
US 20230034011A1 · Sarkar et al. · 2023 [cited by applicant]
US 20230138987A1 · Bo et al. · 2023 [cited by applicant]
US 20230267126A1 · Frieder et al. · 2023 [cited by applicant]
CN 115080721 · 2022 [cited by applicant]
CN 110990533 · 2023 [cited by applicant]
CN 113821622 · 2023 [cited by applicant]
CN 117194056 · 2023 [cited by applicant]
CN 117370523 · 2024 [cited by applicant]
WO 2021120707A1 · 2021 [cited by applicant]
Bang, F. (2023, December). GPTCache: An Open-Source Semantic Cache for LLM Applications Enabling Faster Answers and Cost Savings. In Proceedings of the 3rd Workshop for Natural Language Processing Open Source Software (… [cited by applicant]
Jónsson, B. P., Arinbjarnar, M., Pórsson, B., Franklin, M. J., & Srivastava, D. (2006). Performance and overhead of semantic cache management. ACM Transactions on Internet Technology (TOIT), 6(3), 302-331. [cited by applicant]
Harabagiu, S., Moldovan, D., Pasca, M., Mihalcea, R., Surdeanu, M., Bunsecu, R., . . . & Morarescu, P. (Jul. 2001). The role of lexico-semantic feedback in open-domain textual question-answering. In Proceedings of the 3… [cited by applicant]
Ramírez, G., Lindemann, M., Birch, A., & Titov, I. (2023). Cache & Distil: Optimising API Calls to Large Language Models. arXiv preprint arXiv:2310.13561. [cited by applicant]
Sahar Mor “12 Techniques to reduce your LLM API bill and launch blazingly fast products”, Deep Dives, Ai Tidbits, Jan. 13, 2024. [cited by applicant]
Zhu, Banghua, et al. “On Optimal Caching and Model Multiplexing for Large Model Inference.” arXiv preprint arXiv:2306.02003 (2023). [cited by applicant]
https://python.langchain.com/docs/integrations/Ilms/Ilm_caching. [cited by applicant]
https://github.com/zilliztech/GPTCache. [cited by applicant]
https://plg.uwaterloo.ca/˜gvcormac/cormacksigir09-rrf.pdf. [cited by applicant]
https://www.elastic.co/guide/en/elasticsearch/reference/current/rrf.html. [cited by applicant]
https://towardsdatascience.com/forget-rag-the-future-is-rag-fusion-1147298d8ad1. [cited by applicant]
https://www.elastic.co/blog/improving-information-retrieval-elastic-stack-hybrid. [cited by applicant]
https://arxiv.org/abs/2210.11934. [cited by applicant]
https://medium.com/@sowmiyajaganathan/hybrid-search-with-re-ranking-ff120c8a426d. [cited by applicant]
https://github.com/rochacon/es-janitor. [cited by applicant]
Cited By (4)
US 12,572,515 US 12,608,671 US 12,670,216 US 12,699,723