Document interaction processing method, device and equipment for large language model

By using task decomposition and hybrid indexing techniques, the complex tasks of large language models are transformed into explicit sub-tasks, and a structured knowledge chain is constructed. This solves the problems of broken reasoning chains and retrieval accuracy in complex tasks of large language models, thereby improving retrieval efficiency and accuracy.

CN121562775BActive Publication Date: 2026-07-24BEIJING ACAD OF ARTIFICIAL INTELLLIGENCE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511542857.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-07-24
Estimated Expiration
2045-10-27

AI Technical Summary

Technical Problem

Large language models face challenges such as easily broken inference chains, lack of structured retrieval results, low recall or poor precision when dealing with complex tasks, especially with long documents and heterogeneous documents.

Method used

By splitting tasks, large-scale, fuzzy target tasks are transformed into small-scale, specific target sub-tasks. A hybrid index based on dense semantic vectors and sparse keywords is constructed to generate a sub-knowledge space, forming a structured knowledge chain that is input into the large language model.

Benefits of technology

It effectively reduces the difficulty of retrieval and reasoning for complex tasks, ensures the accuracy and efficiency of retrieval results, solves the problems of low recall or poor precision in traditional retrieval methods, and enables the system to maintain global awareness and local precision when processing long documents and heterogeneous documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121562775B_ABST
    Figure CN121562775B_ABST
Patent Text Reader

Abstract

The application provides a document interaction processing method, device and equipment for a large language model, the method comprising: generating a plurality of target sub-tasks according to a target task input by a user; determining, for each target sub-task, a plurality of sub-queries corresponding to the target sub-task; determining a sub-knowledge space corresponding to the target sub-task according to a hybrid index pre-constructed for a document and the plurality of sub-queries corresponding to the target sub-task; and inputting the plurality of sub-knowledge spaces corresponding to the plurality of target sub-tasks into the large language model to generate a response result corresponding to the target task. The method of the application can effectively reduce the difficulty of subsequent retrieval and reasoning by task splitting, converting a large-scale and fuzzy target task into a small-scale and clear target sub-task, and can solve the problem that a complex task is directly processed and a reasoning chain is easily broken. In addition, the hybrid index is constructed based on a dense semantic vector index and a sparse keyword index for a document, which can effectively avoid the problem of low recall rate or poor precision of a traditional single index, ensure that the retrieval result is both comprehensive and accurate, solve the contradiction between retrieval precision and efficiency, enable the system to maintain global perception and local accuracy when processing long documents and heterogeneous documents, and overcome the limitation of traditional dense retrieval which only focuses on local semantics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a document interaction processing method, apparatus, and device for large language models. Background Technology

[0002] In related technologies, in Retrieval-Augmented Generation (RAG) and agent search, retrieval results are mostly presented in the form of raw fragments and lack structured processing. This makes it difficult for large language models to efficiently assemble and utilize information when the context is limited. Furthermore, the reasoning chain is prone to breakage and lacks scalability when faced with scattered and redundant evidence. Summary of the Invention

[0003] This invention provides a document interaction processing method, apparatus, and device for large language models. By task decomposition, large-scale, fuzzy target tasks are transformed into small-scale, well-defined target sub-tasks, effectively reducing the difficulty of subsequent retrieval and reasoning, and solving the problem of broken reasoning chains that easily occur when directly processing complex tasks. Furthermore, by constructing a hybrid index based on dense semantic vector indexes and sparse keyword indexes of documents, the low recall or poor precision of traditional single indexes can be effectively avoided, ensuring that the retrieval results are both comprehensive and accurate. This resolves the contradiction between retrieval accuracy and efficiency, enabling the system to maintain global awareness and local precision when processing long and heterogeneous documents, overcoming the limitation of traditional dense retrieval that only focuses on local semantics.

[0004] This invention provides a document interaction processing method for large language models, comprising the following steps.

[0005] Based on the target task input by the user, generate multiple target subtasks; For each target subtask, determine multiple subqueries corresponding to the target subtask; Based on the pre-built hybrid index of the document and multiple sub-queries corresponding to the target sub-task, the sub-knowledge space corresponding to the target sub-task is determined; the hybrid index is constructed based on the dense semantic vector index and sparse keyword index of the document; the dense semantic vector is generated based on the key points memory of the document; The multiple sub-knowledge spaces corresponding to the multiple target sub-tasks are input into the large language model to generate the response results corresponding to the target tasks.

[0006] According to a document interaction processing method for large language models provided by the present invention, the step of determining the sub-knowledge space corresponding to the target sub-task based on a pre-constructed hybrid index of the document and multiple sub-queries corresponding to the target sub-task includes: Based on the pre-built hybrid index of the document, determine the atomic knowledge space corresponding to each subquery; Based on the atomic knowledge spaces corresponding to the multiple sub-queries, determine the sub-knowledge space corresponding to the target sub-task.

[0007] According to a document interaction processing method for large language models provided by the present invention, after determining the sub-knowledge space corresponding to the target sub-task based on the atomic knowledge spaces corresponding to the plurality of sub-queries, the method further includes: If it is determined that the information required for the target sub-task is missing in the sub-knowledge space, a sub-query is generated based on the missing information. The atomic knowledge space corresponding to the subquery is added to the subknowledge space corresponding to the target subtask.

[0008] According to a document interaction processing method for large language models provided by the present invention, the step of determining the sub-knowledge space corresponding to the target sub-task based on the atomic knowledge space corresponding to the plurality of sub-queries includes: The atomic knowledge space is filtered based on the key points of the document to obtain the filtered atomic knowledge space. Evidence is extracted based on the filtered atomic knowledge space; The extracted evidence is integrated to obtain the sub-knowledge space.

