A method for generating targeted advertisements LLM systems including receiving a user query, identifying categories of information by analyzing the user query using modeling techniques, generating derived queries from the user query, generating query responses by processing the user query and the derived queries through h-LLMs, determining advertisement content based on the categories of information and a user intention or a user attitude, generating targeted advertisements responsive to the advertisement content, and creating an advertisement-enhanced response by integrating the advertisements with the query responses.
Legal claims defining the scope of protection, as filed with the USPTO.
. A method for generating targeted advertisements in large language model (LLM) systems comprising:
. The method ofwherein determining advertisement content comprises:
. The method ofwherein generating one or more derived queries comprises:
. The method ofwherein the one or more clarifying questions comprises queries about user purchasing intentions within a predetermined time period for products or services related to the one or more categories.
. The method ofwherein:
. The method offurther comprising:
. The method ofwherein the AI input broker is configured to:
. A system for generating targeted advertisements in large language model (LLM) systems comprising:
. The system ofwherein the software, when executed by the processor, is operable to determine the advertisement content by:
. The system ofwherein the software, when executed by the processor, is operable to generate one or more derived queries by:
. The system ofwherein the one or more clarifying questions comprises queries about user purchasing intentions within a predetermined time period for products or services related to the one or more categories.
. The system offurther comprising a document database comprising a plurality of documents that comprises a plurality of superchunks; wherein the software, when executed by the processor, is operable to integrate the one or more targeted advertisements by:
. The system ofwherein the software, when executed by the processor, is operable to:
. The system ofwherein the AI input broker is further configured to:
. A system for generating targeted advertisements in large language model (LLM) systems comprising:
. The system ofwherein the means for determining advertisement content is operable to:
. The system ofwherein the means for generating one or more derived queries is operable to:
. The system ofwherein the one or more clarifying questions comprises queries about user purchasing intentions within a predetermined time period for products or services related to the one or more categories.
. The system offurther comprising:
. The system offurther comprising:
. The system ofwherein the AI input broker is configured to:
. A system for generating targeted advertisements in LLM systems comprising:
. The system ofwherein the advertisement generation module is further configured to:
. The system offurther comprising a user intention prediction engine configured to:
Complete technical specification and implementation details from the patent document.
This application is a continuation application of and claims priority under 35 U.S.C. § 120 of U.S. patent application Ser. No. 18/812,707 filed on Aug. 22, 2024 and titled Method and Systems for Optimizing User of Retrieval Augmented Generation Pipelines in Generative Artificial Intelligence Applications, which in turn claims priority under 35 U.S.C. § 119 of U.S. Provisional Patent Application Ser. No. 63/535,118 filed on Aug. 29, 2023 and titled Networked LLMs and Focused LLMs, U.S. Provisional Patent Application Ser. No. 63/529,177 filed on Jul. 27, 2023 and titled Using LLMs to Create Projects and Tasks in an Optimized Way, U.S. Provisional Patent Application Ser. No. 63/534,974 filed on Aug. 28, 2023 and titled Using Prompts to Generate Search Queries for Context Generation in LLMs, U.S. Provisional Patent Application Ser. No. 63/647,092 filed on May 14, 2024 and titled Using LLMs to Influence Users and Organizations, U.S. Provisional Patent Application Ser. No. 63/607,112 filed on Dec. 7, 2023 and titled Long Document Attention Span Enhancement for LLMs, and U.S. Provisional Patent Application Ser. No. 63/607,647 filed on Dec. 8, 2023 and titled High-Level UI for Prompt Generation for LLMs, and is a continuation-in-part application of and claims priority under 35 U.S.C. § 120 of U.S. patent application Ser. No. 18/744,199, now U.S. Pat. No. 12,306,859, issued May 20, 2025 filed on Jun. 14, 2024 and titled Method and System for Protecting and Removing Private Information Used in Large Language Models, which in turn claims priority under 35 U.S.C. § 119 of U.S. Provisional Patent Application Ser. No. 63/551,548 No. 3026.00172) filed on Feb. 9, 2024 and titled Generation of Synthetic Data for PII, U.S. Provisional Patent Application Ser. No. 63/604,909 filed on Dec. 1, 2023 and titled Guardian-Preventing Privacy Attacks on LLMs, U.S. Provisional Patent Application Ser. No. 63/602,675 filed on Nov. 27, 2023 and titled Object detection combined with LLMs, and is a continuation-in-part application of and claims priority under 35 U.S.C. § 120 of U.S. patent application Ser. No. 18/406,906, now U.S. Pat. No. 12,158,904, issued Dec. 3, 2024 filed on Jan. 8, 2024 and titled Method and System for Protecting and Removing Private Information Used in Large Language Models, which in turn claims priority under 35 U.S.C. § 119 of U.S. Provisional Patent Application Ser. No. 63/602,675 filed on Nov. 27, 2023 and titled Object detection combined with LLMs, U.S. Provisional Patent Application Ser. No. 63/604,910 filed on Dec. 1, 2023 and titled Targeted Forgetting in LLMs-Details, and is a continuation-in-part application of and claims priority under 35 U.S.C. § 120 of U.S. patent application Ser. No. 18/470,487, now U.S. Pat. No. 12,147,461, issued Nov. 19, 2024 filed on Sep. 20, 2023 and titled Method and System for Multi-Level Artificial Intelligence Supercomputer Design, which in turn is a continuation application of and claims priority under 35 U.S.C. § 120 of U.S. patent application Ser. No. 18/348,692, now U.S. Pat. No. 12,001,462, issued Jun. 4, 2024 filed on Jul. 7, 2023 and titled Method and System for Multi-Level Artificial Intelligence Supercomputer Design, which in turn claims priority under 35 U.S.C. § 119 of U.S. Provisional Patent Application Ser. No. 63/463,913 filed on May 4, 2023 and titled New Tools for Document Analysis in CatchUp, and U.S. Provisional Patent Application Ser. No. 63/469,571 filed on May 30, 2023 and titled Multilevel AI PSupercomputer Design. The contents of these applications are incorporated herein by reference.
The present invention primarily relates to artificial intelligence and large language models (LLMs) for generative AI applications.
Large Language Models (LLMs) are generative Artificial Intelligence (AI) models which are trained on limited amounts of data and can perform language processing tasks (with multimodal inputs—text, and more recently, image inputs as in Microsoft's Kosmos-1) and generate human-like text (and associated multimedia material, like images, video and advertisements). LLMs have many parameters (from millions to billions). LLMs can capture complex patterns in language and produce text that closely resembles human language.
The high-level goal of an LLM is to predict the text (and other multimedia material) that is likely to come next in a sequence. The applicants recognize that LLMs are a type of generative AI that is in usually different from traditional machine learning and AI applications. LLM also stands for Learning with Limited Memory and implies that LLM's are closely tied to their training data and make decisions based on the limited amount of data. Both generative AI and LLM generate content, but LLM does it in a manner that improves computational and memory efficiency.
Traditional machine learning type algorithms focus on analysis, such as statistical regression or clustering, and are usually again different from Generative AI and LLMs, which focus on generating content. LLMs have immediate practical implication in generation of new content that matches associated or preceding/future content in an optimized manner, such as legal briefs or computer code, based on training with a limited amount of data, such as existing briefs or code, both from private and public sources. In this invention, we focus on LLM models as the primary focus of these improvements, though we do not disclaim other AI models, unless expressly done as part of the claims.
LLMs are created with complex architectures such as transformers, encoders and decoders. LLMs, typically, use a technique of natural language processing called Tokenization that involves splitting the input text (and images) and output texts into smaller units called tokens. Tokens can be words, characters, sub-words, or symbols, depending on the type and the size of the model. Tokenization helps to reduce the complexity of text data, making it easier for LLMs to process and understand data thus reducing the computational and memory costs. Another important component of an LLM is Embedding, which is a vector representation of the tokens. The Encoder, within the Transformer architecture, processes the input text and converts it into a sequence of vectors, called embeddings, that represent the meaning and context of each word. The Decoder, within the Transformer architecture, generates the output text by predicting the next word in the sequence, based on the embeddings and the previous words. LLMs use Attention mechanisms that allow the models to focus selectively on the most relevant parts of the input and output texts, depending on the context of the task at hand, thus capturing the long-range dependencies and relationships between words.
LLMs are designed to learn the complexity of the language by being pre-trained on vast amounts of text (and multimedia) data from sources such as Wikipedia, books, articles on the web, social media data and other sources. The training procedure can be decomposed into two stages:
Through training on limited amounts of data, the models are able to learn the statistical relationships between words, phrases, and sentences and other multimedia content. The trained models can then be used for generative AI applications such as Question Answering, Instruction Following, Inferencing, for instance, where an input is given to the model in the form of a prompt and the model is able to generate coherent and contextually relevant responses based on the query in the prompt.
Popular LLM models include GPT (Generative Pre-trained Transformer), BERT (Bidirectional Encoder Representations from Transformers), BART (Bidirectional and Auto-Regressive Transformers) and PaLM (Pathways Language Model). See, for example, public domain websites, such as openai.com or bard.google.com for more information as to how a person of ordinary skill in the art may use these models. Public domain and company-specific LLMs, such as GPT4AII, MiniGPT4, RMKV, BERT, MPT-7B, Kosmos-1 (which accepts image and multimodal inputs), YaLM, are also available for wide use, as for example, described in medium.datadriveninvestor.com/list-of-open-source-large-language-models-llms-4eac551bda2e.
Current AI generative models and LLMs require super-computing efforts to compute results and an efficient way to improve response times, accuracies, and reduce computational load is required to improve both cost and scalability and expandability of existing AI models and their use.
LLMs face significant challenges when processing long documents, particularly in maintaining coherence and performing long-range reasoning. This limitation, often referred to as the “attention span problem,” causes a noticeable drop in performance as the length of the input context increases, typically above 10,000 to 50,000 tokens.
The attention span problem has substantial implications for real-world applications, especially in domains that frequently deal with lengthy and complex documents, such as legal, engineering, healthcare, and academic research. In these fields, the ability to comprehend and reason over extended contexts is crucial for tasks like document summarization, question answering, and information extraction.
Existing approaches to mitigate the attention span problem, such as sliding window techniques or hierarchical attention mechanisms, have shown limited success. They often struggle to maintain global coherence or fail to capture long-range dependencies effectively. As a result, there is a pressing need for innovative solutions that can enhance the attention span of LLMs and enable them to process long documents more effectively.
LLMs face inherent limitations due to their reliance on pre-trained knowledge. These include a fixed knowledge cutoff, potential for hallucination, and lack of specificity in responses. Retrieval-Augmented Generation (RAG) is a useful approach in AI that combines the strengths of LLMs with external knowledge retrieval. RAG addresses the limitations of LLMs by providing them with relevant, up-to-date information from a curated knowledge base. This approach grounds LLM outputs in retrieved facts, significantly reducing hallucinations while enabling more accurate and context-specific responses.
Existing RAG systems have shown promise in enhancing the performance of LLMs by providing relevant context from external knowledge sources. However, these systems face significant challenges in processing and retrieving information from long, complex documents. Current RAG implementations often struggle with inefficient document chunking, leading to loss of context and semantic coherence. They typically rely on simplistic keyword-based retrieval methods, which fail to capture the nuanced graph-like relationships between concepts. Moreover, existing systems lack sophisticated mechanisms for dynamically adapting to different types of queries and documents, resulting in sub-optimal retrieval and generation performance. The inability to effectively handle large volumes of text, combined with inadequate context preservation and limited semantic understanding, hinders the widespread adoption of RAG systems in domains that deal with extensive and intricate textual information, such as legal, medical, engineering, and scientific research fields.
This background information is provided to reveal information believed by the applicant to be of possible relevance to the present invention. No admission is necessarily intended, nor should be construed that any of the preceding information constitutes prior art against the present invention.
With the above in mind, embodiments of the present invention are directed to a system and associated methods for multi-level generative AI and large language models (LLM) for generative AI applications, that utilize the following techniques:
Derived Requests: An initial level of generative AI software program, or AI broker, evaluates the incoming client request (maybe a conversational query or through an API, such as OpenAI API) and identifies its specific AI “characteristics” that may make it suitable for one or other or both or multiple AI language models and checks its “derived requests” categories to see if the query suits one of the “derived requests” categories and/or it can or should create a new request.
Multiple h-LLMs: If the new request does is not assigned to one or more of the “derived requests) categories, it evaluates the request and selects one or more AI h-LLM model categories for its evaluation. An h-LLM is a family of models, such as GPT-4, that (in addition) have been trained according to a particular training set T1. A family of generative models, LLM1, trained with a data set T1, can be represented as h-LLM1, while a family of models, LLM2, trained with data set T2, can be represented as h-LLM12. Further, a family of models, LLM1, trained with a data set T3, can be represented as h-LLM35. The combination of models and their training sets (T1 could be a subset of T3, for example, or they can be different) may be used in our proposed invention and they are referred to as h-LLMs, throughout. A family of LLMs that operate at a lower arithmetic precision, on computer CPUs or graphical processing units (GPUs, such as Nvidia's H100), may also be called by a different identifier, e.g., h-LLM14, when trained with its corresponding data set.
Choosing h-LLMs with varying levels of accuracy: It further checks the workload of the AI h-LLM models in the one or more categories and its level of training and its accuracy-called its workload scores or its technical accuracy scores, or its business value metrics or a combination of these scores, and then assigns the request (or its derived form) to one or more of the AI h-LLM models within the selected AI h-LLM model categories.
Assigning weights to results: It then receives the results from the AI models in the AI h-LLM models categories and weights them to compute a result that could be returned to the requester program, or it could resend the request back to the AI h-LLM models/categories hierarchy till it reaches a certain level of service level assurance.
Use of Local Database: It also updates a local database with the results of the request's path through its hierarchy and create an index of “derived requests” that may be used in future to select which set of “derived requests” an incoming request may fall into for further processing.
Distributed Architecture: The tasks may be implemented as containers within Kubernetes environment and a service mesh, such as Istio, may be used to instrument and parameterize the metrics and log collections, but not limited to these cloud models for implementation.
Efficient Search & Retrieval: Traditional online and offline approaches to cluster search are used to find the relevant subset of the documents being evaluated in Retrieval Augmented Generation (RAG) pipelines. Once this subset is retrieved then the traditional pipeline of LLMs operations are carried out as in LangChain and LlamaIndex. The cluster may be generated during time of the Query Prompt input (adds to the delay due to need to generate indexes) or could be used to select a subset of indexes in Vector Db in a quicker approach. Few important queries and prompts may be used to generate clusters (offline) and each new online query may be mapped to the best “cluster” that was pre-generated based on that query or similar queries.
Network of LLMs working together to replace a larger LLM: Currently a single large LLM is trained on all types of data and has large number of parameters (e.g. OpenAI GPT3.5 has 175 billion parameters and GPT-4 has over 1 trillion of parameters). A approach using a Network of LLMs is proposed which combines smaller LLMs (with 3B or 7B parameters, for example), preferably each focused on a specific type of result (cost estimation, profit estimation, expense estimation or prediction). The network of LLMs is used to provide a composite result that is easier to prompt for, easier to optimize and easier to “explain” how it works by having smaller focused LLMs trained on specialized training sets.
Embodiments of the present invention are directed to a system and associated methods for enhancing the attention span of Large Language Models (LLMs) when processing long documents. The system, long-document attention span enhancement through refinement (“LASER”), uses an iterative attention focusing technique that dynamically refines and condenses document and chunk context to improve model comprehension and coherence over extended inputs.
Other embodiments of the present invention are directed to enhancing Retrieval-Augmented Generation (RAG) through context-optimized retrieval techniques. The system, scored context-optimized retrieval enhancement for retrieval augmented generation (“SCORE-RAG”), addresses the limitations of existing RAG systems by incorporating advanced document (including chunk) processing, intelligent information retrieval, and adaptive response generation mechanisms.
In one embodiment, the present invention comprises a document processing system that includes an input module, a model module, an iteration controller, a knowledge module, and an output handler. The input module is configured to split long documents into manageable blocks (or chunks) and generate iterative contexts, while the model module contains an attention model for processing these contexts and a ranking unit for evaluating outputs.
Another embodiment of the invention involves a method for iterative attention focusing, which includes splitting a long document into blocks, batching these blocks, processing them through an LLM, ranking the outputs, and then clustering and reforming new batches based on the highest-ranked content. This process is repeated iteratively, gradually condensing the document to its most relevant parts.
Another embodiment of the invention provides a mechanism for dynamically adjusting the attention focus of an LLM. This mechanism employs a ranking system that scores model outputs based on coherence and relevance, allowing the system to identify and prioritize the most important parts of a document or chunks across multiple processing cycles.
Another embodiment of the invention introduces a knowledge module that incorporates an extractive summarizer and a document clustering component. These elements work together to identify information and group related content, further enhancing the system's ability to distill and focus on critical parts of long documents and chunks.
Another embodiment of the invention comprises a document processor for handling various input formats, a topic modeling engine for semantic analysis, and an intelligent document chunking module that preserves contextual integrity. This embodiment also features a hybrid search module that combines keyword-based and vector similarity search methods for improved retrieval accuracy.
Another embodiment of the invention involves a method for dynamically processing and indexing documents. This method employs a citation analyzer to assess the importance of different text segments, a chunk selection and ranking module to identify the most relevant portions of a document, and a metadata enrichment module to enhance the contextual information associated with each text chunk. The method further includes an adaptive indexing process that optimizes storage and retrieval of processed information.
Another embodiment of the invention provides a mechanism for query augmentation and response generation. This mechanism utilizes a Query Processor to analyze and classify user inputs, an Augmentation Engine to integrate retrieved context with the original query, and a Generation Module that interfaces with LLMs to produce coherent and relevant responses.
The present invention will now be described more fully hereinafter with reference to the accompanying drawings, in which preferred embodiments of the invention are shown. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. Those of ordinary skill in the art realize that the following descriptions of the embodiments of the present invention are illustrative and are not intended to be limiting in any way. Other embodiments of the present invention will readily suggest themselves to such skilled people having the benefit of this disclosure. Like numbers refer to like elements throughout.
Although the following detailed description contains many specifics for the purposes of illustration, anyone of ordinary skill in the art will appreciate that many variations and alterations to the following details are within the scope of the invention. Accordingly, the following embodiments of the invention are set forth without any loss of generality to, and without imposing limitations upon, the claimed invention.
In this detailed description of the present invention, a person skilled in the art should note that directional terms, such as “above,” “below,” “upper,” “lower,” and other like terms are used for the convenience of the reader in reference to the drawings. Also, a person skilled in the art should notice this description may contain other terminology to convey position, orientation, and direction without departing from the principles of the present invention.
Furthermore, in this detailed description, a person skilled in the art should note that quantitative qualifying terms such as “generally,” “substantially,” “mostly,” and other terms are used, in general, to mean that the referred to object, characteristic, or quality constitutes a majority of the subject of the reference. The meaning of any of these terms is dependent upon the context within which it is used, and the meaning may be expressly modified.
Referring now tois an illustration of the training process for creating multiple specialized large language models for specific tasks/categories, is described in more detail. Data(such as text, images, and audio) is used to pre-train a model in a process called unsupervised pre-trainingwhich generates a base h-LLM model. The pre-training process is referred to as unsupervised as unlabeled data is used at this step. The base h-LLM modelis then fine-tuned in a process called supervised fine-tuning. The fine-tuning process uses smaller labeled data sets. The base h-LLM modelis fine-tuned to generate multiple h-LLM models which are specialized to perform specific tasks such as Question Answering, Information Extraction, Sentiment Analysis, Image Captioning, Object Recognition, Instruction Following, Classification, Inferencing, and Sentence Similarity, for instance.
Referring now tois an illustration of h-LLMs trained with different training sets, is described in more detail. As used in this specification h-LLM usually refers to a family of LLMs, such as those used in Google's Bard or OpenAI's GPT-4, that have been trained on a particular training set T. Therefore, the same family of LLMs (e.g., GPT) if trained on a different training set, T1, as opposed to GPT trained on training set T2 could be differentiated as a separate h-LLM). The training sets can be private within an organization or public datasets.
For example, as shown in, h-LLM-1is trained with training set-1, h-LLM-2is trained with training set-2, h-LLM-3is trained with training set-3, and h-LLM-3_4is trained with training set-3and training set-4.
An h-LLM can be described as a combination of LLM families and the training dataset used as follows:
For example,
Referring now to, an illustration of the process for generating synthetic data from multiple h-LLMs and using it for model refinement, is described in more detail. Datais used to train a base h-LLM modelusing unsupervised pre-trainingwhich is then fine-tuned in a supervised fine-tuning processto generate multiple h-LLMs specialized for specific tasks or categories. Each of these h-LLMsare used to generate synthetic datawhich is then fed back to the models in feedback loopthrough a process called model refinement.
Referring now tois an illustration of a bagging approach, that has some similarity to what was originally used in the context of machine learning models in a different way (for analytics as opposed to generative AI applications, such as LLMs) that are described in this invention, where multiple h-LLMs with lower precision and accuracy are merged/fused to create a merged h-LLM with higher precision and accuracy, is described in more detail. Bagging is a machine learning technique which improves the stability and accuracy of machine learning models. Using the input data, multiple subsets of the data are created which are used to train multiple h-LLMs (,,,) in parallel. These models are then combined in a process called merging or fusingto create a merged h-LLM.
Referring now tois an illustration a boosting approach, that has some similarities to that originally used in the context of machine learning models in a different way (for analytics as opposed to generative AI applications used in this invention) where multiple h-LLMs of increasing precision and accuracy are created in a sequential manner and then merged/fused to create a merged h-LLM, is described in more detail. Boosting is a machine learning technique that involves creating a stronger and more accurate model from a number of weaker models. The original datais used to train an h-LLM. The h-LLMis tested and the outputis assigned weights to generate weighted data. The weighted datais then used to train h-LLM. The same process is then repeated and h-LLMsandare generated in a sequence. The h-LLMs,,andare then combined in a process called merging or fusingto create a merged h-LLM.
Referring now tois an illustration of creating a smaller and more specialized h-LLM through extraction/specialization process from a larger h-LLM, is described in more detail. The extraction/specialization processextracts the specific knowledge required for a task from a big, general-purpose model, and creates a smaller h-LLM. For example, a specific task can be sentiment analysis of input text, for which a smaller modelis more efficient as compared to a large, general-purpose model.
Referring now tois an illustration of combining h-LLMs trained with text, image and audio data to create a merged h-LLM, is described in more detail. Text datais used to train h-LLM, image datais used to train h-LLMand audio datais used to train h-LLM. The h-LLMs,,are combined in a process called merging/fusing to create a merged h-LLM.
Unknown
May 26, 2026
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.