Self-routing and self-screening retrieval enhancement generation method, equipment, medium and product
By extending the finite state automaton to realize the self-routing and self-screening retrieval enhancement generation method, the problem of poor completion of large model tasks caused by a single data source is solved, and the accuracy and efficiency of task completion are improved.
Patent Information
- Application Number
- CN202510853983.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-06-24
AI Technical Summary
Traditional retrieval enhancement generation solutions rely on a single data source, which makes it difficult for large models to learn sufficient domain-specific knowledge, resulting in poor task completion. In addition, fuzzy searches for word meaning matching often introduce irrelevant data entries that interfere with large models.
By adopting extended finite state automata, through self-routing and self-screening methods, multiple data sources are rationally selected and relevant data entries are screened. By utilizing the semantic understanding ability of large models, enhanced retrieval generation assisted by multiple data sources is realized.
Effectively reduce information loss and interference from invalid information, improve the completion of large model tasks, ensure data source assistance while avoiding irrelevant interference, and improve task completion accuracy.
Smart Images

Figure CN120706567A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet of Things technology, and in particular to a self-routing and self-screening retrieval enhancement generation method, device, medium and product. Background Art
[0002] Retrieval-Augmented Generation (RAG) technology is primarily used to enable large models to complete given tasks based on domain-specific knowledge, such as completing manual, repetitive tasks. Traditional RAG solutions primarily rely on vector similarity to extract data items from a single data source. The large model is then called upon to learn domain-specific knowledge from these extracted data items to complete the given task.
[0003] However, a single data source often makes it difficult for a large model to learn sufficient domain-specific knowledge, making it difficult for the large model to correctly and reasonably complete a given task. Traditional retrieval enhancement generation schemes only extract data entries from the data source based on vector similarity. This fuzzy search of word meaning matching often introduces data entries that are irrelevant to the given task, thereby interfering with the large model and resulting in poor task completion performance. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a self-routing and self-screening retrieval enhancement generation method, device, medium and product, which can use multiple data sources in the retrieval enhancement generation process and implement reasonable data entry screening of the data sources, thereby improving the task completion effect of large models.
[0005] In a first aspect, an embodiment of the present application provides a self-routing and self-screening retrieval enhancement generation method, which is applied to a preset extended finite state automaton, and the method includes: The extended finite state automaton enters an initial state and performs an initialization operation; When detecting that the extended finite state automaton satisfies the first condition or the second condition, the extended finite state automaton enters a search state to perform self-routing, calls the large model to determine whether a data search is required based on the task description of the task to be completed and the currently screened data items, and, if it is determined that a data search is required, determines the data source currently required to be searched. The first condition includes: the extended finite state automaton completes the initialization operation; the second condition includes: the extended finite state automaton completes the screening of data items for the data source previously required to be searched; When it is detected that the extended finite state automaton satisfies the third condition, the extended finite state automaton enters a screening state to perform self-screening, calling the large model to screen data entries in the data source currently to be searched by analyzing the semantic relevance between the task description of the task to be completed and each data entry in the data source currently to be searched, wherein the third condition includes: the extended finite state automaton determines the data source currently to be searched; When detecting that it satisfies the fourth condition, the extended finite state automaton enters a task-completion state, calls the large model to execute the set operations associated with the retrieval enhancement generation based on the currently filtered data entries to complete the task to be completed. The fourth condition includes: the extended finite state automaton determines that data search is not required.
[0006] A second aspect of an embodiment of the present application provides a self-routing and self-screening retrieval enhancement generation device, which is applied to a preset extended finite state automaton, and includes: An initialization module, used for controlling the extended finite state automaton to enter an initial state and perform an initialization operation; The search module is configured to, upon detecting that the extended finite state automaton satisfies a first condition or a second condition, control the extended finite state automaton to enter a search state for self-routing, call the large model to determine whether a data search is required based on a task description of the task to be completed and currently screened data entries, and, if it is determined that a data search is required, determine a data source to be searched currently, wherein the first condition includes: the extended finite state automaton completes the initialization operation; and the second condition includes: the extended finite state automaton completes the screening of data entries for a previously searched data source; a screening module, configured to, upon detecting that the extended finite state automaton satisfies a third condition, control the extended finite state automaton to enter a screening state for self-screening, and call the large model to screen data entries in the data source currently to be searched by analyzing the semantic relevance between the task description of the task to be completed and each data entry in the data source currently to be searched, wherein the third condition includes: the extended finite state automaton determining the data source currently to be searched; An execution module is used to control the extended finite state automaton to enter a task-completion state when it is detected that the extended finite state automaton satisfies a fourth condition, and to call the large model to execute the set operation associated with the retrieval enhancement generation based on the currently filtered data entries to complete the task to be completed, wherein the fourth condition includes: the extended finite state automaton determines that data search is not required.
[0007] A third aspect of the embodiments of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the self-routing and self-screening retrieval enhancement generation method as described in the first aspect.
[0008] In a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the self-routing and self-screening retrieval enhancement generation method as described in the first aspect are implemented.
[0009] In a fifth aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the self-routing and self-screening retrieval enhancement generation method as described in the first aspect are implemented.
[0010] It can be seen from the above technical solution that this application designs an extended finite state automaton based on whether the conditions are met as the basis for state transfer, thereby realizing the automatic execution of the retrieval enhancement generation scheme with the help of the extended finite state automaton, and in the process of executing the retrieval enhancement generation scheme, this application designs an extended finite state automaton to use the semantic understanding ability of the large model to achieve self-routing and self-screening; self-routing enables the large model to reasonably select the data source required to complete the task, thereby realizing a retrieval enhancement generation scheme that relies on multiple data sources, so that the large model can obtain sufficient data source assistance while avoiding the introduction of irrelevant data sources and causing interference to the large model; self-screening enables the large model to eliminate irrelevant data entries, thereby avoiding the introduction of irrelevant data entries and causing interference to the large model; thereby, it can effectively reduce the interference of information missing and invalid information suffered by the large model in subsequent processing work, thereby greatly improving the task completion effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0012] Figure 1 A flowchart of an implementation of a self-routing and self-screening retrieval enhancement generation method provided in an embodiment of the present application; Figure 2 A schematic diagram of an extended finite state automaton provided in an embodiment of the present application; Figure 3 A schematic diagram of an implementation process of a self-routing and self-screening retrieval enhancement generation method provided in an embodiment of the present application; Figure 4 A schematic diagram of the structure of a self-routing and self-screening retrieval enhancement generation device provided in an embodiment of the present application; Figure 5 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0013] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative work are within the scope of protection of this application.
[0014] As businesses grow and their data volumes increase, the complex and tedious tasks of modern enterprise management also increase. However, the development of large language models has provided a better solution for this type of work: using large language models to complete some of the manual, repetitive tasks. Given the limitations of large language model training, domain-specific knowledge is often not included in the large model. Therefore, retrieval-augmented generation techniques are needed to drive the large model to complete the given tasks based on domain-specific knowledge.
[0015] However, through analyzing the actual application scenarios of retrieval-enhanced generation, the researchers of this application found that completing a task often requires the assistance of multiple data sources. For example, when punishing an employee for a violation, it is necessary not only to process the video of the employee's violation and consider the regulations that the employee violated, but also to consider the employee's past violations and refer to the punishment methods for similar violations. Therefore, traditional retrieval-enhanced generation solutions using a single data source have difficulty supporting large models to learn sufficient domain-specific knowledge, making it difficult for large models to correctly and reasonably complete a given task, resulting in poor task completion performance of large models.
[0016] On this basis, the researchers of this application found through analysis that if you want to introduce multiple data sources for the retrieval enhancement solution, you need to solve the key problem of how to select the data sources to use. Specifically, if all data sources are used, the computational overhead will be greatly increased, and the additional invalid data sources introduced will not necessarily improve the performance of the large model in completing the task, and may even interfere with the completion of the large model task; if too few data sources are used, the knowledge that the large model can rely on to complete the task will be reduced, which will make it difficult for the large model to complete the task correctly and reasonably, or even cause hallucinations.
[0017] In addition, traditional retrieval enhancement generation schemes only extract results based on the similarity of vectors. This fuzzy search of word meaning matching may still introduce irrelevant data entries, interfering with the completion of large model tasks, thereby further affecting the task completion effect of the large model.
[0018] Based on the above analysis, in response to the problem of poor task completion effect of large models in related technologies, the embodiments of the present application provide a self-routing and self-screening retrieval enhanced generation method, device, medium and product. Based on a preset extended finite state automaton, the large model can independently select the required data source and filter out relevant data entries from the data source, thereby improving the task completion effect of the large model.
[0019] See also Figure 1 FIG. 1 is a flowchart of an implementation of a self-routing and self-screening retrieval enhancement generation method provided by an embodiment of the present application. The method is applied to a preset extended finite state automaton and may include the following steps: Step S101: the extended finite state automaton enters the initial state and performs initialization operations.
[0020] In specific implementation, when a specific task needs to be completed, the extended finite state automaton first enters the initial state to perform an initialization operation, which is mainly used to set the initial values of variables such as the content to be searched, for example, initializing the content to be searched to the user's question.
[0021] It should be noted that a finite state machine is a mathematical computational model that represents a finite number of states and behaviors such as transitions and actions between these states, with the state transition condition being an input character. This application uses whether the condition is met as the basis for state transition, and accordingly redesigns the finite number of states associated with the finite state machine, as well as the transitions and actions between these states, thereby designing an extended finite state automaton that can automatically execute retrieval enhancement generation solutions and enable large models to autonomously select the required data source and filter out relevant data entries from the data source, thereby providing a technical implementation foundation for the introduction of multiple data sources.
[0022] Step S102: When it is detected that the extended finite state automaton satisfies the first condition or the second condition, the extended finite state automaton enters the search state for self-routing, and calls the large model to determine whether data search is required based on the task description of the task to be completed and the currently filtered data entries. When it is determined that data search is required, the data source currently required to be searched is determined. The first condition includes: the extended finite state automaton completes the initialization operation, and the second condition includes: the extended finite state automaton completes the filtering of data entries for the data source required to be searched previously.
[0023] In specific implementation, when the initialization operation is completed (i.e., the first condition is met) or the filtering of data entries is completed (i.e., the second condition is met), the extended finite state automaton enters the search state for self-routing, that is, calling the large model to determine whether data search is needed based on the task description of the task to be completed and the currently filtered data entries (for example, whether the number of filtered data entries meets the task requirements such as the number of data entries or modality set in the task description), and if it is determined that data search is needed, select the data source to be searched.
[0024] Step S103: When it is detected that the extended finite state automaton satisfies the third condition, it enters the screening state to perform self-screening, and calls the large model to screen the data items of the data source currently required to be searched by analyzing the semantic correlation between the task description of the task to be completed and each data item in the data source currently required to be searched. The third condition includes: the extended finite state automaton determines the data source currently required to be searched.
[0025] In the specific implementation, when the extended finite state automaton completes the search for the data source (i.e., the third condition is met), it enters the screening state to perform self-screening, that is, calling the large model to analyze the semantic correlation between the task description of the task to be completed and the data entries, thereby screening out data entries that are helpful to the task, and returns to the search state when the screening of the data entries is completed.
[0026] It should be noted that the large model can understand the semantics of task descriptions (such as descriptions of task requirements) and each data item. Therefore, based on the task description, the large model can determine whether the data item is helpful for completing the task, and then filter out data items that are helpful for the task from the data source, thereby achieving self-screening. For example, if the task description records the violation as "late for work", based on word vector similarity matching, two data items will be obtained: "late for work" and "late for a meeting". If the large model is called to filter the data items, the large model can use its own semantic understanding ability to determine that "late for a meeting" is an invalid item and eliminate it, thereby accurately filtering out useful data items.
[0027] Step S104: When the extended finite state automaton detects that it satisfies the fourth condition, it enters a task-completion state, calls the large model to perform the set operations associated with the retrieval enhancement generation based on the currently filtered data entries, so as to complete the task to be completed. The fourth condition includes: the extended finite state automaton determines that data search is not required.
[0028] In specific implementation, when the data search is completed (i.e., the fourth condition is met), the extended finite state automaton enters the task-completable state to complete the task to be completed, that is, calls the large model to learn domain-specific knowledge based on the currently filtered data entries, and then executes the set operations associated with the retrieval enhancement generation, such as the large model answering the user's questions, or completing other specific tasks associated with the retrieval enhancement generation.
[0029] It should be noted that the design purpose of the extended finite state automaton is to call the large model (that is, to utilize the semantic understanding ability of the large model. There are no special requirements for the large model. The large model can flexibly use methods such as expert cooperation and speculative sampling) to search for all content that needs to be searched, and to filter out useful information from the searched content as the basis for completing downstream tasks. Therefore, the task-completion state is a relatively broad concept, which may refer to the large model being able to answer the user's questions more accurately based on the currently filtered data items, or being able to better complete certain other specific tasks (i.e. tasks).
[0030] It can be seen from the above technical solution that this application designs an extended finite state automaton based on whether the conditions are met as the basis for state transfer, thereby realizing the automatic execution of the retrieval enhancement generation scheme with the help of the extended finite state automaton, and in the process of executing the retrieval enhancement generation scheme, this application designs an extended finite state automaton to use the semantic understanding ability of the large model to achieve self-routing and self-screening; self-routing enables the large model to reasonably select the data source required to complete the task, thereby realizing a retrieval enhancement generation scheme that relies on multiple data sources, so that the large model can obtain sufficient data source assistance while avoiding the introduction of irrelevant data sources and causing interference to the large model; self-screening enables the large model to eliminate irrelevant data entries, thereby avoiding the introduction of irrelevant data entries and causing interference to the large model; thereby, it can effectively reduce the interference of information missing and invalid information suffered by the large model in subsequent processing work, thereby greatly improving the task completion effect.
[0031] In an optional embodiment, the calling large model determines whether data search is required based on the task description of the task to be completed and the currently screened data items, including: Determine each preset data source that has not been screened by the data entry as each candidate data source; Calling the large model to perform semantic analysis on the task description and the currently filtered data items to detect whether there is a target semantic description related to the overall description semantics of at least one candidate data source in the task description and the currently filtered data items; The large model is called to determine whether data search is required based on the task description and the detection result of whether the target semantic description exists in the currently filtered data items.
[0032] In this embodiment, the large model, based on its own semantic understanding ability, determines whether data search is needed according to whether there is a target semantic description related to the overall description semantics of at least one candidate data source in the task description (which contains descriptive information of the task requirements) and the currently filtered data entries, so as to achieve exhaustive search of different data sources.
[0033] Taking the task description of employee violation punishment, and the candidate data sources are the employee management regulations manual data source, the historical violation record reference data source, the employee violation record data source and the bid document data source, and the corresponding overall descriptions are the employee management regulations manual, the historical violation record reference, the employee violation record and the bid document as an example, the extended finite state automaton calls the large model for the first self-routing, selects the employee management regulations manual data source as the data source currently required to be searched, and then filters out the penalty items related to the violation.
[0034] The extended finite state automaton then calls the large model to perform self-routing again, performing semantic analysis on the task description and the currently filtered data entries (i.e., penalty entries related to violations) to detect whether the task description and the currently filtered data entries contain a target semantic description that is semantically related to the overall description of at least one candidate data source. For example, if the task description and / or the currently filtered data entries contain a target semantic description that is semantically related to the overall description of the employee's violation record (e.g., a semantic description of cumulative violations), it can be determined that a data search is required, and the candidate data source associated with the target semantic description (i.e., the employee violation record data source) is used as the data source to be searched, so that the employee's past violation records can be filtered out through self-filtering. This achieves a complete search of the data source with the help of self-routing.
[0035] Optionally, the data entries in the preset data source are determined by the following steps: Dividing the data documents in the preset data source in a parent-child document block division manner; The divided parent document block is determined as a data entry, and the child document blocks associated with the parent document block are vector-embedded and indexed to support the large model in performing semantic analysis on the data entry.
[0036] In this embodiment, for each data document in the preset data source, the data document is divided using the parent-child document block division method, and then the child document block is vector embedded indexed, and the parent document block is used as the result of the data source search (i.e., the filtered data entry) so that the parent document block can be searched based on the semantic features of the child document block (which is part of the content of the parent document block), thereby taking into account both search accuracy and context content sufficiency.
[0037] In an optional embodiment, before calling the large model to analyze the semantic relevance between the task description of the to-be-completed task and each data item in the data source currently to be searched, and screening the data items in the data source currently to be searched, the method further includes: Based on word vector similarity, the task description of the task to be completed is matched with each data entry in the data source currently to be searched; After calling the rearrangement model to rearrange the data entries matched by the task description, the first k data entries are extracted therefrom, so that the large model can screen the extracted k data entries, where k is a positive integer.
[0038] In specific implementation, from the data source currently to be searched, select the data entries whose word vector similarity with the task description meets the similarity condition (for example, higher than the similarity threshold), and use these data entries as the data entries matched by the task description.
[0039] Then, a reordering model (e.g., a model using a Cross-Encoder architecture) is called to reorder the data items that match the task description. Specifically, the reordering model is called to analyze the relevance between the task description and the data items found based on the word vector similarity search to assign a relevance score. The data items are then reordered in descending order of relevance scores, thereby achieving a reordering of the data items that match the task description.
[0040] Subsequently, the top k (the value is determined according to actual needs) data entries are extracted from the rearranged data entries, that is, a part of the data entries with higher relevance scores are screened out; when self-screening is performed subsequently, the large model can be called to further screen these data entries.
[0041] In this embodiment, by further introducing a rearrangement model, the semantic evaluation capability of data source search can be improved, so that relevant data items that are helpful for the task can be screened out more accurately.
[0042] In an optional embodiment, the initialization operation includes at least one of the following: Item A-1: Initialize a large model (such as a multimodal large model) to make it usable; Item A-2: receiving a task description of the task to be completed input by a user, or calling a large model to generate a task description according to the task type of the task to be completed; Item A-3: Initialize the data entry list to be empty, and the data entry list is used to store the currently filtered data entries; Item A-4: Add or delete preset data sources based on a data source adjustment instruction received from the user. The preset data sources are used by the large model to determine the data source currently required for search. Different preset data sources may contain data entries of the same or different modalities. Item A-5: Initialize a candidate data source list to record all preset data sources as candidate data sources. The candidate data source list is used to support the large model in determining the data source currently required to be searched.
[0043] In this example, for item A-2, the user can manually enter a task description, enter task requirements (to assist in determining the task type), or directly enter the task type. Once the big model knows the task type, it automatically generates a task description. For example, for a penalty task, the big model can generate a task description or manually format it. The task description might be "Someone committed a certain violation at a certain time and place."
[0044] For item A-4, this application, on the basis of implementing a search enhancement generation solution using multiple data sources, also supports users to dynamically add and delete these multiple data sources; and these multiple data sources can not only include text-related data entries, but also include data entries of other modalities such as communication (such as video) related and perception (such as sensors) related. This can fully utilize the multimodal data processing capabilities of the large model, so that the large model can use data entries from multiple data sources (such as data entries from text, video, sensors and other related data sources) for search enhancement generation, thereby helping modern enterprises to manage complex intelligent systems.
[0045] For item A-5, initialize the candidate data source list to record all preset data sources (i.e., all available data sources) as candidate data sources, so that when the large model performs self-routing for the first time, the data source currently required to be searched is selected from all preset data sources, and the data source currently required to be searched is removed from the candidate data source list. When self-routing is performed again subsequently, the remaining preset data sources (i.e., candidate data sources) that have not been screened by data entries can be quickly determined based on the candidate data source list, and the data source currently required to be searched can be selected from them. This can effectively avoid repeated searches and missed searches of preset data sources.
[0046] Optionally, the candidate data source list is obtained by storing an overall description of a preset data source to record the preset data source as a candidate data source; The overall description of the preset data source is determined by the following steps: Calling the big model to generate an overall description of the preset data source; Alternatively, an overall description of the preset data source input by a user is received.
[0047] In this embodiment, for each preset data source, a comprehensive description of the preset data source is generated using the macro model, or a summary of the preset data source is manually created, thereby obtaining a comprehensive description of each preset data source (which semantically represents the overall content of the data items stored in the data source). It will be appreciated that storing the comprehensive description of each preset data source as a candidate data source in the candidate data source list facilitates the subsequent macro model's ability to distinguish between different preset data sources and facilitates the macro model's rapid selection of appropriate data sources based on the comprehensive descriptions stored in the candidate data source list.
[0048] In an alternative embodiment, see Figure 2 The schematic diagram of the extended finite state automaton is shown, in which the state set of the extended finite state automaton is , initial state , and the final state In the case of the extended finite state automaton, the state transition function It is expressed as follows:
[0049]
[0050]
[0051]
[0052] In this embodiment, the extended finite state automaton is based on the above-mentioned state transition function and can automatically call the large model for self-routing and self-screening, so that in the retrieval enhancement generation process, different data sources can be searched thoroughly and useful data strips can be accurately screened out. As a result, the large model will not be disturbed by missing and invalid information when processing the next work, so that it can complete downstream tasks more excellently.
[0053] For example, see Figure 3 FIG. 1 is a schematic diagram of an implementation process of a self-routing and self-screening retrieval enhancement generation method, wherein the implementation process mainly includes the following steps: Step 1: For N data sources, use the embedding model to build N vector databases and generate an overall description of each data source.
[0054] Step 2: Expand the finite state automaton to enter the initial state and perform initialization operations for the task to be completed (completing the task requires the collaboration of multiple data sources such as text, video, and sensors). For example, generate a task description, initialize the large model, the data entry list, and the optional data source list (i.e., the candidate data source list).
[0055] Step 3: Expand the finite state automaton to enter the search state and use the large model to make a judgment: "Given the task description and data entries, can the task be completed?"; if yes, execute step 7; otherwise, execute step 4.
[0056] In this step, the input data of the large model can be expressed as "task description: XXX; data entries: XXX, XXX, XXX; whether the task can be completed with these data entries: YES / NO".
[0057] The large model then semantically analyzes the task description and data entries to determine whether the data is sufficient (that is, whether the task can be completed well using the currently filtered data entries). If the judgment result is "YES", the "data search completed" condition is met, and the extended finite state automaton enters the task completion state; if the result is "NO", the extended finite state automaton remains in the search state.
[0058] Optionally, the large model can be fine-tuned on the judgment task to improve its ability to complete the judgment task. Fine-tuning here means retraining the large model using pre-prepared question-answer pairs or high-quality question-answer pairs obtained during use to make it more suitable for the judgment task.
[0059] Step 4: Use the big model to make a judgment: "Given the task description and the list of optional data sources, which data source should be selected for search?" and record the data source selected by the big model as .
[0060] In this step, the input data of the large model can be expressed as "task description: XXX; list of optional data sources: XXX data source contains XXX, XXX data source contains XXX; which data source needs to be selected for search".
[0061] Optionally, the large model here can use a large model that has been fine-tuned on the classification task to improve the ability of the large model to complete the classification task (i.e., select the data source).
[0062] Step 5: Expand the finite state automaton to enter the screening state and perform the data source Search by matching and rearranging word vector similarity to find the most similar task description. data entries.
[0063] In this step, the extended finite state automaton is still in the search state until the "search data source completion" condition is met (that is, the most similar to the task description is found). data entries), it moves to the filtering state.
[0064] Step 6: Expand the finite state automaton into the screening state and use the large model to Data entries The second judgment is: "Given the task description and data entry, is the data entry helpful in completing the task?" If it is helpful, it is retained; otherwise, the entry is discarded, and the filtered data entry is then Add data items to the data item list and set the data source Delete it from the list of available data sources and return to step 3.
[0065] In this step, the large model side will perform multiple iterations, and the number of iterations is the number of data entries. The input data of each iteration can be expressed as "task description: XXX; data entry: XXX; whether this data entry helps to complete the task: YES / NO"; if the answer of the large model is YES, the data entry is retained; otherwise, the data entry is deleted; finally, the retained data entry is added to the data entry list.
[0066] Optionally, the large model here can use a large model that has been fine-tuned on the judgment task to improve the ability of the large model to complete the judgment task.
[0067] Step 7: The extended finite state automaton enters a task-completion state, and executes the set operation associated with the retrieval enhancement generation to complete the task to be completed.
[0068] Optionally, at this time, the large model can use a large model fine-tuned on a related specific task to improve the ability of the large model to complete such specific tasks.
[0069] It should be noted that for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the order of the actions described, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0070] The embodiment of the present application also provides a self-routing and self-screening retrieval enhancement generation device, which is applied to a preset extended finite state automaton, such as Figure 4 As shown, the device includes: An initialization module, used for controlling the extended finite state automaton to enter an initial state and perform an initialization operation; The search module is configured to, upon detecting that the extended finite state automaton satisfies a first condition or a second condition, control the extended finite state automaton to enter a search state for self-routing, call the large model to determine whether a data search is required based on a task description of the task to be completed and currently screened data entries, and, if it is determined that a data search is required, determine a data source to be searched currently, wherein the first condition includes: the extended finite state automaton completes the initialization operation; and the second condition includes: the extended finite state automaton completes the screening of data entries for a previously searched data source; a screening module, configured to, upon detecting that the extended finite state automaton satisfies a third condition, control the extended finite state automaton to enter a screening state for self-screening, and call the large model to screen data entries in the data source currently to be searched by analyzing the semantic relevance between the task description of the task to be completed and each data entry in the data source currently to be searched, wherein the third condition includes: the extended finite state automaton determining the data source currently to be searched; An execution module is used to control the extended finite state automaton to enter a task-completion state when it is detected that the extended finite state automaton satisfies a fourth condition, and to call the large model to execute the set operation associated with the retrieval enhancement generation based on the currently filtered data entries to complete the task to be completed, wherein the fourth condition includes: the extended finite state automaton determines that data search is not required.
[0071] Optionally, the search module is further configured to perform the following steps: Determine each preset data source that has not been screened by the data entry as each candidate data source; Calling the large model to perform semantic analysis on the task description and the currently filtered data items to detect whether there is a target semantic description related to the overall description semantics of at least one candidate data source in the task description and the currently filtered data items; The large model is called to determine whether data search is required based on the task description and the detection result of whether the target semantic description exists in the currently filtered data items.
[0072] Optionally, the device further includes a data source processing module, configured to perform the following steps: Dividing the data documents in the preset data source in a parent-child document block division manner; The divided parent document block is determined as a data entry, and the child document blocks associated with the parent document block are vector embedded and indexed to support the large model in performing semantic analysis on the data entry.
[0073] Optionally, the device further includes a data extraction module, configured to perform the following steps: Based on word vector similarity, the task description of the task to be completed is matched with each data entry in the data source currently to be searched; After calling the rearrangement model to rearrange the data entries matched by the task description, the first k data entries are extracted therefrom, so that the large model can screen the extracted k data entries, where k is a positive integer.
[0074] Optionally, the initialization operation includes at least one of the following: Initialize the large model to make it usable; Receive a task description of the task to be completed input by a user, or call a large model to generate a task description according to the task type of the task to be completed; Initialize the data entry list to be empty, and the data entry list is used to store the currently filtered data entries; Add or delete preset data sources based on a data source adjustment instruction received from the user. The preset data sources are used by the macro model to determine the data source currently required for search. Different preset data sources may contain data entries of the same or different modalities. Initialize a candidate data source list to record all preset data sources as candidate data sources. The candidate data source list is used to support the large model to determine the data source currently required to be searched.
[0075] Optionally, the candidate data source list is obtained by storing an overall description of a preset data source to record the preset data source as a candidate data source; The device further includes a description generating module configured to perform the following steps: Calling the big model to generate an overall description of the preset data source; Alternatively, an overall description of the preset data source input by a user is received.
[0076] Optionally, in the state set of the extended finite state automaton , initial state , and the final state In the case of the extended finite state automaton, the state transition function It is expressed as follows:
[0077]
[0078]
[0079]
[0080] It can be seen from the above technical solution that this application designs an extended finite state automaton based on whether the conditions are met as the basis for state transfer, thereby realizing the automatic execution of the retrieval enhancement generation scheme with the help of the extended finite state automaton, and in the process of executing the retrieval enhancement generation scheme, this application designs an extended finite state automaton to use the semantic understanding ability of the large model to achieve self-routing and self-screening; self-routing enables the large model to reasonably select the data source required to complete the task, thereby realizing a retrieval enhancement generation scheme that relies on multiple data sources, so that the large model can obtain sufficient data source assistance while avoiding the introduction of irrelevant data sources and causing interference to the large model; self-screening enables the large model to eliminate irrelevant data entries, thereby avoiding the introduction of irrelevant data entries and causing interference to the large model; thereby, it can effectively reduce the interference of information missing and invalid information suffered by the large model in subsequent processing work, thereby greatly improving the task completion effect.
[0081] The present application also provides an electronic device, Figure 5 , Figure 5 Schematic diagram of the electronic device proposed in the embodiment of the present application. Figure 5 As shown, the electronic device 100 includes: a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus communication. A computer program is stored in the memory 110. The computer program can be run on the processor 120 to implement the steps in the self-routing and self-screening retrieval enhancement generation method disclosed in the embodiment of the present application.
[0082] The embodiment of the present application also provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the self-routing and self-screening retrieval enhancement generation method disclosed in the embodiment of the present application is implemented.
[0083] The embodiment of the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the self-routing and self-screening retrieval enhancement generation method disclosed in the embodiment of the present application.
[0084] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0085] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0086] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, systems, devices, storage media, and program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0087] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0088] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0089] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "includes," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements that are inherent to such process, method, article, or terminal device. In the absence of further restrictions, an element defined by the phrase "comprises a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
[0090] The above is a detailed introduction to the self-routing and self-screening retrieval enhanced generation method, device, medium and product provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A self-routing and self-screening retrieval enhancement generation method, characterized in that: Applied to a preset extended finite state automaton, the method includes: The extended finite state automaton enters an initial state and performs an initialization operation; When detecting that the extended finite state automaton satisfies the first condition or the second condition, the extended finite state automaton enters a search state to perform self-routing, calls the large model to determine whether a data search is required based on the task description of the task to be completed and the currently screened data items, and, if it is determined that a data search is required, determines the data source currently required to be searched. The first condition includes: the extended finite state automaton completes the initialization operation; the second condition includes: the extended finite state automaton completes the screening of data items for the data source previously required to be searched; When it is detected that the extended finite state automaton satisfies the third condition, the extended finite state automaton enters a screening state to perform self-screening, calling the large model to screen data entries in the data source currently to be searched by analyzing the semantic relevance between the task description of the task to be completed and each data entry in the data source currently to be searched, wherein the third condition includes: the extended finite state automaton determines the data source currently to be searched; When detecting that it satisfies the fourth condition, the extended finite state automaton enters a task-completion state, calls the large model to execute the set operations associated with the retrieval enhancement generation based on the currently filtered data entries to complete the task to be completed. The fourth condition includes: the extended finite state automaton determines that data search is not required.
2. The method according to claim 1, characterized in that The calling large model determines whether data search is required based on the task description of the task to be completed and the currently filtered data items, including: Determine each preset data source that has not been screened by the data entry as each candidate data source; Calling the large model to perform semantic analysis on the task description and the currently filtered data items to detect whether there is a target semantic description related to the overall description semantics of at least one candidate data source in the task description and the currently filtered data items; The large model is called to determine whether data search is required based on the task description and the detection result of whether the target semantic description exists in the currently filtered data items.
3. The method according to claim 2, characterized in that The data entries in the preset data source are determined by the following steps: Dividing the data documents in the preset data source in a parent-child document block division manner; The divided parent document block is determined as a data entry, and the child document blocks associated with the parent document block are vector-embedded and indexed to support the large model in performing semantic analysis on the data entry.
4. The method according to claim 1, wherein Before calling the large model to screen data entries in the data source currently to be searched by analyzing the semantic relevance between the task description of the to-be-completed task and each data entry in the data source currently to be searched, the method further includes: Based on word vector similarity, the task description of the task to be completed is matched with each data entry in the data source currently to be searched; After calling the rearrangement model to rearrange the data entries matched by the task description, the first k data entries are extracted therefrom, so that the large model can screen the extracted k data entries, where k is a positive integer.
5. The method according to claim 1, wherein The initialization operation includes at least one of the following: Initialize the large model to make it usable; Receive a task description of the task to be completed input by a user, or call a large model to generate a task description according to the task type of the task to be completed; Initialize the data entry list to be empty, and the data entry list is used to store the currently filtered data entries; Add or delete preset data sources based on a data source adjustment instruction received from the user. The preset data sources are used by the macro model to determine the data source currently required for search. Different preset data sources may contain data entries of the same or different modalities. Initialize a candidate data source list to record all preset data sources as candidate data sources. The candidate data source list is used to support the large model to determine the data source currently required to be searched.
6. The method according to claim 5, characterized in that The candidate data source list is obtained by storing an overall description of a preset data source to record the preset data source as a candidate data source; The overall description of the preset data source is determined by the following steps: Calling the big model to generate an overall description of the preset data source; Alternatively, an overall description of the preset data source input by a user is received.
7. The method according to any one of claims 1 to 6, characterized in that: The state set of the extended finite state automaton , initial state , and the final state In the case of the extended finite state automaton, the state transition function It is expressed as follows: 。 8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the self-routing and self-screening retrieval enhancement generation method according to any one of claims 1 to 7 is implemented.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein: The processor executes the computer program to implement the self-routing and self-screening retrieval enhancement generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the self-routing and self-screening retrieval enhancement generation method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Fault self-recovery method and system based on large language model
CN117909119A
Self-adaptive retrieval enhancement generation method and system based on model knowledge boundary
CN118503354A
Cross-modal retrieval enhancement method and system based on visual large language model and medium
CN119782558A
Utilizing a gated self-attention memory network model for predicting a candidate answer match to a query
US20210081503A1
Data source mapper for enhanced data retrieval
US20250200088A1