[0009] According to the document interaction processing method for a large language model provided by the present invention, the step of inputting multiple sub-knowledge spaces corresponding to the multiple target sub-tasks into the large language model and generating response results corresponding to the target tasks includes: Based on the logical association order between the multiple target sub-tasks corresponding to the target task, the multiple sub-knowledge spaces corresponding to the multiple target sub-tasks are organized into a knowledge chain; The knowledge chain is input into the large language model to generate the response result corresponding to the target task.

[0010] The present invention also provides a document interaction processing device for large language models, comprising the following modules: The generation module is used to generate multiple target subtasks based on the target task input by the user; The first determining module is used to determine multiple sub-queries corresponding to each target sub-task; The second determining module is used to determine the sub-knowledge space corresponding to the target sub-task based on the pre-built hybrid index of the document and multiple sub-queries corresponding to the target sub-task; the hybrid index is constructed based on the dense semantic vector index and sparse keyword index of the document; the dense semantic vector is generated based on the key points memory of the document; The response module is used to input the multiple sub-knowledge spaces corresponding to the multiple target sub-tasks into the large language model and generate the response results corresponding to the target tasks.

[0011] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the document interaction processing method for large language models as described above.

[0012] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the document interaction processing method for large language models as described above.

[0013] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the document interaction processing method for large language models as described above.

[0014] The document interaction processing method, apparatus, and device provided by this invention for large language models transform large-scale, fuzzy target tasks into small-scale, well-defined target sub-tasks through task decomposition. This effectively reduces the difficulty of subsequent retrieval and reasoning, solving the problem of broken reasoning chains that easily occur when directly processing complex tasks. Furthermore, the hybrid index constructed based on dense semantic vector indexing and sparse keyword indexing of documents effectively avoids the problems of low recall or poor precision in traditional single indexes, ensuring that retrieval results are both comprehensive and accurate. This resolves the contradiction between retrieval accuracy and efficiency, enabling the system to maintain global awareness and local precision when processing long and heterogeneous documents, overcoming the limitations of traditional dense retrieval that only focuses on local semantics. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0016] Figure 1 This is one of the flowcharts of the document interaction processing method for large language models provided by the present invention.

[0017] Figure 2 This is the second flowchart of the document interaction processing method for large language models provided by this invention.

[0018] Figure 3 This is the third flowchart of the document interaction processing method for large language models provided by this invention.

[0019] Figure 4 This is a schematic diagram of the document interaction processing device for large language models provided by the present invention.

[0020] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0022] The following is combined Figures 1-5 This invention describes a document interaction processing method, apparatus, and device for large language models.

[0023] To facilitate a clearer understanding of the technical solutions of the various embodiments of this application, some technical content related to the various embodiments of this application will be introduced first.

[0024] In related technologies, to compensate for the inherent limitations of large language models—namely, their fixed knowledge and difficulty in timely updates—they are often combined with external knowledge sources to enhance their performance in knowledge-intensive tasks. A common approach is Retrieval-Enhanced Generative Algorithm (RAG), which retrieves relevant document fragments from external knowledge bases by retrieving the input query and directly injects these fragments into the model's context to assist in generating answers. Subsequently, various RAG-based improvement schemes have emerged, such as optimizing the relevance of retrieval results through query rewriting, improving model generation quality through self-reflection, accumulating and reusing historical knowledge through memory enhancement, or improving evidence organization and association capabilities through graph structure retrieval. These improvements have, to some extent, enhanced the model's knowledge utilization and the accuracy of its answers.

[0025] However, the above methods generally rely on directly inputting raw document fragments without deep processing into the model before inference, which has the following main drawbacks: 1. Lack of structured processing: Retrieval results are often presented in the form of raw text fragments, which are noisy and redundant. The model needs to assemble and reason on its own within a limited context window, resulting in low efficiency.

[0026] 2. Insufficient ability to handle scattered information: When key information is sparsely distributed across different documents or locations, the model needs to rely on context to piece together fragmented content, which can easily lead to the omission of important evidence or logical breaks, and an unstable reasoning chain.

[0027] 3. Limited scalability: As task complexity and the size of external documents increase, existing methods are limited by the size of the context window and computing resources, making it difficult to achieve large-scale information organization and efficient utilization.

[0028] To address the above issues, the industry has proposed the Agentic Search method. This method iterates between retrieval and inference, incorporating task decomposition and tool calls to enable the model to progressively refine queries and integrate evidence. This type of method has improved performance in multi-step inference tasks to some extent. However, Agentic Search still relies on contextual processing of large-scale raw evidence, and it still has the following shortcomings when information redundancy is severe or the hierarchy of evidence information is deeply interdependent: 1. Low efficiency in evidence processing: During the continuous retrieval and reasoning process, the agent still needs to load a large number of original fragments in the context, which is complex and computationally expensive.

[0029] 2. Difficult to scale: When faced with long documents, massive amounts of data, or cross-domain knowledge, existing methods cannot effectively compress evidence into a form that the model can directly consume, resulting in a significant decrease in efficiency and accuracy as the task scales up.

[0030] Therefore, in general, the relevant technologies generally suffer from the following technical bottlenecks: the retrieval results lack structure and compactness, making it difficult for large language models to consume them directly and efficiently; the ability to process scattered and interdependent evidence is insufficient, which easily leads to omissions, redundancy, or reasoning errors; and the efficiency and scalability are poor when the task complexity and knowledge scale increase.

