Retrieval enhancement generation method and device, electronic equipment and storage medium
By scheduling multi-source searches and rearranging evidence information based on temporal consistency and relevance scores, high-quality search results are generated, solving the problem of poor quality and cost compatibility in existing technologies and achieving efficient search result generation within budget.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-05-01
AI Technical Summary
In existing technologies, search enhancement generation cannot balance quality and cost, resulting in poor quality or high cost of generated search results.
By acquiring the text to be retrieved and the budget vector, multi-source retrieval scheduling is performed to determine the target action, calculate the temporal consistency and relevance scores between the evidence information and the text to be retrieved, rearrange the evidence information, and input it into a pre-trained language model to generate candidate retrieval results. Finally, the results are verified to output the target retrieval result.
While staying within the cost budget, the quality of search results was improved, while maintaining compatibility between quality and cost in the search enhancement generation process.
Smart Images

Figure CN121958448A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of retrieval technology, and in particular to a retrieval enhancement generation method, apparatus, electronic device, and storage medium. Background Technology
[0002] Retrieval-Augmented Generation (RAG) is a technique that combines information retrieval with the generative capabilities of Large Language Models (LLM). Its core idea is to retrieve relevant information from external knowledge sources (such as document databases, knowledge bases, and the internet) before or during LLM's answer generation. This retrieved evidence is then input into the LLM along with the user's query, resulting in a more factual, timely, and accurate answer.
[0003] However, existing technologies cannot effectively balance quality and cost when generating search enhancement results, resulting in either poor quality or high cost. Therefore, how to better balance quality and cost in the search enhancement generation process has become an urgent technical problem to be solved. Summary of the Invention
[0004] This application provides a retrieval enhancement generation method, apparatus, electronic device, and storage medium to solve the quality and cost problems in the retrieval enhancement generation process that cannot be well compatible in the prior art.
[0005] In a first aspect, embodiments of this application provide a retrieval enhancement generation method, the method comprising: Obtain the text to be retrieved and the budget vector, wherein the budget vector is used to represent the upper limit value of various budgets; Based on the budget vector, multi-source retrieval scheduling is performed on the text to be retrieved, and a target action is determined from multiple candidate actions, wherein the target action is the action with the highest action utility among the multiple candidate actions; Execute the target action to obtain the evidence information corresponding to the text to be retrieved; Calculate the temporal consistency score and relevance score between the evidence information and the text to be retrieved, and rearrange the evidence information based on the temporal consistency score and the relevance score; The rearranged evidence information and the text to be retrieved are input into a pre-trained language model to generate multiple candidate retrieval results; The multiple candidate search results are verified, and the verified candidate search results are output as the target search results.
[0006] Optionally, determining the target action from multiple candidate actions includes: Obtain the information gain prediction value and cost prediction value corresponding to each of the multiple candidate actions, wherein the information gain prediction value is used to characterize the information gain after executing the corresponding candidate action, and the cost prediction value is used to characterize the cost expenditure required to execute the corresponding candidate action; Based on the predicted information gain and the predicted cost, calculate the action utility corresponding to each candidate action; The candidate action with the greatest action utility is determined as the target action.
[0007] Optionally, the formula for calculating the effect of the action is as follows: ; in, This indicates the utility of the action corresponding to candidate action a. This represents the predicted information gain value corresponding to candidate action a. This represents the predicted cost value corresponding to candidate action a. It is a preset value that is greater than zero. Indicates the preset weight. This represents the uncertainty corresponding to candidate action a.
[0008] Optionally, calculating the temporal consistency score and relevance score between the evidence information and the text to be retrieved includes: The temporal distance, version matching degree, and / or the recentity of the evidence information are obtained between the evidence information and the text to be retrieved. Based on the temporal distance, version matching degree, and / or recentity, the temporal consistency score is determined. The temporal distance is determined based on the timestamp of the evidence information and the temporal intent in the text to be retrieved. The version matching degree is determined based on the version number of the evidence information and the temporal intent in the text to be retrieved. The recentity is determined based on the frequency of the evidence information being accessed recently. Calculate the text similarity between the evidence information and the text to be retrieved, and determine the relevance score based on the text similarity.
[0009] Optionally, the formula for calculating the time consistency score is as follows: ; in, Indicates evidence information With the text to be retrieved The time consistency score between them Indicates evidence information With the text to be retrieved The time distance between them, Indicates evidence information timestamp, Indicates the text to be searched The time intention in the middle This represents the time window normalization parameter. Indicates evidence information With the text to be retrieved The version matching degree between them Indicates evidence information The aforementioned proximity, , and This indicates the preset weight.
[0010] Optionally, the step of validating the plurality of candidate search results and outputting the validated candidate search results as the target search results includes: Calculate the bundle search score, coverage score, and stability score for each candidate search result among the multiple candidate search results; Based on the beam search score, the coverage score, and the stability score, a comprehensive score is determined for each candidate retrieval result; The overall score of each candidate search result is compared with a preset threshold. If there are candidate search results with a comprehensive score greater than the preset threshold, the candidate search results with a comprehensive score greater than the preset threshold are determined as the target search results, and the target search results are output.
[0011] Optionally, after comparing the overall score of each candidate search result with a preset threshold, the method further includes: If no candidate search result has a comprehensive score greater than the preset threshold, the model parameters are updated, and the text to be searched is searched again after the model parameters are updated.
[0012] Secondly, embodiments of this application also provide a retrieval enhancement generation apparatus, the apparatus comprising: The acquisition module is used to acquire the text to be retrieved and the budget vector, wherein the budget vector is used to represent the upper limit value of various budgets; The retrieval scheduling module is used to perform multi-source retrieval scheduling on the text to be retrieved based on the budget vector, and to determine the target action from multiple candidate actions, wherein the target action is the action with the highest action utility among the multiple candidate actions; The execution module is used to execute the target action and obtain evidence information corresponding to the text to be retrieved; The rearrangement module is used to calculate the temporal consistency score and relevance score between the evidence information and the text to be retrieved, and rearrange the evidence information based on the temporal consistency score and the relevance score. The generation module is used to input the rearranged evidence information and the text to be retrieved into a pre-trained language model to generate multiple candidate retrieval results; The verification and output module is used to verify the multiple candidate search results and output the verified candidate search results as the target search results.
[0013] Thirdly, embodiments of this application also provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the retrieval enhancement generation method as described in any of the first aspects.
[0014] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the retrieval enhancement generation method as described in any of the first aspects.
[0015] The technical solutions provided in this application have the following advantages compared with the prior art: The method provided in this application embodiment obtains a text to be retrieved and a budget vector, wherein the budget vector is used to represent the upper limit of various budgets; based on the budget vector, multi-source retrieval scheduling is performed on the text to be retrieved, and a target action is determined from multiple candidate actions, wherein the target action is the action with the highest action utility among the multiple candidate actions; the target action is executed to obtain evidence information corresponding to the text to be retrieved; the temporal consistency score and relevance score between the evidence information and the text to be retrieved are calculated, and the evidence information is rearranged based on the temporal consistency score and the relevance score; the rearranged evidence information and the text to be retrieved are input into a pre-trained language model to generate multiple candidate retrieval results; the multiple candidate retrieval results are verified, and the verified candidate retrieval results are output as the target retrieval results. The above approach allows for multi-source retrieval scheduling of the text to be retrieved based on the budget vector during the retrieval enhancement generation process, ensuring that the cost does not exceed the budget limit. Furthermore, by calculating the temporal consistency score and relevance score between the evidence information and the text to be retrieved, the evidence information is rearranged, and by verifying the candidate retrieval results, the target retrieval result is determined. All of these methods contribute to improving the quality of the retrieval results. Therefore, this approach can effectively balance quality and cost in the retrieval enhancement generation process, maximizing the quality of the retrieval results without exceeding the cost budget. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating a retrieval enhancement generation method provided in an embodiment of this application; Figure 2 A flowchart illustrating another retrieval enhancement generation method provided in this application embodiment; Figure 3 This is a schematic diagram of the structure of a search enhancement generation device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0020] See Figure 1 , Figure 1 This is a flowchart illustrating a search enhancement generation method provided in an embodiment of this application. Figure 1 As shown, the retrieval enhancement generation method may include the following steps: Step S101: Obtain the text to be retrieved and the budget vector, wherein the budget vector is used to represent the upper limit value of various budgets.
[0021] Specifically, the text to be retrieved can be determined based on the actual application scenario. For example, when the application scenario is a financial Q&A scenario, the text to be retrieved could be "How did a certain company's net profit change year-on-year as of July 2025?"; when the application scenario is a white paper Q&A scenario, the text to be retrieved could be "What are the test environment and comparison conclusions of Table 2 in Chapter 3?"; when the application scenario is a corporate knowledge base customer service Q&A scenario, the text to be retrieved could be "What are the sales volumes of product X in each quarter?", etc. The budget vector can be used to represent the upper limit of various budgets, such as the maximum allowed response latency, the maximum cost budget for a single query, the maximum number of text bytes that can be consumed, etc. As an optional implementation, the budget vector can be represented as: ; in, Represents a preset vector. This indicates the maximum allowable response latency (in milliseconds), which affects the user experience and real-time requirements. This indicates the maximum cost budget for a single query, and the unit can be either "cents" or "yuan". This indicates the maximum number of text bytes that can be consumed (e.g., vector retrieval, total word limit for generation, etc.). This represents the maximum limit on the number of calls to external Application Programming Interfaces (APIs) (such as multi-source call limits). These parameters can be flexibly set based on factors such as the user's desired response speed, interface cost limits, and context length limits. During scheduling, if any dimension reaches the limit, the system will stop early or use a fallback path.
[0022] Step S102: Based on the budget vector, perform multi-source retrieval scheduling on the text to be retrieved, and determine the target action from multiple candidate actions. The target action is the action with the highest action utility among multiple candidate actions.
[0023] Specifically, the aforementioned multi-source retrieval scheduling refers to determining the optimal retrieval method from multiple retrieval methods to obtain evidence information related to the text to be retrieved. The aforementioned candidate action refers to the action of obtaining evidence information using a specific retrieval method; this candidate action can be methods such as expanded retrieval, cross-source fusion, or recalling more TopK data. The aforementioned target action refers to the action with the highest action utility among multiple candidate actions; action utility here refers to the information gain obtained after executing this action (i.e., obtaining evidence information with higher coverage).
[0024] When determining the target action from multiple candidate actions, you can first calculate the action utility corresponding to each candidate action, and then select the candidate action with the highest action utility as the target action.
[0025] Step S103: Execute the target action to obtain the evidence information corresponding to the text to be retrieved.
[0026] After determining the target action, the target action can be executed to obtain the evidence information corresponding to the text to be retrieved.
[0027] Step S104: Calculate the temporal consistency score and relevance score between the evidence information and the text to be retrieved, and rearrange the evidence information based on the temporal consistency score and relevance score.
[0028] Specifically, the aforementioned temporal consistency score characterizes the degree of temporal matching between the evidence information and the text to be retrieved. This temporal consistency score can be calculated from some or all of several dimensions, including the temporal distance and version matching between the evidence information and the text to be retrieved, as well as the recentity of the evidence information. The aforementioned relevance score characterizes the textual similarity between the evidence information and the text to be retrieved. For example, cosine similarity, Euclidean distance, Manhattan distance, etc., can be used to calculate the relevance score.
[0029] After calculating the temporal consistency score and relevance score between the evidence information and the text to be retrieved, a comprehensive score can be calculated for both scores. The evidence information is then rearranged based on this comprehensive score. This allows evidence information with higher comprehensive scores to be placed earlier and evidence information with lower comprehensive scores to be placed later, thereby improving the quality of the evidence information.
[0030] Step S105: Input the rearranged evidence information and the text to be retrieved into the pre-trained language model to generate multiple candidate retrieval results.
[0031] Specifically, the language model mentioned above can be a Generative Pre-trained Transformer (GPT), a deepseek model, etc. The number of candidate search results can be preset by the user.
[0032] Step S106: Verify multiple candidate search results and output the verified candidate search results as the target search results.
[0033] Specifically, when validating multiple candidate search results, they can be evaluated from multiple dimensions such as coverage, stability, structural coherence, temporal consistency, and similarity. This ensures that the target search results possess high coverage, stability, structural coherence, temporal consistency, and similarity, thereby improving the quality of the search results.
[0034] The above approach allows for multi-source retrieval scheduling of the text to be retrieved based on the budget vector during the retrieval enhancement generation process, ensuring that the cost does not exceed the budget limit. Furthermore, by calculating the temporal consistency score and relevance score between the evidence information and the text to be retrieved, the evidence information is rearranged, and by verifying the candidate retrieval results, the target retrieval result is determined. All of these methods contribute to improving the quality of the retrieval results. Therefore, this approach can effectively balance quality and cost in the retrieval enhancement generation process, maximizing the quality of the retrieval results without exceeding the cost budget.
[0035] In an optional embodiment, step S102, determining the target action from a plurality of candidate actions, includes: Obtain the information gain prediction value and cost prediction value corresponding to each candidate action among multiple candidate actions. The information gain prediction value is used to characterize the information gain after executing the corresponding candidate action, and the cost prediction value is used to characterize the cost expenditure required to execute the corresponding candidate action. Based on the predicted information gain and cost, calculate the action utility corresponding to each candidate action. The candidate action with the greatest action utility is identified as the target action.
[0036] Specifically, when determining the target action from multiple candidate actions, we can first obtain the predicted information gain and cost for each candidate action. The predicted information gain can be used to measure the coverage improvement after executing each candidate action. This predicted information gain can be obtained based on historical feedback statistics or estimation models. The predicted cost refers to the response latency, cost, number of text bytes consumed, and number of API calls consumed after executing each candidate action. This predicted cost can be obtained based on historical execution records and empirical models. Next, based on the predicted information gain and cost, we can calculate the action utility corresponding to each candidate action, and then determine the candidate action with the highest action utility as the target action.
[0037] In this way, the target action can be accurately identified from multiple candidate actions, making it easier to execute the target action and obtain the evidence information corresponding to the text to be retrieved.
[0038] In an optional embodiment, the formula for calculating the above-mentioned action effect is as follows: ; in, This represents the action utility corresponding to candidate action a. This represents the predicted information gain value corresponding to candidate action a. This represents the predicted cost value corresponding to candidate action 'a'. It is a preset value that is greater than zero. Indicates the preset weight. This represents the uncertainty corresponding to candidate action a.
[0039] Specifically, the candidate action 'a' here can be actions such as extended retrieval, cross-source fusion, or recalling more TopK, and the candidate action 'a' ∈ the candidate action set A, which is pre-set. This is a preset value greater than zero, used to prevent division by zero. It can be an extremely small positive number, such as 1e-6. This represents the uncertainty corresponding to candidate action 'a', such as the entropy and variance of the current score, indicating whether there is a lack of confidence at the moment. This represents the preset weights, which are used to adjust the uncertainty. The responsiveness level, whose value can be updated online. The formula for calculating the cost forecast is as follows: ; Among them, here , , , These represent the candidate actions to be executed. The resulting response latency (in milliseconds), cost (in yuan), number of text bytes consumed (in KB), and number of API calls consumed (in times) are all calculated. These values can be obtained based on historical execution records and empirical models. , , and This indicates a preset weight, the value of which can be updated online.
[0040] It should be noted that when Stop early if any dimension of the budget vector B is exhausted; otherwise, proceed. .in, Refers to the effect of action The largest action, i.e. the target action. Indicates the action utility threshold, If the value falls below this level, candidate action 'a' will no longer be executed, triggering early stopping. It is a dynamically adjustable parameter. Of course, as another optional implementation, the above formula can also be modified when calculating the action's utility. Perform simple deformations, such as using ,or The utility of an action can be calculated using formulas, but this application does not impose specific limitations.
[0041] In this way, action selection and budget control can be performed using the above formula, comprehensively considering "information benefits" and "cost expenditures," and taking uncertainty into account. To adjust the scheduling intensity. Additionally, when no action yields a significant benefit (i.e., When the system terminates scheduling or the budget is exhausted, it will proceed to the next process.
[0042] In an optional embodiment, step S104, calculating the temporal consistency score and relevance score between the evidence information and the text to be retrieved, includes: The time distance, version matching degree, and / or the relevance of the evidence information and the text to be retrieved are obtained, and a time consistency score is determined based on the time distance, version matching degree, and / or relevance. The time distance is determined based on the timestamp of the evidence information and the time intent in the text to be retrieved; the version matching degree is determined based on the version number of the evidence information and the time intent in the text to be retrieved; and the relevance is determined based on the frequency of the evidence information being accessed recently. Calculate the text similarity between the evidence information and the text to be retrieved, and determine the relevance score based on the text similarity.
[0043] Specifically, when calculating the time consistency score between evidence information and the text to be retrieved, one can first obtain one or more of the following factors: time distance, version matching degree, and recentity of the evidence information. Then, based on one or more of these factors, the time consistency score is determined. Specifically, the time consistency score can be determined based on any one of these factors; it can also be determined based on any two of these factors; or it can be determined based on all three factors.
[0044] When calculating the relevance score between evidence information and the text to be retrieved, a preset similarity algorithm such as cosine similarity, Euclidean distance, Manhattan distance, etc., can be used to calculate the text similarity between the evidence information and the text to be retrieved, and then the relevance score can be determined based on the text similarity.
[0045] The above method can accurately calculate the time consistency score and relevance score between the evidence information and the text to be retrieved, which facilitates the subsequent rearrangement of the evidence information based on the time consistency score and relevance score.
[0046] In one optional embodiment, the time consistency score is calculated using the following formula: ; in, Indicates evidence information With the text to be retrieved Time consistency score between Indicates evidence information With the text to be retrieved The time distance between them Indicates evidence information timestamp, Indicates the text to be searched The time intention in the middle This represents the time window normalization parameter. Indicates evidence information With the text to be retrieved Version compatibility between them Indicates evidence information Recentness , and This indicates the preset weight.
[0047] Specifically, the temporal consistency score can be determined based on three factors: the time distance between the evidence information and the text to be retrieved, the version matching degree, and the recentity of the evidence information. Indicates evidence information Timestamps, such as publication time. Indicates the text to be searched The time intent in the text, such as "as of 2025-07", etc. , and These are used to adjust the contribution rates of time distance, version matching degree, and recentity, respectively. If evidence information... With the text to be retrieved If the versions are completely matched, then the version match is... Set to 1; otherwise, version matching score is 1. It is 0.
[0048] It should be noted that, if If there are significant time conflicts between different pieces of evidence (such as cross-version mixing), the system enters a "time rollback" mode, limiting retrieval to only the most recent N days or a specified version. This is the time consistency threshold.
[0049] In this way, by calculating the time consistency score by comprehensively considering the time distance, version matching degree, and recentity of the evidence information between the evidence information and the text to be retrieved, evidence information that is highly matched with the user's time intent in terms of time and version and has been frequently accessed recently can be given priority recommendation.
[0050] In an optional embodiment, step S106, which verifies multiple candidate search results and outputs the verified candidate search results as the target search results, includes: Calculate the bundle search score, coverage score, and stability score for each candidate search result in the multiple candidate search results. The comprehensive score of each candidate retrieval result is determined based on the bundle search score, coverage score, and stability score. The overall score of each candidate search result is compared with a preset threshold. If there are candidate search results with a comprehensive score greater than a preset threshold, the candidate search results with a comprehensive score greater than the preset threshold are identified as target search results and output.
[0051] Specifically, the aforementioned bundle search score can be determined by comprehensively considering the similarity score between each candidate retrieval result and the evidence information, the temporal consistency score, and the structural coherence score of each candidate retrieval result. As an optional implementation, this bundle search score... ,in, This represents the similarity score between each candidate search result and the evidence information. This represents the structural coherence score of each candidate search result. This represents the temporal consistency score between each candidate search result and the evidentiary information. , and These represent the weighting coefficients.
[0052] The coverage score mentioned above is used to characterize the degree to which each candidate search result covers the evidentiary information. When calculating the coverage score of each candidate search result, it can be first segmented into sentences, and then the similarity of each sentence in different evidentiary fragments can be calculated. For example, the similarity score of the i-th sentence can be calculated. In the j-th evidence fragment Similarity in This yields the sentence-level coverage matrix M. Then, based on the sentence-level coverage matrix M, the i-th sentence is calculated. The average similarity across all evidence fragments is then used to calculate the coverage score of the candidate retrieval result by averaging or summing the average similarity of each sentence.
[0053] The stability score mentioned above can be determined based on the consistency of the evidence information before and after perturbation, and the consistency of the candidate search results before and after perturbation. Here, perturbation refers to processing certain words in the search text, such as alias replacement, synonym replacement, and case / space variations. The consistency of the evidence information before and after perturbation can be calculated using the following formula: ,in, Indicates before the disturbance One piece of evidence information, Indicates the disturbance One piece of evidence information, ( ) function represents calculation Distance, or similarity. The consistency of candidate search results before and after perturbation can be calculated using the following formula: ,in, This represents the candidate search results before the perturbation. This represents the candidate search results after perturbation. ( ) function represents calculation Distance, or similarity.
[0054] After calculating the bundle search score, coverage score, and stability score of each candidate retrieval result, the bundle search score, coverage score, and stability score can be weighted and summed to determine the comprehensive score of each candidate retrieval result. Then, the comprehensive score of each candidate retrieval result is compared with a preset threshold. If there is a candidate retrieval result with a comprehensive score greater than the preset threshold, the candidate retrieval result with a comprehensive score greater than the preset threshold is determined as the target retrieval result and output.
[0055] It should be noted that this preset threshold can be set as needed, and no specific limitation is made here. When calculating the coverage score for each candidate search result, if the coverage score... If the citation confidence score is less than the citation confidence threshold γ, then an additional search is performed or a "short answer + full citation" degradation strategy is executed. The citation output uses (doc_id, offset_start, offset_end) or (table x, row y, column z). When calculating the stability score of each candidate search result, if the stability score... This increases K, cross-source expansion, upscaling rearrangement intensity, and reduces generation temperature.
[0056] The above methods allow for the validation of multiple candidate search results across various dimensions, including coverage, stability, structural coherence, temporal consistency, and similarity. This ensures that the target search results possess high coverage, stability, structural coherence, temporal consistency, and similarity, thereby improving the quality of the search results.
[0057] In an optional embodiment, after the above steps of comparing the comprehensive score of each candidate retrieval result with a preset threshold, the method further includes: If no candidate search results with a comprehensive score greater than the preset threshold are found, the model parameters are updated, and the search for the text to be searched is performed again after the model parameters are updated.
[0058] Specifically, if no candidate search result with a comprehensive score greater than the preset threshold exists, the model parameters can be updated, and the search for the text to be retrieved can be performed again after the model parameters are updated. The model parameters here may include, but are not limited to, the action utility threshold τ, the preset weight λ, and the predicted information gain value. a. Cost forecast _a, etc. The update process for the action utility threshold τ is as follows: ; in, The learning rate is used to adjust the update step size. This indicates the coverage target set by the system. This represents the currently observed coverage. If the currently observed coverage... Insufficient coverage target set by the system Then improve This makes the next round more conservative (and more likely to stop early).
[0059] The update process for the preset weight λ is as follows: ; in, The learning rate is used to adjust the update step size. This indicates the stability target set by the system. This represents the current perturbation stability score. If the current perturbation stability score... Below the system's set stability target ,improve This allows the system to focus more on uncertainty-driven exploration.
[0060] Information gain prediction The update process for _a is as follows: ; in, This represents the smoothing coefficient, used to progressively update the estimated value. Indicates the currently observed Changes. This allows for smooth updates to information gain predictions (such as coverage improvements).
[0061] Cost forecast The update process for _a is as follows: ; in, This represents the smoothing coefficient, used to progressively update the estimated value. Indicates the currently observed Changes. This allows for smooth updates to the motion cost estimate.
[0062] By using the above methods, the model parameters can be continuously optimized, ensuring that the quality of the final output search results is increasingly higher.
[0063] To better understand the search enhancement generation method provided in this application, the following example illustrates the search enhancement generation process. Assume the text to be searched is "As of July 2025, how much did Company A's net profit increase year-on-year?", and the process is as follows: Figure 2 As shown: Step S201: Pre-processing for warehousing.
[0064] The PDF / webpage is parsed to extract paragraph and table coordinates, and then an RO-Graph is constructed: paragraphs are nodes, and table adjacencies are edges. An index is built: inverted index + vector index + table cell index + timestamp.
[0065] Step S202: Query parsing and budget setting.
[0066] The key information in the text to be retrieved is extracted as follows: Time intent: t_q = 2025-07; Entity: Company A; Indicator: Net profit.
[0067] Obtain system configuration information, including budget vector B and key parameters: ; The key parameters are θ=0.8, γ=0.7, T_min=0.55, σ_min=0.75, τ=0.2.
[0068] Step S203, Budget-Aware Scheduling.
[0069] Candidate actions include: a1: local vector library retrieval, a2: news source expansion, and a3: external API call; Calculate U(a), select argmax_a U(a) and execute. If the total budget is exhausted or If so, stop early.
[0070] Step S204: Time consistency rearrangement.
[0071] Calculate T(q,d) and fuse them to generate R'(q,d). If found... Or the evidence versions are inconsistent, and the start time is rolled back, such as only "announcements for the first three months of 2025".
[0072] Step S205: Evidence fusion and generation.
[0073] The rearranged evidence information and the text to be retrieved are fused together and input into a pre-trained language model to generate multiple candidate retrieval results.
[0074] Step S206: Verify each candidate search result and determine the final output search result.
[0075] Calculate the sentence-proof coverage matrix M: If the coverage rate Cov(s_i) of a certain sentence in the candidate search results is <0.8 or the citation confidence is <0.7, then trigger supplementary proof or the "short answer + full citation" mode. Output: content + citation (doc_id, offset_start, offset_end).
[0076] Construct a perturbation set G, such as "Company A", "Shares A", "Enterprise A", etc. If the stability S_stab = 0.68 < 0.75, the system automatically: increases TopK to expand the recall source; decreases the generation temperature to improve determinism.
[0077] Step S207: Feedback and learning.
[0078] Upon receiving user click / error correction feedback, the system updates τ, λ, _a、 Parameters such as _a are used to record exceptions, and these exceptions are written to the audit log.
[0079] Final results: Response latency: 1240ms, Time-Consistency@TopK improved to 91%, generated content structure is continuous with coverage of 0.86, and stability improved to S_stab=0.84.
[0080] See Figure 3 , Figure 3 This is a schematic diagram of a search enhancement generation device provided in an embodiment of this application. Figure 3 As shown, the search enhancement generation device 300 includes: The acquisition module 301 is used to acquire the text to be retrieved and the budget vector, wherein the budget vector is used to represent the upper limit value of various budgets; The retrieval scheduling module 302 is used to perform multi-source retrieval scheduling on the text to be retrieved based on the budget vector, and to determine the target action from multiple candidate actions, wherein the target action is the action with the highest action utility among multiple candidate actions; Execution module 303 is used to execute the target action and obtain evidence information corresponding to the text to be retrieved; The rearrangement module 304 is used to calculate the temporal consistency score and relevance score between the evidence information and the text to be retrieved, and rearrange the evidence information based on the temporal consistency score and relevance score. The generation module 305 is used to input the rearranged evidence information and the text to be retrieved into a pre-trained language model to generate multiple candidate retrieval results; The verification and output module 306 is used to verify multiple candidate search results and output the verified candidate search results as the target search results.
[0081] Furthermore, the retrieval scheduling module 302 includes: The first acquisition submodule is used to acquire the information gain prediction value and cost prediction value corresponding to each candidate action among multiple candidate actions. The information gain prediction value is used to characterize the information gain after executing the corresponding candidate action, and the cost prediction value is used to characterize the cost expenditure required to execute the corresponding candidate action. The first calculation submodule is used to calculate the action utility corresponding to each candidate action based on the information gain prediction value and the cost prediction value. The first determination submodule is used to determine the candidate action with the greatest action utility as the target action.
[0082] Furthermore, the formula for calculating the utility of an action is as follows: ; in, This represents the action utility corresponding to candidate action a. This represents the predicted information gain value corresponding to candidate action a. This represents the predicted cost value corresponding to candidate action 'a'. It is a preset value that is greater than zero. Indicates the preset weight. This represents the uncertainty corresponding to candidate action a.
[0083] Furthermore, the rearrangement module 304 includes: The second acquisition submodule is used to acquire the time distance, version matching degree and / or the relevance of the evidence information and the text to be retrieved, and to determine the time consistency score based on the time distance, version matching degree and / or relevance. The time distance is determined based on the timestamp of the evidence information and the time intent in the text to be retrieved, the version matching degree is determined based on the version number of the evidence information and the time intent in the text to be retrieved, and the relevance is determined based on the frequency of the evidence information being accessed recently. The second calculation submodule is used to calculate the text similarity between the evidence information and the text to be retrieved, and to determine the relevance score based on the text similarity.
[0084] Furthermore, the formula for calculating the time consistency score is as follows: ; in, Indicates evidence information With the text to be retrieved Time consistency score between Indicates evidence information With the text to be retrieved The time distance between them Indicates evidence information timestamp, Indicates the text to be searched The time intention in the middle This represents the time window normalization parameter. Indicates evidence information With the text to be retrieved Version compatibility between them Indicates evidence information Recentness , and This indicates the preset weight.
[0085] Furthermore, the verification and output module 306 includes: The third calculation submodule is used to calculate the bundle search score, coverage score and stability score of each candidate search result in multiple candidate search results respectively; The second determination submodule is used to determine the comprehensive score of each candidate retrieval result based on the beam search score, coverage score, and stability score. The comparison submodule is used to compare the overall score of each candidate search result with a preset threshold. The third determination submodule is used to determine the candidate search results with a comprehensive score greater than the preset threshold as the target search results when there are candidate search results with a comprehensive score greater than the preset threshold, and output the target search results.
[0086] Furthermore, the verification and output module 306 also includes: The Refresh submodule is used to update the model parameters when there are no candidate search results with a comprehensive score greater than a preset threshold, and then re-search the text to be searched after the model parameters are updated.
[0087] It should be noted that the retrieval enhancement generation device 300 can implement the steps of the retrieval enhancement generation method provided in any of the aforementioned method embodiments, and can achieve the same technical effect, which will not be described in detail here.
[0088] like Figure 4 As shown in the illustration, this application also provides an electronic device, including a processor 411, a communication interface 412, a memory 413, and a communication bus 414, wherein the processor 411, the communication interface 412, and the memory 413 communicate with each other via the communication bus 414. Memory 413 is used to store computer programs; In one embodiment of this application, when the processor 411 executes the program stored in the memory 413, it implements the retrieval enhancement generation method provided in any of the foregoing method embodiments.
[0089] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the retrieval enhancement generation method as provided in any of the foregoing method embodiments.
[0090] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0091] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A retrieval enhancement generation method, characterized in that, The method includes: Obtain the text to be retrieved and the budget vector, wherein the budget vector is used to represent the upper limit value of various budgets; Based on the budget vector, multi-source retrieval scheduling is performed on the text to be retrieved, and a target action is determined from multiple candidate actions, wherein the target action is the action with the highest action utility among the multiple candidate actions; Execute the target action to obtain the evidence information corresponding to the text to be retrieved; Calculate the temporal consistency score and relevance score between the evidence information and the text to be retrieved, and rearrange the evidence information based on the temporal consistency score and the relevance score; The rearranged evidence information and the text to be retrieved are input into a pre-trained language model to generate multiple candidate retrieval results; The multiple candidate search results are verified, and the verified candidate search results are output as the target search results.
2. The retrieval enhancement generation method according to claim 1, characterized in that, The process of determining the target action from multiple candidate actions includes: Obtain the information gain prediction value and cost prediction value corresponding to each of the multiple candidate actions, wherein the information gain prediction value is used to characterize the information gain after executing the corresponding candidate action, and the cost prediction value is used to characterize the cost expenditure required to execute the corresponding candidate action; Based on the predicted information gain and the predicted cost, calculate the action utility corresponding to each candidate action; The candidate action with the greatest action utility is determined as the target action.
3. The retrieval enhancement generation method according to claim 2, characterized in that, The formula for calculating the effectiveness of the action is as follows: ; in, This indicates the utility of the action corresponding to candidate action a. This represents the predicted information gain value corresponding to candidate action a. This represents the predicted cost value corresponding to candidate action a. It is a preset value that is greater than zero. Indicates the preset weight. This represents the uncertainty corresponding to candidate action a.
4. The retrieval enhancement generation method according to claim 1, characterized in that, The calculation of the temporal consistency score and relevance score between the evidence information and the text to be retrieved includes: The temporal distance, version matching degree, and / or the recentity of the evidence information are obtained between the evidence information and the text to be retrieved. Based on the temporal distance, version matching degree, and / or recentity, the temporal consistency score is determined. The temporal distance is determined based on the timestamp of the evidence information and the temporal intent in the text to be retrieved. The version matching degree is determined based on the version number of the evidence information and the temporal intent in the text to be retrieved. The recentity is determined based on the frequency of the evidence information being accessed recently. Calculate the text similarity between the evidence information and the text to be retrieved, and determine the relevance score based on the text similarity.
5. The retrieval enhancement generation method according to claim 4, characterized in that, The formula for calculating the time consistency score is as follows: ; in, Indicates evidence information With the text to be retrieved The time consistency score between them Indicates evidence information With the text to be retrieved The time distance between them, Indicates evidence information timestamp, Indicates the text to be searched The time intention in the middle This represents the time window normalization parameter. Indicates evidence information With the text to be retrieved The version matching degree between them Indicates evidence information The aforementioned proximity, , and This indicates the preset weight.
6. The retrieval enhancement generation method according to claim 1, characterized in that, The step of validating the multiple candidate search results and outputting the verified candidate search results as the target search results includes: Calculate the bundle search score, coverage score, and stability score for each candidate search result among the multiple candidate search results; Based on the beam search score, the coverage score, and the stability score, a comprehensive score is determined for each candidate retrieval result; The overall score of each candidate search result is compared with a preset threshold. If there are candidate search results with a comprehensive score greater than the preset threshold, the candidate search results with a comprehensive score greater than the preset threshold are determined as the target search results, and the target search results are output.
7. The retrieval enhancement generation method according to claim 6, characterized in that, After comparing the overall score of each candidate retrieval result with a preset threshold, the method further includes: If no candidate search result has a comprehensive score greater than the preset threshold, the model parameters are updated, and the text to be searched is searched again after the model parameters are updated.
8. A retrieval enhancement generation device, characterized in that, The device includes: The acquisition module is used to acquire the text to be retrieved and the budget vector, wherein the budget vector is used to represent the upper limit value of various budgets; The retrieval scheduling module is used to perform multi-source retrieval scheduling on the text to be retrieved based on the budget vector, and to determine the target action from multiple candidate actions, wherein the target action is the action with the highest action utility among the multiple candidate actions; The execution module is used to execute the target action and obtain evidence information corresponding to the text to be retrieved; The rearrangement module is used to calculate the temporal consistency score and relevance score between the evidence information and the text to be retrieved, and rearrange the evidence information based on the temporal consistency score and the relevance score. The generation module is used to input the rearranged evidence information and the text to be retrieved into a pre-trained language model to generate multiple candidate retrieval results; The verification and output module is used to verify the multiple candidate search results and output the verified candidate search results as the target search results.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the retrieval enhancement generation method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the retrieval enhancement generation method as described in any one of claims 1-7.