Method for supporting large file questions and answers in large language model
By converting long text files into feature vectors and utilizing chained prompt word templates, the accuracy and efficiency issues of large language models in processing large files are solved, achieving efficient question answering and multilingual translation capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN YUANSHIJIE SOFTWARE TECH CO LTD
- Filing Date
- 2023-05-21
- Publication Date
- 2026-04-24
AI Technical Summary
Large language models cannot effectively handle large files, resulting in low accuracy and efficiency in long text understanding and question answering.
Long text files are converted into feature vectors, chained prompt word templates are used to set the context, and similarity algorithms are used to calculate related text paragraphs. The prompt words are then recombined and input into a large language model for question answering.
It enables efficient and accurate question answering of large documents using a large language model, improving the efficiency of professional document content analysis, summarization, translation, and question answering, and possesses multilingual translation capabilities.
Smart Images

Figure CN121919299A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of large text search technology, specifically to a method for supporting large document question answering in a large language model. Background Technology
[0002] Large language models have length limitations on both input and output due to the fixed input and output dimensions of their neural network architectures (such as Transformers). Typically, the input length is limited to a few thousand words or tokens, while the output length is subject to even stricter constraints. Therefore, for inputs like large files, even when broken down into smaller chunks, language models may still experience issues with accuracy and efficiency, partly due to problems with integrating the processed segments and appropriately determining the relationships between them. Thus, current large language models do not yet adequately support the processing of large files. In practical applications, when a large model is required to understand a long text dialogue, it often proves unsuccessful. Summary of the Invention
[0003] The purpose of this invention is to address the shortcomings of existing technologies by providing a method for supporting large document question answering in a large language model, thereby solving the problems mentioned in the background art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a method for supporting large document question answering in a large language model, comprising the following steps:
[0005] Step 1: Output unsupported long text files into segments of feature vectors that can be stored in a vector storage system through methods such as file conversion, text segmentation, and feature vector extraction;
[0006] Step 2: By using the chained prompt word template technique, the context of the large language model is set to the chained prompt word template for this document, thus setting the answer environment and answer logic for subsequent user questions;
[0007] Step 3: When a user asks a question, the feature vector of the question needs to be extracted, and the most relevant text paragraphs for the question need to be calculated from the vector storage system using a similarity algorithm.
[0008] Step 4: Reassemble the text paragraphs into new cue words;
[0009] Step 5: Input the above prompts into the large language model. With the help of the chained context, the large language model will return the accurate answer to the question in the document.
[0010] It is important to note the following: S01 is specifically for document reading and text extraction. This module is mainly used for reading and extracting text from large user documents. It can employ OCR (Optical Character Recognition) or other software technologies capable of extracting text from documents, supporting formats such as PDF. S02 is specifically for text segmentation and feature vector conversion. This module is mainly used to input the text extracted from S01 into a large language model to obtain feature vectors. Due to the limitations of the large language model, the extraction system also needs to perform text analysis, and the vectorization should be completed by the feature vector calculation algorithm supported by the large language model. S03 is specifically for the text feature vector storage system. This module is mainly responsible for storing the feature vectors obtained from S02 into a vector database or other storage system. Vector storage can use a dedicated feature vector database or a traditional database, and an algorithm is developed to calculate vector similarity. S04 is specifically for the large language model targeting this... The document chain prompt setting module mainly sets the chain prompt template and execution steps for the large language model, and filters non-document question-and-answer. S05 specifically involves the system providing a user question interaction interface with a pre-set context after the above four steps, prompting the user to input content related to the document and interact with the context. S06 specifically involves the feature vector conversion of the content question. Similar to S02, the vectorization work should be completed by the feature vector calculation algorithm supported by the large language model. S07 specifically involves querying the feature vector similarity in the vector storage system. Using the data returned in S06, the system queries the same vector storage system as S03 to find the text paragraphs most similar to the question content. S08 specifically involves combining 1-2 similar text paragraphs returned in S07 into prompt words and providing them to the large language model. S09 specifically involves the large language model setting the response content based on the current prompt words and context and presenting it to the user.
[0011] As a preferred technical solution of the present invention, the vector production algorithm needs to be consistent with the text feature vector extraction algorithm during the questioning period.
[0012] As a preferred technical solution of the present invention, the vector storage system uses conventional database storage, and similarity calculation methods are used to complete the similarity calculation during the reading process, specifically algorithms such as cosine similarity algorithm and Euclidean distance.
[0013] As a preferred technical solution of the present invention, the setting of the chain prompt words can be localized, as long as the prompt words can achieve the purpose of limiting stable matching, paragraph querying and accurate answering.
[0014] Compared with existing technologies, this invention provides a method for supporting large document question answering in a large language model, which has the following beneficial effects:
[0015] This invention discloses a method for supporting large document question answering within a large language model. Utilizing the aforementioned software, it effectively combines the fast indexing and search capabilities of vector databases with the large language model. When a user needs the large language model to understand a long text document, the technology and solution employed in this patent can efficiently and quickly support accurate question answering for that document. Furthermore, during the question answering process, leveraging the capabilities of the large language model, it can also perform multilingual translation and other large language model functions. This significantly improves the efficiency of analyzing, summarizing, translating, and answering questions related to professional document content. Attached Figure Description
[0016] Figure 1 This is flowchart A, which illustrates the support for large file question answering methods in a large language model according to an embodiment of the present invention.
[0017] Figure 2 This is flowchart B, representing an embodiment of the present invention, showing how to support large file question answering methods in a large language model.
[0018] Figure 3 This is a schematic diagram A of the structure supporting large file question answering methods in a large language model in an embodiment of the present invention;
[0019] Figure 4 This is a schematic diagram (B) illustrating the structure of a large file question-answering method supported in a large language model according to an embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Please see Figure 1-4 In this implementation scheme: a method for supporting large document question answering in a large language model, comprising the following steps:
[0022] Step 1: Output unsupported long text files into segments of feature vectors that can be stored in a vector storage system through methods such as file conversion, text segmentation, and feature vector extraction;
[0023] Step 2: By using the chained prompt word template technique, the context of the large language model is set to the chained prompt word template for this document, thus setting the answer environment and answer logic for subsequent user questions;
[0024] Step 3: When a user asks a question, the feature vector of the question needs to be extracted, and the most relevant text paragraphs for the question need to be calculated from the vector storage system using a similarity algorithm.
[0025] Step 4: Reassemble the text paragraphs into new cue words;
[0026] Step 5: Input the above prompts into the large language model. With the help of the chained context, the large language model will return the accurate answer to the question in the document.
[0027] It is important to note the following: S01 is specifically for document reading and text extraction. This module is mainly used for reading and extracting text from large user documents. It can employ OCR (Optical Character Recognition) or other software technologies capable of extracting text from documents, supporting formats such as PDF. S02 is specifically for text segmentation and feature vector conversion. This module is mainly used to input the text extracted from S01 into a large language model to obtain feature vectors. Due to the limitations of the large language model, the extraction system also needs to perform text analysis, and the vectorization should be completed by the feature vector calculation algorithm supported by the large language model. S03 is specifically for the text feature vector storage system. This module is mainly responsible for storing the feature vectors obtained from S02 into a vector database or other storage system. Vector storage can use a dedicated feature vector database or a traditional database, and an algorithm is developed to calculate vector similarity. S04 is specifically for the large language model targeting this... The document chain prompt setting module mainly sets the chain prompt template and execution steps for the large language model, and filters non-document question-and-answer. S05 specifically involves the system providing a user question interaction interface with a pre-set context after the above four steps, prompting the user to input content related to the document and interact with the context. S06 specifically involves the feature vector conversion of the content question. Similar to S02, the vectorization work should be completed by the feature vector calculation algorithm supported by the large language model. S07 specifically involves querying the feature vector similarity in the vector storage system. Using the data returned in S06, the system queries the same vector storage system as S03 to find the text paragraphs most similar to the question content. S08 specifically involves combining 1-2 similar text paragraphs returned in S07 into prompt words and providing them to the large language model. S09 specifically involves the large language model setting the response content based on the current prompt words and context and presenting it to the user.
[0028] In this embodiment, the vector production algorithm needs to be consistent with the text feature vector extraction algorithm during the questioning period; the vector storage system uses conventional database storage, and similarity calculation methods are used to complete the similarity calculation during the reading process, specifically algorithms such as cosine similarity algorithm and Euclidean distance; the setting of chain prompt words can be partial, as long as the prompt words can achieve the purpose of limited stable matching, paragraph query and accurate answer.
[0029] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for supporting large document question answering in a large language model, characterized in that: Includes the following steps: Step 1: Output unsupported long text files into segments of feature vectors that can be stored in a vector storage system through methods such as file conversion, text segmentation, and feature vector extraction; Step 2: By using the chained prompt word template technique, the context of the large language model is set to the chained prompt word template for this document, thus setting the answer environment and answer logic for subsequent user questions; Step 3: When a user asks a question, the feature vector of the question needs to be extracted, and the most relevant text paragraphs for the question need to be calculated from the vector storage system using a similarity algorithm. Step 4: Reassemble the text paragraphs into new cue words; Step 5: Input the above prompts into the large language model. With the help of the chained context, the large language model will return the accurate answer to the question in the document.
2. The method for supporting large document question answering in a large language model according to claim 1, characterized in that: S01 specifically refers to document reading and text extraction. This module is mainly used for reading and extracting text from large user documents. Specifically, it can employ OCR (Optical Character Recognition) or other software technologies capable of extracting text from documents. Supported formats include PDF. S02 specifically refers to text segmentation and feature vector conversion. This module is mainly used to input the text extracted from S01 into a large language model to obtain feature vectors. Due to the limitations of the large language model, the extraction system also needs to perform text analysis. The vectorization work should be completed by the feature vector calculation algorithm supported by the large language model. S03 specifically refers to a text feature vector storage system. This module is mainly responsible for storing the feature vectors obtained from S02 into a vector database or other storage system. The stored vectors can be from a dedicated feature vector database or a traditional database, and an algorithm is developed to calculate vector similarity. S04 specifically refers to the large language model's processing of the document... The chain prompt word setting module mainly sets the chain prompt word template and execution steps for the large language model, and filters non-document question-and-answer. S05 specifically involves the system providing a user question interaction interface with a pre-set context after the above four steps, prompting the user to input content related to the document and interact with the context. S06 specifically involves the feature vector conversion of the content question. Similar to S02, the vectorization work should be completed by the feature vector calculation algorithm supported by the large language model. S07 specifically involves querying the feature vector similarity in the vector storage system. Using the data returned in S06, the system queries the same vector storage system as S03 to find the text paragraphs most similar to the question content. S08 specifically involves combining 1-2 similar text paragraphs returned in S07 into prompt words and providing them to the large language model. S09 specifically involves the large language model setting the response content based on the current prompt words and context and presenting it to the user.
3. The method for supporting large document question answering in a large language model according to claim 1, characterized in that: In step one, the vector generation algorithm needs to be consistent with the text feature vector extraction algorithm during the questioning period.
4. The method for supporting large document question answering in a large language model according to claim 1, characterized in that: In step three, the vector storage system uses a conventional database for storage, and similarity calculation is performed during the reading process. Specifically, similarity calculation can be performed using algorithms such as cosine similarity algorithm or Euclidean distance.
5. The method for supporting large document question answering in a large language model according to claim 1, characterized in that: In step four, the setting of the chain prompt words can be localized, as long as the prompt words can achieve the purpose of limiting stable matching, paragraph querying, and accurate response.