[0031] It should be noted that, in the embodiments of this application, the key terms are explained as follows: Large Language Model (LLM): A deep learning model trained on large-scale corpora, usually based on the Transformer architecture, which can demonstrate powerful capabilities in natural language understanding and generation tasks, including question answering, reasoning and text generation.

[0032] Information-Seeking / Search: The process of finding useful information relevant to a user's query from large-scale data sources, such as the web, databases, or local document repositories.

[0033] Knowledge-intensive tasks: Problems that require broad domain knowledge or up-to-date information to solve, such as specialized question answering, academic research problems, or cross-domain reasoning tasks.

[0034] Retrieval-Augmented Generation (RAG): A framework that combines retrieval and generation. It first retrieves relevant text fragments from an external knowledge base and then injects them into the context of a language model to generate more accurate and information-rich answers.

[0035] Tool-integrated reasoning combines a language model with external tools (such as search engines, calculators, and database interfaces). The model then plans and invokes these tools to gradually complete complex reasoning and tasks.

[0036] Context (Context Window): The range of input text that a language model can utilize during a single inference process, typically limited by a fixed token window size.

[0037] Data Chaos: A common characteristic of real-world data: lengthy, heterogeneous, unstructured, noisy, and highly redundant, resulting in sparse information and a low signal-to-noise ratio, which increases the difficulty of model retrieval and inference.

[0038] Model-Document Protocol (MDP): A newly proposed framework that redefines retrieval as a transformation process from "raw document to compact, structured, task-specific knowledge," ensuring that document knowledge can be utilized in an LLM-ready form.

[0039] Agentic Reasoning: This method uses intelligent agents to reason about and organize documents, gradually planning, retrieving, and integrating information to organize raw evidence into a coherent context.

[0040] Memory grounding: Constructing reusable notes or key points (memory notes) that can be accumulated and reused in subsequent inference, enhancing the model's knowledge support for long-term tasks.

[0041] Structured Leveraging: Encoding document content into structured representations, such as knowledge graphs and key-value caches, enables models to invoke and reason more efficiently.

[0042] In the context of artificial intelligence, an intelligent agent refers to an entity capable of perceiving its environment, making autonomous decisions based on its goals, and taking action. It typically possesses three core capabilities: perception, decision-making, and action. It can be a software program (such as an information retrieval agent), a robot, or the reasoning and planning module within a language model. In your research context, the intelligent agent emphasizes an AI system that proactively completes complex tasks through planning, retrieval, reasoning, and tool invocation, as opposed to traditional models that passively receive input and generate output.

[0043] Gist Memory: A simplified representation of a document's global theme and structure, ensuring comprehensive coverage while facilitating filtering and pre-selection in large-scale corpora.

[0044] Hybrid Indexing: This indexing method combines dense embeddings with sparse text, supporting both semantic retrieval and ensuring accurate keyword matching.

[0045] Information Intent: An intermediate sub-goal or query intent derived from a complex task, used to guide the retrieval and reasoning process.

[0046] Atomic Sub-Query: The smallest granular query unit obtained by decomposing a complex problem, corresponding to the atomic knowledge points in the document.

[0047] Diffusion-Based Horizontal Exploration: Starting from known evidence, expand the scope of the search by extending and diffusing the retrieval of relevant documents, thus avoiding the omission of key information.

[0048] Vertical Exploitation: In the established chain of evidence, delve deeper into its hierarchical dependencies to ensure the depth and completeness of the reasoning.

[0049] Memory-Accelerated Filtering: Utilizes key information to quickly filter documents, reducing irrelevant content entering subsequent processing and improving efficiency and scalability.

[0050] Map-Reduce Style Synthesis: Drawing inspiration from the Map-Reduce concept in distributed computing, it first processes a large number of evidence fragments in parallel (Map), and then performs centralized integration (Reduce) to obtain a compact and sufficient knowledge representation.

[0051] Knowledge Chain: Connects scattered atomic knowledge points into a structured link in a logical order for model reasoning and generation.

[0052] Contextual Intelligence: The model organizes raw information into structured knowledge that is highly relevant to the task through abstraction, exploration, and synthesis, thereby enhancing understanding and reasoning abilities.

[0053] Figure 1 This is one of the flowcharts illustrating the document interaction processing method for large language models provided by the present invention. The method includes the following: Step 101: Generate multiple target sub-tasks based on the target task input by the user.

[0054] Specifically, in this embodiment, the complex target task proposed by the user is first decomposed into multiple logically independent and step-by-step sub-tasks. In other words, this embodiment transforms a large-scale, ambiguous target task into smaller, more specific sub-tasks through task decomposition, effectively reducing the difficulty of subsequent retrieval and reasoning, and solving the problem of broken reasoning chains that easily occur when directly processing complex tasks.

[0055] Step 102: For each target subtask, determine the multiple subqueries corresponding to the target subtask.

[0056] Specifically, after generating multiple target sub-tasks based on the user-input target task, this embodiment further decomposes each target sub-task into multiple sub-queries, i.e., the smallest granularity query units, based on the information intent of each target sub-task. Each sub-query corresponds to a specific knowledge point or information requirement in the target sub-task. In other words, each sub-query covers one information dimension of the target sub-task, and multiple sub-queries jointly support the information requirements of the target sub-task, thereby effectively reducing the lack of evidence due to incomplete queries and avoiding the problems of low relevance and redundant information in search results caused by directly querying based on the target sub-task.

[0057] For example, if the target subtask is to evaluate an experimental method, it can be broken down into subqueries such as experimental data sources, model architecture design, and evaluation metric selection.

