An evidence snippet hit rate statistics and optimization method for large model applications
By constructing vector encoding and indexing of evidence fragments, the evidence fragments actually used by large models can be identified, solving the problem that the utilization of evidence fragments cannot be quantified in existing technologies. This achieves efficient evidence utilization and system optimization, and improves the accuracy and interpretability of model responses.
Patent Information
- Application Number
- CN202611231018.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-11-20
AI Technical Summary
Existing large-scale model applications lack the ability to analyze the actual hit rate of evidence fragments, making it impossible to accurately identify the evidence fragments actually used by the model. This results in low response accuracy, low efficiency in the utilization of context resources, a lack of dynamic optimization mechanisms, insufficient system interpretability, and difficulty in adapting to complex business scenarios.
By vector encoding and indexing evidence fragments, we can identify evidence fragments actually used in large models, establish a hit rate statistics and optimization mechanism, dynamically adjust retrieval strategies and context construction, and output evidence source information to improve system interpretability.
It achieves accurate identification and quantitative evaluation of evidence fragments, reduces the hallucination problem, improves the accuracy of model responses and the efficiency of context utilization, enhances the system's self-optimization capability and interpretability, and adapts to complex business scenarios.
Smart Images

Figure CN123140004A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for large-scale model retrieval, and more particularly to a statistical and optimization method for evidence fragment hit rate in large-scale model applications. Background Technology
[0002] With the rapid development of artificial intelligence technology, Large Language Models (LLMs) have been widely applied in scenarios such as intelligent question answering, knowledge assistants, intelligent customer service, enterprise search, code generation, and business analysis. To improve the accuracy of knowledge acquisition and real-time information retrieval capabilities of large models in specialized fields, the industry is gradually adopting a Retrieval-Augmented Generation (RAG) architecture. This architecture uses external knowledge base retrieval results as contextual input into the large model to assist in generating more accurate answers. Intelligent question answering, business assistants, intelligent customer service, and intelligent decision-making systems based on Retrieval-Augmented Generation (RAG) are widely used.
[0003] In existing RAG systems, knowledge documents are typically first segmented to form multiple evidence chunks. Then, based on vector retrieval, keyword matching, or a hybrid recall method, several evidence chunks relevant to the user's question are retrieved from the knowledge base. These chunks are then concatenated and input into a large model for inference and content generation. Specifically, the following steps are included:
[0004] S101: Divide the original knowledge document into multiple text fragments according to fixed length or semantic rules;
[0005] S102: Use a vector model to embedding and encode text fragments, and store them in a vector database;
[0006] S103: When a user raises a question, the question content is vectorized and a similarity search is performed in the vector database;
[0007] S104: After sorting the evidence fragments obtained from the recall according to their similarity, they are spliced together to form a context.
[0008] S105: Input the context and user question into the large model, and the large model generates the final answer.
[0009] However, in practical applications, the way large models use input evidence fragments is highly uncertain. Although the RAG system injects multiple retrieval fragments into the large model, not all fragments will actually participate in the model's inference; some fragments may be ignored by the model, and some low-relevance content may even interfere with the model's generated results, leading to problems such as biased answers, information redundancy, or "illusions".
[0010] Currently, most systems rely on vector similarity, recall scores, or ranking results to measure retrieval quality. However, these metrics only reflect the "relevance during the retrieval stage," i.e., whether the evidence fragments are semantically similar to the user's question. They lack the analytical capability to determine "which evidence fragments the large model actually uses," failing to accurately reflect "the actual usage during the model generation stage." In other words, existing solutions lack statistical and analytical mechanisms for the actual hit rate of evidence fragments, making it impossible to determine which fragments are truly effectively utilized by the model. Existing technologies typically assume that content recalled and injected into the context will participate in model inference. However, in reality, large models may only use a portion of these fragments during the generation process, or even ignore high-scoring recalled content.
[0011] Furthermore, existing technologies typically lack the ability to dynamically optimize evidence fragments. Knowledge segmentation granularity, context concatenation order, recall quantity, and ranking strategies mostly employ fixed configurations, failing to continuously adjust based on the model's actual usage performance. This makes it difficult for the system to form an effective self-optimization loop during long-term operation. The optimization mechanisms in existing solutions mainly rely on manual experience configuration, such as: manually adjusting chunk segmentation length; manually setting the TopK recall quantity; adjusting vector recall thresholds; modifying the Prompt template; and manually optimizing ranking rules. Such solutions lack a data feedback mechanism based on the model's actual usage behavior, failing to form a closed-loop structure of "retrieval—hit analysis—dynamic optimization," thus making it difficult to continuously improve evidence utilization efficiency and response accuracy.
[0012] This problem becomes more pronounced in multi-turn dialogues, complex knowledge bases, and long text reasoning scenarios. Due to the limited length of the context window, a large number of low-value evidence fragments consume model context resources, reducing the effective information density and thus affecting model reasoning efficiency and response accuracy. Furthermore, in complex business scenarios, multi-turn dialogues, and long-context tasks, existing solutions struggle to quantitatively evaluate the effectiveness of evidence fragments and establish a precise correlation between evidence fragments and model-generated results, leading to persistent issues such as model illusion, invalid recall, and context redundancy.
[0013] In summary, it can be seen that while existing large-scale model application solutions based on retrieval augmentation generation (RAG) can improve the model's answering ability through external knowledge bases, they still have many shortcomings in terms of the practical use of evidence fragments, statistical analysis, and dynamic optimization. These shortcomings are mainly reflected in the following aspects:
[0014] (1) Lack of analytical ability regarding the actual hit rate of evidence fragments;
[0015] Existing technologies typically judge retrieval quality based solely on vector similarity, keyword matching scores, or ranking results, failing to accurately identify which evidence fragments were actually used by large models during the response generation process.
[0016] In real-world scenarios, although the model receives multiple context fragments, some fragments may not be involved in reasoning or may even be completely ignored by the model. Therefore, relying solely on recall scores cannot accurately reflect the effectiveness of evidence fragments, resulting in the system lacking the ability to accurately assess the utilization of evidence.
[0017] (2) Unable to establish a correlation between the model's response and the source of evidence;
[0018] Existing solutions typically cannot perform evidence attribution analysis on model-generated content, making it difficult to determine which knowledge segment a particular answer originates from, nor can they trace the key evidence paths used in the model generation process.
[0019] When the model produces incorrect answers, content bias, or "illusion" problems, the system struggles to quickly pinpoint the source of the problem and cannot distinguish whether it is caused by retrieval errors, sorting errors, or unreasonable context construction.
[0020] (3) Lack of a dynamic optimization mechanism based on actual hit results;
[0021] Currently, in most systems, the chunk segmentation length, recall quantity, sorting rules, and context splicing method are usually fixed configurations or adjusted manually based on experience.
[0022] This type of approach cannot be automatically optimized based on the actual usage of the model, resulting in high-value evidence fragments failing to continuously increase their weight, while low-quality, repetitive, or invalid fragments may still frequently enter the model context, affecting the inference effect.
[0023] (4) The utilization efficiency of contextual resources is low;
[0024] Because existing systems cannot identify which evidence is truly valid, they often inject a large number of candidate fragments into the model, which can easily cause the context window to be occupied by low-value content.
[0025] Especially in long texts, multi-turn dialogues, and complex business scenarios, a large number of redundant fragments will reduce the effective information density, increase the model's reasoning burden, and affect the generation speed and answer accuracy.
[0026] (5) Lack of a quality assessment system for evidence fragments;
[0027] Existing technologies typically lack statistical analysis of the long-term performance of evidence fragments, making it impossible to establish fragment-level metrics such as hit rate, usage frequency, effective contribution, and user feedback correlation.
[0028] Therefore, the system cannot identify which segments have long-term high value, nor can it automatically eliminate or optimize low-quality knowledge content.
[0029] (6) It is difficult to form a continuous self-optimizing closed loop;
[0030] The existing RAG system has relatively independent retrieval, sorting and generation processes, and lacks a feedback loop that drives knowledge retrieval optimization based on model-generated results.
[0031] The system is unable to automatically adjust its retrieval strategy, vector index structure, chunk partitioning method, and context construction logic based on historical hit statistics, resulting in a lack of continuous learning and self-optimization capabilities in the overall system.
[0032] (7) The system lacks interpretability and auditability;
[0033] In scenarios such as enterprise knowledge bases, intelligent customer service, financial Q&A, and government Q&A, it is usually necessary to clearly state the basis and source of knowledge for the answer.
[0034] However, existing technologies cannot accurately output the hit rate of the corresponding evidence fragments in the model's answers, resulting in insufficient interpretability of the system and making it difficult to meet the needs for answer credibility, audit trail and risk control in complex business scenarios.
[0035] Therefore, how to identify, statistically analyze, and dynamically optimize retrieval and context construction strategies based on statistical results during the reasoning process of large models, thereby improving the accuracy of large model responses, reducing the probability of hallucinations, enhancing evidence traceability, and improving the system's self-optimization capabilities, has become a key technical issue in the current field of large model retrieval enhancement applications. Summary of the Invention
[0036] This invention provides a statistical and optimization method for evidence fragment hit rate in large-scale model applications, addressing problems in existing technologies such as the inability to quantify evidence fragment utilization, lack of evidence attribution in model responses, insufficient context optimization capabilities, and the lack of dynamic feedback mechanisms. The technical solution is as follows:
[0037] A statistical optimization method for evidence fragment hit rate in large-scale model applications includes the following steps:
[0038] S1: Obtain the original knowledge document, preprocess the knowledge document, and then segment the knowledge document according to preset rules to generate multiple evidence fragments;
[0039] S2: By calling the Embedding model to perform vector encoding on the evidence fragments, corresponding semantic vector data is generated and then stored in the vector database to realize index construction;
[0040] S3: Receive user questions and vectorize them to generate question vectors;
[0041] S4: Based on the question vector, perform a search in the vector database, and sort and filter the multiple evidence fragments retrieved;
[0042] S5: The system splices together the user's question with the evidence fragments obtained from the recall to construct the context of the large model input, inputs it into the large model for reasoning and content generation, and outputs the answer result;
[0043] S6: Perform evidence fragment hit identification processing. After the large model is generated, perform evidence association analysis on the generated content to identify the evidence fragments actually used by the large model and calculate the hit strength and contribution of each evidence fragment.
[0044] S7: Perform aggregated analysis on historical hit data of evidence fragments, establish a statistical index system for evidence fragments, and evaluate the quality and value of the fragments;
[0045] S8: Based on the hit statistics, dynamically optimize the retrieval strategy, fragment segmentation, sorting rules, etc., update system parameters, and form continuous optimization;
[0046] S9: While outputting the model's answer, the system can simultaneously output the corresponding evidence source information and credibility.
[0047] Furthermore, in step S1, the knowledge document is segmented according to preset rules, which include but are not limited to fixed-length segmentation, semantic boundary-based segmentation, title structure-based segmentation, business field-based segmentation, and dynamic context-based segmentation. For generating multiple evidence fragments, a unique identifier ID is generated for each evidence fragment, and the corresponding source document, chapter, starting position, timestamp, and business tag are recorded.
[0048] Furthermore, in step S2, the semantic vector data is stored in a vector database, and the retrieval indexing methods include: fragment ID index, keyword inverted index, semantic vector index, business classification index, and hit statistics index.
[0049] Furthermore, in step S4, a search is performed in the vector database based on the question vector, and the retrieved evidence fragments are sorted and filtered. Based on the question type, business scenario, historical hit rate, user behavior data, and knowledge fragment weight, the TopK recall quantity, similarity threshold, recall priority, and multi-path recall ratio can be dynamically adjusted.
[0050] Furthermore, in step S6, one or a combination of the following methods are used for hit identification: text similarity analysis, token-level semantic mapping, attention weight analysis, quotation matching, keyword coverage detection, vector semantic association analysis, and reasoning path analysis. After identifying the hit evidence fragment, a corresponding hit record is generated, including fragment ID, hit count, hit location, hit strength, contribution score, and associated answer content.
[0051] Furthermore, in step S7, the statistical indicators include, but are not limited to, evidence fragment hit rate, average contribution, high-frequency question hit rate, user adoption rate, answer accuracy correlation value, multi-round reuse rate, and hallucination correlation risk value.
[0052] Furthermore, in step S8, the knowledge retrieval and context generation strategies are dynamically optimized based on the hit statistics. The optimization includes adjusting the chunk segmentation granularity, adjusting the recall weight, optimizing the sorting rules, dynamically controlling the context length, merging highly relevant segments, reducing the priority of low-quality segments, and updating the embedding index structure.
[0053] A system for statistical analysis and optimization of evidence fragment hit rates for large-scale model applications includes the following modules:
[0054] The knowledge segmentation and indexing module is used to preprocess the original knowledge documents and perform fragmentation segmentation.
[0055] The problem retrieval and evidence recall module is used to retrieve and recall multiple candidate evidence fragments based on user questions;
[0056] The context building and model generation module is used to concatenate user questions with the evidence fragments obtained from the recall and generate a large model input context;
[0057] The evidence fragment hit analysis module is used to analyze the model-generated results and identify the evidence fragments actually used in the model's response process.
[0058] The hit rate statistics and evaluation module is used to statistically analyze and evaluate the historical hit rate of evidence fragments.
[0059] The dynamic optimization feedback module dynamically optimizes the knowledge retrieval and context construction strategies based on the hit statistics.
[0060] The evidence tracking and interpretable output module is used to output the evidence source information corresponding to the model's answer, so as to realize the interpretable display of the answer results.
[0061] The proposed method for statistical analysis and optimization of evidence fragment hit rates for large-scale model applications has the following advantages compared to existing large-scale model application solutions based on Retrieval Augmentation Generation (RAG):
[0062] (1) It can accurately identify evidence fragments actually used in large models;
[0063] Existing technologies typically rely solely on vector similarity or recall results to determine the validity of evidence, failing to ascertain which knowledge content the model actually used during the response generation process.
[0064] This invention identifies the use of evidence during the model generation process through text matching, semantic association analysis, token-level contribution analysis, attention weight analysis, and reference path identification, achieving accurate analysis of actual hit evidence fragments. Therefore, this invention can more realistically reflect the actual contribution of evidence fragments to the model's reasoning process.
[0065] (2) It has enabled a quantitative assessment of the evidence utilization process;
[0066] Existing technologies lack statistical analysis mechanisms for the long-term effectiveness of evidence fragments. This invention establishes statistical indicators such as hit rate, contribution, user adoption rate, multi-round reuse rate, and illusion risk value to achieve a quantitative assessment of the quality and effectiveness of knowledge fragments. Compared to traditional methods that rely on human experience for judgment, this invention can form a data-driven evidence quality analysis system.
[0067] (3) It can effectively reduce the problem of large-scale model hallucinations;
[0068] In existing solutions, large models may reference low-relevance or erroneous knowledge, easily leading to model illusion problems. This invention analyzes the correlation between response results and evidence fragments to identify low-hit fragments, high-risk fragments, and unsubstantiated content; and dynamically reduces the recall priority of low-quality evidence, thereby improving the consistency between response content and knowledge sources. Therefore, this invention can effectively reduce model illusion and misreference problems.
[0069] (4) Achieve dynamic optimization of retrieval and context construction;
[0070] Existing technologies typically employ fixed configurations for chunk length, TopK recall count, sorting rules, and context concatenation methods, lacking dynamic optimization capabilities. This invention can automatically adjust: chunk segmentation granularity, retrieval weight, context order, token resource allocation, and multi-path recall strategies based on historical hit statistics. This forms a closed-loop mechanism of "retrieval—generation—hit analysis—feedback optimization." Compared to traditional solutions, this invention possesses continuous self-optimization capabilities.
[0071] (5) Improve the efficiency of context window utilization;
[0072] In existing technologies, a large number of low-value fragments consume context window resources, reducing the density of effective information. This invention addresses this by prioritizing high-hit fragments, automatically pruning redundant fragments, automatically aggregating highly relevant fragments, and dynamically allocating context, thereby increasing the proportion of effective information within the context. Therefore, this invention can reduce the consumption of invalid tokens and improve the inference efficiency of large models in long-context scenarios.
[0073] (6) Enhance system interpretability and auditability;
[0074] Existing RAG systems typically cannot explicitly state the knowledge sources from which the model's responses originate. This invention outputs relevant evidence fragments, source documents, citation locations, contribution scores, and credibility information, establishing a mapping between the model's responses and the knowledge sources. Therefore, this invention enhances the interpretability, traceability, and auditability of large model systems.
[0075] (7) Able to adapt to complex business scenarios and multi-turn dialogue scenarios;
[0076] This invention can continuously analyze the usage of evidence fragments by combining multi-round context, user behavior, session state, question type, and business tags. Compared with traditional single-round static retrieval solutions, this invention is more suitable for complex business scenarios such as enterprise knowledge bases, intelligent customer service, financial Q&A, legal consultation, medical assistance, and agent systems.
[0077] (8) It has the ability to evolve and continuously optimize its knowledge base over a long period of time;
[0078] This invention can automatically perform knowledge fragment optimization, chunk boundary adjustment, low-quality content weight reduction, high-value knowledge enhancement, and vector index update based on the long-term performance of evidence fragments. This enables the dynamic evolution of the knowledge base structure. Compared to traditional static knowledge base structures, this invention has stronger long-term adaptive capabilities and system stability.
[0079] In summary, this invention can accurately identify and continuously optimize the use of evidence fragments in large models, improve knowledge retrieval efficiency, answer accuracy, context utilization efficiency, and system interpretability, and has high application value and promotion significance. Attached Figure Description
[0080] Figure 1 This is a flowchart illustrating the statistical and optimization method for evidence fragment hit rates in large-scale model applications.
[0081] Figure 2 This is a schematic diagram illustrating the working process of the evidence fragment hit rate statistics and optimization method for large model applications. Detailed Implementation
[0082] like Figure 1 and Figure 2 As shown, the method for statistical analysis and optimization of evidence fragment hit rates for large-scale model applications includes the following steps:
[0083] Step S1: Obtain the original knowledge document, preprocess the knowledge document, and then segment the knowledge document according to preset rules to generate multiple evidence fragments;
[0084] The system acquires the original knowledge document and preprocesses it, including text cleaning, format standardization, special character filtering, heading level recognition, and paragraph structure analysis. Text cleaning involves thoroughly cleaning the original knowledge document, removing useless symbols, garbled text, and duplicate content to create a clean and organized format. Format standardization uses scientific analysis methods to uniformly design the document according to its purpose, use, presentation, data element representation, and carrier material, establishing and implementing standardized specifications that meet the processing needs of modern equipment. Special character filtering focuses on clearly defining a whitelist of allowed characters and removing / escaping illegal symbols using regular expressions or built-in functions to prevent injection attacks and standardize data format. Heading level recognition uses algorithms or rules to automatically identify which sentences or paragraphs in the text are "headings" and accurately determine their level depth (e.g., first-level heading, second-level heading, third-level heading, etc.). Paragraph structure analysis, after determining paragraph boundaries, further analyzes the semantic role and functional attributes of the paragraph within its context.
[0085] Subsequently, the system segments the knowledge document according to preset rules, generating multiple evidence chunks. These preset rules include, but are not limited to, fixed-length segmentation, semantic boundary-based segmentation, title structure-based segmentation, business field-based segmentation, and dynamic context-based segmentation. Fixed-length segmentation mechanically "hard-cuts" the text according to a preset fixed number of characters, words, or tokens. Semantic boundary-based segmentation, unlike fixed-length segmentation, does not compromise semantic integrity, ensuring that each segmented text chunk is an independent and coherent semantic unit. Title structure-based segmentation utilizes the document's inherent hierarchical structure. Business field-based segmentation is a customized segmentation strategy tailored to specific business scenarios and data models, splitting the text based on structured fields within the business context. Dynamic context-based segmentation dynamically adjusts the retention and trimming of text according to actual runtime requirements.
[0086] The system generates a unique identifier ID for each piece of evidence and records the corresponding source document, chapter, starting position, timestamp, and business tag.
[0087] Step S2: By calling the Embedding model to perform vector encoding on the evidence fragments, corresponding semantic vector data is generated and then stored in the vector database to realize index construction;
[0088] The system invokes the Embedding model to perform vector encoding on the evidence fragments, generating corresponding semantic vector data. The Embedding model is a tool that maps discrete data (such as words, sentences, images, etc.) into dense vectors in a continuous vector space, transforming text, images, etc., into numerical vectors, enabling computers to understand semantic similarity.
[0089] Subsequently, the evidence fragment content, vector information, and fragment metadata are stored in a vector database to establish a searchable knowledge base. The system also constructs indexes such as fragment ID index, keyword inverted index, semantic vector index, business classification index, and hit statistics index.
[0090] Step S3: Receive user questions and vectorize them to generate question vectors;
[0091] When a user asks a question, the system receives the user's input and performs semantic analysis and preprocessing, including question normalization, intent recognition, keyword extraction, contextual analysis, and multi-turn conversation fusion. Question normalization transforms non-standard input. Intent recognition determines the true purpose behind the user's question. Keyword extraction extracts the most essential entities (such as "Beijing" and "weather") and action words, significantly improving the accuracy of subsequent information retrieval from databases or knowledge bases. Contextual analysis combines the current question with previous dialogue history. Multi-turn conversation fusion directly "fills" the current question with key information from historical dialogues.
[0092] Subsequently, the system vectorizes the user's questions using the Embedding model, generating question vectors.
[0093] Step S4: Search the vector database based on the question vector, and sort and filter the retrieved evidence fragments.
[0094] Based on question vectors, the system performs similarity retrieval in a vector database and, combined with keyword matching, business rules, or a hybrid recall strategy, retrieves multiple candidate evidence fragments from the knowledge base. The system can dynamically adjust the TopK recall quantity, similarity threshold, recall priority, and multi-path recall ratio based on question type, business scenario, historical hit rate, user behavior data, and knowledge fragment weights.
[0095] The question type is used to identify and classify user input intent. The business scenario identifies the business context of the current request and determines the scenario state. The historical hit rate is a statistical analysis of the retrieval performance of the question or question cluster over a past period, using historical feedback as lessons learned to guide the correction of the current retrieval strategy. The user behavior data captures real-time interactive feedback from users in the current or historical sessions. The knowledge fragment weight is the weight of text content to identify high-value content.
[0096] The system then sorts and filters the recall results.
[0097] Step S5: The system splices the user's question with the evidence fragments obtained from the recall to construct the context of the large model input, inputs it into the large model for reasoning and content generation, and outputs the answer result.
[0098] During the context construction process, the system dynamically adjusts the order of evidence fragments and the proportion of context based on the historical hit rate, semantic relevance, business importance, user feedback results, and token usage of the evidence fragments.
[0099] Step S6: Perform evidence fragment hit identification processing. After the large model is generated, perform evidence association analysis on the generated content to identify the evidence fragments actually used by the large model and calculate the hit strength and contribution of each evidence fragment.
[0100] The system can employ one or a combination of the following methods for hit detection: text similarity analysis, token-level semantic mapping, attention weight analysis, quotation matching, keyword coverage detection, vector semantic association analysis, and inference path analysis. By identifying the relationship between the model's response and contextual evidence fragments, it achieves accurate analysis of the actual hit rate of the evidence fragments.
[0101] The text similarity analysis assesses relevance by calculating the lexical overlap between the query and candidate documents, typically employing classic sparse retrieval algorithms such as BM25 or TF-IDF. The token-level semantic mapping is suitable for long text retrieval, accurately capturing the specific location and contextual relationships of query terms within documents. The attention weight analysis utilizes the attention mechanism within a large language model to capture deep structural relationships and logical connections between texts. The quotation matching uses a cross-encoder or specialized quotation model to trace the source of generated answers, forcing the model to find corresponding quotation fragments in the context, or performing secondary summary filtering. The keyword coverage detection extracts key entities from the question, such as time, location, and specific names, using regular expressions or Named Entity Recognition (NER), and performs Boolean logic matching on the recalled Top-K results; documents that do not cover key constraints are downweighted or directly filtered. The vector semantic association analysis uses an embedding model to map queries and documents into dense vectors, stores them in a vector database, and performs approximate nearest neighbor search using cosine similarity or HNSW algorithms. The reasoning path analysis involves converting entities into nodes and relationships into edges to construct a knowledge graph. By traversing the paths on the graph, causal relationships and multi-hop associations between entities are captured.
[0102] After the system identifies the evidence fragments that match the criteria, it generates a corresponding hit record, including fragment ID, number of hits, hit location, hit strength, contribution score, and related answer content.
[0103] Step S7: Perform aggregated analysis on the historical hit data of the evidence fragments, establish a statistical index system for the evidence fragments, and evaluate the quality and value of the fragments.
[0104] The statistical indicators include, but are not limited to, evidence fragment hit rate, average contribution, high-frequency question hit rate, user adoption rate, answer accuracy correlation value, multi-round reuse rate, and illusion correlation risk value. By establishing a fragment-level statistical model, the quality and actual value of knowledge fragments can be quantitatively evaluated. Then, the system identifies high-value evidence fragments, low-quality fragments, redundant fragments, and low-hit fragments based on the statistical results, thereby providing data support for subsequent optimization.
[0105] The evidence fragment hit rate measures the proportion of a knowledge fragment successfully recalled in historical retrievals and used as a reference source for the final answer. The average contribution quantifies the actual information increment of the fragment to the final generated answer through the attention mechanism within the large model or post-generation source tracing scoring. The high-frequency question hit rate tracks the recall performance of corresponding knowledge fragments for popular questions (Top Queries) in the business system. The user adoption rate collects explicit feedback from end users. The answer accuracy correlation value cross-analyzes the fragment recall situation with manual review or automated evaluation. The multi-round reuse rate indicates the frequency with which the same knowledge fragment is called multiple times in a user's continuous conversation (Session). The illusion association risk value assesses whether the fragment is likely to induce factual errors in the large model by analyzing the semantic deviation between the generated result and the original fragment.
[0106] Step S8: Based on the hit statistics, dynamically optimize the retrieval strategy, fragment segmentation, sorting rules, etc., update system parameters, and form continuous optimization.
[0107] Based on the hit statistics, the knowledge retrieval and context generation strategies are dynamically optimized. Optimizations include adjusting the chunk splitting granularity, adjusting recall weights, optimizing sorting rules, dynamically controlling context length, merging highly relevant segments, reducing the priority of low-quality segments, and updating the embedding index structure.
[0108] The system simultaneously feeds back the optimization results to the problem retrieval and evidence recall module, as well as the context building and model generation module, forming a continuously iterative closed-loop optimization mechanism. Compared to the traditional method of relying on manual experience to adjust parameters, it can automatically optimize based on the model's actual usage behavior, improving the system's long-term performance.
[0109] Step S9: While outputting the model's answer, the system can simultaneously output the corresponding evidence source information and credibility.
[0110] The evidence source information includes the hit evidence fragments, cited source documents, evidence credibility, hit contribution score, and related knowledge location, thereby enabling the model's answer results to be interpretable and auditable. It is suitable for scenarios with high credibility requirements, such as financial risk control, legal consulting, medical assistance, government Q&A, and enterprise knowledge bases.
[0111] Through the above implementation process, the present invention can achieve accurate statistics on the actual use of evidence fragments during the generation of large models, and dynamically optimize knowledge retrieval and context construction strategies based on the statistical results, thereby improving the answer accuracy, evidence utilization efficiency and continuous optimization capability of the large model system.
[0112] A system for statistical analysis and optimization of evidence fragment hit rates for large-scale model applications unifies the management of knowledge retrieval, context construction, large-scale model generation, and evidence hit analysis processes, enabling statistical analysis of evidence fragment hit rates, semantic association analysis, and dynamic optimization. It includes the following modules:
[0113] (1) Knowledge segmentation and indexing module, used to preprocess the original knowledge document and perform fragmentation segmentation;
[0114] This module is used to preprocess the original knowledge document, segmenting it into multiple evidence chunks according to preset rules. The segmentation methods include, but are not limited to, fixed-length segmentation, semantic boundary-based segmentation, title-level-based segmentation, paragraph-structure-based segmentation, and business-field-based segmentation. Each segmented evidence chunk will generate a unique identifier, and after being processed into vector data using an embedding model, it will be stored in a vector database or retrieval index.
[0115] (2) Problem retrieval and evidence recall module, used to retrieve and recall multiple candidate evidence fragments based on user problems;
[0116] After a user enters a question, the module vectorizes the question and retrieves multiple candidate evidence fragments from the knowledge base based on vector similarity, keyword matching, or a hybrid recall method.
[0117] The TopK recall quantity, similarity threshold, re-ranking rules, multi-path recall strategy, and recall priority can be dynamically configured according to different business scenarios. The TopK recall quantity dynamically scales based on query complexity and business requirements. The similarity threshold is a dynamically set score threshold based on the scenario's tolerance for accuracy. The re-ranking rules can dynamically combine re-ranking strategies according to business objectives. The multi-path recall strategy needs to dynamically allocate the weights or triggering conditions of different recall channels based on query features. The recall priority is based on fragment priority weights, and recall is carried out by assigning dynamic priority weights to fragments with different features.
[0118] The recalled evidence fragments will be used to construct a contextual input structure according to preset rules.
[0119] (3) Context building and model generation module, which is used to splice user questions with evidence fragments obtained from recall and generate large model input context.
[0120] The system can dynamically adjust the order of evidence fragments and the proportion of context they occupy based on: evidence fragment length, historical hit rate, business importance, semantic relevance, and user behavior characteristics. Subsequently, the large model generates the answer result based on the constructed context.
[0121] (4) Evidence fragment hit analysis module, which is used to analyze the model-generated results and identify the evidence fragments actually used in the model's response process.
[0122] Specifically, the system determines the evidence hit rate through one or a combination of the following methods: text similarity matching, token-level semantic association analysis, attention weight analysis, quoted fragment localization, keyword coverage analysis, vector semantic comparison, and inference link association analysis. Based on the analysis results, the system generates corresponding hit records, including the hit fragment ID, hit count, hit location, hit weight, effective contribution, and answer relevance.
[0123] (5) Hit rate statistics and evaluation module, used to statistically evaluate the historical hit rate of evidence fragments.
[0124] The system can establish the following statistical indicators: segment hit rate, average contribution, user adoption rate, answer accuracy correlation rate, multi-turn dialogue reuse rate, and high-frequency question hit trend. These indicators can be used to identify high-value evidence segments and low-quality segments.
[0125] (6) Dynamic optimization feedback module: Based on the hit statistics, dynamically optimize the knowledge retrieval and context construction strategies.
[0126] The optimizations include, but are not limited to: dynamically adjusting the chunk splitting granularity, adjusting the recall priority, optimizing the sorting weight, deleting low-value segments, merging highly relevant segments, adjusting the context splicing order, optimizing the embedding index structure, and dynamically controlling the context length.
[0127] The system forms a closed-loop structure of "retrieval - generation - hit analysis - optimization" through continuous feedback.
[0128] (7) Evidence tracking and interpretable output module, used to output the evidence source information corresponding to the model answer, so as to realize the interpretable display of the answer result.
[0129] The system can attach information such as the source of the evidence, the location of the cited fragments, the credibility of the evidence, the contribution score, and the path to the related knowledge documents to the generated content. This enhances the system's credibility and auditability in financial, government, legal, medical, and enterprise knowledge base scenarios.
[0130] In summary, by constructing an evidence fragment hit analysis and dynamic optimization mechanism, this invention enables the evidence utilization process in a large model retrieval enhancement system to be quantifiable, traceable, and continuously optimized, thereby improving knowledge retrieval efficiency, model response accuracy, and the overall intelligent optimization capability of the system.
[0131] In the example:
[0132] The following detailed description, in conjunction with specific embodiments, illustrates the implementation of the method for statistical analysis and optimization of evidence fragment hit rates for large-scale model applications proposed in this invention.
[0133] This invention can be deployed in intelligent question-answering systems, enterprise knowledge base systems, intelligent customer service systems, agent systems, or other large model application platforms based on retrieval-enhanced generation (RAG).
[0134] In one specific embodiment, the method of the present invention includes the following steps:
[0135] S10: Implementation process of knowledge document access and fragment generation;
[0136] The system first receives external knowledge data, including but not limited to: PDF documents, Word documents, Markdown documents, web page content, database text, FAQ data, business rule documents, and API documentation. The system then standardizes the raw knowledge content, including: unified encoding, special character removal, paragraph recognition, heading level parsing, table text expansion, and invalid content filtering. Subsequently, the system uses a dynamic segmentation mechanism to generate evidence fragments.
[0137] In this embodiment, the system does not use a fixed uniform chunk length, but dynamically generates evidence fragments based on semantic integrity, paragraph structure, token length, title boundaries, and business field relevance.
[0138] For example: business rule documents are segmented at the paragraph level; API documentation is segmented at the interface level; FAQ documents are segmented using question-and-answer pairs; and long text descriptions are segmented using a sliding window. The system generates a unique fragment ID for each piece of evidence and records: document source, chapter, generation time, number of tokens, business tags, and version information.
[0139] S11: Vectorized indexing implementation process;
[0140] The system calls the Embedding model to vectorize the evidence fragments. In this embodiment, BGE model, E5 model, GTE model, OpenAI Embedding model, and enterprise self-trained vector model can be used.
[0141] Subsequently, the system stores the evidence fragment text, vector data, and metadata information in a vector database. This vector database includes, but is not limited to, Milvus, FAISS, Elasticsearch, pgvector, Weaviate, and Chroma. Simultaneously, vector indexes, inverted indexes, business tag indexes, and hit statistics indexes are established.
[0142] S13: Implementation process of problem retrieval and context construction;
[0143] After a user inputs a question, the system first preprocesses the question, including question normalization, keyword extraction, intent classification, multi-turn context fusion, and business tag recognition. Then, the system generates a question vector and performs multi-path recall.
[0144] In this embodiment, the system simultaneously performs vector similarity recall, BM25 keyword recall, historical high-hit fragment recall, and hot topic knowledge recall. The system then merges and sorts the recall results.
[0145] During the sorting process, the system comprehensively considers semantic similarity, historical hit rate, user feedback rating, business priority, time weight, and fragment credibility. The system constructs a context based on the sorting results and dynamically controls the context length. For example: high-hit fragments are prioritized; the context ratio of consecutive low-hit fragments is reduced; redundant content is automatically pruned; and highly relevant fragments are automatically merged.
[0146] Then, the user's question and context are fed into the large model.
[0147] S14: Implementation process of evidence fragment hit identification;
[0148] After the large model outputs its response, the system performs evidence hit analysis on the generated results.
[0149] In this embodiment, the system employs a multi-dimensional fusion recognition mechanism, including:
[0150] (1) Text matching analysis;
[0151] The system calculates the edit distance, keyword coverage, sentence vector similarity, and n-gram matching degree between the answer content and the evidence fragment.
[0152] (2) Semantic association analysis;
[0153] The system calculates the semantic correlation between the answer and the fragment semantics, as well as the semantic contribution between the answer sentence and the knowledge fragment, using a semantic vector model.
[0154] (3) Token-level contribution analysis;
[0155] The system analyzes the contribution of different evidence fragments to the generation of responses based on the token association information in the large model generation process.
[0156] (4) Attention weight analysis;
[0157] The system acquires the attention weights of context tokens during model inference and identifies the evidence fragment regions that are of particular interest.
[0158] (5) Reference path analysis;
[0159] The system identifies cited statements, data sources, rule bases, and business field mapping relationships in the answers, and ultimately generates evidence hit results.
[0160] S15: Implementation process of hit rate statistics;
[0161] The system stores and statistically analyzes the hit data from each generation process. In this embodiment, each piece of evidence maintains corresponding statistical indicators, including total recall, total hits, average contribution, user adoption rate, answer accuracy correlation value, multi-round reuse rate, and hallucination correlation risk value.
[0162] The system establishes a fragment quality assessment system based on the above indicators. For example, fragments with high frequency of hits and high adoption are marked as high-value fragments, fragments with high frequency of recall but low hits are marked as inefficient fragments, and fragments with high hallucination associations are marked as risky fragments.
[0163] S16: Dynamically optimize the implementation process;
[0164] The system automatically performs optimization operations based on the hit statistics.
[0165] Specifically, it includes:
[0166] (1) Chunk segmentation optimization;
[0167] For segments with long-term low hit rates, the chunk length is automatically shortened, semantic boundaries are redefined, and sliding window parameters are adjusted.
[0168] (2) Optimize retrieval weights;
[0169] Increase the priority of high-frequency hit segments, high-contribution segments, and high-user adoption segments during the retrieval phase.
[0170] (3) Context optimization;
[0171] The system dynamically adjusts the order of context fragments, the token allocation ratio, and the context pruning rules.
[0172] (4) Knowledge base optimization;
[0173] The system automatically merges duplicate segments, reduces the weight of low-value segments, updates the vector index, and cleans up invalid knowledge.
[0174] S17: Implementation process of evidence interpretation output;
[0175] When the model outputs results, the system simultaneously outputs related evidence fragments, source documents, hit contribution, citation credibility, and knowledge location information. Users can view the evidence sources corresponding to their answers, making the model's answers interpretable and auditable.
[0176] Through the above implementation method, the present invention can achieve accurate statistics on the use of evidence fragments in large models, and continuously optimize the knowledge retrieval and context construction process based on the statistical results, thereby improving the answer accuracy, context utilization efficiency and long-term self-optimization capability of large model application systems.
[0177] This invention can achieve the following objectives:
[0178] (1) To achieve statistical analysis of the actual hit rate of evidence fragments;
[0179] By analyzing the context usage during the generation of large models, we can identify the evidence fragments that actually participate in the reasoning during the model's response and establish a statistical mechanism for the hit rate of evidence fragments, thereby achieving a quantitative evaluation of the effectiveness of evidence utilization.
[0180] (2) Establish a correlation mapping between model responses and evidence sources
[0181] By matching the semantic associations between the model-generated content and knowledge fragments, a correspondence between the answer content and the source of evidence is constructed, enabling evidence tracking, source location, and reasoning process analysis of the model's answer, thereby improving the interpretability of the system.
[0182] (3) Improve the accuracy of the response generated by the search enhancement system
[0183] Based on the historical hit rate, effective contribution, and user feedback of evidence fragments, the retrieval recall, fragment ranking, and context construction strategies are dynamically adjusted to improve the recall priority of high-value evidence fragments and reduce the interference of low-quality content on model reasoning, thereby improving the quality of model responses.
[0184] (4) Achieve dynamic optimization and adaptive adjustment of evidence fragments.
[0185] By constructing an optimization closed loop based on hit statistics, the system automatically optimizes the granularity of knowledge fragment segmentation, the order of context splicing, the number of recalls, and the retrieval weight, thereby enabling the system to adapt to different business scenarios and different problem types.
[0186] (5) Reduce the problems of large model illusion and misreference.
[0187] By analyzing the correlation between model-generated results and evidence fragments, unfounded generation, misquotation, and low-relevance content can be identified, thereby improving the consistency between model responses and knowledge sources and reducing the probability of large model illusion problems.
[0188] (6) Improve the efficiency of context window resource utilization
[0189] By filtering evidence fragments with high hit rates and high validity, redundant context injection is reduced, the effective information density in the model's context window is increased, invalid token usage is reduced, and the model's inference efficiency is improved.
[0190] (7) Enhance the system's continuous learning and closed-loop optimization capabilities
[0191] By continuously recording the hit rate, usage frequency, and optimization results of evidence fragments, a closed-loop mechanism of "retrieval - hit analysis - optimization feedback - re-retrieval" is formed, enabling the system to continuously optimize knowledge retrieval and context construction capabilities.
[0192] (8) Enhance auditability in complex business scenarios
[0193] In scenarios where high credibility of answers is required, such as enterprise knowledge bases, financial risk control, government Q&A, legal consultation, and medical assistance, the system enables traceable, verifiable, and auditable evidence of model answers, thereby improving the reliability and controllability of the system in actual business operations.
Claims
1. A statistical and optimization method for evidence fragment hit rate in large-scale model applications, comprising the following steps: S1: Obtain the original knowledge document, preprocess the knowledge document, and then segment the knowledge document according to preset rules to generate multiple evidence fragments; S2: By calling the Embedding model to perform vector encoding on the evidence fragments, corresponding semantic vector data is generated and then stored in the vector database to realize index construction; S3: Receive user questions and vectorize them to generate question vectors; S4: Based on the question vector, perform a search in the vector database, and sort and filter the multiple evidence fragments retrieved; S5: The system splices together the user's question with the evidence fragments obtained from the recall to construct the context of the large model input, inputs it into the large model for reasoning and content generation, and outputs the answer result; S6: Perform evidence fragment hit identification processing. After the large model is generated, perform evidence association analysis on the generated content to identify the evidence fragments actually used by the large model and calculate the hit strength and contribution of each evidence fragment. S7: Perform aggregated analysis on historical hit data of evidence fragments, establish a statistical index system for evidence fragments, and evaluate the quality and value of the fragments; S8: Based on the hit statistics, dynamically optimize the retrieval strategy, fragment segmentation, sorting rules, etc., update system parameters, and form continuous optimization; S9: While outputting the model's answer, the system can simultaneously output the corresponding evidence source information and credibility.
2. The method for statistical analysis and optimization of evidence fragment hit rates for large-scale model applications according to claim 1, characterized in that: In step S1, the knowledge document is segmented according to preset rules, which include but are not limited to fixed-length segmentation, semantic boundary-based segmentation, title structure-based segmentation, business field-based segmentation, and dynamic context-based segmentation. For generating multiple evidence fragments, a unique identifier ID is generated for each evidence fragment, and the corresponding source document, chapter, starting position, timestamp, and business tag are recorded.
3. The method for statistical analysis and optimization of evidence fragment hit rates for large-scale model applications according to claim 1, characterized in that: In step S2, the semantic vector data is stored in a vector database, and the retrieval indexing methods include: fragment ID index, keyword inverted index, semantic vector index, business classification index, and hit statistics index.
4. The method for statistical analysis and optimization of evidence fragment hit rates for large-scale model applications according to claim 1, characterized in that: In step S4, a search is performed in the vector database based on the question vector. The retrieved evidence fragments are sorted and filtered. The TopK recall quantity, similarity threshold, recall priority, and multi-path recall ratio can be dynamically adjusted according to question type, business scenario, historical hit rate, user behavior data, and knowledge fragment weight.
5. The method for statistical analysis and optimization of evidence fragment hit rates for large-scale model applications according to claim 1, characterized in that: In step S6, one or a combination of the following methods are used for hit identification: text similarity analysis, token-level semantic mapping, attention weight analysis, quotation matching, keyword coverage detection, vector semantic association analysis, and reasoning path analysis. After the hit evidence fragment is identified, the corresponding hit record is generated, including fragment ID, hit count, hit location, hit strength, contribution score, and associated answer content.
6. The method for statistical analysis and optimization of evidence fragment hit rate for large-scale model applications according to claim 1, characterized in that: In step S7, the statistical indicators include, but are not limited to, evidence fragment hit rate, average contribution, high-frequency question hit rate, user adoption rate, answer accuracy correlation value, multi-round reuse rate, and hallucination correlation risk value.
7. The method for statistical analysis and optimization of evidence fragment hit rates for large-scale model applications according to claim 1, characterized in that: In step S8, the knowledge retrieval and context generation strategies are dynamically optimized based on the hit statistics. The optimization includes adjusting the chunk segmentation granularity, adjusting the recall weight, optimizing the sorting rules, dynamically controlling the context length, merging highly relevant segments, reducing the priority of low-quality segments, and updating the embedding index structure.
8. A statistical optimization system for evidence fragment hit rates in large-scale model applications, characterized in that: Includes the following modules: The knowledge segmentation and indexing module is used to preprocess the original knowledge documents and perform fragmentation segmentation. The problem retrieval and evidence recall module is used to retrieve and recall multiple candidate evidence fragments based on user questions; The context building and model generation module is used to concatenate user questions with the evidence fragments obtained from the recall and generate a large model input context; The evidence fragment hit analysis module is used to analyze the model-generated results and identify the evidence fragments actually used in the model's response process. The hit rate statistics and evaluation module is used to statistically analyze and evaluate the historical hit rate of evidence fragments. The dynamic optimization feedback module dynamically optimizes the knowledge retrieval and context construction strategies based on the hit statistics. The evidence tracking and interpretable output module is used to output the evidence source information corresponding to the model's answer, so as to realize the interpretable display of the answer results.
