Dual large language model agents for web-based-knowledge grounding
Dual LM-based agents for web-based-knowledge grounding address the limitations of static LMs by dynamically accessing real-time information, ensuring accurate and timely responses to diverse queries.
Patent Information
- Application Number
- US18/900434
- Authority / Receiving Office
- US · United States
- Patent Type
- Patents(United States)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2026-12-01
- Estimated Expiration
- 2044-11-22
AI Technical Summary
Large language models (LMs) lack continuous updating capabilities and access to private or use-case specific information, leading to outdated or inaccurate responses in question-answering systems.
Implementing dual LM-based agents for web-based-knowledge grounding that dynamically access and integrate real-time information from various online sources, analyze context and credibility, and adapt by identifying and refining grounding gaps to ensure accurate and timely responses.
Enhances the accuracy and relevance of responses by continuously updating knowledge and handling complex tasks, providing comprehensive and contextually appropriate answers to evergreen and time-sensitive queries.
Smart Images

Figure US12817874-D00000_ABST
Abstract
Description
BACKGROUND
[0001] Grounding of a large language model (LM) refers to the process of ensuring that the outputs generated by the model are anchored in real-world knowledge, facts, or a specific context. LMs are not databases, even if they possess a wealth of knowledge. LMs are trained on extensive corpus of information only up to a certain point in time and do not update continuously. Moreover, LMs only have access to public information and lack knowledge about anything behind corporate firewalls, private data, or use case specific information. It is important to obtain accurate and relevant outputs in LM-based question-answering (QA) systems by providing the underlying LMs with the necessary information.BRIEF DESCRIPTION OF DRAWINGS
[0002] FIG. 1 is a block diagram illustrating an example QA system using dual language model (LM)-based agents for web-based-knowledge grounding.
[0003] FIG. 2 is a block diagram illustrating a natural language processing subsystem of the QA system of FIG. 1.
[0004] FIG. 3 is a block diagram illustrating an example monitoring subsystem used by an LM-based grounding appraisal agent of the QA system of FIG. 1.
[0005] FIG. 4 is a block diagram showing how the LM-based grounding appraisal agent of the QA system identifies grounding gaps in retrieval and ranking systems and implements interventions.
[0006] FIG. 5 is a flow chart illustrating an example process for implementing dual LM-based agents for web-based-knowledge grounding and fine-tuning a retrieval pipeline of the QA system of FIG. 1.
[0007] FIG. 6 is a block diagram showing an example architecture of a network-connected device that may be used.
[0008] FIG. 7 is a block diagram showing an example architecture of a server device that may be used.DETAILED DESCRIPTION
[0009] In the following description, reference is made to the accompanying drawings that illustrate several examples of the present disclosure. It is understood that other examples may be utilized and various operational changes may be made without departing from the scope of the present disclosure. The following detailed description is not to be taken in a limiting sense, and the scope of the embodiments of the present disclosure is defined only by the claims of the issued patent.
[0010] The present disclosure generally relates to an LM-based agent-style QA system configured to search for an up-to-date answer for a given query, retrieve documents from various online sources (e.g., databases, websites, or application programming interfaces (APIs)), and obtain snippets from the retrieved document(s). Unlike traditional QA systems that rely solely on pre-existing, static datasets or internal knowledge bases, the LM-based agent-style QA system leverages the vast and dynamic information available on the internet. As will be described fully below, the QA system of the present disclosure can access and deliver the most current information available online, which is particularly useful for answering questions related to ongoing events, news, or rapidly changing topics. By tapping into the online resources, the QA system can cover a wide range of topics that may not be well-represented in traditional datasets. Further, the QA system can obtain information from various types of sources, such as academic articles, news websites, blogs, forums, and more. This variety allows the QA system to provide more comprehensive and diverse answers. Web-based-knowledge may allow the QA system to continuously update its understanding and answers based on the latest information, without requiring manual updates to the internal databases. In some embodiments, the QA system of the present disclosure may analyze the context and credibility of the located web sources, filtering out unreliable or less relevant information to improve the accuracy of the responses. For example, the QA system of the present disclosure may provide answers related to breaking news, weather forecasts, or live event updates by obtaining data from news sites or real-time feeds.
[0011] To generate accurate, informative, and contextually appropriate response to a query, a web-based-knowledge grounding process may be carried out for validating, supporting, and enriching information within the QA system of the present disclosure by referencing or retrieving data from these web sources. In accordance with various aspects, dual LM-based agents for web-based-knowledge grounding may be implemented to work at the start with a query, and at the end based on grounding gaps to the expected outputs. Grounding gaps generally refer to the differences between the expected outputs and the actual outputs of the QA system. These gaps indicate where the system's understanding or knowledge falls short. The dual LM-based agents of the present disclosure may identify and analyze these gaps to reveal why the QA system is producing incorrect or suboptimal answers (e.g., insufficient training data, misunderstanding the context of the question, or limitations in the underlying knowledge base). Once grounding gaps are identified, the dual LM-based agents may refine the overall system by adjusting relevant algorithms, expanding its knowledge base, or improving its training data to close these gaps and improve future performance. As such, the QA system of the present disclosure may be configured to dynamically learn and adapt by identifying grounding gaps and improving over time.
[0012] An LM is an artificial intelligence (AI) model that may be capable of processing and generating human-like text based on the latent information it has learned from vast amounts of training data. The term “large” refers to the size of these models in terms of the number of parameters or weights, which are the values that the model learns during training to make predictions and generate text. LMs may have millions, billions (or even more) parameters, which enable such models to capture complex patterns and nuances in language that, in turn, allow the models to understand and generate more natural-sounding text (relative to previous approaches). Examples of LMs may include the generative pre-trained transformer models, Pathways Language Model (PaLM), Language Model for Dialogue Applications (LaMDA), Bard, Large Language Model Meta Artificial Intelligence (LLaMA), Amazon Titan Foundational Model, LM and even non-generative examples such as bidirectional encoder representations from transformers (BERT), etc.
[0013] In a generative context, an LM may generate text that is responsive to the input prompt provided to the LM. LMs excel at generating natural sounding text that appears as though it has been generated by a native speaker in the relevant language. In addition to fluency, generative LMs are able to generate detailed, relevant, and largely accurate responses to input prompts in many cases due to the large amount of latent information the generative LM has learned during training.
[0014] An LM-based agent may generally refer to a software system or an autonomous component programmed to leverage one or more LMs to perform tasks, engage in conversations, and provide information or services in response to user inputs. Each LM-based agent disclosed in the present disclosure may use the natural language processing capabilities of LMs to understand, generate, and interact with human language, thereby functioning as interactive, intelligent assistants across a wide range of applications. For example, each LM-based agent may comprehend and interpret queries expressed in natural language, regardless of how they are phrased, using advanced language understanding capabilities of the LMs, and generate coherent, contextually relevant, and human-like responses, making interactions more natural and intuitive. Each LM-based agent may retain context across interactions and handle multi-turn conversations and provide responses that are consistent with previous exchanges. Each LM-based agent of the present disclosure may perform various tasks including but not limited to answering questions, retrieving information, or executing commands, depending on their integration with other systems or databases. Being continuously fine-tuned or updated based on new data or feedback, each LM-based agent may improve over time in each specific domain or application. In some implementations, in addition to texts, each LM-based agent of the present disclosure may process and generate content in other formats, such as images, audio, or video, especially if the underlying LMs are integrated with other AI technologies.
[0015] In accordance with aspects, FIG. 1 is a block diagram illustrating an example QA system 100 employing dual LM-based agents (grounding agent 106 and grounding appraisal agent 108) to, for a received query in natural language, determine the best retrieval configuration and formulate a search request, and, based on feedback, determine how to evolve different components of a search pipeline which generally includes a sequence of steps or processes for retrieving and ranking relevant information to answer the received query. The search pipeline may locate the best possible answer from a collection of documents, a database, and, more importantly, various online resources. For example, data relating to the query may be initially processed using e.g., tokenization and normalization. That is, a received query may be partitioned into individual tokens or words, and then converted into a standard format, such as lowercasing, removing stop words, stemming, or lemmatization. In some embodiments, additional keywords or synonyms may be added to the query to improve recall. A subsequent process may involve document retrieval. In one aspect, the QA system 100 may search the web for relevant information, using search engines, web crawlers, or direct API calls to online databases. According to some embodiments, dataset may be preprocessed to create an index that maps keywords to documents. This step speeds up the retrieval process. Then the processed query may be used to search through the index and retrieve a set of potentially relevant documents. Example algorithms used during this process may include Term Frequency-Inverse Document Frequency (TF-IDF) or BM25.
[0016] Candidate answers to the query may be generated by extracting relevant passages or snippets from the retrieved documents that may contain the answer. Specific phrases or sentences may be identified within the snippets that directly answer the query.
[0017] Thereafter, the candidate answers may be assigned scores based on various features including relevance, context, and answer type. The candidate answers may be ordered or ranked based on their scores to present the most likely correct answer at the top. The best answer(s) may be selected based on the highest ranking, and the selected answer may be formatted for presentation to the user, which may involve summarizing or rephrasing.
[0018] User feedback may be incorporated to improve future responses. This may involve learning from incorrect answers or adjusting the QA system based on user interaction.
[0019] According to a preferred embodiment, the grounding agent 106 may be configured to vary a retrieval configuration for e.g., evergreen and time-sensitive questions in order to provide optimal results. In the context of information retrieval, search engines, and content management, evergreen and time-sensitive queries refer to two different types of user search intents based on the relevance and longevity of the information being sought. Evergreen queries may include search queries that relate to topics or information that remains relevant, useful, and accurate over a long period. The content addressing these queries may not become outdated quickly and continues to attract interest regardless of current events or trends. That is, evergreen queries may relate to information that is timeless and does not need frequent updates (e.g., foundational knowledge, how-tos, or general topics) and the search volume for these queries tends to be stable over time. Some example evergreen queries may include “How to tie a tie”, “Benefits of drinking 8 glasses of water a day,” and “What is photosynthesis?” Evergreen content is important in search engine optimization because it continues to attract traffic long after it is published. Many educational materials, guides, and tutorials fall into the evergreen category.
[0020] On the other hand, time-sensitive queries may generally relate to topics or information that is relevant only within a specific time frame. The relevance of the content addressing these queries may quickly diminish as new information or events occur. For example, information related to time-sensitive queries may be closely tied to a specific event, date, or period. Search volumes for these queries can spike rapidly and then drop off as the event or trend fades. Users seeking information on these topics often need the most current and up-to-date details. Some example time-sensitive queries may include “Olympics 2024 medal count” and “Current stock market news.” News outlets and social media platforms focus on time-sensitive content may be searched as they tend to keep current and accurate at the moment of publication. Campaigns around holidays, product launches, or significant events often target time-sensitive queries.
[0021] To understand the distinction between evergreen and time-sensitive questions, the grounding agent 106 may be configured to prioritize the most relevant content for a given query. Evergreen content may rank consistently high over time, while time-sensitive content may be given a temporary boost during peak relevance. Providing accurate and timely information is important for satisfying user needs, particularly for time-sensitive queries where outdated information may be misleading or useless.
[0022] In some embodiments, it may be difficult to carry out an enriched search by adding additional metadata to improve search quality. For example, for a user question asking about a not-so-popular person, results about a different person may be found due to mismatch in names. Further, for a trending query, outdated document or content may be retrieved. This problem may be solved or at least mitigated by enforcing a time of match for information by the QA system 100 of the present disclosure. A trending query refers to a query that is currently popular or frequently asked by users within a specific period. These queries often reflect the current interests, concerns, or needs of the users, and they can be influenced by various factors such as recent events, popular culture, or seasonal topics.
[0023] In accordance with important aspects, the grounding appraisal agent 108 of the present disclosure may be configured to monitor performance on customer queries and their feedback, and proactively query various components via a monitoring subsystem 110 to identify the strengths and weaknesses of the QA system 100. In one embodiment, the monitoring subsystem 110 may monitor what is trending in real-world in terms of information need, then constructs (query, correct answer) from that knowledge. This information may be used to query and assess the QA system 100 to determine its successes and failures. As such, the monitoring subsystem 110 provides a forecast of future customer traffic trend in the QA system 100.
[0024] According to additional aspects, the grounding appraisal agent 108 may determine what is the correct best response to queries. This can be useful to replay the QA system 100 end-to-end with a different configuration to identify where the information retrieval may succeed. Based on the query data and the monitoring subsystem 110, the grounding appraisal agent 108 may determine the importance on various queries, thereby providing a realistic estimate of the system performance. The grounding appraisal agent 108 may also be configured to detect and appraise which step in the retrieval pipeline has a fault. Retrieval may be a multi-step procedure, so quantifying each step by the QA system 100 which contributes to identified successes and failures is important to make improvements realistically.
[0025] The LM-based QA system 100 of the present disclosure may enhance user experience, providing more accurate information, and handling complex tasks. As will be described fully below, the QA system 100 may integrate real-time data, access databases, APIs, or other external knowledge sources, ensuring that the responses to user queries are up-to-date and grounded in current information. In some embodiments, cross-domain knowledge (e.g., finance, healthcare, technology) may be obtained to provide comprehensive answers to user queries.
[0026] As shown in FIG. 1, the QA system 100 may include a computing device 104 (e.g., 104a, 104b, 104c, . . . 104n including but not limited to a voice-activated smart device, smartphone, desktop, laptop, tablet, etc.) local to a user 102, a natural language processing system 140 (abbreviated “subsystem 140”), and a subsystem 150 including dual LM-based agents for web-based-knowledge grounding and fine-tuning a retrieval pipeline of the QA system 100. All of the components and subsystems of QA system 100 are deployed within and connected across one or more network(s) 130. The network(s) 130 may include the Internet and / or any other wide- or local-area network, and may include wired, wireless, and / or cellular network hardware. Although the figures and discussion of the present disclosure illustrate certain steps in a particular order, the steps described may be performed in a different order (as well as certain steps removed or added) without departing from the present disclosure.
[0027] Referring to FIG. 2, in accordance with some embodiments, the computing device 104 may include audio capture component(s), such as a microphone or array of microphones, configured to capture audio 202 and generate corresponding audio data 206. Once speech is detected in audio data 206 representing the audio 202, the device 104 may determine if the speech contains a knowledge related query to be processed by the device 104 and the subsystem 150. For example, such determination may be carried out using a wakeword detection component 204. The wakeword detection component 204 may be configured to detect various wakewords. In at least some examples, each wakeword may correspond to a name of a different digital assistant. An example wakeword / digital assistant name is “Alexa.” In another example, input to the system may be in form of text data 208, for example as a result of a user typing an input into a user interface of device 104. Other input forms may include indication that the user has pressed a physical or virtual button on device 104, the user has made a gesture, etc. The device 104 may also capture images using camera(s) of the device 104 and may send image data 210 representing those image(s) to the system component(s). The image data 210 may include raw image data or image data processed by the device 104 before sending to the subsystem 140. The image data 210 may be used in various manners by different components of the system to perform operations such as determining whether a user is directing an utterance to the system, interpreting a user command, responding to a user command, etc.
[0028] The wakeword detection component 204 of the device 104 may process the audio data 206, representing the audio 202, to determine whether the audio data 206 includes speech using various techniques. In some examples, the device 104 may apply voice-activity detection (VAD) techniques. Such techniques may determine whether speech is present in audio data based on various quantitative aspects of the audio data 206, such as the spectral slope between one or more frames of the audio data; the energy levels of the audio data 206 in one or more spectral bands; the signal-to-noise ratios of the audio data 206 in one or more spectral bands; or other quantitative aspects. In other examples, the device 104 may implement a classifier configured to distinguish speech from background noise. The classifier may be implemented by techniques such as linear classifiers, support vector machines, and decision trees. In still other examples, the device 104 may apply hidden Markov model (HMM) or Gaussian mixture model (GMM) techniques to compare the audio data 206 to one or more acoustic models in storage, which acoustic models may include models corresponding to speech, noise (e.g., environmental noise or background noise), or silence. Still other techniques may be used to determine whether speech is present in audio data 206.
[0029] Wakeword detection may be performed without performing linguistic analysis, textual analysis, or semantic analysis. Instead, the audio data 206, representing the audio 202, may be analyzed to determine if specific characteristics of the audio data 206 match preconfigured acoustic waveforms, audio signatures, or other data corresponding to a wakeword.
[0030] Thus, the wakeword detection component 204 may compare audio data 206 to stored data to detect a wakeword. One approach for wakeword detection applies general large vocabulary continuous speech recognition (LVCSR) systems to decode audio signals, with wakeword searching being conducted in the resulting lattices or confusion networks. Another approach for wakeword detection builds HMMs for each wakeword and non-wakeword speech signals, respectively. The non-wakeword speech includes other spoken words, background noise, etc. There can be one or more HMMs built to model the non-wakeword speech characteristics, which are named filler models. Viterbi decoding is used to search the best path in the decoding graph, and the decoding output is further processed to make the decision on wakeword presence. This approach can be extended to include discriminative information by incorporating a hybrid deep neural network (DNN)-HMM decoding framework. In another example, the wakeword detection component 204 may be built on DNN / recursive neural network (RNN) structures directly, without HMM being involved. Such an architecture may estimate the posteriors of wakewords with context data, either by stacking frames within a context window for DNN, or using RNN. Follow-on posterior threshold tuning or smoothing is applied for decision making. Other techniques for wakeword detection, such as those known in the art, may also be used.
[0031] Once the wakeword is detected by the wakeword detection component 204 and / or input is detected by an input detector, the device 104 may “wake” and begin transmitting audio data 206, representing the audio 202, to the subsystem 140. The audio data 206 may include data corresponding to the wakeword; in other embodiments, the portion of the audio corresponding to the wakeword is removed by the device 104 prior to sending the audio data 206 to the subsystem 140. In the case of touch input detection or gesture based input detection, the audio data 206 may not include a wakeword.
[0032] More than one subsystem 140 may be implemented to respond to different wakewords and / or perform different categories of tasks. Each subsystem 140 may be associated with its own wakeword such that speaking a certain wakeword results in audio data 206 be sent to and processed by a particular system. For example, detection of the wakeword “Alexa” by the wakeword detection component 204 may result in sending audio data 206 to a first subsystem 140 for processing while detection of the wakeword “Computer” by the wakeword detector may result in sending audio data 206 to a second subsystem 140 for processing. Different wakewords and different skills / systems may be coordinated by one or more skill(s) 210 of one or more subsystems 140.
[0033] Upon receipt by the subsystem 140, the audio data 206 may be sent to an orchestrator component 212. In one aspect, the orchestrator component 212 may include memory and logic that enables the orchestrator component 212 to transmit various information and data to various components of the subsystem 140 and the subsystem 150, as well as perform other operations as described herein to determine whether the audio data 206 contain a knowledge related query to be processed by the subsystem 150.
[0034] The orchestrator component 212 may send the audio data 206 to a language processing component 214. The language processing component 214 (also referred to as a spoken language understanding (SLU) component) may include an automatic speech recognition (ASR) component 216 and a natural language understanding (NLU) component 218. The ASR component 216 may transcribe the audio data 206 into text data. The text data output by the ASR component 216 represents one or more than one (e.g., in the form of an N-best list) ASR hypotheses representing speech represented in the audio data 206. The ASR component 216 interprets the speech in the audio data 206 based on a similarity between the audio data 206 and pre-established language models. For example, the ASR component 216 may compare the audio data 206 with models for sounds (e.g., acoustic units such as phonemes, phones, etc.) and sequences of sounds to identify words that match the sequence of sounds of the speech represented in the audio data 206. The ASR component 216 sends the text data generated to the NLU component 218, via, in some embodiments, the orchestrator component 212. The text data sent from the ASR component 216 to the NLU component 218 may include a single top-scoring ASR hypothesis or may include an N-best list including multiple top-scoring ASR hypotheses. An N-best list may additionally include a respective score associated with each ASR hypothesis represented therein.
[0035] In some embodiments, the NLU component 218 may receive text data from the ASR component. The NLU component 218 may perform a semantic interpretation of the phrase(s) or statement(s) represented in the text data 208 by determining one or more meanings associated with the phrase(s) or statement(s). The NLU component 218 may determine an intent representing an action that a user desires be performed and may determine information that allows a device (e.g., the device 104, the subsystem 140, a skill component 210, a skill system component(s) 220, etc.) to execute the intent. For example, if the text data 208 corresponds to “play the 5th Symphony by Beethoven,” the NLU component 218 may determine an intent that the system output music and may identify “Beethoven” as an artist / composer and “5th Symphony” as the piece of music to be played. For further example, if the text data 208 corresponds to “what is the weather,” the NLU component 218 may determine an intent that the system output weather information associated with a geographic location of the device 104. In another example, if the text data corresponds to “turn off the lights,” the NLU component 218 may determine an intent that the system turn off lights associated with the device 104 or the user 102. However, if the NLU component 218 is unable to resolve the entity—for example, because the entity is referred to by anaphora such as “this song” or “my next appointment”—the language processing component 214 can send a decode request to another language processing component 214 for information regarding the entity mention and / or other context related to the utterance. The language processing component 214 may augment, correct, or base results data upon the received audio data 206, text data 208, and image data 210.
[0036] The NLU component 218 may return NLU results data (which may include tagged text data, indicators of intent, etc.) back to the orchestrator component 212. The orchestrator component 212 may forward the NLU results data to a skill component(s) 210. If the NLU results data includes a single NLU hypothesis, the NLU component 218 and the orchestrator component 212 may direct the NLU results data to the skill component(s) 210 associated with the NLU hypothesis. If the NLU results data includes an N-best list of NLU hypotheses, the NLU component 218 and the orchestrator component 212 may direct the top scoring NLU hypothesis to a skill component(s) 210 associated with the top scoring NLU hypothesis.
[0037] A skill component may be software running on the subsystem 140 that is akin to a software application. That is, a skill component 210 may enable the subsystem 140 to execute specific functionality in order to provide data or produce some other requested output. As used herein, a “skill component” may refer to software that may be placed on a machine or a virtual machine (e.g., software that may be launched in a virtual instance when called). A skill component may be software customized to perform one or more actions as indicated by a business entity, device manufacturer, user, etc. What is described herein as a skill component may be referred to using many different terms, such as an action, bot, app, or the like. The subsystem 140 may be configured with more than one skill component 210. For example, a weather service skill component may enable the subsystem 140 to provide weather information, a car service skill component may enable the subsystem 140 to book a trip with respect to a taxi or ride sharing service, a restaurant skill component may enable the subsystem 140 to order a pizza with respect to the restaurant's online ordering system, etc. A skill component 210 may operate in conjunction between the subsystem 140 and other devices, such as the device 104, in order to complete certain functions. Inputs to a skill component 210 may come from speech processing interactions or through other interactions or input sources. A skill component 210 may include hardware, software, firmware, or the like that may be dedicated to a particular skill component 210 or shared among different skill components 210.
[0038] A skill system component(s) 220 may communicate with a skill component(s) 210 within the subsystem 140 and / or directly with the orchestrator component 212 or with other components. A skill system component(s) 220 may be configured to perform one or more actions. An ability to perform such action(s) may sometimes be referred to as a “skill.” That is, a skill may enable a skill system component(s) 220 to execute specific functionality in order to provide data or perform some other action requested by a user. For example, a weather service skill may enable a skill system component(s) 220 to provide weather information to the subsystem 140, a car service skill may enable a skill system component(s) 220 to book a trip with respect to a taxi or ride sharing service, an order pizza skill may enable a skill system component(s) 220 to order a pizza with respect to a restaurant's online ordering system, etc. Additional types of skills include home automation skills (e.g., skills that enable a user to control home devices such as lights, door locks, cameras, thermostats, etc.), entertainment device skills (e.g., skills that enable a user to control entertainment devices such as smart televisions), video skills, flash briefing skills, as well as custom skills that are not associated with any preconfigured type of skill.
[0039] The subsystem 140 may be configured with a skill component 210 dedicated to interacting with the skill system component(s) 220. Unless expressly stated otherwise, reference to a skill, skill device, or skill component may include a skill component 210 operated by the subsystem 140 and / or skill operated by the skill system component(s) 220. Moreover, the functionality described herein as a skill or skill may be referred to using many different terms, such as an action, bot, app, or the like. The skill component 210 and or skill system component(s) 220 may return output data to the orchestrator component 212.
[0040] Dialog processing is a field of computer science that involves communication between a computing system and a human via text, audio, and / or other forms of communication. While some dialog processing involves only simple generation of a response given only a most recent input from a user (i.e., single-turn dialog), more complicated dialog processing involves determining and optionally acting on one or more goals expressed by the user over multiple turns of dialog, such as making a restaurant reservation and / or booking an airline ticket. These multi-turn “goal-oriented” dialog systems typically need to recognize, retain, and use information collected during more than one input during a back-and-forth or “multi-turn” interaction with the user.
[0041] According to some implementations, the subsystem 140 includes a language output component 222. The language output component 222 includes a natural language generation (NLG) component 224 and a text-to-speech (TTS) component 226. The NLG component 224 can generate text for purposes of TTS output to a user. For example, the NLG component 224 may generate text corresponding to instructions corresponding to a particular action for the user to perform. The NLG component 224 may generate appropriate text for various outputs as described herein. The NLG component 224 may include one or more trained models configured to output text appropriate for a particular input. The text output by the NLG component 224 may become input for the TTS component 226 (e.g., output text data discussed below). Alternatively, or in addition, the TTS component 226 may receive text data from a skill component 210 or other system component for output.
[0042] The NLG component 224 may include a trained model. The NLG component 224 generates text data from dialog data received by the dialog manager such that the output text data has a natural feel and, in some embodiments, includes words and / or phrases specifically formatted for a requesting individual. The NLG component 224 may use templates to formulate responses. Further, the NLG component 224 may include models trained from the various templates for forming the output text data. For example, the NLG component 224 may analyze transcripts of local news programs, television shows, sporting events, or any other media program to obtain common components of a relevant language and / or region. As one illustrative example, the NLG component 224 may analyze a transcription of a regional sports program to determine commonly used words or phrases for describing scores or other sporting news for a particular region. The NLG component 224 may further receive, as inputs, a dialog history, an indicator of a level of formality, and / or a command history or other user history such as the dialog history.
[0043] The NLG component 224 may generate dialog data based on one or more response templates. Further continuing the example above, the NLG component 224 may select a template in response to the question, “What is the weather currently like?” of the form: “The weather currently is $weather_information$.” The NLG component 224 may analyze the logical form of the template to produce one or more textual responses including markups and annotations to familiarize the response that is generated. In some embodiments, the NLG component 224 may determine which response is the most appropriate response to be selected. The selection may, therefore, be based on past responses, past questions, a level of formality, and / or any other feature, or any other combination thereof. Responsive audio data representing the response generated by the NLG component 224 may then be generated using the TTS 226.
[0044] The TTS component 226 may generate audio data (e.g., synthesized speech) from text data using one or more different methods. Text data input to the TTS component 226 may come from a skill component 210, the orchestrator component 212, or another component of the system. In one method of synthesis called unit selection, the TTS component 226 matches text data against a database of recorded speech. The TTS component 226 selects matching units of recorded speech and concatenates the units together to form audio data. In another method of synthesis called parametric synthesis, the TTS component 226 varies parameters such as frequency, volume, and noise to create audio data including an artificial speech waveform. Parametric synthesis uses a computerized voice generator, sometimes called a vocoder.
[0045] The device 104 may include still image and / or video capture components such as a camera or cameras to capture one or more images. The device 104 may include circuitry for digitizing the images and / or video for transmission to the subsystem 140 as image data. The device 104 may further include circuitry for voice command-based control of the camera, allowing a user 102 to request capture of image or video data. The device 104 may process the commands locally or send audio data 206 representing the commands to the subsystem 140 for processing, after which the subsystem 140 may return output data that can cause the device 104 to engage its camera.
[0046] Still referring to FIG. 2, a profile storage 228 may be used for storing a variety of information related to individual users, groups of users, devices, etc. that interact with the system. As used herein, a “profile” refers to a set of data associated with a user, group of users, device, etc. The data of a profile may include preferences specific to the user, device, etc.; input and output capabilities of the device; internet connectivity information; user bibliographic information; subscription information, as well as other information.
[0047] The profile storage 228 may include one or more user profiles, with each user profile being associated with a different user identifier / user profile identifier. Each user profile may include various user identifying data. Each user profile may also include data corresponding to preferences of the user. Each user profile may also include preferences of the user and / or one or more device identifiers, representing one or more devices of the user. For instance, the user account may include one or more IP addresses, MAC addresses, and / or device identifiers, such as a serial number, of each additional electronic device associated with the identified user account. When a user logs into to an application installed on a device 104, the user profile (associated with the presented login information) may be updated to include information about the device 104, for example with an indication that the device is currently in use. Each user profile may include identifiers of skills that the user has enabled. When a user enables a skill component 210, the user is providing the subsystem 140 with permission to allow the skill to execute with respect to the user's natural language user inputs. If a user does not enable a skill, the subsystem 140 may not invoke the skill component 210 to execute with respect to the user's natural language user inputs.
[0048] The profile storage 228 may include one or more group profiles. Each group profile may be associated with a different group identifier. A group profile may be specific to a group of users. That is, a group profile may be associated with two or more individual user profiles. For example, a group profile may be a household profile that is associated with user profiles associated with multiple users of a single household. A group profile may include preferences shared by all the user profiles associated therewith. Each user profile associated with a group profile may additionally include preferences specific to the user associated therewith. That is, each user profile may include preferences unique from one or more other user profiles associated with the same group profile. A user profile may be a stand-alone profile or may be associated with a group profile.
[0049] The profile storage 228 may include one or more device profiles. Each device profile may be associated with a different device identifier. Each device profile may include various device identifying information. Each device profile may also include one or more user identifiers, representing one or more users associated with the device. For example, a household device's profile may include the user identifiers of users of the household.
[0050] An entity resolver 230 may be used to determine that the input text data 208 includes a representation of one or more entities, a process that may include named entity recognition (NER)—i.e., determining that the input text data 208 includes the representation- and entity resolution (ER)—i.e., identifying a meaning or context of the entity, such as associating an identity of a person based on a recognized nickname. An entity may be a person, place, thing, idea, and / or goal; example entities include proper names, nicknames, business names, place names, and / or application names.
[0051] In some embodiments, a single entity resolver 230 is used for more than one domain (i.e., a “cross-domain” entity resolver 230). Each domain may correspond to one or more dialog models. One or more candidate domains corresponding to the input text data 208 may be determined; entity resolvers 230 corresponding to the candidate domains may be used to process the input text data 208. The dialog focus data may store the output entities from each candidate domain and may remove unselected entities when an API is selected or an action to be performed is determined.
[0052] The entity resolver 230 may utilize gazetteer information stored in an entity library storage. The gazetteer information may be used to match text data (representing a portion of the user input) with text data representing known entities, such as song titles, contact names, etc. Gazetteers may be linked to users (e.g., a particular gazetteer may be associated with a specific user's music collection), may be linked to certain skill components 210 (e.g., a shopping skill, a music skill, a video skill, etc.), or may be organized in a variety of other ways.
[0053] The entity resolver 230 may include a ranker component. The ranker component may assign a particular confidence score to each hypothesis input therein. The confidence score of a hypothesis may represent a confidence of the system in the processing performed with respect to the hypothesis. The confidence score of a particular hypothesis may be affected by whether the hypothesis has unfilled slots. For example, if a hypothesis associated with a first skill component includes slots that are all filled / resolved, that NLU hypothesis may be assigned a higher confidence score than another hypothesis including at least some slots that are unfilled / unresolved by the entity resolver 230. The focus data may store data relevant to a dialog. In various embodiments, the dialog focus data stores the input text data 208, other input data, entity data from the entity resolver 230 and / or action data and dialog data from an action selector. The dialog focus data may further include additional information, such as location data, user preference data, and environment data. In various embodiments, the dialog focus data uses an encoder to encode some or all of the received data into one or more feature vectors and a decoder to determine, based on the feature vectors, intent data corresponding to an intent of a user. The dialog focus data may further include state data that represents prior dialog, actions, or other prior user information or data.
[0054] In accordance with aspects, the orchestrator component 212 of the subsystem 140 may identify the received natural language input from the computing device 104 (e.g., the audio data 206, the image data 210, or the text data 208) contain a knowledge related query to be processed by the subsystem 150. A knowledge related query may generally refer to a request for information or an answer that can be retrieved from a structured or unstructured knowledge base. Subsequently, referring back to FIG. 1, the orchestrator component 212 of the subsystem 140 may send (step 1) the knowledge related query to the grounding agent 106. The grounding agent 106 may access a query database 112 (step 2) and a knowledge database 114 (step 3) to process the query data and plan the execution steps / actions. Initially, the received query may be decomposed or converted into a template. For example, the grounding agent 106 may normalize the query, identify various query structures, and map them to pre-defined response formats. This process generally involves understanding the intent of the query, extracting relevant entities, and transforming the query into a format that can be matched against a database (e.g., query database 112), the knowledge database 114, or set of pre-defined rules.
[0055] In some implementations, the query database 112 of the QA system 100 may store and manage queries made by users, along with their corresponding responses or the data necessary to generate those responses. It serves several purposes, including improving the efficiency and accuracy of the QA system 100, enabling quick retrieval of frequently asked questions, and providing data for system optimization and user behavior analysis. Specifically, the query database 112 keeps a record of all user queries submitted to the QA system 100. This can include the raw input, processed versions of the query, and metadata such as timestamps, user IDs, or session information. By analyzing stored queries, the QA system 100 may identify common patterns, recurring topics, or frequently asked questions. The data stored may be analyzed to understand user preferences, behavior trends, and the types of questions users are most interested in. Further, queries that are commonly asked may be stored along with their responses, allowing the QA system 100 to quickly retrieve and return answers without reprocessing the query. If a similar query has been processed before, the QA system 100 may retrieve the previous response from the query database 112, reducing the need for complex data retrieval operations. The QA system 100 may also use historical data to refine its query processing and answer generation mechanisms, leading to faster and more accurate results.
[0056] In certain embodiments, the query database 112 may store queries within the context of a conversation or session. This enables the QA system 100 to maintain context across multiple interactions, allowing for more coherent and contextually relevant answers. The query database 112 may assist in expanding or refining a query based on past interactions, improving the relevance of responses. The stored queries and responses may be used to train or fine-tune machine learning (ML) models or LMs that support the QA system 100. This is particularly useful for improving the NLU components of the QA system 100.
[0057] If users provide feedback on the accuracy or usefulness of responses, this feedback may be stored in the query database 112 and used to improve future responses. The query database 112 can be used to track and audit user interactions with the QA system 100, ensuring that responses are consistent with guidelines or regulations. In regulated industries, the query database 112 ensures that the QA system 100 complies with data protection and privacy laws by storing queries and responses in a secure and compliant manner.
[0058] According to various implementations, the structure of the query database 112 may include tables and collections. Depending on whether a relational or NoSQL database is used, the queries might be stored in tables (relational) or collections (NoSQL). Each record in the query database 112 may include: query ID (a unique identifier for each query), query data (e.g., the raw text of the query as input by the user or text representing an utterance of the user), processed query (a version of the query after NLP processing, such as tokenization, lemmatization, or entity extraction), response (the answer generated by the QA system 100), timestamp (the date and time when the query was made), user information (metadata about the user, if applicable, such as user ID, session ID, or demographic data), contextual data (information about the context in which the query was made, such as previous queries in the session), feedback (any feedback provided by the user about the accuracy or usefulness of the response), indexes and keys (indexes on fields like the query text, user ID, or timestamp), and relationships. For example, in relational databases, queries may be linked to other data entities, such as knowledge base entries, user profiles, or feedback records, through foreign keys.
[0059] The knowledge database 114 may be a structured repository of information that the QA system 100 uses to answer questions. It may contain data, facts, and rules organized in a way that allows the QA system 100 to retrieve relevant information efficiently and accurately. The knowledge database 114 may provide the necessary context and content for generating answers. For example, the user's query may be processed using NLP techniques to understand its intent and identify key components, such as entities (nouns or noun phrases) and properties (verbs, adjectives, or specific attributes related to the entities). Named entity recognition (NER) models may be used by the knowledge database 114 to identify and classify entities mentioned in the query. For example, in the query “What is the population of Paris?”, “Paris” is recognized as a geographic entity. The knowledge database 114 also identifies the relationships or properties associated with the entities. In the same example, “population” is recognized as the property related to the entity “Paris.” If the knowledge database 114 uses an ontology or a taxonomy, it maps the identified entities and properties to corresponding concepts in the ontology. For example, “Paris” may be mapped to a node in the knowledge graph labeled “City,” and “population” may be mapped to a property connected to that node. The knowledge database 114 may reformulate the natural language query into a structured query language, such as SPARQL (for RDF triple stores) or SQL (for relational databases). This structured query explicitly defines how to retrieve the desired information from the knowledge database 114.
[0060] In some embodiments, the grounding agent 106 queries the knowledge database 114 to find the node or record corresponding to the identified entity. For example, the query may search for all nodes labeled “City” where the name property equals “Paris.” Once the correct entity is found, the knowledge database 114 retrieves the value of the specified property. For instance, it may extract the “population” property from the “Paris” node. If the query involves derived information (e.g., “Who is the current president of France?” where “current” implies temporal reasoning), the knowledge database 114 may use inference rules or temporal logic to identify the relevant property value. The retrieved data may be formatted into a human-readable response.
[0061] In one embodiment, when handling simple and straightforward queries where the structure is predictable, the grounding agent 106 may define patterns or regular expressions that match common query formats. When a query matches a pattern, it can be converted into a corresponding template. For example, for a query “What is the capital of France?”, a template may be: “What is the capital of [COUNTRY]?”, when the regular expression: What is the capital of (.+) \?.
[0062] For complex sentences where understanding the syntactic structure is necessary, the grounding agent 106 may analyze the grammatical structure of the query using dependency parsing to identify the relationships between words. The parsed structure may identify the main intent and entities, which can then be mapped to a template. For example, a query may be: “Who wrote ‘The Silent Patient’?”, the determined parsed structure may be: Subject (Who), Verb (wrote), Object (‘The Silent Patient’). The template may be: “Who [VERB] [BOOK]?”
[0063] When a query may relate to specific entities like names, dates, or locations, the grounding agent 106 may use named entity recognition (NER) to identify entities within the query (e.g., people, places, organizations). These entities may be replaced with placeholders in the template. For example, in response to receiving a query: “Show me flights from New York to San Francisco.”, the NER output may be: [Location] New York, [Location] San Francisco, and the resulting template may be: “Show me flights from [CITY_A] to [CITY_B].”
[0064] In some implementations, especially useful in conversational agent or voice assistants that handle a wide range of query types, the grounding agent 106 may use ML models to identify the intent of the query and then extract specific slots (i.e., entities or values) that are relevant to the intent. The extracted slots may be used to populate a template. For example, in response to receiving a query that “Book a table at a French restaurant in Manhattan for tomorrow evening.”, the identified intent is “Book a table,” and the slots are: [Cuisine: French], [Location: Manhattan], [Time: tomorrow evening]. The resulting template may be: “Book a [CUISINE] restaurant in [LOCATION] for [TIME].”
[0065] According to another embodiment, the grounding agent 106 may process complex queries that require a deep understanding of relationships between different parts of the query. Specifically, the query may be translated into a logical form or a semantic representation that captures the meaning of the query. This form may then be mapped to a template. For example, for a query: “Find all articles written by John Doe in 2021.”, an semantic representation may be: Find (articles, author=John Doe, year=2021). The resulting template may be: “Find [ITEM] written by [AUTHOR] in [YEAR].”
[0066] For multi-turn conversations where the context influences the query structure, the grounding agent 106 may leverage the context of the conversation to dynamically generate a template. This may involve using previous interactions or inferred user preferences. For example, a query may be: “What about flights to Los Angeles?” and the context may include a prior query regarding flights from New York. The resulting template may be: “Show me flights from [PREVIOUS_CITY] to [NEW_CITY].”
[0067] According to additional embodiments, the grounding agent 106 may train multiple ML models on a large corpus of question-template pairs to learn how to automatically generate templates from user queries, when manually defining all possible templates is infeasible. This approach can be particularly useful when dealing with a diverse set of queries. For example, in response to a query that “How can I reset my password?”, an example output may be “How can I [ACTION] my [ITEM]?” The resulting template may be: “How can I reset my password?”
[0068] In some cases, domains with predictable query structures where heuristic rules can be easily defined. Accordingly, the grounding agent 106 may apply a set of heuristic rules based on common query patterns, domain knowledge, or simple if-else logic to transform the query into a template. For example, for a query “Tell me the population of Tokyo.”, a determined heuristic rule may be: Queries starting with “Tell me” can be transformed into “What is the [SUBJECT]?” The resulting template may be: “What is the population of [CITY]?”
[0069] When searching databases or enterprise systems, queries may be reformulated to match SQL-like queries. In an embodiment, the grounding agent 106 may identify key phrases or keywords in the query and reformulate the query into a template using predefined phrases. For example, for a query “List all employees who joined after 2019.”, the identified key phrases may include “List all”, “employees”, “joined after.” The resulting template may be: “List all [ENTITY] who [CONDITION].”
[0070] According to additional embodiments where high accuracy and flexibility are needed in complex query handling, the grounding agent 106 may combine multiple methods, such as using NER followed by pattern matching or combining dependency parsing with semantic parsing, to create more robust templates. For example, for a query “What's the weather like in Paris tomorrow?”, the NER may be: [Location: Paris], [Time: tomorrow], the dependency parsing may be: Main intent (weather query), and the template may be: “What's the weather in [CITY] on [DATE]?”
[0071] It should be appreciated that the aforementioned and other suitable approaches and implementations to convert a query into a template may be used individually or in combination with one another, depending on e.g., the complexity of the queries and the desired level of precision and flexibility in matching user queries to templates.
[0072] Both the original form and template version of the received query may be used by the grounding agent 106 to search in the query database 112 (step 2) and the knowledge database 114 (step 3) to generate understanding signals (step 5) of the received query (step 1). According to one implementation, the query database 112 may be in a templatized form. That is, inputs to the query database 112 are structured using templates in predefined, parameterized formats, rather than being written as unique, one-off queries each time. As a result, the way queries are generated and executed by the query database 112 is standardized, allowing for flexibility, reusability, and consistency. For example, the template used by the query database 112 may include placeholders or parameters for specific values or conditions. Instead of writing a complete SQL query for different scenarios, the variables or parameters of the template used by the query database 112 may be replaced with actual values at runtime. For instance, a template may include a placeholder for a date or a customer identifier that may be filled in when the query is executed. Using templates ensures that queries are consistently structured in the query database 112, reducing the risk of errors and improving maintainability. This is especially important in large systems where many similar queries may be run frequently. Further, the query database 112 may dynamically generate SQL queries based on user inputs or other runtime conditions, making the querying process more flexible and adaptable to different needs.
[0073] According to one implementation, a received query “compare crime rates in California and New York” may be templatized as “[assess] [safety statistics] in [location] and [location]”. This template may be used in fetching queries which were executed successfully, and it may become “[safety statistics] in [location]” by which the grounding agent 106 can split the query into “[safety statistics] in [location]” for two different locations, namely, crime rates in California and crime rates in New York. In another example, if a query search retrieves specific information, [latest_info] [John Doe] (for “what is the news with John Doe”), there may be other queries of the form “John Doe's health” or “when John Doe's health started declining due to XYZ Syndrome.” The template may accordingly become: [latest_info] [health / XYZ Syndrome] [John Doe], which provides an enriched query.
[0074] Some other understanding signals of the received query may be obtained by searching the query database 112 and the knowledge database 114 including but not limited to: (i) trendiness of the query, which determines a time range of retrieved documents, (ii) presence of entity in the knowledge database 114 (step 6), and (iii) attributes of the entity or event from the knowledge database 114 (step 6) (e.g., superbowl 2024 can also be mentioned as superbowl LVIII aka alias, which helps to expand the search).
[0075] According to various aspects, the query database 112 may detect trendiness in time-sensitive user utterances or objects (e.g., web feeds, classic Alexa question-answering, information grounding). Performing trend detection over a complete set of obtained query or URI streams, the query database 112 may accordingly generate signals on trendiness of any topic or utterance by providing aggregate time-series statistics of different kinds (e.g., top stories). Additionally, the query database 112 may enrich uniform resource locators (URLs) with additional trending information from those same query streams to power different recommendation experiences. Providing these foundational trending signals may enable different experiences to incorporate a set of curated trending signals from all available query streams into their ranking and recommendation models, thereby improving time-sensitive user experiences across many services that may be provided by the QA system 100 of the present disclosure. Abstractions over many different query streams may also be created. In certain embodiments, when performing detection, collection, and production of trending information and signals, the query database 112 may use techniques that are document centered, query centered, and / or click centered. For a given stream of documents or URLs, trending signals may be identified and collected based on e.g., pre-identified list of domains, explicitly or implicitly, containing trending information. If no trending signal has been pre-identified in the stream of documents, queries or user clicks, the query database 112 may perform detection and collection of the trending signals contained in the received stream of data. For example, document centered trend detection may be carried out by clustering news articles and detecting entities which are then used to drive the feeds experience.
[0076] In certain implementations, BERT based question shape detectors may be utilized to identify and classify the structure or shape of questions. This shape may refer to various aspects, such as question type, intended answer format, and structural patterns. Specifically, a BERT based question shape detector may identify whether a question is a yes / no question, a “wh-” question (who, what, when, where, why, how, etc.), a choice question, etc. Further, the question shape detector may detect whether the expected answer is a fact, a list, a definition, an explanation, or some other format. Recurring linguistic patterns in questions may also be identified, such as whether the question is open-ended or close-ended, or whether it requires a simple answer or a more complex one.
[0077] To process real time signals from query streams, the query database 112 may enrich these query streams by tagging, consolidation and then feed them into a sematic matching index. For example, the query database 112 may concurrently include two offline components: a query stat aggregator and an URL enrichment service which processes the incoming stream of records and provide access to URL and query level features through a low latency runtime feature store that is continuously updated by a background service as new data appears. This feature store may be available to be accessed by any downstream service to obtain signals on trendiness of URLs or queries at runtime.
[0078] According to various embodiments, the query stat aggregator of the query database 112 may perform record enrichment and consolidation by enriching and consolidating all incoming query streams into uniform records, removing reliance on one query stream vendor. These records may then be aggregated and time-series like features may be created on a query-by-query basis. Further, since queries and URLs are arriving through the query stream, the URLs flowing through the pipeline may be enriched with real-time query signals from the record enrichment. This will enable feeds like experiences to better discover trending topics to surface to users. Enriched query records may be streamed into a question bank index of the query database 112 and can be used to lookup statistics from the query stat aggregator over time.
[0079] The query database 112 may provide downstream applications with a set of ranking features (e.g., real-time, low latency query level and URL level features) that can be used inside corresponding ranking and recommendation models (e.g., snippet ranking, document ranking, feeds URL recommendation etc.) instead of providing binary decision on trendiness before retrieval or ranking. That is, the query database 112 may follow the principle of making late-binding decisions with as much information available as possible. That is, a decision on “trendiness” of a user interaction may be made as late as possible in the processing pipeline, such that as much data as possible is available to make this decision. Specifically, a received query is not classified as trending by only considering its live index. Rather, all possible signals may be incorporated into stages of ranking and recommendation pipelines to enable the query database 112 to leverage as many signals as possible. For example, twitter mentions might be an important signal for feeds ranking but not for trending QA. A dedicated system may be used to create, serve and propagate these signals to all components of the ranking and recommendation pipelines. For example, a low-latency feature store may serve these features to all downstream components and applications. Moreover, an offline processing pipeline may be implemented to take in query streams, abstract over them, and derive different query features from them to power different experiences. The query database 112 may also leverage extensive query streams with billions of records daily that inform the computing system of the present disclosure about what people search about in the world each day.
[0080] For example, with respect to a query= “Australia open”, date= “Jan. 26, 2024”, the semantic match in the query database 112 is tennis and the features returned as follows:
[0081] [
[0082] “top_stories_15m”: 0, “top_stories_1 h”: 12,
[0083] “top_stories_12 h”: 32,
[0084] “top_stories_1 day”: 42,
[0085] “top_stories_1w”: 3423,
[0086] “top_stories_1m”: 3531,
[0087] “top_stories_6m”: 3612,
[0088] “top_stories_12m”: 3912,
[0089] “twitter_mentions_1 day”: 32132,
[0090] “click_through_news_article”: 0.8,
[0091] “click_through_wikipedia”: 0.1,
[0092] “kic_shows_knowledge_graph”: 1.0,
[0093] “kic_shows_image”: 1.0,
[0094] “recent_crawled_page_count_1 day”: 4323,
[0095] “alexa_user_interest”: 0.8,
[0096] “is_shopping”: 0,”
[0097] is_programming”: 0,
[0098] “is_sport”: 1,
[0099] . . .
[0100] ]
[0101] These returned features may be used by document or snippet ranking, in addition to document level features, to learn when a query requires recent information, which might not be binary. In one aspect, since trendiness generally is not a binary decision, the query database 112 may make late-binding ranking decisions based on crawling information, document level information, and query stream information and other dimensions at ranking time not before ranking takes place.
[0102] In addition to query level features, the query database 112 also provides URL level features that originate from input query streams. This will enable associating query level features with specific URLs, enabling trending recommendation of URLs and ranking features associated with documents. These URL level features may be updated on a continuous basis and can be accessed via a low latency runtime API.
[0103] As such, the grounding agent 106 may access (step 2) the query database 112 at runtime to obtain query and document level features to conduct integration into various ranking systems to improve ranking performance. For example, these features may be integrated into a query feature store, as disclosed above, to obtain query level trendiness features at runtime and use them in different ranking stages (document ranking and snippet ranking). These features may further be integrated into an URL level feature store to obtain URL document level trendiness features at runtime that are continuously updated.
[0104] On the other hand, recommendation (feeds) seeks to suggest items based on user preferences, past interactions or similarity to other users and items. Similarly, recommendation decisions may be made with as much available data as possible. To improve recommendation performance, the grounding agent 106 may access the query database 112 to obtain up-to-date features of all existing and newly arriving URLs (e.g., what queries were they shown for?), and obtain features if user interests are trending (e.g., query features, user cares about “tennis”, is it currently trending?), and obtain interaction data (e.g., users who search for X also search for Y available in similar web).
[0105] Once a decomposed and enriched query is generated, the grounding agent 106 may determine the search actions, i.e., to parametrize the search queries with required input, such as the query and metadata to satisfy e.g., time range of documents. As shown in FIG. 1, the grounding agent 106 may perform (step 7) auto-discovery of metadata relating to the query via a content and metadata index subsystem 116. The decomposed and parametrized search request may be used (step 8) by the grounding agent 106 to identify the right search tools via API tools 118 to retrieve the answer. For example, appropriate API tools 118 may be determined and used for search in e.g., content and metadata index subsystem 116 (step 10), and the knowledge database 114. Other search approaches such as lexical search, neural search, and hybrid ranker may be used as well.
[0106] In one aspect, the content and metadata index subsystem 116 may employ various indices to enable the LM-based agent-style QA system 100 of the present disclosure to provide accurate and relevant answers quickly, even when dealing with large and complex datasets. A content index refers to the structured organization and indexing of the actual text or data that the QA system 100 uses to locate answers. This involves creating a searchable index of the contents of documents, articles, or any data source the QA system 100 is using. For example, the text from various documents may be processed and partitioned into smaller units, like words or phrases, which are then stored in a way that allows for fast retrieval. This index allows the QA system 100 to quickly find and retrieve relevant content based on a user's query. During semantic indexing, the content is indexed not just by exact words but by the meaning or concepts behind the text. This allows the QA system 100 to match user queries with content that may not use the exact same words but is semantically similar. Further, specific entities (e.g., names, places, dates) and key phrases are often indexed separately to enhance the retrieval of highly relevant answers. A metadata index refers to the structured data that describes the content, rather than the content itself. This metadata may be associated with each document or piece of content and is used to improve the accuracy and relevance of search results. For example, document metadata includes information regarding a document as a whole, such as the title, author, publication date, and source. The QA system 100 may use the document metadata to filter and prioritize results based on relevance to the user's query. Content metadata may include information regarding attributes or tags applied to specific sections or pieces of content within a document, such as topic categories, keywords, summaries, or mentions of important entities (people, places, etc.). Further, structural metadata may include information about the structure of the content, such as headings, subheadings, paragraphs, and sections. The QA system 100 may use the structural metadata to understand the layout and organization of information, allowing it to more effectively locate the right answer. In addition, user metadata may include information related to users querying the QA system 100, such as their preferences, past interactions, and roles. The user metadata may be used in personalizing the responses and improving the relevance of the answers provided. As such, the content index of the content and metadata index subsystem 116 allows the QA system 100 to directly search through and retrieve relevant text or data that may answer the user's question. On the other hand, metadata index of the content and metadata index subsystem 116 enhances the search process by allowing the system to consider additional attributes and filters, ensuring that the most relevant and contextually appropriate answers are retrieved.
[0107] Depending on the topic of the received query, the grounding agent 106 may first select (step 9) an index using the content and metadata index subsystem 116. If a query is related to finance, an index based on financial embeddings may be appropriate. If the query is related to biomedical, a domain-specific index may be more suitable. Subsequently, based on other query understanding signals (at least from step 5), the retrieval approaches may be selected the grounding agent 106. For example, if a query or sub-query involves rare topics or events, the API tools 118 may rely on lexical exact matches (high match threshold). A threshold in this context refers to the criteria that determine how closely a document or passage must match the query to be considered a relevant result. A high match threshold means the QA system 100 is looking for very close, if not perfect, matches between the query and the indexed content. The QA system 100 may only return results where most or all of the words in the query appear in the same order or very close proximity in the text. There may be little tolerance for variations, such as different tenses, singular / plural forms, or synonyms. If the query is “global warming,” a high threshold may discard documents that mention “climate change” unless “global warming” is explicitly mentioned.
[0108] In some embodiments, the match threshold for lexical matches used by the API tools 118 may be adjusted, allowing for more flexibility in how closely the search results need to align with the query, thereby balancing precision and recall. A lower threshold may be used by the QA system 100 to locate results that only partially match the query. This may include variations like different word forms, similar but not identical phrases, or even results where only a subset of the query terms appear. As such, using a lower threshold will return a wider range of results, potentially including more loosely related documents that share some but not all of the query terms, with increased recall (the proportion of relevant results returned) and lower precision. By contrast, using a higher threshold may increase precision with lower recall.
[0109] In some implementations, the grounding agent 106 may dynamically adjust the threshold of a query search. For example, a high threshold may be initially employed to get the most precise results, and then lowered if the search needs to be broadened. The threshold may also be adjusted automatically based on the context or the type of query. For instance, a general information query may use a lower threshold to gather more diverse information, while a legal query may use a higher threshold to ensure exact matches.
[0110] To implement threshold adjustments, the API tools 118 may assign different weights to various components of a match (exact word, partial word, proximity, etc.). Adjusting the threshold changes how these weights influence the final score of a match. In another example, the API tools 118 may initially employ a strict Boolean (exact match) approach but switch to fuzzy matching (allowing slight variations or errors) when the threshold is lowered.
[0111] For a high threshold, the API tools 118 may prioritize phrase matching (exact sequences of words). For a lower threshold, the API tools 118 may be more permissive, matching on individual terms even if they appear in different parts of the document.
[0112] If a query does not specify the requested information directly e.g., “suggest some remedies for nausea and 100 degrees fever”, then a neural approach may be determined and used by the API tools 118. A neural approach leverages deep learning models, particularly neural networks, to understand and retrieve relevant information from large datasets. Unlike traditional keyword-based search methods, which rely on lexical matching, a neural search may focus on understanding the semantic meaning of queries and documents. This allows the QA system 100 to provide more accurate and contextually relevant answers, even when the query does not exactly match the wording of the source content.
[0113] Neural search systems often use word and sentence embeddings like Word2Vec, GloVe, or more advanced models like BERT and GPT. These embeddings convert words, sentences, or even entire documents into dense vector representations in a high-dimensional space. Because these embeddings capture the semantic meaning of words, phrases, and sentences, the QA system 100 may compare the similarity between the query and potential answers based on meaning rather than exact word matches. For example, “car” and “automobile” would have similar embeddings, so the QA system 100 may recognize them as related search results.
[0114] Models like BERT and GPT are particularly effective in understanding the context of words within a sentence. For example, in the sentence “bank” may refer to a financial institution or the side of a river, depending on the surrounding words. These models can disambiguate such terms based on their context. Neural approaches may consider the broader context of a query, including previous questions in a conversational AI system or related content, to better understand the intent and retrieve more relevant information.
[0115] After retrieving a set of potential answers or documents, the QA system 100 may use neural networks to rank them based on how well they match the query semantically. An example process may involve scoring the relevance of each document or passage using techniques like cross-attention mechanisms, which compare the query directly to the text. Neural search models may be fine-tuned on specific domains or datasets, improving their ability to rank and retrieve information relevant to specialized areas, such as legal texts, medical research, or technical documentation.
[0116] Instead of just retrieving whole documents, neural approaches may retrieve specific passages or snippets that directly answer the query. On the other hand, a neural search may involve a multi-stage process where an initial, broad set of documents is retrieved using traditional methods (e.g., BM25), and then a neural model refines and re-ranks these results to deliver the most relevant answers.
[0117] Additionally, certain neural approaches may use reinforcement learning to improve over time. An example neural approach may learn from user interactions, such as clicks and selections, to adjust how it ranks and retrieves information. By training on large datasets and user feedback, neural models can continuously improve their understanding of language and context, leading to more accurate and relevant search results.
[0118] Neural approaches can understand the meaning behind words and phrases, which allows them to retrieve relevant information even when the query does not match the text exactly. The context awareness of these approaches makes them more effective in answering complex or nuanced questions. By leveraging advanced models like transformers, neural search can provide more accurate and contextually appropriate answers compared to traditional keyword-based methods. Moreover, neural search is more flexible in handling synonyms, paraphrasing, and variations in language, making it particularly useful in natural language understanding tasks.
[0119] As an example, during a neural search, a user's query may be initially converted into an embedding using a neural model like BERT. The QA system 100 may generate embeddings for the documents or passages in its database. The query embedding may be compared with the document embeddings to find semantically similar content. The top results may be re-ranked using a neural ranking model, which considers both the semantic similarity and the relevance of the content. The QA system 100 then provides specific answers by extracting the most relevant passage or snippet from the top-ranked documents.
[0120] In addition, in determining the right API tools 118, the grounding agent 106 may specify the % of documents from each of the approaches and / or thresholds of similarity for the approaches. That is, the grounding agent 106 may leverage various ranking techniques to improve the relevance and accuracy of the answers provided. For example, by combining the speed and precision of lexical matching with the deep understanding and context-awareness of neural models, a hybrid ranker approach may be employed by the API tools 118 in answering complex queries.
[0121] Such a hybrid approach may combine lexical ranking algorithms (e.g., BM25 and TF-IDF) with advanced methods based on neural models. The former relies on the frequency of query terms in documents and how rare those terms are across the entire collection. Documents may be ranked based on exact word matches and term importance. Further, Boolean matching may be used to rank documents based on whether they contain certain keywords or phrases from the query. Boolean matching may be highly precise but may miss relevant documents that use different wording.
[0122] As disclosed above, neural models, such as BERT or GPT, may be used to understand the semantic meaning behind queries and documents. They rank results based on the similarity of meaning, rather than just matching words. These models consider the context in which words appear, allowing the QA system 100 to rank documents based on their relevance to the entire query, even if they do not contain the exact words used in the query.
[0123] According to one implementation, the grounding agent 106 may initially specify a traditional lexical ranker, like BM25, to quickly retrieve a broad set of potentially relevant documents or passages based on exact word matches with the query. This stage ensures that documents with a high lexical overlap with the query are included in the results, providing a strong baseline. After the initial retrieval, a neural ranker may be utilized to re-evaluate the top documents. This neural model assesses the relevance of each document by considering the semantic similarity between the query and the document content. The neural ranker may re-order the results, moving documents with higher semantic relevance to the top, even if they are not the highest-ranked based on lexical criteria.
[0124] In implementing the hybrid ranker approach, in one embodiment, the grounding agent 106 may assign different weights to the scores from the lexical and neural rankers, creating a final ranking score that is a weighted sum of both. For example, if precision is crucial, the neural ranker's score might be weighted more heavily. In another example, a cascade or multi-stage ranking may be used where results from a lexical ranker are passed through a neural ranker in stages, progressively refining the ranking. This approach reduces the computational cost by limiting the use of the more resource-intensive neural model to a smaller set of documents.
[0125] The API tools 118 may also use a hybrid ranker to integrate additional features, such as user feedback, click-through data, or metadata, to further refine the ranking. For example, if a user has previously clicked on certain types of documents, the ranking may be adjusted to prioritize similar content. Continuous learning from user interactions allows the hybrid ranker to evolve and improve over time.
[0126] Moreover, by combining lexical and neural approaches, the API tools 118 may employ a hybrid ranker to achieve a better balance between precision (finding the most relevant documents) and recall (ensuring that all relevant documents are considered). As a result, the QA system 100 can manage both exact matches and semantically related content, making it more robust in handling different types of queries. Moreover, a hybrid approach may allow for efficient initial filtering using lightweight methods (e.g., BM25), followed by more intensive processing (neural re-ranking) on a smaller, more relevant set of documents. The integration of neural models leads to a better understanding of the context of queries, improving the relevance of answers, especially in complex or nuanced scenarios.
[0127] For example, for a trending query “what happened to Baltimore's key bridge”, if there are similar queries in the past month starting from end of March, then the predicted search config may be determined as follows:
[0128] {
[0129] “query”: “what happened to Baltimore's key bridge”,
[0130] “entity”: “Baltimore's key bridge”,
[0131] “expected time”: 26 Mar. 2024
[0132] }
[0133] The query may be searched against indexes, using lexical / neural retrieval approaches. In addition, the search emphasizes that the output contains Baltimore's key bridge as the entity name and the output duration to be the from end of March 2024.
[0134] In some embodiments, there may be two different indexes for recent data and old data (static and live indexes). For a trending query, the grounding agent 106 may search deeper in live index than static index. As shown below, the depth of a live search may be set to be 100, higher than a static search depth of 50.
[0135] {
[0136] “query”: “what happened to Baltimore's key bridge”,
[0137] entity”: “Baltimore's key bridge”,
[0138] “expected time”: 26 Mar. 2024,
[0139] “static_search_depth”: 50,
[0140] “live_search_depth”: 100
[0141] }
[0142] That is, the grounding agent 106 may vary the retrieval configuration (e.g., retrieval depth) for evergreen and time-sensitive questions to provide optimal results. Retrieval depth refers to the number of documents or pieces of information that are retrieved from a larger database or corpus in response to a query before the QA system 100 of the present disclosure begins to process or rank them for relevance to the query. As disclosed above, the grounding agent 106 receives a query and processes it to understand the intent and keywords. Thereafter, a certain number of documents or passages may be retrieved from a larger corpus that are likely to contain the answer. The retrieval depth indicates how many of these documents are initially pulled in. For instance, a retrieval depth of 100 means that the top 100 most relevant documents are retrieved based on the initial query. From the retrieved documents, the QA system 100 extracts the most relevant answers and ranks them according to relevance or confidence scores. A higher retrieval depth may increase the chances of finding the correct answer but can also lead to increased processing time and computational cost. Balancing retrieval depth is crucial. If a retrieval is too shallow, the QA system 100 may miss relevant documents; however, if a retrieval is too deep, and the QA system 100 may get overwhelmed with irrelevant data, affecting accuracy. Retrieval depth influences both the efficiency and effectiveness of the QA system 100 of the present disclosure by controlling how many documents are considered for answer extraction. In accordance with one example study conducted in the context of elastic search, different retrieval configurations may impact recall which correlates with snippet-level output improvements (e.g., top-k snippet in FIG. 1). Specifically, increasing retrieval depth may contribute to a significant boost in recall. Varying other parameters such as dense indexing (DI), dense passage retrieval (DPR), learning to rank (LTR) may also help fine-tune the search results. For example, keeping LTR docs at a selected threshold (e.g., 20 per shard) may be important to preserve recall for evergreen questions, and increasing DI / DPR while keeping the numbers of LTR docs and elastic search docs at selected thresholds may increase the recall for both evergreen and time-sensitive questions. Furthermore, different configurations may be determined and used for different applications. For example, for voice-activated applications such as Alexa, faster result retrieval may be desired, but a deeper search may be carried out with another configuration for a different application.
[0143] As shown in FIG. 1, the processing results of the API tools 118 may include top-k web documents and knowledge data outputs (step 11). Top-k web documents refer to the top “k” number of web documents (where “k” is a specified number) that are most relevant to a given query. These documents are retrieved from the web or a document repository and are used to generate an answer to the user's question based on selected ranking algorithms. As disclosed above, the grounding agent 106 processes and understands a query based on NLP using e.g., tokenization, part-of-speech tagging, NER, and query reformulation in certain implementations to better match the retrieval mechanisms. As described above, a decomposed and parametrized search request (from step 8) may be generated by the grounding agent 106 and input into the API tools 118 for searching the web and / or a specific databases or corpus of documents and retrieving the documents relevant to the query. The API tools 118 may assign a relevance score to each document it finds, based on how well the content of the document matches the query. As disclosed above, this process may use information retrieval methods like TF-IDF, BM25, or more advanced methods like embeddings and neural search models. The documents may be sorted by their relevance scores and the top-k (e.g., top-5, top-10) documents may be selected in accordance with defined criteria. These results are the ones most likely to contain the correct or most useful information for answering the received query. In one embodiment, the retrieved documents may be parsed from the API response by the API tools 118, by e.g., extracting the text, metadata (such as the URL, title, and snippet), and the structure (e.g., headings, bullet points) of the documents. The selected top-k documents may be further processed to improve answer extraction, such as text pre-processing by cleaning and normalizing the text for downstream tasks, chunking via partitioning documents into smaller sections or passages to focus on the most relevant parts, and using embeddings (e.g., BERT, GPT) to understand the context of the text within these documents.
[0144] In another embodiment, the top-k documents generated by the API tools 118 (step 11) may be used to either directly extract an answer (extractive QA) or generate a response (generative QA). For extractive systems, it may identify the most relevant sentence or passage. For generative systems, it may involve synthesizing information from multiple documents to form a coherent response. The API tools 118 may be configured to balance retrieving a sufficient number of documents (k) with the time it takes to fetch and process them. Higher k-values may increase the chances of finding the right information but also increase the noise, so relevance scoring and ranking are crucial. Ensuring that the top-k documents cover a range of perspectives or subtopics is important for generating a comprehensive answer.
[0145] Referring still to FIG. 1, according to some aspects, a dynamic document chunk LM 120 may be used to obtain portions of the top-k documents which can help answer the user question. This requires understanding what the query demands, and understand the raw hypertext markup language (HTML) source to weigh different elements in the HTML. For example, a query may relate to the latest score of a football game, and if the retrieved webpage has a table of scores, then may become an important element to fetch. The grounding agent 106 may configure the dynamic document chunk LM 120 to analyze the entire HTML structure and employ dynamic chunking to retrieve text and paragraphs, table or sub-table and so on in order to generate top-k snippets (step 12). Unlike static chunking, where the document is divided into fixed-size pieces, the dynamic document chunk LM 120 adaptively divides the received top-k web documents (from step 11) based on the context, semantics, or specific instructions. As such, each chunk contains coherent and contextually related information, improving the understanding and response accuracy to the query. By breaking the document into chunks, the dynamic document chunk LM 120 can process large documents more efficiently. This is particularly useful for handling long texts where traditional LMs might struggle with memory limitations or context loss. Dynamic chunking may maintain context across different parts of each top-k document. The dynamic document chunk LM 120 may reference previous chunks or adjust the chunk boundaries to ensure that the context is preserved throughout the document processing.
[0146] A HTML source of a top-k document may contain both the content and structural information that may be used to segment the document into manageable chunks or snippets. For example, the HTML source document may be parsed to understand its structure. This includes identifying tags like (paragraph), <h1>, <h2>, etc. (headings), (list items), , and others that denote different parts of the content. The dynamic document chunk LM 120 may extract text content from relevant tags, filtering out irrelevant parts such as navigation bars, footers, ads, or other non-content elements. Further, the hierarchical structure provided by the HTML tags may be used to segment the document into meaningful chunks. For example, content under a specific <h2> may be grouped together as one chunk. Dynamic chunking may also be implemented in accordance with the length of text and semantic coherence. If a section is too long, it may be further divided into smaller, semantically consistent chunks to make processing easier. The dynamic document chunk LM 120 may apply heuristics, such as segmenting at paragraph breaks or after headings, to ensure each chunk is self-contained and relevant. To generate top-k snippet, the dynamic document chunk LM 120 may initially match the user's query against each chunk to determine relevance, identifying exact or semantic matches. Embeddings (e.g., BERT) may be used to encode both the query and document chunks into vectors and compute similarity scores to rank them. Based on these relevance scores, the top-k chunks may be selected as snippets. These are the segments most likely to contain the answer to the user's query. The dynamic document chunk LM 120 may further refine these chunks into concise snippets. For example, sentence-level scoring or selecting the best representative sentence from the chunk may be carried out. In certain instances, the dynamic document chunk LM 120 may add surrounding sentences to ensure that the snippet preserves the context required to understand the information correctly. Relevant terms or phrases in the snippet may be highlighted to emphasize their connection to the user's query.
[0147] According to various embodiments, the API tools 118 and the dynamic document chunk LM 120 may collectively perform retrieval and reranking with respect to graph search, web text search, and question and image search. In some examples, web text search may have the most mature and complex retrieval and reranking pipeline. According to one embodiment, a document to sub-document funnel may be included to search for documents then extract snippets for subsequent reranking. In the document to sub-document funnel, documents are progressively filtered, analyzed, and ranked based on increasingly granular units of text to identify the most relevant and useful parts of a document, such as sections, paragraphs, or sentences, that best match a user's query or intent. Document level analysis begins by retrieving and ranking entire documents based on their relevance to the query. This step may use retrieval techniques like term matching, semantic similarity, or LTR models. Irrelevant or less relevant documents may be filtered out, leaving a smaller set of documents that appear most relevant based on their overall content. The remaining documents may then be broken down into smaller units, i.e., sub-documents. Examples may include sections, chapters, paragraphs, or even individual sentences. Each sub-document is analyzed and ranked independently, using criteria such as relevance to the query, clarity, informativeness, or specific keyword matches. Sub-documents that meet certain relevance thresholds are selected. This phase may discard parts of a document that are less relevant, ensuring that only the most pertinent information is considered. The most relevant sub-documents may be used to generate snippets or summaries that are presented to the user. These snippets are used to give a clear and concise preview of the content, emphasizing the parts of the document most aligned with the query.
[0148] In a preferred embodiment, sub-documents may be used to rank documents based on a structure where passages in dense representations and documents in sparse representations form the initial retrieval base or the “top of the funnel,” and then after a joint LTR phase, an additional snippet reranking phase can filter out documents that had no “competitive” snippets. Dense representations refer to embeddings or vectors where the information from text (passages) is encoded into continuous, low-dimensional spaces, using neural networks like BERT, GPT, or other transformer-based models. In dense representations, text passages (short sections of text, usually a few sentences or a paragraph) are converted into dense vectors that capture the semantic meaning of the text. To retrieve relevant passages, the similarity between the query's dense vector and the dense vectors of the passages may be calculated using cosine similarity or other distance metrics. The passages are ranked based on their similarity scores to the query. The closer a passage's dense vector is to the query vector, the higher it is ranked. Sparse representations refer to traditional text representations like bag-of-words (BoW), TF-IDF, or other methods that produce high-dimensional, sparse vectors. Each dimension typically corresponds to a specific word or term in the vocabulary, and the values indicate the presence or frequency of these terms in the text. In sparse representations, whole documents (larger texts, potentially encompassing many passages) are represented as sparse vectors where only a few dimensions are non-zero (i.e., where the corresponding terms are present in the document). Similarity measurement between the query and documents may be determined based on term overlap, with scoring mechanisms like TF-IDF or BM25. Documents may be ranked based on how many query terms they contain and how important those terms are in the context of the document and the corpus. Searching and ranking passages in dense representations and documents in sparse representations may combine the strengths of both approaches. Specifically, for precise and semantically rich retrieval, passages within documents may be searched and ranked using dense representations. As a result, even if the exact words in the query do not appear in the passage, the relevant passages can still be found based on their meaning. At the document level, sparse representations may be used to quickly and efficiently retrieve documents that contain the query terms. During the initial retrieval, only relevant documents are considered, which is particularly useful when dealing with large datasets. Further, during the joint LTR, documents are ranked based on a combination of factors such as relevance to the query, predicted user engagement, and other objectives. Each document typically has a snippet, which is a short excerpt or summary of the document's content, shown in the search results. Snippets give users a quick preview of the document's content and are crucial for attracting clicks. A “competitive” snippet is one that effectively summarizes the document's relevance to the query and is likely to capture the user's attention. It should clearly demonstrate why the document is relevant and useful. Filtering based on snippets further evaluates the snippets generated for the documents that were ranked during the joint LTR phase. If a document's snippet is not competitive, meaning it does not provide a compelling, clear, or relevant summary, this document may be downgraded or filtered out from the top results. Documents with strong, competitive snippets may be moved up in the rankings, while those with weak snippets may be pushed down or removed from the top results. This ensures that the final list of documents not only ranks well in terms of overall relevance but also presents content that is more likely to engage the user based on the quality of the snippets.
[0149] With respect to documents and snippets, or answers extracted or abstracted from snippets, good documents contain good snippets. For example, a Wikipedia page (a good or a trusted domain) on Obama will contain relevant, factual information on questions about him. Not all of a document is relevant just because it is good. Generally, the more “good snippets” or relevant passages in a document, the more likely the document is good. This inter-relationship makes a funnel of documents to sub-documents “lossy,” as sub-documents may not have been used to identify the best documents at any given phase. In one embodiment, sub-documents may be used by the dynamic document chunk LM 120 to additionally identify documents.
[0150] A budget-based information selector 122 may obtain the knowledge base outputs from the API tools 118 directly (step 13) and the top-k snippets (step 12) to determine which subset of grounding to be transmitted to formulate an answer to the query. The output of the budget-based information selector 122 may be sent (step 14) to a customer query and feedback database 124. In one aspect, the grounding appraisal agent 108 may have access to the customer query and feedback database 124 to obtain users' responses (step 15) to the grounding provided, in real-time, or historically, or both. As disclosed above, the grounding appraisal agent 108 may use the monitoring subsystem 110 (step 16) to determine what queries are popular and what is the expected correct information that the grounding agent 108 requires. As a result, the grounding appraisal agent 108 may identify root causes for success or failure of the LM-based agent-style QA system 100 of the present disclosure. According to one embodiment, a custom reward attribution approach may be employed by the grounding appraisal agent 108 to replay its decisions to get the expected grounding (when available), identify the failure for each decision, identify query understanding shortcomings, which can estimate the impact of different decisions. In ML, particularly in reinforcement learning, a “reward” refers to a feedback signal that indicates the success or failure of an action. Rewards may indicate how well the QA system 100 of the present disclosure answers questions (e.g., correctness, relevance, user satisfaction). Attribution refers to the process of assigning a portion of the overall reward to specific actions, decisions, or components of the QA system 100 to determine their impact on the final outcome. The custom reward attribution approach disclosed herein may use metrics and criteria specifically designed for the QA system 100, including but not limited to accuracy, response time, user engagement, or other relevant factors. In some embodiments, this approach may analyze individual subsystems (e.g., NLU, retrieval mechanism, answer generation) of the QA system 100 and assess each subsystem's contribution to the final result. For each decision in the pipeline, the QA system 100 may estimate impact by marginalizing other factors.
[0151] Most LMs are trained with fixed knowledge cutoff dates due to training overhead and expenses, and they tend to operate with outdated information. Hence, if LMs need to reason about recent events after their training data cut off, they may utilize outdated information and hallucinate. Some time-sensitive QA datasets may have been developed to evaluate LMs on their knowledge about recent events and monitor their knowledge gaps. However, these datasets are either manually curated and not easily scalable, or are developed from a static time period in the past and hence are or will soon be outdated. In accordance with aspects of the present disclosure, referring to FIG. 3, the grounding appraisal agent 108 may use the monitoring subsystem 110 to monitor what is trending in real-world in terms of information need and construct (query, correct answer) from that knowledge. In one embodiment, the monitoring subsystem 110 may generate question-answer pairs in real time by leveraging multiple high performance LMs interacting in a multi-agent workflow. This workflow is fully automatic with no human intervention at any stage. As a result, the monitoring subsystem 110 may scale up by generating large volumes of new questions for any arbitrary time period, enabling dynamic regeneration of test sets. In one embodiment, the monitoring subsystem 110 may implement a process / program to obtain a document of interest 302. For example, if the target documents relate to recent events, the monitoring subsystem 110 may obtain documents published after a specified time to create question and answer pairs. If the target documents are health-related, the monitoring subsystem 110 may use a topic classification system to obtain health-related documents to generate question and answer pairs. In certain implementation, the monitoring subsystem 110 may apply filters such as “trustworthiness” of sources, based on any preexisting indicators to choose documents from. As shown in FIG. 3, the monitoring subsystem 110 may prompt multiple LMs to generate questions and answers from selected target documents. Specifically, to improve quality, a multi-agent review process may be implemented to verify the correctness of generated questions and answers. Rather than using multiple verification LMs as a filter to improve precision, the monitoring subsystem 110 may retrain the generator LM 306 based on feedback obtained from verification LMs. Further, the monitoring subsystem 110 may either use a consensus among verification LMs or to train a decision LM which uses the output of verification LMs to finally determine a question-answer pair in response to a query.
[0152] In one embodiment, referring still to FIG. 3, generated questions and answers 304 may satisfy a number of criteria. Specifically, answers should be factually accurate to the given question, and the question and answer should be grammatically consistent and meaningful. Given a question, the monitoring subsystem 110 unambiguously provides a distinct answer (i.e., specificity) and the question-answer pair should be of broad interest to a given region or community. In other words, they should not be related to events about a private individual or a minor local event. The monitoring subsystem 110 may use a curated agentic workflow containing selected prompts for multiple LMs cooperation with one another. For example, a generator LM 306 of the monitoring subsystem 110 may be prompted to conduct a series of reasoning steps before arriving at a candidate question answer pair as shown in element 304. Specifically, the generator LM 306 may first determine if the document of interest 302 contains at least two proper nouns, i.e., a subject and an object it can use in a new QA sample. If this is true, the generator LM 306 is instructed to generate an unambiguous question where the object from the previous step is the only possible answer to the question for the given time period. The approach substantially reduces the ambiguity of generated questions and answers, thereby increasing specificity. A large volume of candidate questions and answers from the document of interest 302 may be generated accordingly. To further reduce ambiguity and hallucinated information and increase accuracy to the generated candidate questions 308, the monitoring subsystem 110 may implement a multi-agent review process using several distinct verification LMs 310, 312, 314 to test if the candidate questions 308 contain proper nouns. These LMs 310, 312, 314 may be prompted to answer each candidate question using a selected prompt template, with the corresponding document of interest 302 as knowledge grounding. Finally, the monitoring subsystem 110 may retain the candidate questions 308 which pass the first test and are answered correctly by all verification LMs 310, 312, 314. This process may be repeated until a desired number of verified data samples for the given time period are obtained. For example, based on a source document “https: / / en.wikipedia.org / wiki / Super_Bowl_LVIII,” a generated question may be: “Who won the superbowl 2024?” The generated answer may be: “The Chiefs became the first team to win back-to-back Super Bowls since the 2004 New England Patriots. The game was played on Feb. 11, 2024, at Allegiant Stadium in Paradise, Nevada. This was the first Super Bowl to be held in the state of Nevada.”
[0153] According to one example study, the monitoring subsystem 110 may generate grounding documents specific to a target LM under evaluation (e.g., Llama, Claude, Mistral, GPT 3.5, GPT 4, Cohere Command, etc.). Alternate answer candidates may be generated for specific questions and a new grounding document may be generated to support the alternate candidate as answer to the given question. To generate the grounding documents, the monitoring subsystem 110 may generate and filter questions for which the target LM under evaluation provides accurate answers without any additional knowledge grounding. The monitoring subsystem 110 may store these questions for which the LM under evaluation has the accurate answer in its parametric memory. Given this pool of target LM specific questions, the monitoring subsystem 110 may first prompt the generator LM 306 (e.g., Titan Premier) to generate a number of alternate answers which are in the same category as the original answer, for each question. Next, the monitoring subsystem 110 may use a multi-agent review process to independently prompt each verification LM 310, 312, 314 (e.g., Mistral, Claude, and Titan Express) to reason with each alternate answer obtained by the generator LM 306 and verify if it serves as a viable alternate. If the generated answer is confirmed at the decision 316 by all the verification LMs 310, 312, 314, the monitoring subsystem 110 may use the generated question and answer for further evaluation. In one aspect, rather than using multiple verification LMs as a filter to improve precision, the monitoring subsystem 110 may retrain the generator LM 306 based on feedback obtained from verification LMs. A consensus at the decision 316 among multiple verification LMs may be used to verify the correctness of the generated question and answer. In one embodiment, the monitoring subsystem 110 may train a decision LM 318 which uses the output of verification LMs to make a decision.
[0154] Further, the monitoring subsystem 110 may prompt the generator LM 306 again to generate a new grounding document by leveraging the question from the target LM specific pool and the newly sampled answer. As such, the monitoring subsystem 110 may generate a new grounding document rather than just replacing the correct answer in the original grounding document in order to avoid instances where the original answer may be abbreviated or shortened which would make the process noisy. This process may be repeated for each target LM to obtain an LM-specific QA dataset along with distorted grounding documents (a text or dataset that has been intentionally altered or manipulated from its original form), which will be used to reevaluate the target LM. LMs have prior beliefs through parametric knowledge and the provided grounding information can either be supporting or conflicting with the prior beliefs, thereby leading to unexpected results. To evaluate hallucination tendency, the monitoring subsystem 110 may generate distortions to news articles with conflicting information to evaluate LM responses to evolving information. For example, the monitoring subsystem 110 may use multiple distinct and independent verification LMs 310, 312, 314 to generate grounding distortions, which consider the entire context of the text, and are more likely to be adopted by LMs. Further, when the distortions are far from reality, the LMs are less likely to adopt it. When the LM's prior beliefs has a low likelihood, it is more likely to adopt the distorted grounding. LMs are highly receptive to distortions when it is the only available evidence (i.e., single source scenario), and LMs exhibit a strong confirmation bias toward prior beliefs when a mix of supporting and conflicting evidence are presented (multi-source scenario). As shown in FIG. 3, the monitoring subsystem 110 may use single-source grounding distortions, and in particular target time-sensitive questions and recent events-based grounding. In one embodiment, smaller models of the same model families (Llama 2 13B vs. 70B, Claude 2 vs. 3 Sonnet, Mistral 7B vs. Large, etc.) may be more flexible in adopting their responses to grounded evidence. One explanation is that the plasticity in LMs may decrease as the model size increases. This plasticity loss problem may occur when new information is introduced to existing AI models, their artificial neurons may lose their ability to learn, significantly impacting their functionality. This problem may be considered when building real time LM applications where relevant information can change frequently such as time-sensitive questions.
[0155] The example study shows that questions generated by the monitoring subsystem 110 are answerable if LMs are exposed to the relevant information via in context knowledge grounding disclosed above or model retraining, and the monitoring subsystem 110 may be used to monitor LMs in real time for any knowledge gaps for any target applications.
[0156] After identifying what queries are popular and what is the expected correct information that the grounding agent 106 should provide, the grounding appraisal agent 108 may identify root causes for success or failure of the QA system 100. One example implementation may involve a custom reward attribution approach. For example, the grounding appraisal agent 108 may initially define a plurality of parameters or success metrics of the QA system 100 relating to the accuracy of answers, user satisfaction, speed of response, or a combination of factors. For example, success of the QA system 100 may be correctly answering 90% of questions within 3 seconds. Subsequently, the grounding appraisal agent 108 may partition the question answering process into a number of discrete subprocesses (e.g., query parsing, information retrieval, answer extraction, response generation), and assign a portion of the overall reward (or penalty) to each subprocess based on its performance. For example, if an answer is incorrect, the grounding appraisal agent 108 may determine whether the failure was due to poor query understanding, inadequate retrieval, or faulty answer generation. Analyzing the rewards or penalties attributed to each subprocess may be used to identify patterns. For example, if a significant number of penalties are attributed to the information retrieval subprocess, this may indicate that the retrieval mechanism is the root cause of failure. On the other hand, consistently high rewards for a particular subprocess may help identify strengths in the QA system 100. Based on the insights gained from the reward attribution, the grounding appraisal agent 108 may carry out iterative refinement to improve the QA system 100. For example, if an answer extraction component is frequently identified as a failure point, the algorithms of this component may be refined. Moreover, the example reward attribution approach may be continuously updated reflect changes in system design or user expectations. In one embodiment, one or more feedback loops may be implemented where the reward attribution data is fed back into the QA system 100 to guide future improvements and training.
[0157] Based on root-cause identified, the behaviors of the grounding appraisal agent 108 may be fine-tuned through retraining models, e.g., fine-tune document chunking part carried out by the dynamic document chuck LM 120 if the identified segments are not sufficient and if there are other useful parts left in the document. Fine-tuning document chunking to capture more useful parts of a document need to balance the granularity of the chunks with the content's relevance. In one embodiment, the size of each document chunk may be adjusted to capture finer details. Reducing the chunk size may capture more granular information. If important content spans multiple chunks, increasing the overlap between chunks may ensure that these transitional sections are fully captured. Moreover, instead of chunking based solely on length, segmenting the document based on themes, sections, or headings may ensure that each chunk contains thematically coherent content. Semantic chunking using NLP techniques may also identify key sentences or paragraphs that convey significant meaning and create chunks around these identified points. In yet another embodiment, the grounding appraisal agent 108 may configure the dynamic document chuck LM 120 to carry out dynamic chunking based on content. For example, key phrases, terms, or concepts may be identified within the document, and used as anchors for chunking. Chunks may start or end around these key phrases to ensure they are fully captured. Chunking at sentence boundaries instead of arbitrary length may also ensure that logical content units are not split. Furthermore, the grounding appraisal agent 108 may review the chunks generated and identify areas where content is missing or poorly segmented, thereby adjusting the chunking strategy based on these observations. In an alternate embodiment, the grounding appraisal agent 108 may train a model to predict chunk boundaries based on labeled data where chunks have been adjusted for content relevance. The grounding appraisal agent 108 may use a combination of length-based chunking with content-aware techniques, like thematic segmentation or key phrase detection, to capture more meaningful content. After initial chunking, the grounding appraisal agent 108 may review and merge adjacent chunks that belong together but were split due to arbitrary boundaries. On the other hand, if a chunk is too large and contains multiple distinct topics, the grounding appraisal agent 108 may split it further. As shown in FIG. 1, the grounding appraisal agent 108 may use outputs from the customer query and feedback database 124 (step 15) to gather and incorporate feedback from users on the relevance and completeness of the chucks, thereby making the document chunking a part of an interactive process.
[0158] Alternatively, adapting its behavior through in-context learning, the grounding appraisal agent 108 may access the customer query and feedback database 124 to retrieve suitable in-context examples for its inference in providing positive and negative examples.
[0159] In-context learning allows an LM to take a sequence of examples and prompts as input and generate outputs that align with the patterns observed in those examples. For example, if an LM model has been provided with a few examples of question-answer pairs, it may generalize from those examples to answer a new question in a similar style or format. In one embodiment, the customer query and feedback database 124 may be a repository of examples that have been previously evaluated, annotated, or curated based on user interactions or other evaluation metrics. This database may contain positive examples (correct or high-quality outputs) and negative examples (incorrect or low-quality outputs), which the grounding appraisal agent 108 may use as references. When the grounding appraisal agent 108 is tasked with making an inference, it may query the customer query and feedback database 124 to retrieve examples that are relevant to the current task. The retrieval process may employ semantic search techniques or embedding based similarity measures to find examples that match the context of the current query. The grounding appraisal agent 108 may incorporate retrieved positive examples into its context to guide its outputs toward desired behavior. These positive examples may show the grounding appraisal agent 108 what a correct or preferred output looks like. On the other hand, the grounding appraisal agent 108 may also use negative examples to understand what to avoid, helping it steer away from generating similar mistakes or undesirable outputs. In some embodiments, by dynamically incorporating these retrieved examples into its prompt, the grounding appraisal agent 108 may adjust its predictions on the fly. These examples allow the grounding appraisal agent 108 to adapt to different tasks or user preferences without changing its underlying weights or structure. For example, upon receiving data relating to a query, the grounding appraisal agent 108 may query the customer query and feedback database 124 to retrieve relevant examples based on the input context. These examples are then included in the prompt to the grounding appraisal agent 108, which in turn uses the patterns it observes in the context, including the retrieved examples, to generate its output. As such, the grounding appraisal agent 108 may process data relating to a wide range of queries without requiring explicit retraining. Further, the grounding appraisal agent 108 may improve over time by leveraging more examples stored in the feedback database, refining its behavior as it encounters more scenarios. By identifying negative examples, the grounding appraisal agent 108 may learn to avoid common pitfalls.
[0160] As shown in FIG. 1, feedback generated (steps 17, 18, and 19) by the grounding appraisal agent 108 may be used to influence all the stages, including but not limited to, retraining understanding and query decomposition approaches employed by the grounding agent 106 (step 17), top-k documents re-ranker (hybrid approach) from outputs of individual retrieval techniques employed by the API tools 118, the dynamic document chunk LM 120 (step 18), and the budget-based information selector 122 shortlisting of top ranked chunks in the grounding outputs (step 19).
[0161] In the context of QA systems, rank biased precision (RBP) may be used to evaluate the effectiveness of the system in ranking relevant answers. If a QA system returns a ranked list of potential answers to a question, RBP may assess how well the system is placing the most relevant answers at the top of the list, taking into account the likelihood that a user will continue looking down the list. RBP places more importance on higher-ranked items, which reflects a user's behavior in real-world scenarios, i.e., users are more likely to be satisfied with relevant items near the top of the list. The RBP score is calculated by summing the relevance scores of items in the ranked list, each weighted by the probability that a user will review that item based on their positions in the list.
[0162] To evaluate content failures, for each query, the grounding appraisal agent 108 may determine whether the expected information is available in e.g., the content and metadata index subsystem 116 of FIG. 1 or not (binary), and use this determination to compute grounding gaps to an ideal RBP, which assumes all content is available in the content and metadata index subsystem 116. For example, the grounding appraisal agent 108 may evaluate all the indexes available such as static lexical indexes, DPR dense indexes, and live indexes. An automated recall at infinity approach may be used to quantify the grounding gap. Recall is a metric used to measure the completeness of content retrieval. It calculates the proportion of relevant items retrieved out of the total relevant items available in the dataset. “Recall at infinity” refers to a situation where the QA system 100 may be allowed to return an infinitely long list of items, meaning that if the system retrieves all possible items, it would eventually retrieve all relevant items. Thus, recall at infinity would ideally be 100% if all relevant items are included somewhere in the list. When evaluating the performance of the content failures of the system 100, instead of requiring the system to return an infinite list, the grounding appraisal agent 108 may generate a ranked list of items up to a certain practical limit. The recall at infinity can be estimated or approximated using automated methods that predict the likely recall if the list were extended infinitely. For example, selected statistical models, ML, or other techniques may be used by the grounding appraisal agent 108 to estimate how many relevant items may be retrieved if the system continued indefinitely. This approach is useful because it allows the grounding appraisal agent 108 to understand the potential recall of the QA system 100 without needing to exhaustively retrieve or evaluate an impractically large number of items. It is particularly helpful in large datasets where manually checking all possible items is infeasible.
[0163] An example automated approach to compute recall at infinity may employ a two stage search based approach. During the first stage, the grounding appraisal agent 108 may determine whether a document is present in the index, and next if the expected content is available in the document or not, which may be estimated using a similarity threshold. During the second stage, if the expected content is not available in the document, or if the document is not available in the index, the grounding appraisal agent 108 may search the expected information against each index, and based on the retrieved content decide if the index contains the relevant information to the query or not. For example, the grounding appraisal agent 108 may search for the answer in the index, and add an automated verification step, based on text edit distance or using LMs, to decide whether the index has the expected answer or not.
[0164] To evaluate failures occurred during top-k documents retrieval (step 11), for queries which have expected information in the content and metadata index subsystem 116, the grounding appraisal agent 108 may check whether top-k documents retrieval approaches used by the API tools 118 can retrieve expected information or not. In some implementations, the grounding appraisal agent 108 may label each document retrieved by the API tools 118 in response to a query as relevant or not based on the expected content, and use an LM scorer to evaluate the quality of responses, such as the relevance, accuracy, coherence, and fluency of each response relative to the given question. The LM scorer may be applied to rank different passages, documents, or pieces of text based on their relevance to a query or topic, thereby presenting the most relevant information at the top of the list. In one example, such an LM scorer may use embeddings (dense vector representations of text) to compute similarity or relevance scores between inputs and reference texts.
[0165] To evaluate how much RBP is lost due to top-k candidate documents and snippets and final top-documents and snippets (step 12), the grounding appraisal agent 108 may similarly use the LM scorer to check the results generated by the dynamic document chunk LM 120.
[0166] In various aspects, the LM scorer may work both at a document level and a paragraph or snippet level, and scale to thousands of data points per query. At the document level, the LM scorer may annotate top-k documents to be relevant or not, given the expected “gold” snippets and time of grounding. At the paragraph level, the LM scorer may use the snippets or paragraphs from documents to achieve the labeling. In one embodiment, the document level LM scorer may use paragraph level annotations, i.e., a document can be relevant if it has at least one relevant paragraph and a document is irrelevant if it has no relevant paragraph.
[0167] In order to measure crawling efficiency of the QA system 100, the grounding appraisal agent 108 may compute, for the target set of queries and expected content, recall at index and final RBP over time on a periodical basis (e.g., hourly analysis or daily analysis). Recall focuses solely on whether all relevant items are retrieved, without considering their order. High recall means that most, if not all, relevant items have been located, but they may be buried deep in the list. RBP incorporates ranking into its evaluation, rewarding approaches that place relevant items higher in the list, which is crucial for user satisfaction. RBP may work as a balance between precision and recall, weighted by the rank of items. For example, a QA system may have high recall but low RBP if it retrieves all relevant items but ranks them poorly. However, the system may have lower recall but high RBP if it ranks the relevant items it does retrieve very well.
[0168] In various aspects, the grounding appraisal agent 108 may determine conditional recalls of all the retrieval approaches on their own available index (e.g., DPR on dense index, elastic search on live index), followed by recall at document LTR, recall at broker node (e.g., a subsystem of QA system 100 that is responsible for handling queries, distributing tasks to other nodes, aggregating results, and managing data flow) LTR, and recall at snippet ranker.
[0169] In some embodiments, the expected URL may not present in the index e.g., due to not allowing domains, or when the final top-k retrieved documents do not fetch the expected URL, the QA system 100 may have “similar” content to answer the question. For example, the grounding appraisal agent 108 may use an automated approach to check if the “expected snippet” is available in the index / retrieved documents to have a more precise estimation of gaps at different levels.
[0170] Once identifying which documents and / or snippets are missed in ranking and for what set of queries there is a gap, the grounding appraisal agent 108 may group the errors at document / snippet and query level, to derive meaningful insights. For all the URLs which are missed at different stages, clusters of URLs may be computed using the characteristics including but not limited to readability of text in content, update frequency, length of content, domain, whether a do-not-crawl (DNC) domain, whether a do-not-use (DNU) domain, ranking of the URL for the query, does it contain images, does it contain tables, does it contain lists. Similarly, clusters for snippet level failures may be computed. Moreover, for queries which success and fail at different stages (e.g., not present in index; or present in the index, but missed during top-k documents retrieval; or present in the top-k documents retrieval, but missed during top-k candidate documents and snippets retrieval; or present in the top-k candidate documents and snippets retrieval, but missed during the final top-k documents and snippets retrieval), clusters of problematic queries may be computed using the characteristics including but not limited to length, keyword vs. question-like, evergreen vs. time-sensitive, topic of the question, presence of entities / event, time of responses, type of question (subjective, objective, forecasting), time indicators in query, location in query, whether top results present in DNU domain, and whether top-k results present in DNC domain. For example, query ambiguity or typographical errors in a query may make the QA system 100 locate irrelevant URLs. Even though correct content presents in index, the pages may have graphical content, thus are not ranked high in document retrieval process.
[0171] In yet another aspect, the grounding appraisal agent 108 may proactively identify gaps in the retrieval and ranking parts of the QA system 100 of the present disclosure and implement “human-in-loop” intervention mechanisms to improve the accuracy of grounding. Rather than implementing interventions on any random sample of error, the grounding appraisal agent 108 may identify “popular” queries through a clustering process and implement targeted interventions to achieve error reduction in time-sensitive and evergreen questions.
[0172] In various embodiments, FIG. 4 illustrates that the grounding appraisal agent 108 may use customer queries and error feedback 402 provided by the customer queries and feedback database 124 of FIG. 1 to identify for direct interventions and planning long-term improvements. Specifically, automatic QA generation for different answer shapes 406 may extract QA dataset from latest top stories or news articles 404 to cover both facts and long text grounding shapes. Facts include verifiable pieces of information used to ensure the accuracy of a model's output. For a question like “What is the capital of Japan?”, the fact used for grounding is “The capital of Japan is Tokyo.” Long text grounding may involve maintaining accuracy and consistency over longer responses or texts, such as summaries, reports, or detailed answers. The grounding appraisal agent 108 may use patterns or methods to anchor different parts of the output to relevant sections of the source text. With the automatically generated QA for different answer shapes 406, an LM scorer may be used to compare grounding to the expected answer 408 as disclosed above, and identify grounding gaps if there are any. Next, the grounding appraisal agent 108 may cluster queries with errors and prioritize based on popularity among customer queries 410. For answers use top stories or new articles 404, they are news related and news search or news summary services may be identified by the grounding service 412. The grounding appraisal agent 108 may cluster queries that fail, using both grounding service 412 and query features to capture the topic or event and the requested information (e.g., all queries seeking status of a football final match, or seeking scores of a rugby match). Multiple queries related to the same topic or event may be clustered, as it is easier to get answers for all the related questions. The clustering may be enhanced using click-through URL data. Clusters of queries which fail may be ranked based on impact size, which is estimated based on % of “similar” queries in human-web-data or a customer query database. Query clusters may be addressed one-by-one in decreasing order of estimated impact to optimize knowledge annotator efforts. Interventions may vary based on whether a fact is missing and whether the expected content is missing. For each failed query, i.e., the final output does not match the expected response, the grounding appraisal agent 108 may use a triplet (NL Query, Formal DB Query, System Response) and annotate for a possible fix. In one embodiment, the grounding appraisal agent 108 may obtain a NL Query as input and translate it into a Formal DB Query. This translation involves understanding the intent of the natural language input and mapping it to the appropriate entities and relationships within a database. The generated Formal DB Query may be executed against the database to retrieve the relevant data. Once the data is retrieved, the grounding appraisal agent 108 may generate a response, often in natural language, which is then presented to the user. If the Formal DB Query is wrong, the grounding appraisal agent 108 may edit the query directly. For missing entities and facts, the grounding appraisal agent 108 may update the knowledge database 114 of FIG. 1 by editing relevant files 414.
[0173] As further shown in element 416 of FIG. 4, verified correct answer for the query may be stored in the form of an overrides database (not shown). This database may be used to retrain the respective retrieval or ranking models or act as an input during inference time to re-rank results or used as an additional grounding service. For example, an automated approach may be used to check the question and answer using a web index to ensure if they are valid at a given time. This validity check may be run periodically to keep the overrides database updated and not have stale information.
[0174] FIG. 5 is a flow chart illustrating an example process 500 for implementing dual LM-based agents for web-based-knowledge grounding and fine-tuning a retrieval pipeline of a QA system, in accordance with embodiments of the present disclosure. The process 500 of FIG. 5 may be executed by one or more computing devices. The actions of process 500 may represent a series of instructions comprising computer-readable machine code executable by a processing unit of a computing device. In various examples, the computer-readable machine code may be comprised of instructions selected from a native instruction set of the computing device and / or an operating system of the computing device. Various actions in process 500 may be described above with reference to elements of FIGS. 1-4. Although shown in a particular order, the steps of process 500 may instead be performed in a different order. Additionally, various steps may be performed in parallel in various implementations. Further, some steps may be omitted and / or other steps may be added in accordance with the web-based-knowledge grounding techniques described herein.
[0175] Process 500 may begin at action 502, at which a natural language input may be received by the computing device 104 (e.g., the audio data 206, the image data 210, or the text data 208) from the user 102. Processing may continue at action 504, at which the orchestrator component 212 of the subsystem 140 may identify whether the received natural language input contains a knowledge related query to be processed by the subsystem 150.
[0176] At action 506, in response to determining that the received natural language input contains a knowledge related query, the orchestrator component 212 of the subsystem 140 may send the query to the LM-based grounding agent 106, where the received query may be decomposed or converted into a template. For example, the grounding agent 106 may normalize the query, identify various query structures, and transform the query into a format that can be searched against a database (e.g., query database 112), the knowledge database 114, or set of pre-defined rules.
[0177] At action 508, the LM-based grounding agent 106 may use the natural language query input and the template version of the natural language query input to search the knowledge database 114 which may contain data, facts, and rules organized in a way that allows the QA system 100 to retrieve relevant information efficiently and accurately. For example, the query may be processed using NLP techniques to understand its intent and identify key components, such as entities (nouns or noun phrases) and properties (verbs, adjectives, or specific attributes related to the entities). NER models may be used by the knowledge database 114 to identify and classify entities mentioned in the query. The knowledge database 114 also identifies the relationships or properties associated with the entities.
[0178] At action 510, the LM-based grounding agent 106 may also use the natural language query input and the template version of the natural language query input to search the query database 112 which may store and manage queries made by users, along with their corresponding responses or the data necessary to generate those responses.
[0179] At action 512, the LM-based grounding agent 106 may perform auto-discovery of metadata (e.g., metadata index, document metadata, content metadata, structural metadata, user metadata, etc.) relating to the query via a content and metadata index subsystem 116.
[0180] At action 514, the LM-based grounding agent 106 may generate understanding signals of the natural language query based at least upon the search results received from the query database 112, the knowledge database 114, and the content and metadata index subsystem 116. For example, the understanding signals may at least indicate a time range of an output answering the natural language query input, a presence of an entity relating to the natural language query input in the knowledge database 114, and attributes relating to the entity in the knowledge database 114.
[0181] At action 516, the LM-based grounding agent 106 may determine metadata, index information, and retrieval approaches for the natural language query input to parameterize a search request based at least in part on the understanding signals. For example, appropriate API tools 118 may be determined and used for conducting searches in e.g., content and metadata index subsystem 116, and the knowledge database 114. Additional search approaches may be implemented as well. For example, if a query or sub-query involves rare topics or events, the API tools 118 may rely on lexical exact matches (high match threshold). If a query does not specify the requested information directly e.g., “suggest some remedies for nausea and 100 degrees fever”, then a neural approach may be determined and used by the API tools 118. A neural search may focus on understanding the semantic meaning of queries and documents. This allows the QA system 100 to provide more accurate and contextually relevant answers, even when the query does not exactly match the wording of the source content. In yet another example, by combining the speed and precision of lexical matching with the deep understanding and context-awareness of neural models, a hybrid ranker approach may be employed by the API tools 118 in answering complex queries. Such a hybrid approach may combine lexical ranking algorithms (e.g., BM25 and TF-IDF) with advanced methods based on neural models to achieve a better balance between precision (finding the most relevant documents) and recall (ensuring that all relevant documents are considered).
[0182] In one embodiment, the grounding agent 106 may determine whether the natural language query input relates to an evergreen question or a time-sensitive question, and vary the retrieval configuration for both types of questions. For example, the retrieval depth of the documents for a time-sensitive question may be deeper than that of an evergreen question. It should be appreciated that the LM-based grounding agent and the LM-based grounding appraisal agent of the present disclosure can handle any type of queries including evergreen and time-sensitive questions described above.
[0183] At action 518, the QA system 100 may use the search request generated by the grounding agent 106 and the determined API tools 118 to retrieve and rank documents relating to an output answering the natural language query input. For example, the processing results of the API tools 118 may include top-k web documents and knowledge base outputs. These documents may be retrieved from various online sources or a document repository and are used to generate an answer to the received query based on selected ranking algorithms.
[0184] At action 520, the dynamic document chunk LM 120 may generate top-k snippets based at least in part on the top-k web documents. In some embodiments, a HTML source of a top-k document may contain both the content and structural information that may be used to segment the document into manageable chunks or snippets. For example, the HTML source document may be parsed by the dynamic document chunk LM 120 to understand its structure. This includes identifying tags like (paragraph), <h1>, <h2>, etc. (headings), (list items), , and others that denote different parts of the content. The dynamic document chunk LM 120 may extract text content from relevant tags, filtering out irrelevant parts such as navigation bars, footers, ads, or other non-content elements. Further, the hierarchical structure provided by the HTML tags may be used to segment the document into meaningful chunks. For example, content under a specific <h2> may be grouped together as one chunk. Dynamic chunking may also be implemented in accordance with the length of text and semantic coherence. If a section is too long, it may be further divided into smaller, semantically consistent chunks to make processing easier. To generate top-k snippet, the dynamic document chunk LM 120 may initially match the query against each chunk to determine relevance, identifying exact or semantic matches. Embeddings may be used to encode both the query and document chunks into vectors and compute similarity scores to rank them. Based on these relevance scores, the top-k chunks may be selected as snippets. In one embodiment, the budget-based information selector 122 may obtain the knowledge base outputs from the API tools 118 directly and the top-k snippets from the dynamic document chunk LM 120 to determine which subset of grounding to be transmitted to formulate an answer to the query. Top ranked chunks in the grounding outputs may be shortlisted. The output of the budget-based information selector 122 may be sent to the customer query and feedback database 124.
[0185] At action 522, the LM-based ground appraisal agent 108 may receive outputs answering the natural language query input retrieved by the QA system 100 from the customer query and feedback database 124. In one aspect, the LM-based ground appraisal agent 108 may evaluate the retrieved and ranked documents and snippets based at least in part on real-time or historical user feedback data.
[0186] At action 524, the LM-based ground appraisal agent 108 may use the monitoring subsystem 110 to monitor what is trending in real-world in relation to the query. In one embodiment, the monitoring subsystem 110 may generate question-answer pairs in real time based on web-based data by leveraging multiple LMs interacting in a multi-agent workflow that is fully automatic with no human intervention at any stage. The monitoring subsystem 110 may scale up by generating large volumes of new questions for any arbitrary time period, enabling dynamic regeneration of test sets.
[0187] At action 526, the LM-based ground appraisal agent 108 may identify grounding gaps during at least retrieval and ranking of the outputs by the QA system 100 by analyzing e.g., the understanding signals of the natural language query input, the search request generated by the grounding agent 106, the retrieval approaches determined and used by the API tools 118, the documents and the snippets retrieved by the API tools 118 and the dynamic document chunk LM 120. In one aspect, the LM-based ground appraisal agent 108 may identify root causes for successes or failures of the QA system 100 based at least in part on the user feedback data obtained from the customer query and feedback database 124 and the question-answer pairs generated by the monitoring subsystem 110 in real-time in relation to the query. According to one embodiment, a custom reward attribution approach may be employed by the grounding appraisal agent 108 to analyze individual subsystems (e.g., NLU, retrieval mechanism, answer generation) of the QA system 100 and assess each subsystem's contribution to the final result.
[0188] Once the grounding gaps are identified, at action 528, the grounding appraisal agent 108 may determine and implement interventions to fine-tune the retrieval and ranking of the outputs by the QA system 100 based at least in part on the grounding gaps. Fine-tuning may be performed through retraining models. For example, the dynamic document chunk LM 120 may adjust the document chunking step to balance the granularity of the chunks with respect to the content's relevance. Further, the grounding appraisal agent 108 may access the customer query and feedback database 124 to retrieve suitable in-context examples for its inference in providing positive and negative examples. These examples allow the grounding appraisal agent 108 to adapt to different tasks or user preferences dynamically. For example, upon receiving data relating to a query, the grounding appraisal agent 108 may query the customer query and feedback database 124 to retrieve relevant examples based on the input context. These examples are then included in the prompt to the grounding appraisal agent 108, which in turn uses the patterns it observes in the context, including the retrieved examples, to generate its output. As such, the grounding appraisal agent 108 may process data relating to a wide range of queries and improve over time by leveraging more examples stored in the feedback database, refining its behavior as it encounters more scenarios. By identifying negative examples, the grounding appraisal agent 108 may learn to avoid common pitfalls.
[0189] Feedback generated by the grounding appraisal agent 108 may be used to influence all the stages, including but not limited to, retraining understanding and query decomposition approaches employed by the grounding agent 106, top-k documents re-ranker (hybrid approach) from outputs of individual retrieval techniques employed by the API tools 118, the dynamic document chunk LM 120, and the budget-based information selector 122 shortlisting of top ranked chunks in the grounding outputs. For example, to evaluate content failures, for each query, the grounding appraisal agent 108 may determine whether the expected information is available in e.g., the content and metadata index subsystem 116 or not (a binary decision), and use this determination to compute grounding gaps. To evaluate failures occurred during top-k documents retrieval, for queries which have expected information in the content and metadata index subsystem 116, the grounding appraisal agent 108 may check whether top-k documents retrieval approaches used by the API tools 118 can retrieve expected information or not. For example, an LM scorer may be used to evaluate the quality of responses, such as the relevance, accuracy, coherence, and fluency of each response relative to the given question. The LM scorer may be applied to rank different passages, documents, or pieces of text based on their relevance to a query or topic, thereby presenting the most relevant information at the top of the list. To evaluate the quality of the top-k candidate documents and snippets and final top-documents and snippets, the grounding appraisal agent 108 may similarly use the LM scorer to check the results generated by the dynamic document chunk LM 120. The grounding appraisal agent 108 may group identified errors at document / snippet and query level, and determine and implement interventions to address the identified grounding gaps. For example, for queries which success and fail at different stages (e.g., not present in index; or present in the index, but missed during top-k documents retrieval; or present in the top-k documents retrieval, but missed during top-k candidate documents and snippets retrieval; or present in the top-k candidate documents and snippets retrieval, but missed during the final top-k documents and snippets retrieval), these queries may be clustered using the characteristics including but not limited to length, keyword vs. question-like, evergreen vs. time-sensitive, topic of the question, presence of entities / event, time of responses, type of question (subjective, objective, forecasting), time indicators in query, location in query, whether top results present in DNU domain, and whether top-k results present in DNC domain. For example, query ambiguity or typographical errors in a query may make the QA system 100 locate irrelevant URLs. Even though correct content presents in index, the pages may have graphical content, thus are not ranked high in document retrieval process.
[0190] In various embodiments, the LM-based grounding appraisal agent 108 may identify interventions by at least determining different answer shapes to the outputs: a fact grounding shape and a long text grounding shape. When the grounding gaps relates to a missing fact, the LM-based grounding appraisal agent 108 may verify and add the missing fact at least in a knowledge database 114 of the QA system 100 using the fact grounding shape. When the grounding gaps relates to a long text, the LM-based grounding appraisal agent 108 may verify and add a correct answer to the query input at least in an overrides database of the QA system 100 using the long text grounding shape. Data stored in the overrides database may be used by various subsystems of the QA system 100 to retrain retrieval and ranking of the outputs by the QA system 100.
[0191] FIG. 6 is a block diagram illustrating a user device 104 that may be used with the QA system 100. FIG. 7 is a block diagram illustrating example components of a remote device, such as the subsystem 140, and the components of the subsystem 150 including dual LM-based agents 106 and 108. Server(s) 700 may include one or more servers. A “server” as used herein may refer to a traditional server as understood in a server / client computing structure but may also refer to a number of different computing components that may assist with the operations discussed herein. For example, a server may include one or more physical computing components (such as a rack server) that are connected to other devices / components either physically and / or over a network and is capable of performing computing operations. A server may also include one or more virtual machines that emulates a computer system and is run on one or across multiple devices. A server may also include other combinations of hardware, software, firmware, or the like to perform operations discussed herein. The server(s) may be configured to operate using one or more of a client-server model, a computer bureau model, grid computing techniques, fog computing techniques, mainframe techniques, utility computing techniques, a peer-to-peer model, sandbox techniques, or other computing techniques.
[0192] While the user device 104 may operate locally to a user (e.g., within a same environment so the device may receive inputs and playback outputs for the user), the server(s) 700 may be located remotely from the user device 104 as its operations may not require proximity to the user. The server(s) 700 may be located in an entirely different location from the user device 104 (for example, as part of a cloud computing system or the like) or may be located in a same environment as the user device 104 but physically separated therefrom (for example a home server or similar device that resides in a user's home or business but perhaps in a closet, basement, attic, or the like). The server(s) 700 may also be a version of a user device 104 that includes different (e.g., more) processing capabilities than other user device(s) 104 in a home / office. One benefit to the server(s) 700 being in a user's home / business is that data used to process a command / return a response may be kept within the user's home, thus reducing potential privacy concerns.
[0193] The server(s) 700 may be included in the QA system 100 of the present disclosure, such as the orchestrator component 212 of the subsystem 140, the LM-based grounding agent 106, and the LM-based ground appraisal agent 108, etc. In operation, each of these systems may include computer-readable and computer-executable instructions that reside on the respective device, as will be discussed further below.
[0194] Each of these devices (104 / 700) may include one or more controllers / processors (604 / 706), which may each include a central processing unit (CPU) for processing data and computer-readable instructions, and a memory (606 / 708) for storing data and instructions of the respective device. The memories (606 / 708) may individually include volatile random-access memory (RAM), non-volatile read only memory (ROM), non-volatile magneto-resistive memory (MRAM), and / or other types of memory. Each device (104 / 700) may also include a data storage component (608 / 710) for storing data and controller / processor-executable instructions. Each data storage component (608 / 710) may individually include one or more non-volatile storage types such as magnetic storage, optical storage, solid-state storage, etc. Each device (104 / 700) may also be connected to removable or external non-volatile memory and / or storage (such as a removable memory card, memory key drive, networked storage, etc.) through respective input / output device interfaces (602 / 704).
[0195] Computer instructions for operating each device (104 / 700) and its various components may be executed by the respective device's controller(s) / processor(s) (604 / 706), using the memory (606 / 708) as temporary “working” storage at runtime. A device's computer instructions may be stored in a non-transitory manner in non-volatile memory (606 / 708), storage (608 / 710), or an external device(s). Alternatively, some or all of the executable instructions may be embedded in hardware or firmware on the respective device in addition to or instead of software.
[0196] Each device (104 / 700) includes input / output device interfaces (602 / 704). A variety of components may be connected through the input / output device interfaces (602 / 704), as will be discussed further below. Additionally, each device (602 / 704) may include an address / data bus (624 / 702) for conveying data among components of the respective device. Each component within a device (104 / 700) may also be directly connected to other components in addition to (or instead of) being connected to other components across the bus (624 / 702).
[0197] Referring to FIG. 6, the user device 104 may include input / output device interfaces 602 that connect to a variety of components such as an audio output component such as a speaker 612, a wired headset or a wireless headset (not illustrated), or other component capable of outputting audio. The user device 104 may also include an audio capture component. The audio capture component may be, for example, a microphone 620 or array of microphones, a wired headset or a wireless headset (not illustrated), etc. If an array of microphones is included, approximate distance to a sound's point of origin may be determined by acoustic localization based on time and amplitude differences between sounds captured by different microphones of the array. The user device 104 may additionally include a display 616 for displaying content. The user device 104 may further include a camera 618.
[0198] Via antenna(s) 622, the input / output device interfaces 602 may connect to one or more networks 130 via a wireless local area network (WLAN) (such as Wi-Fi) radio, Bluetooth, and / or wireless network radio, such as a radio capable of communication with a wireless communication network such as a Long Term Evolution (LTE) network, WiMAX network, 3G network, 4G network, 5G network, etc. A wired connection such as Ethernet may also be supported. Through the network(s) 130, the system may be distributed across a networked environment. The I / O device interface (602 / 704) may also include communication components that allow data to be exchanged between devices such as different physical servers in a collection of servers or other components.
[0199] The components of the device(s) 104 and 700 may include their own dedicated processors, memory, and / or storage. Alternatively, one or more of the components of the device(s) 104 and 700 may utilize the I / O interfaces (602 / 704), processor(s) (604 / 706), memory (606 / 708), and / or storage (608 / 710) of the device(s) 104 and 700, respectively.
[0200] As noted above, multiple devices may be employed in a single system. In such a multi-device system, each of the devices may include different components for performing different aspects of the system's processing. The multiple devices may include overlapping components. The components of the user device 104 and server(s) 700, as described herein, are illustrative, and may be located as a stand-alone device or may be included, in whole or in part, as a component of a larger device or system. As can be appreciated, a number of components may exist either on a system component(s) and / or on user device 104 and server(s) 700. Unless expressly noted otherwise, the system version of such components may operate similarly to the device version of such components and thus the description of one version (e.g., the system version or the local version) applies to the description of the other version (e.g., the local version or system version) and vice-versa.
[0201] According to some embodiments, the LM-based agent-style QA system 100 of the present disclosure may also incorporate multimedia elements like images, charts, or links in their responses, enhancing the depth and clarity of the information provided.
[0202] It should be appreciated that various technical aspects of the present disclosure may be tailored to various domains and industries, from customer service and support to education and content creation, offering versatile solutions across different sectors. That is, although the dual LM-based agent are disclosed within the context of a QA system, the applications of the present disclosure may additionally include customer service in industries like retail, banking, or healthcare by providing support and answering queries, virtual assistants (e.g., assisting with tasks like scheduling, reminders, or information retrieval in personal, professional, or corporate contexts), educational tools (e.g., offering tutoring, explanations, or study aids in academic settings), content creation (e.g., assisting with drafting, editing, or generating written content in various creative industries). According to one implementation, the dual LM-based agents may be embedded in in a website to interact with users, answer questions, and guide users through a wide range of processes. When acting as virtual assistants, the dual LM-based agents may use language models to understand and respond to user voice commands. In yet another embodiment, the dual LM-based agents may include automated content generators configured to assist in writing articles, summaries, or reports by generating text based on user prompts.
[0203] In addition, the LM-based dual agents may be updated and fine-tuned over time, improving the accuracy and relevance based on user feedback, new data, or changes in the underlying knowledge base. The dual LM-based agents may predict user needs or provide suggestions based on past interactions, trends, or recognized patterns, leading to a more proactive and helpful user experience.
[0204] By automating complex queries and routine tasks, the LM-based agent-style QA system 100 may reduce the need for human intervention, lowering operational costs while maintaining high service quality. In addition, consistent answers may be provided by the QA system 100 of the present disclosure across different users and contexts, ensuring reliability and reducing the risk of errors or inconsistencies common in human-driven systems.
[0205] Although various systems described herein may be embodied in software or code executed by general purpose hardware as discussed above, as an alternate the same may also be embodied in dedicated hardware or a combination of software / general purpose hardware and dedicated hardware. If embodied in dedicated hardware, each can be implemented as a circuit or state machine that employs any one of or a combination of a number of technologies. These technologies may include, but are not limited to, discrete logic circuits having logic gates for implementing various logic functions upon an application of one or more data signals, application specific integrated circuits having appropriate logic gates, or other components, etc. Such technologies are generally well known by those of ordinary skill in the art and consequently, are not described in detail herein.
[0206] The flowcharts and methods described herein show the functionality and operation of various implementations. If embodied in software, each block or step may represent a module, segment, or portion of code that comprises program instructions to implement the specified logical function(s). The program instructions may be embodied in the form of source code that comprises human-readable statements written in a programming language or machine code that comprises numerical instructions recognizable by a suitable execution system such as a processing component in a computer system. If embodied in hardware, each block may represent a circuit or a number of interconnected circuits to implement the specified logical function(s).
[0207] Although the flowcharts and methods described herein may describe a specific order of execution, it is understood that the order of execution may differ from that which is described. For example, the order of execution of two or more blocks or steps may be scrambled relative to the order described. Also, two or more blocks or steps may be executed concurrently or with partial concurrence. Further, in some embodiments, one or more of the blocks or steps may be skipped or omitted. It is understood that all such variations are within the scope of the present disclosure.
[0208] Also, any logic or application described herein that comprises software or code can be embodied in any non-transitory computer-readable medium or memory for use by or in connection with an instruction execution system such as a processing component in a computer system. In this sense, the logic may comprise, for example, statements including instructions and declarations that can be fetched from the computer-readable medium and executed by the instruction execution system. In the context of the present disclosure, a “computer-readable medium” can be any medium that can contain, store, or maintain the logic or application described herein for use by or in connection with the instruction execution system. The computer-readable medium can comprise any one of many physical media such as magnetic, optical, or semiconductor media. More specific examples of a suitable computer-readable media include, but are not limited to, magnetic tapes, magnetic floppy diskettes, magnetic hard drives, memory cards, solid-state drives, USB flash drives, or optical discs. Also, the computer-readable medium may be a random access memory (RAM) including, for example, static random access memory (SRAM) and dynamic random access memory (DRAM), or magnetic random access memory (MRAM). In addition, the computer-readable medium may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or other type of memory device.
[0209] It should be emphasized that the above-described embodiments of the present disclosure are merely possible examples of implementations set forth for a clear understanding of the principles of the disclosure. Many variations and modifications may be made to the above-described example(s) without departing substantially from the spirit and principles of the disclosure. All such modifications and variations are intended to be included herein within the scope of this disclosure and protected by the following claims.
Claims
1. A computer-implemented method comprising:receiving a natural language query input;generating, by a language model-based grounding agent, a template version of the natural language query input;generating understanding signals of the natural language query input, by the language model-based grounding agent, by searching a query database and a knowledge database using the natural language query input and the template version of the natural language query input, wherein the understanding signals at least indicate a time range of an output answering the natural language query input, a presence of an entity relating to the natural language query input in the knowledge database, and attributes relating to the entity in the knowledge database;determining metadata, index information, and retrieval approaches for the natural language query input, by the language model-based grounding agent, to parameterize a search request based at least in part on the understanding signals;retrieving and ranking, using the search request and the retrieval approaches, documents relating to the output answering the natural language query input;generating and ranking snippets answering the natural language query input based at least in part on the documents;evaluating, by a language model-based grounding appraisal agent, the documents and snippets based at least in part on user feedback data;receiving, by the language model-based grounding appraisal agent, a plurality of questions and accurate answers to the questions based on the natural language query input, wherein the plurality of the questions and the accurate answers are generated based at least in part on web-based data;determining, by the language model-based grounding appraisal agent, grounding gaps in the output answering the natural language query input by analyzing at least the understanding signals of the natural language query input, the search request, the retrieval approaches, the documents, and the snippets based at least in part on the user feedback data, and the plurality of the questions and the accurate answers; andfine-tuning the retrieval and ranking of the output by the language model-based grounding appraisal agent based at least in part on the grounding gaps and the natural language query input.
2. The computer-implemented method of claim 1, further comprising:determining, by the language model-based grounding agent, whether the natural language query input relates to an evergreen question or a time-sensitive question; anddetermining, by the language model-based grounding agent, a first retrieval depth of the documents for the evergreen question and a second retrieval depth of the documents for the time-sensitive question, wherein the second retrieval depth is deeper than the first retrieval depth.
3. The computer-implemented method of claim 1, further comprising:determining, by the language model-based grounding appraisal agent, a plurality of parameters to evaluate performance of processes generating the understanding signals of the natural language query input, the search request, the retrieval approaches, the documents, and the snippets;in response to detecting one of the documents or snippets incorrectly answering the natural language query input, identifying, by the language model-based grounding appraisal agent, the grounding gaps in at least one of the processes based at least in part on the plurality of parameters; andfine-tuning the plurality of parameters.
4. The computer-implemented method of claim 1, further comprising:in response to detecting one of the documents or snippets incorrectly answering the natural language query input, determining, by the language model-based grounding appraisal agent, whether the one of the documents or snippets is present in the index information, and whether the output is available in the one of the documents or snippets;in response to detecting that the one of the documents or snippets is not present in the index information or the output is unavailable in the one of the documents or snippets, determining, by the language model-based grounding appraisal agent, the grounding gaps as content failures;labeling each of the documents and snippets obtained by the retrieval approaches of the natural language query input to indicate a relevancy based on the output;using a language model scorer to annotate each of the documents and snippets at a document level and a paragraph level based at least in part on the relevancy; andidentifying the grounding gaps in the retrieval approaches and the documents and snippets obtained by the retrieval approaches based on annotation results of the language model scorer.
5. A method comprising:receiving, by a first language model of a question-answering system, outputs retrieved by the question-answering system in response to a query input;evaluating, by the first language model, the outputs based at least in part on user feedback data;receiving, by the first language model, a plurality of question-answer pairs based on the query input, wherein the plurality of question-answer pairs are generated based at least in part on online data;determining, by the first language model, grounding gaps during at least retrieval and ranking of the outputs by the question-answering system based at least in part on the user feedback data and the plurality of question-answer pairs; andfine-tuning the retrieval and ranking of the outputs by the question-answering system based at least in part on the grounding gaps and the query input.
6. The method of claim 5, further comprising:determining, by a second language model of the question-answering system, whether the query input relates to an evergreen question or a time-sensitive question; anddetermining, by the second language model, a first retrieval depth of documents for the evergreen question and a second retrieval depth of the documents for the time-sensitive question, wherein the second retrieval depth is deeper than the first retrieval depth.
7. The method of claim 5, wherein the plurality of question-answer pairs are generated by:using a generator language model to determine whether a document of interest obtained from a selected web source during a defined time frame contains at least one subject and at least one object as an answer to the at least one subject;generating, by the generator language model, a pair of a candidate question and a candidate answer including the at least one subject and the at least one object;checking, by each of a plurality of verification language models, whether the at least one object is present in the answer;answering, by each of the plurality of verification language models, the candidate question using the document of interest as knowledge grounding; andvalidating the candidate question answer pair in response to detecting that answers generated by the plurality of verification language models match the candidate answer.
8. The method of claim 5, further comprising:determining, by the first language model, a plurality of processes performed by the question-answering system in generating the outputs;defining a plurality of success metrics for each of the plurality of processes;determining performance of each of the plurality of processes based at least in part on the plurality of success metrics in generating the outputs;identifying failure patterns present in at least one of the plurality of processes based at least in part on the performance; andinputting feedback data to correct the failure patterns present in the at least one of the plurality of processes.
9. The method of claim 8, further comprising:fine-tuning document chunking of the outputs by adjusting a chunk size to capture information at different granularities.
10. The method of claim 8, further comprising:receiving, by the first language model, positive and negative examples from the user feedback data, wherein a positive example relates to a correct or preferred output and a negative example relates to a mistake or undesirable output; andperforming an inference relating to the query input based at least in part on the positive and negative examples.
11. The method of claim 8, further comprising:in response to detecting the failure patterns present in the retrieval and ranking of the outputs by the question-answering system, determining, by the first language model, whether documents and snippets contained in the outputs are present in an index of the question-answering system, and whether expected outputs to the query input are available in at least one of the documents or snippets;in response to detecting that the documents and snippets are not present in the index or the expected outputs are unavailable in the one of the documents or snippets, determining, by the first language model, the grounding gaps as content failures;labeling each of the documents and snippets, by the first language model, to indicate a relevancy based on the expected outputs;using a language model scorer to annotate each of the documents and snippets at a document level and a paragraph level based at least in part on the relevancy;identifying the grounding gaps based on annotation results of the language model scorer; andclustering the grounding gaps at the document level, the paragraph level, and a query level in accordance with selected characteristics.
12. The method of claim 11, further comprising:prioritizing, by the first language model, the grounding gaps at the query level based on popularity indicated by the user feedback data and the plurality of question-answer pairs;determining, by the first language model, different answer shapes to the outputs, wherein the answer shapes include a fact grounding shape and a long text grounding shape;in response to detecting that the grounding gaps relates to a missing fact, verifying and adding, by the first language model, the missing fact at least in a knowledge base of the question-answering system using the fact grounding shape;in response to detecting that the grounding gaps relates to a long text, verifying and adding, by the first language model, a correct answer to the query input at least in an overrides database of the question-answering system using the long text grounding shape; andusing data stored in the overrides database to retrain the retrieval and ranking of the outputs by the question-answering system.
13. A system comprising:at least one processor; andnon-transitory computer-readable memory storing instructions that, when executed by the at least one processor, are effective to:receive, by a first language model of a question-answering system, outputs retrieved by the question-answering system in response to a query input;evaluate, by the first language model, the outputs based at least in part on user feedback data;receive, by the first language model, a plurality of question-answer pairs based on the query input, wherein the plurality of question-answer pairs are generated based at least in part on online data;determine, by the first language model, grounding gaps during at least retrieval and ranking of the outputs by the question-answering system based at least in part on the user feedback data and the plurality of question-answer pairs; andfine-tune the retrieval and ranking of the outputs by the question-answering system based at least in part on the grounding gaps and the query input.
14. The system of claim 13, the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:determine, by a second language model of the question-answering system, whether the query input relates to an evergreen question or a time-sensitive question; anddetermine, by the second language model, a first retrieval depth of documents for the evergreen question and a second retrieval depth of the documents for the question, wherein the second retrieval depth is deeper than the first retrieval depth.
15. The system of claim 14, the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:use a generator language model to determine whether a document of interest obtained from a selected web source during a defined time frame contains at least one subject and at least one object as an answer to the at least one subject;generate, by the generator language model, a pair of a candidate question and a candidate answer including the at least one subject and the at least one object;check, by each of a plurality of verification language models, whether the at least one object is present in the answer;answer, by each of the plurality of verification language models, the candidate question using the document of interest as knowledge grounding; andvalidate the candidate question answer pair in response to detecting that answers generated by the plurality of verification language models match the candidate answer.
16. The system of claim 13, the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:determine, by the first language model, a plurality of processes performed by the question-answering system in generating the outputs;define a plurality of success metrics for each of the plurality of processes;determine performance of each of the plurality of processes based at least in part on the plurality of success metrics in generating the outputs;identify failure patterns present in at least one of the plurality of processes based at least in part on the performance; andinput feedback data to correct the failure patterns present in the at least one of the plurality of processes.
17. The system of claim 16, the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:fine-tune document chunking of the outputs by adjusting a chunk size to capture information at different granularities.
18. The system of claim 16, the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:receive, by the first language model, positive and negative examples from the user feedback data, wherein a positive example relates to a correct or preferred output and a negative example relates to a mistake or undesirable output; andperform an inference relating to the query input based at least in part on the positive and negative examples.
19. The system of claim 16, the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:in response to detecting the failure patterns present in the retrieval and ranking of the outputs by the question-answering system, determine, by the first language model, whether documents and snippets contained in the outputs are present in an index of the question-answering system, and whether expected outputs to the query input are available in at least one of the documents or snippets;in response to detecting that the documents and snippets are not present in the index or the expected outputs are unavailable in the one of the documents or snippets, determine, by the first language model, the grounding gaps as content failures;label each of the documents and snippets, by the first language model, to indicate a relevancy based on the expected outputs;use a language model scorer to annotate each of the documents and snippets at a document level and a paragraph level based at least in part on the relevancy;identify the grounding gaps based on annotation results of the language model scorer; andcluster the grounding gaps at the document level, the paragraph level, and a query level in accordance with selected characteristics.
20. The system of claim 19, the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:prioritize, by the first language model, the grounding gaps at the query level based on popularity indicated by the user feedback data and the plurality of question-answer pairs;determine, by the first language model, different answer shapes to the outputs, wherein the answer shapes include a fact grounding shape and a long text grounding shape;in response to detecting that the grounding gaps relates to a missing fact, verify and add, by the first language model, the missing fact at least in a knowledge base of the question-answering system using the fact grounding shape;in response to detecting that the grounding gaps relates to a long text, verify and add, by the first language model, a correct answer to the query input at least in an overrides database of the question-answering system using the long text grounding shape; anduse data stored in the overrides database to retrain the retrieval and ranking of the outputs by the question-answering system.
Citation Information
Patent Citations
Natural language processing routing
US11640823B1
Layered multi-prompt engineering for pre-trained large language models
US12493772B1
Managing documents in question answering systems
US20150347587A1
System and method for chat community question answering
US20190260694A1
Dataset generation using large language models
US20240185001A1