[0058] Step 103: Determine the sub-knowledge space corresponding to the target sub-task based on the pre-built hybrid index of the document and the multiple sub-queries corresponding to the target sub-task; the hybrid index is built based on the dense semantic vector index and sparse keyword index of the document; the dense semantic vector is generated based on the key points memory of the document.

[0059] Specifically, in this embodiment, the pre-built hybrid index for the document consists of two parts: a dense semantic vector index and a sparse keyword index. The dense semantic vector is generated based on the document's key information. Key information is an abstract representation of the document's global theme and structure, encoded into a dense vector for global semantic matching. The sparse keyword index consists of keywords and key phrases from the document, used for precise matching of specific information in subqueries.

[0060] Optionally, the relevance between the subquery and the document can be calculated using a pre-built hybrid index of the document, highly relevant documents can be filtered out, and corresponding key information such as text fragments, data, and logical relationships can be extracted from the filtered highly relevant documents to obtain the sub-knowledge space corresponding to the target sub-task.

[0061] It should be noted that the hybrid index constructed based on the dense semantic vector index and sparse keyword index of the document in this embodiment can effectively avoid the problem of low recall or poor precision of traditional single index, ensure that the search results are both comprehensive and accurate, resolve the contradiction between search accuracy and efficiency, and enable the system to maintain global awareness and local accuracy when processing long documents and heterogeneous documents, overcoming the limitation of traditional dense search that only focuses on local semantics.

[0062] For example, in one implementation, for the input document Generate key memory using a lightweight long context model. . Describe the document's overall theme, hierarchical structure, and organization without retaining details. For example: If For a collection of journal articles, This can include the journal title, research scope, and types of papers included, without having to list the paper titles individually. Then, Encoded as a dense vector And retain the original document at the same time. A sparse index. Optionally, the relevance of the subquery to the document is determined based on the following: in, Used to balance global semantic consistency with detailed matching; For subqueries The relevance score to document D; The similarity between the subquery q and the original document D is calculated using the dense semantic vector index. The sparse index similarity between subquery q and the original document D.

[0063] Step 104: Input the multiple sub-knowledge spaces corresponding to the multiple target sub-tasks into the large language model to generate the response results corresponding to the target tasks.

[0064] Specifically, in this embodiment, after determining the sub-knowledge space corresponding to the target sub-task based on the pre-built hybrid index of the document and multiple sub-queries corresponding to the target sub-task, the sub-knowledge spaces corresponding to each target sub-task can be chained together to form a structured LLM-ready context, which is then input into the large language model. The large language model directly performs reasoning based on the structured knowledge, ultimately generating response results that meet the requirements of the target task, such as a complete report, accurate question answers, and logically rigorous analytical conclusions.

[0065] The method described in the above embodiments, by task decomposition, transforms large-scale, ambiguous target tasks into small-scale, well-defined target sub-tasks. This effectively reduces the difficulty of subsequent retrieval and reasoning, and solves the problem of broken reasoning chains that easily occur when directly processing complex tasks. Furthermore, constructing a hybrid index based on dense semantic vector indexes and sparse keyword indexes effectively avoids the problems of low recall or poor precision in traditional single indexes, ensuring that retrieval results are both comprehensive and accurate. This resolves the contradiction between retrieval accuracy and efficiency, enabling the system to maintain global awareness and local precision when processing long and heterogeneous documents, overcoming the limitations of traditional dense retrieval that only focuses on local semantics.

[0066] In some embodiments, the sub-knowledge space corresponding to the target subtask is determined based on a pre-built hybrid index of the document and multiple subqueries corresponding to the target subtask, including: Based on the pre-built hybrid index of the document, determine the atomic knowledge space corresponding to each subquery; Based on the atomic knowledge spaces corresponding to multiple subqueries, determine the sub-knowledge space corresponding to the target subtask.

[0067] Specifically, in this embodiment, based on a pre-built hybrid index of documents, a relevance score between the subquery and the documents is calculated. Documents highly relevant to the current subquery are then selected based on the relevance score. Key information units required by the corresponding subquery, such as text fragments, data, conclusions, and logical relationships, are extracted from these documents to form the atomic knowledge space corresponding to the subquery. That is, each subquery corresponds to a minimal set of information focusing on a single knowledge point, breaking down complex information in the document into directly reusable information units. Optionally, the atomic knowledge spaces corresponding to all subqueries under the same target subtask can be aggregated to form a structurally coherent and informationally complete sub-knowledge space. Optionally, this sub-knowledge space fully covers the information requirements of the target subtask and presents structured information relationships.

[0068] The method described above calculates the relevance between subqueries and documents based on a pre-built hybrid index, ultimately selecting highly relevant documents and extracting key information units to form atomic knowledge spaces. Multiple atomic knowledge spaces under the same target sub-task are then aggregated, making the sub-knowledge spaces present structured features and fully cover all information requirements of the target sub-task. This provides highly accurate, structured, and high-quality knowledge input for the Large Language Model (LLM), thereby significantly improving the reliability, efficiency, and scalability of the LLM in complex information retrieval and reasoning tasks.

[0069] In some embodiments, after determining the sub-knowledge space corresponding to the target sub-task based on the atomic knowledge spaces corresponding to multiple sub-queries, the method further includes: If it is determined that the information required for the target subtask is missing in the sub-knowledge space, a sub-query is generated based on the missing information. The atomic knowledge space corresponding to the subquery is added to the subknowledge space corresponding to the target subtask.

[0070] Specifically, in this embodiment, after determining the sub-knowledge space corresponding to the target sub-task based on the pre-built hybrid index of the document and multiple sub-queries corresponding to the target sub-task, the information integrity of the current sub-knowledge space is verified according to the information requirements of the target sub-task. This involves identifying whether there are uncovered information dimensions, missing key evidence, or broken logical chains. For the identified information gaps, the missing information dimensions are transformed into new sub-queries. Optionally, after generating new sub-queries based on the missing information, the pre-built hybrid index of the document can be called. Highly relevant documents are filtered through relevance calculations, and key information units corresponding to the missing information are extracted to form a new atomic knowledge space. This new atomic knowledge space is then added to the original sub-knowledge space, ultimately forming an updated sub-knowledge space with complete information and consistent logic. In other words, this application ensures that the sub-knowledge space can fully match all the information requirements of the target sub-task through dynamic verification and completion, avoiding knowledge blind spots or logical breaks during LLM inference due to missing information, and effectively avoiding potential omissions in the initial sub-query splitting.

[0071] For example, in one implementation, if the initial query fails to cover all the information required for the target subtask, a broad-coverage exploration strategy is adopted to generate more subqueries based on the existing results, gradually expanding the retrieval boundary until sufficient evidence is obtained, thereby effectively ensuring the complete coverage of the knowledge space and avoiding the lack of evidence due to insufficient description of intent.

[0072] The method described in the above embodiments performs integrity verification on the initially formed sub-knowledge space according to the information requirements of the target sub-task, accurately identifies uncovered information dimensions, missing key evidence, or broken logical chains, and then generates new sub-queries focusing on the missing dimensions based on the identified gap information. This avoids information blind spots caused by human or algorithmic limitations during the initial sub-query splitting, solves the problem of missing information dimensions that may exist in the initial sub-query splitting, ensures that the sub-knowledge space can match all the information requirements of the target sub-task, provides complete and reliable knowledge input for the Large Language Model (LLM), and avoids inference breaks or hallucination outputs caused by information gaps in the LLM.

[0073] In some embodiments, determining the sub-knowledge space corresponding to the target sub-task based on the atomic knowledge spaces corresponding to multiple sub-queries includes: The atomic knowledge space is filtered based on the key points of the document to obtain the filtered atomic knowledge space. Evidence is extracted based on the filtered atomic knowledge space; The extracted evidence is integrated to obtain a sub-knowledge space.

[0074] Specifically, in this embodiment, after determining the atomic knowledge space corresponding to each subquery based on the pre-built hybrid index of the document, the atomic knowledge space is filtered according to the document's key points memory to obtain the filtered atomic knowledge space. Optionally, in this embodiment, the key points memory is an abstract representation of the global theme, hierarchical structure, and core logic of the original document. For example, the key points memory of a journal collection includes the journal title, research field, and paper category, rather than the specific experimental data of a single paper; the key points memory of a long document covers the chapter theme and the connection of core arguments, rather than specific cases or descriptive statements within paragraphs. In this embodiment, by semantically matching each atomic knowledge space with the document's key points memory, atomic knowledge spaces highly related to the theme of the key points memory are selected, and atomic knowledge spaces that are irrelevant or lowly related to the target subtask are eliminated. This avoids irrelevant information from entering subsequent processing stages, reduces the invalid occupation of the LLM context window, and reduces redundancy and noise interference.

[0075] Optionally, after filtering the atomic knowledge space based on the key points of the document to obtain the filtered atomic knowledge space, this embodiment focuses on the key evidence units, such as core data, logical relationships, authoritative conclusions, and attribute information, within the filtered atomic knowledge space. Combined with natural language processing technology, it achieves accurate extraction, thus transforming the fuzzy text in the atomic knowledge space into structured evidence that can be directly parsed by LLM. This effectively solves the efficiency problem of traditional methods where the model needs to manually filter key information from the original text, improving the efficiency of LLM in utilizing knowledge.

[0076] Optionally, after extracting evidence from the filtered atomic knowledge space, the embodiments of this application integrate the scattered structured evidence into a sub-knowledge space that covers the full information requirements of the target sub-task, solving the problem that it is difficult to piece together scattered evidence into a complete reasoning chain in the prior art, ensuring that LLM obtains logically coherent and informationally complete knowledge input, and forming a precise and systematic knowledge loop.

[0077] For example, in one implementation, to address the scaling problem caused by diffusion, this application employs memory-guided parallel synthesis. The specific steps are as follows: Filtering operator F: Quickly remove irrelevant documents by memorizing key points of the document; Mapping operator E: Performs parallel evidence extraction on the retained documents; Synthesis operator R: integrates extracted evidence into a compact subspace. : in, The i-th sub-knowledge space is a structured set of knowledge for a specific target sub-task, which has been filtered, extracted, and integrated, and is used to provide accurate knowledge input for the large language model. This represents the knowledge integration operation, which involves logically linking and merging dimensions of the input evidence set to ultimately form a structured sub-knowledge space. This represents the evidence extraction operation on document D, which involves extracting atomic evidence related to the target subtask from document D, including core data, logical relationships, authoritative conclusions, etc. D represents the original document. This indicates a document filtering operation, used to select documents from a document collection that are relevant to the target subtask. Let i represent the i-th target subtask.

[0078] The method described in the above embodiments utilizes document key memory to filter the atomic knowledge space, directly eliminating information units irrelevant to the target subtask, effectively reducing redundancy and noise; and through the evidence extraction stage, it transforms the fuzzy text in the atomic knowledge space into structured evidence that can be directly parsed by the LLM, saving the LLM from the process of filtering key information from the original text, allowing the model to utilize knowledge more efficiently and improving the model's reasoning efficiency.

[0079] In some embodiments, multiple sub-knowledge spaces corresponding to multiple target sub-tasks are input into a large language model to generate response results corresponding to the target tasks, including: Based on the logical relationship between the multiple sub-tasks corresponding to the target task, the multiple sub-knowledge spaces corresponding to the multiple sub-tasks are organized into a knowledge chain. The knowledge chain is input into a large language model to generate the response results corresponding to the target task.

[0080] Specifically, in this embodiment, by analyzing the inherent logical relationships between the sub-tasks under the target task, the sub-knowledge spaces corresponding to each sub-task are sorted, and the sorted sub-knowledge spaces are sequentially linked to form a knowledge chain. Optionally, each node in the knowledge chain corresponds to a sub-knowledge space, and the nodes are connected through logical associations, clearly showing the logical transmission relationship between the sub-knowledge spaces. This organizes the originally scattered sub-knowledge spaces into an ordered knowledge chain according to the logical associations of the target sub-tasks, making the logical structure of knowledge clearer and more intuitive. This facilitates the large language model's understanding of the overall logical context of the target task, avoids the confusion in logical reasoning caused by the disorder of factor knowledge spaces when the large language model processes multiple sub-tasks, and ensures that the model can think and reason along a clear logical chain. This allows the large language model to process complex target tasks more efficiently, reduces the process of repeatedly querying and organizing information, and improves the overall efficiency of document interaction processing.

[0081] For example, in one implementation, when each subspace Once constructed, it is organized into a knowledge chain according to the logical order of the target subtasks: in, This represents a knowledge chain, i.e., a structured and compact LLM-ready context. This knowledge chain can be directly input into large language models, reducing redundancy and improving the stability of inference and the reliability of results.

[0082] The method described in the above embodiments analyzes the logical relationships between target sub-tasks, connects the scattered sub-knowledge spaces into an ordered knowledge chain, and forms a logical closed loop from the originally fragmented sub-knowledge spaces. This allows the Large Language Model (LLM) to intuitively understand the overall logical context of the target task, eliminating the need for the LLM to sort out the logic of the sub-tasks on its own. This significantly reduces the risk of logical confusion during model inference and improves inference efficiency and stability.

[0083] For example, such as Figure 2 As shown in the embodiments of this application, a document interaction processing method for large language models is provided. By abstracting key points, exploring layers, and synthesizing multiple sources from the original document, long, heterogeneous, and redundant data is transformed into compact, task-specific structured knowledge input, thereby significantly improving the utilization efficiency, reasoning stability, and large-scale application capability of large language models in complex information retrieval and reasoning tasks. The specific process is as follows: 1. Text data cleaning In one implementation, the input unstructured text data (such as web pages, office documents, PDF files, etc.) is cleaned and standardized to remove redundant information, noisy data, and inconsistent formatting. This includes removing HTML tags, extra spaces, and special characters, standardizing encoding formats, and segmenting sentences. Text data cleaning effectively reduces redundancy and noise in the original document, improving the accuracy and stability of subsequent processing modules and ensuring that knowledge processing is based on high-quality input data.

[0084] 2. Extraction of core semantic information In one implementation, natural language processing (NLP) techniques are used to analyze the cleaned text and automatically identify the core semantic points of the document, including the title, summary, key information fragments, and their logical relationships. This process can be achieved by combining keyword extraction, sentence importance assessment, and topic modeling. By extracting core semantic information, lengthy and complex unstructured data can be transformed into concise and compact task-related information, reducing the difficulty for large language models to automatically filter data under limited context.

[0085] 3. Structured Coding In one implementation, this application encodes the extracted semantic information into a multi-dimensional structured representation, specifically including: Summary information is used to represent the overall topic of a document; Information chunks are used to store key information in an atomic form. Meta information (meta_info) is used to record attributes such as source, context location, and timestamp; Vector embeddings are used to support semantic similarity retrieval; Structured relationships can be recorded in the form of knowledge graphs or key-value pairs to represent the logical dependencies between concepts.

[0086] By employing multi-dimensional encoding methods, documents retain their original semantics while also possessing structured and computable characteristics, thus laying the foundation for efficient retrieval and intelligent reasoning.

[0087] 4. Model – Document Exchange Protocol In one implementation, based on the aforementioned structured encoding, it is uniformly converted into a Model-Document Exchange Protocol (MEP) format. This protocol defines a standard interface for the interaction between document information and the large language model, including various data items such as text fields, summary fields, fragment arrays, vector representations, and graph structure relationships.

[0088] It should be noted that, unlike existing technologies that directly inject raw fragments into the model context, this application ensures that the input content is compact, task-specific, and structured knowledge through protocol-based processing, thereby significantly reducing contextual redundancy and improving the utilization efficiency of large language models.

[0089] 5. Structured Information Retrieval In one implementation, a structured retrieval is performed on documents stored in a protocol format. This retrieval employs a hybrid indexing approach, combining dense semantic vector indexes with sparse keyword indexes to ensure both global coverage and precise local location. This method can quickly find relevant and accurate information in large-scale document sets, avoiding the problems of insufficient recall or excessive error in traditional single-method retrieval.

[0090] 6. Knowledge Anchoring In one implementation, key information and intermediate results extracted during the task are stored as memory notes and linked to their source. These memories can be directly retrieved in subsequent tasks. This knowledge memory anchoring supports knowledge reuse across tasks or long-term tasks, reduces redundant computation and retrieval, and improves the system's scalability and continuous learning capabilities.

[0091] 7. Agent Reasoning In one implementation, this application employs an intelligent agent for multi-step reasoning and information integration, specifically including: Horizontal diffusion exploration: Continuously expand the scope of relevant documents during the search process to ensure comprehensive coverage; Vertical depth utilization: Further analyze the upper and lower layer dependencies in the found evidence chain; Map-Reduce Synthesis: In a large-scale evidence environment, evidence fragments are first processed in parallel (Map), and then globally integrated (Reduce) to generate a compact knowledge chain.

[0092] This method overcomes the problems of omissions and broken reasoning chains in multi-step reasoning in existing technologies, and improves the stability and completeness of complex tasks.

[0093] 8. Context-aware intelligent output In one implementation, the results obtained through the above steps are reorganized into a compact contextual intelligence output, which serves as input to a large language model. The output includes structured knowledge chains, task-specific summaries, and necessary atomic fragments.

[0094] This method ensures that the context input to a large language model is both accurate and efficient, improving the model's performance in complex information retrieval and reasoning tasks, and achieving higher reliability and scalability.

[0095] The methods described above abstract, explore, and synthesize raw information at the document level, transforming it into compact, structured, and task-specific knowledge input, thereby significantly improving the reliability, efficiency, and scalability of large language models in complex information retrieval and reasoning tasks.

[0096] For example, such as Figure 3 As shown in the figure, this application provides a document interaction processing method for large language models, as detailed below: It is divided into two stages: 1. Data Indexing with Gist Memory 2. Agentic Knowledge Discovery In the first stage, the system performs key point abstraction (gist memory) and hybrid indexing (dense + sparse) on the original documents, transforming unstructured data into structured knowledge units to ensure that both the global theme is preserved and local details are accurately located. In the second stage, the system gradually proposes information intents through intelligent agents, generates subqueries, obtains evidence and synthesizes it, and gradually builds a minimum and sufficient knowledge space, ultimately forming a compact task-specific context, which is suitable for direct consumption by large language models (LLM).

[0097] For example, : The original document that was input.

[0098] Document Gist memory is a key memory technique that represents the high-level themes and structural information of a document.

[0099] Document Dense semantic vector representation.

[0100] This indicates a user query.

[0101] This represents the relevance score between the query and the document.

[0102] Indicating in the reasoning steps The target sub-task at that time.

[0103] Indicates subquery The acquired atomic knowledge space.

[0104] Indicating in the reasoning steps The constructed subspace of knowledge.

[0105] It represents the final, complete knowledge space.

[0106] Indicating in the reasoning steps The inference operator being executed.

[0107] It represents a knowledge chain constructed from tasks, informational intents, and a chain of evidence.

[0108] This represents the final answer output by the large language model.

[0109] For example, during the data indexing phase, for the input document Generate key memory using a lightweight long context model. . Describe the document's overall theme, hierarchical structure, and organization without reserving details. For example: If For a collection of journal articles, This can include the journal title, research scope, and types of papers included, without having to list the paper titles individually. Then, Encoded as a dense vector And retain the original document at the same time. A sparse index. Optionally, the relevance of the subquery to the document is determined based on the following: in, Used to balance global semantic consistency with detailed matching; For subqueries The relevance score to document D; The similarity between the subquery q and the original document D is calculated using the dense semantic vector index. The sparse index similarity between subquery q and the original document D.

[0110] For example, in the knowledge discovery phase of an intelligent agent, for complex tasks... MDP constructs a complete knowledge space through the following process. Optionally, the target subtask is generated first. And identify current knowledge gaps. Then, Decomposed into a set of atomic subqueries: Each subquery corresponds to one retrieval, resulting in the atomic knowledge space. .all Aggregation forms subspace .when Enough to solve At that time, the system proceeds to the next target subtask. , construct in sequence Until a complete knowledge space is obtained: The method described above overcomes the shortcomings of traditional dense retrieval in lacking global semantics by using gist memory and hybrid indexing, achieving global awareness and local precision. Moreover, it avoids evidence omissions due to intent bias through diffuse exploration, solves the efficiency problem under large-scale retrieval through memory-guided parallel synthesis, and ensures the logical integrity and interpretability of complex tasks through task-aware knowledge chain construction.

[0111] The document interaction processing apparatus for large language models provided by the present invention will be described below. The document interaction processing apparatus for large language models described below can be referred to in correspondence with the document interaction processing method for large language models described above. The document interaction processing apparatus for large language models in the embodiments of this application is as follows: Figure 4 As shown, it includes: The generation module 410 is used to generate multiple target subtasks based on the target task input by the user; The first determining module 420 is used to determine multiple sub-queries corresponding to each target sub-task; The second determining module 430 is used to determine the sub-knowledge space corresponding to the target sub-task based on the pre-built hybrid index of the document and multiple sub-queries corresponding to the target sub-task; the hybrid index is constructed based on the dense semantic vector index and sparse keyword index of the document; the dense semantic vector is generated based on the key points memory of the document; The response module 440 is used to input multiple sub-knowledge spaces corresponding to multiple target sub-tasks into the large language model and generate response results corresponding to the target tasks.

[0112] Figure 5 A schematic diagram of the physical structure of an electronic device is provided. This electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540. The processor 510, communications interface 520, and memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a document interaction processing method for a large language model. This method includes: generating multiple target subtasks based on a target task input by the user; determining multiple subqueries corresponding to each target subtask; determining a sub-knowledge space corresponding to the target subtask based on a pre-built hybrid index of the document and the multiple subqueries corresponding to the target subtask; the hybrid index is constructed based on a dense semantic vector index and a sparse keyword index of the document; the dense semantic vector is generated based on the document's key point memory; and inputting the multiple sub-knowledge spaces corresponding to the multiple target subtasks into a large language model to generate a response result corresponding to the target task.

[0113] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0114] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the document interaction processing method for a large language model provided by the above methods. The method includes: generating multiple target sub-tasks based on the target task input by the user; determining multiple sub-queries corresponding to each target sub-task for each target sub-task; determining the sub-knowledge space corresponding to the target sub-task based on a pre-built hybrid index of the document and the multiple sub-queries corresponding to the target sub-task; the hybrid index is constructed based on the dense semantic vector index and sparse keyword index of the document; the dense semantic vector is generated based on the key points memory of the document; and inputting the multiple sub-knowledge spaces corresponding to the multiple target sub-tasks into a large language model to generate the response result corresponding to the target task.

[0115] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the document interaction processing method for a large language model provided by the methods described above. This method includes: generating multiple target sub-tasks based on a target task input by a user; determining multiple sub-queries corresponding to each target sub-task; determining a sub-knowledge space corresponding to the target sub-task based on a pre-built hybrid index of the document and the multiple sub-queries corresponding to the target sub-task; the hybrid index is constructed based on a dense semantic vector index and a sparse keyword index of the document; the dense semantic vector is generated based on the document's key point memory; and inputting the multiple sub-knowledge spaces corresponding to the multiple target sub-tasks into a large language model to generate a response result corresponding to the target task.

[0116] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0117] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A document interaction processing method for large language models, characterized in that, include: Based on the target task input by the user, generate multiple target subtasks; For each target subtask, determine multiple subqueries corresponding to the target subtask; Based on the pre-built hybrid index of the document and multiple sub-queries corresponding to the target sub-task, the sub-knowledge space corresponding to the target sub-task is determined; the hybrid index is constructed based on the dense semantic vector index and sparse keyword index of the document; the dense semantic vector is generated based on the key point memory of the document; the key point memory describes the global topic, hierarchical structure and organization method of the document; Input the multiple sub-knowledge spaces corresponding to the multiple target sub-tasks into the large language model to generate the response results corresponding to the target tasks; The step of determining the sub-knowledge space corresponding to the target sub-task based on the pre-built hybrid index of the document and multiple sub-queries corresponding to the target sub-task includes: Based on the pre-built hybrid index of the document, determine the atomic knowledge space corresponding to each subquery; Based on the atomic knowledge spaces corresponding to the multiple sub-queries, determine the sub-knowledge space corresponding to the target sub-task; The step of determining the sub-knowledge space corresponding to the target sub-task based on the atomic knowledge spaces corresponding to the multiple sub-queries includes: The atomic knowledge space is filtered based on the key points of the document to obtain the filtered atomic knowledge space. Evidence is extracted based on the filtered atomic knowledge space; The extracted evidence is integrated to obtain the sub-knowledge space.

2. The document interaction processing method for large language models according to claim 1, characterized in that, After determining the sub-knowledge space corresponding to the target sub-task based on the atomic knowledge spaces corresponding to the multiple sub-queries, the method further includes: If it is determined that the information required for the target sub-task is missing in the sub-knowledge space, a sub-query is generated based on the missing information. The atomic knowledge space corresponding to the subquery is added to the subknowledge space corresponding to the target subtask.

3. The document interaction processing method for large language models according to claim 1, characterized in that, The step of inputting multiple sub-knowledge spaces corresponding to the multiple target sub-tasks into a large language model to generate response results corresponding to the target tasks includes: Based on the logical association order between the multiple target sub-tasks corresponding to the target task, the multiple sub-knowledge spaces corresponding to the multiple target sub-tasks are organized into a knowledge chain; The knowledge chain is input into the large language model to generate the response result corresponding to the target task.

4. A document interaction processing device for large language models, used to implement the method as described in any one of claims 1-3, characterized in that, include: The generation module is used to generate multiple target subtasks based on the target task input by the user; The first determining module is used to determine multiple sub-queries corresponding to each target sub-task; The second determining module is used to determine the sub-knowledge space corresponding to the target sub-task based on the pre-built hybrid index of the document and multiple sub-queries corresponding to the target sub-task; the hybrid index is constructed based on the dense semantic vector index and sparse keyword index of the document; the dense semantic vector is generated based on the key point memory of the document; the key point memory describes the global topic, hierarchical structure and organization method of the document; The step of determining the sub-knowledge space corresponding to the target sub-task based on the pre-built hybrid index of the document and multiple sub-queries corresponding to the target sub-task includes: determining the atomic knowledge space corresponding to each sub-query based on the pre-built hybrid index of the document; determining the sub-knowledge space corresponding to the target sub-task based on the atomic knowledge spaces corresponding to the multiple sub-queries; the step of determining the sub-knowledge space corresponding to the target sub-task based on the atomic knowledge spaces corresponding to the multiple sub-queries includes: filtering the atomic knowledge space based on the key points of the document to obtain the filtered atomic knowledge space; extracting evidence based on the filtered atomic knowledge space; and integrating the extracted evidence to obtain the sub-knowledge space. The response module is used to input the multiple sub-knowledge spaces corresponding to the multiple target sub-tasks into the large language model and generate the response results corresponding to the target tasks.

5. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the document interaction processing method for large language models as described in any one of claims 1 to 3.

6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the document interaction processing method for large language models as described in any one of claims 1 to 3.

7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the document interaction processing method for large language models as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Policy question-answering system based on large language model, reverse index and embedded retrieval

    CN119128082A

  • Knowledge question-answering method, device and equipment based on fire-fighting equipment and storage medium

    CN120764679A