A report generation method, system, electronic device and storage medium

By introducing task decomposition and iterative search into a large language model, the cognitive process of human researchers is simulated to generate high-quality, structured reports. This solves the problems of knowledge cutoff, illusion, and structure in the generation of in-depth research reports in existing technologies, and achieves the authenticity and coherence of the reports.

CN120911622BActive Publication Date: 2025-12-26TIANJIN ANXIN DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511396324.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-28
Publication Date
2025-12-26
Estimated Expiration
2045-09-28

AI Technical Summary

Technical Problem

Existing technologies cannot generate high-quality, structured, and factually accurate in-depth research reports. They suffer from issues such as knowledge cutoffs, illusions, lack of structure, and limitations on context length, and cannot simulate the dynamic cognitive processes of human researchers.

Method used

By introducing task decomposition prompts into a large language model, the iterative search and deliberation cycle of human researchers is simulated, and multiple iterative analyses and external searches are conducted to generate high-quality, structured reports.

Benefits of technology

Ensure the authenticity and timeliness of the report content, provide a logical structure at the level of a professional analyst, avoid content illusions, and achieve the generation of high-quality, structured reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120911622B_ABST
    Figure CN120911622B_ABST
Patent Text Reader

Abstract

The application provides a report generation method, system, electronic equipment and storage medium, comprising: obtaining query information Q input by a user; calling a task decomposition prompt instruction to obtain a prompt word sequence P corresponding to Q; obtaining a sub-query sequence S=(S1, S2,..., S i ,..., S n ) corresponding to Q; performing iterative search analysis on S i to obtain a text output sequence A=(A1, A2,..., A i ,..., A n ); the iterative search analysis comprises performing at least one analysis and calling an external search tool to perform search according to an analysis result each time; A i is output obtained according to a current knowledge base after the last search is performed; and a report R=(R1, R2,..., R i ,..., R n ) is generated. The application can automatically generate a high-quality, structured and factually accurate multi-part report.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a report generation method and system, an electronic device, and a storage medium. BACKGROUND

[0002] Under the background of rapid development of information technology, the demand for analyzing, refining and forming structured reports from massive data is increasing. Traditional business intelligence (BI) and automated reporting tools, such as Tableau, Power BI, Alteryx, etc., have been widely used in the field of automated reporting. The core capability of these systems is to connect structured data sources (e.g., databases, application program interfaces (APIs), spreadsheets), aggregate and calculate the indicators therein, and present them in the form of visual dashboards or charts. However, these traditional tools have fundamental limitations. They are essentially non-generative, with functions limited to displaying pre-existing data, and are unable to synthesize narrative text from scratch, conduct qualitative analysis, or generate human-readable prose reports. These systems lack the ability of deep semantic understanding, reasoning, and natural language generation, and cannot meet the demand for in-depth analysis and writing of intelligence reports on complex topics. In recent years, the emergence of large language models (LLMs) has brought significant changes to the field of content generation. Although LLMs have great potential, their direct use in generating in-depth research reports faces a series of recognized technical challenges. First, the knowledge cut-off problem, LLMs' knowledge comes from their static training data sets, which means their internal knowledge will become outdated. For topics that require real-time and up-to-date information (such as geopolitics, market dynamics), this inherent flaw of LLMs makes it difficult for them to perform well. Second, the hallucination problem, LLMs may fabricate seemingly reasonable but actually completely false or meaningless information when generating content, which is a fatal flaw for analysis reports that require factual accuracy. Third, the lack of structure, without explicit and precise instructions, LLMs' output is often loose and unstructured text flow, lacking the logical hierarchy and rigorous structure required for professional reports. Fourth, the context length limitation, LLMs' ability to handle context length is limited, which makes it face great challenges in handling large amounts of reference materials or generating long and coherent documents, and it is easy to contradict or forget key information.

[0003] Despite the progress made by the prior art, there is still a significant technical gap. When a real human researcher is working, his process is not linear. He will first read a part of the material, then stop to assess his current knowledge reserve, judge whether the information is sufficient, and based on this, decide whether to continue to search for more information or start writing the current part. This continuous "review-decision" cycle is the key to high-quality research. Therefore, the current technical field urgently needs a new report generation method that not only can structurally decompose the report, but more importantly, can simulate the cognitive process of a human researcher for each part of the report, enter a dynamic, review cycle, in which reasoning, searching and knowledge absorption are carried out until the information is sufficient before writing, while ensuring that the factual accuracy of each part of the research results can be maintained when the report is finally integrated, and new LLM hallucinations are avoided in the integration stage. SUMMARY

[0004] In view of the above technical problems, the technical scheme adopted by the present application is:

[0005] A report generation method applied to a large language model, the method comprising the following steps:

[0006] Step S01: obtaining query information Q input by a user; the query information Q includes a topic of a report to be generated;

[0007] Step S02: calling a task decomposition prompt instruction to obtain a prompt word sequence P=(P1, P2, …, P i , …, P n ) corresponding to Q; wherein i=1, 2, …, n; P i is the i-th prompt word corresponding to Q; n is the number of chapters of the report to be generated; each prompt word corresponds to a chapter;

[0008] Step S03: obtaining a sub-query sequence S=(S1, S2, …, S i , …, S n ) corresponding to Q; wherein S i is the i-th sub-query corresponding to Q; S i =(Q, P i );

[0009] Step S04: iteratively searching and analyzing S i to obtain a text output sequence A=(A1, A2, …, A i , …, A n ); wherein A i is the i-th text output corresponding to S iThe corresponding text output is the content corresponding to the i-th chapter of the report to be generated; the iterative search analysis includes performing at least one analysis and calling an external search tool to perform a search based on the results of each analysis; the first analysis object is S. i Each subsequent analysis object is updated based on the search results obtained from the current execution; the first search object is determined based on the first analysis result, and each subsequent search object is updated based on the analysis results obtained from the current execution; each search result is written to the knowledge base; A i The output obtained based on the current knowledge base after the last search is performed;

[0010] Step S05: Generate report R = (R1, R2, ..., R i , ..., R n ); where R i =(P i A i ).

[0011] Further, step S04 includes:

[0012] For S i Perform iterative analysis to obtain S i The corresponding analysis sequence C i =(C i,1 C i,2 C i,j C i,t ); where j = 1, 2, ..., t; t is the number of iterations performed; C i,1 For S i Corresponding analysis results; C i,j For S i The analysis results obtained from analyzing the j-th search result;

[0013] For S i Perform an iterative search to obtain S i The corresponding search sequence H i =(H i,1 H i,2 H i,j H i,t ); where H i,j For S i The corresponding j-th search term; H i,j =C i,1 ∪C i,2 ∪…∪C i,j-1 ;

[0014] Call external search tools to search H i,j Perform a search to obtain S i The corresponding knowledge base K i =Ki,1 ∪K i,2 ∪…∪K i,j ∪…∪K i,t Among them, K i,j For S i The corresponding j-th search result;

[0015] Calculate K i The output of is obtained as A. i .

[0016] Further, t≤T; T is the preset maximum number of iterations; step S04 also includes: when according to C i,t Once it is determined that the current knowledge base meets the requirements for generating the report, the current iteration of search and analysis ends. At this point, t <T。

[0017] Furthermore, if according to C i,t If it is determined that the current knowledge base does not meet the requirements for generating the report, the current iterative search analysis continues until the current knowledge base meets the requirements for generating the report or the current number of iterative search analyses is T.

[0018] Furthermore, external search tools will be invoked to search for H. i,j K obtained from the search i,j Convert it to the specified format.

[0019] Furthermore, during the analysis performed in step S04, S i Corresponding to the think tag; when performing the search in step S04, S i Corresponding search tag; when A is obtained i S i The corresponding answer tag.

[0020] Furthermore, when the parser detects S i When the corresponding answer tag is used, the coordinator is informed to save A. i and terminate S i The corresponding iterative search analysis.

[0021] A report generation system applied to a large language model, the system comprising:

[0022] The query information acquisition module is used to acquire the query information Q input by the user; the query information Q includes the topic of the report to be generated.

[0023] The chapter retrieval module is used to invoke the task decomposition hint instruction and obtain the hint word sequence P = (P1, P2, ..., P) corresponding to Q. i , ..., P n ); where i = 1, 2, ..., n; P iThe i th prompt word corresponding to Q; n is a preset number of chapters of a report to be generated; each of the prompt words corresponds to one of the chapters;

[0024] A subquery acquisition module is configured to acquire a subquery sequence S=(S1, S2, …, S i , …, S n ) corresponding to Q; wherein S i is the i th subquery corresponding to Q; S i =(Q, P i );

[0025] An iterative search analysis module is configured to perform iterative search analysis on S i to obtain a text output sequence A=(A1, A2, …, A i , …, A n ); wherein A i is a text output corresponding to S i , i.e., content corresponding to the i th chapter of the report to be generated; the iterative search analysis includes performing at least one analysis and calling an external search tool to perform search according to a result of each analysis; an object of the first analysis is S i , and an object of each subsequent analysis is updated according to a search result obtained by a current execution; an object of the first search is determined according to a result of the first analysis, and an object of each subsequent search is updated according to an analysis result obtained by a current execution; each search result is written into a knowledge base; A i is an output obtained from the current knowledge base after performing the last search;

[0026] A report generation module is configured to generate a report R=(R1, R2, …, R i , …, R n ); wherein R i =(P i , A i ).

[0027] A non-transitory computer readable storage medium has at least one instruction or at least one program stored therein, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the foregoing method.

[0028] An electronic device includes a processor and the foregoing non-transitory computer readable storage medium.

[0029] The present application has at least the following beneficial effects:

[0030] The present application greatly reduces the dependence on outdated training data of LLM and effectively suppresses content hallucination by performing multiple, iterative, real-time information-based searches during the generation process of each chapter, ensuring the authenticity and timeliness of the report content. The initial task decomposition phase ensures that the final report has a professional analyst-level logical structure, and the subsequent deliberative research process is conducted within this preset framework, ensuring the focus of each part and the coherence of the overall report. The present application simulates the cognitive process of human researchers, performs a dynamic, deliberative cycle in which reasoning, searching, and knowledge absorption are performed, to automatically generate high-quality, structured, and factually accurate multi-part reports, solving the rigidity of the "planning-execution" mode of the agent model in the prior art and the unreliability of LLM in fact accuracy and final report integration. BRIEF DESCRIPTION OF DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0032] Figure 1 A report generation method flowchart is provided for the embodiments of the present application.

[0033] Figure 2 A report generation reasoning framework overview schematic diagram is provided for the embodiments of the present application.

[0034] Figure 3 A report generation system structure diagram is provided for the embodiments of the present application.

[0035] Figure 4 A report generation flowchart is provided for the embodiments of the present application. DETAILED DESCRIPTION

[0036] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0037] The present application provides a report generation method embodiment applied to a large language model, such as Figure 1 As shown in the figure, the method comprises the following steps:

[0038] Step S01: obtaining query information Q input by a user; the query information Q includes a topic of a report to be generated;

[0039] Step S02: calling a task decomposition prompt instruction to obtain a prompt word sequence P=(P1, P2, …, P i , …, P n ) corresponding to Q; wherein, i=1, 2, …, n; P i is the i-th prompt word corresponding to Q; n is the number of chapters of the report to be generated; each prompt word corresponds to a chapter; n is generally 6 to 8, which is obtained according to the analysis of the large language model task decomposition prompt instruction on Q;

[0040] Step S03: obtaining a sub-query sequence S=(S1, S2, …, S i , …, S n ) corresponding to Q; wherein, S i is the i-th sub-query corresponding to Q; S i =(Q, P i );

[0041] Step S04: performing iterative search analysis on S i to obtain a text output sequence A=(A1, A2, …, A i , …, A n ); wherein, A i is the text output corresponding to S i , that is, the content corresponding to the i-th chapter of the report to be generated; the iterative search analysis includes performing at least one analysis, and calling an external search tool to perform search according to the analysis result of each time; the first analysis object is S i , and the analysis object is updated according to the search result obtained by the current execution after each analysis; the first search object is determined according to the first analysis result, and the search object is updated according to the analysis result obtained by the current execution after each search; each search result is written into a knowledge base; A i is the output obtained from the current knowledge base after the last search is performed;

[0042] Step S05: generating a report R=(R1, R2, …, R i , …, R n ); wherein, R i =(P i , A i ).

[0043] Figure 1The embodiment comprises three parts, the first part is task decomposition and structure generation, including step S01 and step S02, the goal is to establish a macro and logical framework for the report to be generated. When the user submits a broad report topic, the traditional approach is to directly start searching for relevant information and return the output, but this is easy to cause the final generated content to be disorganized. This embodiment solves this problem through a preprocessing step, that is, using a large language model configured with a task decomposition prompt to generate an ordered set of report chapters. Specifically, first, the user's input query information is packaged in a specially designed prompt, and the LLM model is called. The instructions of this prompt do not require the LLM model to directly answer the question, but to divide the report topic into several core chapters that a standard report should contain, such as 5 to 8 chapters. For example, Q is "global climate change intelligence analysis", and the LLM model may return a string sequence (1. Background and historical evolution, 2. Analysis of main driving factors, 3. Current global impact and performance, 4. Main international policies and agreements, 5. Future trend prediction and scenario simulation, 6. Key actors and stakeholders). The prompt for generating chapter topics is as follows:

[0044] [INST] Please take "{query}" as the topic of an intelligence analysis report and propose 5-8 aspects or chapters that need in-depth research. Each aspect should be an important component of an intelligence analysis report, such as "background overview", "main participants", "current development status", "problems and challenges", "future trends", etc. Just list the title of each part (2-5 words) separated by commas. Please note!! No additional explanation or numbering is required. Please only propose 5-8, cannot propose more. For example: background overview, main participants, current development status, economic impact, international response, future trends. Please give your output: [ / INST]

[0045] The second part of the embodiment is an iterative search review cycle and research writing of the agent, including steps S03 and S04, which are specific embodiments of simulating the cognitive process of human researchers. In this part, the coordinator facilitates each chapter title generated in the first stage and independently performs an iterative search analysis for each chapter title. For each chapter title, first combine it with the main query to form a more specific sub-query, such as "Global Climate Change Intelligence Analysis: Analysis of Major Driving Factors", then initialize a new and independent dialogue history for the chapter title and generate dedicated iterative search analysis guidance instructions, the core of which is to require the LLM model to enter a review mode. This part simulates the cognitive process of human researchers and enters a dynamic and review cycle, in which reasoning, searching and knowledge absorption are carried out, which helps to generate high-quality and structured reports by combining each chapter title with the main query, and can maintain the factual accuracy of the research results of each part, avoiding the introduction of new LLM hallucinations in the integration stage.

[0046] The third part of the embodiment is the deterministic report integration, including step S05, which integrates all chapter corresponding text output to generate the final report. This process uses a deterministic code splicing method to combine each chapter corresponding text output in order and splice the subheadings of each part, ensuring that high-quality content modules that have passed fact checking can be assembled without loss, solving the key weakness of end-to-end LLM systems that may appear content degradation or distortion in the last link, and improving the reliability of the entire system and the stability of the output results.

[0047] Figure 1 The embodiment can automatically generate high-quality, structured and factually accurate multi-part reports, solving the rigidity of the "planning-execution" mode of the agent model in the prior art and the unreliability of the LLM model in the fact accuracy and final report integration stage.

[0048] Preferably, the step S04 comprises:

[0049] S i performing iterative analysis to obtain S i the corresponding analysis sequence C i = (C i,1 , C i,2 , …, C i,j , …, C i,t ); wherein j = 1, 2, …, t; t is the number of iterations performed; C i,1 is the analysis result corresponding to S i ; C i,j is the analysis result obtained by analyzing the jth search result corresponding to S i ;

[0050] S i iterative search to obtain S i corresponding search sequence H i = (H i,1 , H i,2 , …, H i,j , …, H i,t ); wherein H i,j is the jthsearch content corresponding to S i H i,j = C i,1 ∪ C i,2 ∪ … ∪ C i,j-1 ;

[0051] call an external search tool to search H i,j to obtain S i corresponding knowledge base K i = K i,1 ∪ K i,2 ∪ … ∪ K i,j ∪ … ∪ K i,t ; wherein K i,j is the jthsearch result corresponding to S i ;

[0052] calculate the output of K i to obtain A i .

[0053] Preferably, t≤T; T is a preset maximum number of iterations; the step S04 further comprises: when it is determined according to C i,t that the current knowledge base has met the demand of the report to be generated, ending the current iterative search analysis, at this time t

[0054] Preferably, if it is determined according to C i,t that the current knowledge base does not meet the demand of the report to be generated, continue to perform the current iterative search analysis until the current knowledge base meets the demand of the report to be generated or the number of currently performed iterative search analysis is T.

[0055] Preferably, K i,j obtained by searching H i,j using an external search tool is converted into a specified format.

[0056] Preferably, when performing analysis in step S04, S i corresponds to a think label; when performing search in step S04, S i corresponds to a search label; and when obtaining A i , S i corresponds to an answer label.

[0057] Preferably, when the parser detects Si When answer tag is met, tell coordinator to save A i , and terminate S i Corresponding iterative search analysis.

[0058] The above preferred solution gives a specific implementation of iterative search analysis, in which an analysis and a search based on the analysis result are performed in each iteration, the object of each analysis is the search result of the last iteration, and the result of each analysis is added to the search content of the current iteration. The search result of each iteration is added to the knowledge base, i.e. the knowledge base is dynamically updated. The writing content corresponding to the current chapter is obtained based on the final obtained knowledge base. Specific examples are as follows:

[0059] At initialization t = 0, S i The corresponding knowledge base K i is an empty set; after the start of the iterative search analysis, the LLM model is first required to output the reasoning thinking content, i.e. the analysis of the current task state and the planning of the next action, this part of content is wrapped in the think tag, for example, <think>To analyze the main drivers of climate change, I need to distinguish between natural and human factors. I should first search for information about greenhouse gases and their main sources.< / think> This part of content makes the LLM model enhance its reasoning ability, and makes the reasoning process transparent and traceable. Based on the above thinking, the LLM model autonomously decides the action to be taken next. If the LLM model considers that the current information is insufficient, it will output a search tag containing the keywords it considers to be searched, for example: <search>What are the main sources of greenhouse gases< / search> . The structured response parser will capture this tag and extract the query "What are the main sources of greenhouse gases?", and the coordinator will call the external search tool to execute this query immediately. The information returned by the search tool (for example, multiple web page summaries) will be formatted and wrapped in <information>The tag is appended to the chapter's dialogue history and the cycle enters the next iteration. In the next iteration, the context provided to the LLM model already contains the new information found in the previous round of search, and the LLM model will base its new round of thinking on the updated knowledge state, for example: <think>I now have information about carbon dioxide, methane, and nitrous oxide, which is good, but to provide a comprehensive perspective, I also need information about natural drivers, such as the solar activity cycle and volcanic eruptions.< / think> Subsequently, it will output another search instruction: <search>Natural drivers of climate change< / search> When the LLM model has gone through one or more rounds of "thinking-search" cycles and determines that the information it has mastered is comprehensive and deep enough to write a high-quality chapter (or when the number of cycles reaches the preset upper limit), it will choose to output the answer tag, which contains the final and complete text content for the chapter, for example: <answer>The main drivers of global climate change can be divided into two categories: human and natural factors, the most important human driver being the emission of greenhouse gases……[Here is the detailed paragraph text]……< / answer> Once the parser detects the answer tag, it marks the completion of the current chapter's research and writing work, and the coordinator saves the text content in the tag and terminates the cycle of the current chapter.

[0060] The "agent deliberation cycle" of the above preferred solution is fundamentally different from the prior art. It is not a linear "retrieve-and-generate" (RAG) process. Standard RAG is a one-time retrieval and then a one-time generation. The process of the present embodiment is dynamic and iterative. The LLM model plays the role of a decision-maker in each round, actively assessing the knowledge state and deciding the next action, which accurately replicates the nonlinear and cyclical cognitive workflow of human experts when conducting complex research. This cognitive model is translated into a specific, operational, and structured tag-mediated technical process.

[0061] The present embodiment provides a report generation reasoning framework overview diagram, as shown in Figure 2 .

[0062] Compared with the prior art, the present embodiment has the following significant advantages:

[0063] Improve factual accuracy: By conducting multiple, iterative, real-time information-based searches during the generation process of each chapter, the system greatly reduces the dependence on outdated training data for LLMs and effectively suppresses content hallucinations, ensuring the authenticity and timeliness of the report content. Enhance the structure and coherence of the report: The initial task decomposition phase ensures that the final report has a logical structure at the level of professional analysts, and the subsequent deliberative research process is conducted within this pre-set framework, ensuring the focus of each part and the coherence of the overall report. Automate the cognitive workflow: The core "deliberation cycle" of the invention not only automates the "writing" process, but more importantly, automates the core cognitive decision-making process of "determining whether the information is sufficient", which is a major breakthrough over simple RAG or rigid planning models, and is a non-obvious innovation. Ensure reliability and certainty: The deterministic code method is used in the final report integration stage to ensure that high-quality content modules that have been fact-checked can be assembled without loss, addressing the key weakness of end-to-end LLM systems that may degrade or distort content at the last link, improving the reliability of the entire system and the stability of the output results.

[0064] The embodiment of the present application provides a report generation system applied to a large language model, such as Figure 3 As shown in the figure, the system comprises:

[0065] The query information acquisition module 31 is configured to acquire the query information Q input by the user; the query information Q comprises a topic of a report to be generated;

[0066] The chapter acquisition module 32 is configured to call a task decomposition prompt instruction to acquire a prompt word sequence P=(P1, P2, …, P i , …, P n ) corresponding to Q; wherein i=1, 2, …, n; P i is the i-th prompt word corresponding to Q; n is the number of chapters of the report to be generated; each prompt word corresponds to a chapter; n is obtained according to the analysis of the task decomposition prompt instruction of the large language model on Q, and is generally 6 to 8;

[0067] The sub-query acquisition module 33 is configured to acquire a sub-query sequence S=(S1, S2, …, S i , …, S n ) corresponding to Q; wherein S i is the i-th sub-query corresponding to Q; S i =(Q, P i );

[0068] The iterative search analysis module 34 performs iterative search analysis on S i to obtain a text output sequence A=(A1, A2, …, A i , …, A n ); wherein, A i is S i ; the corresponding text output, i.e. the content corresponding to the i-th chapter of the report to be generated; the iterative search analysis comprises performing at least one analysis, and calling an external search tool to perform a search according to the result of each analysis; the object of the first analysis is S i , and the object of each subsequent analysis is updated according to the search result obtained in the current execution; the object of the first search is determined according to the result of the first analysis, and the object of each subsequent search is updated according to the analysis result obtained in the current execution; the result of each search is written into a knowledge base; A i is the output obtained from the current knowledge base after the last search is performed;

[0069] The report generation module 35 is configured to generate a report R = (R1, R2, …, R i , …, R n ); wherein, R i = (P i , A i ).

[0070] Preferably, the iterative search analysis module 34 is specifically configured to:

[0071] perform iterative analysis on S i to obtain an analysis sequence C i = (C i , C i,1 , …, C i,2 , …, C i,j ) corresponding to S i,t ; wherein, j = 1, 2, …, t; t is the specified number of iterations; C i,1 is the analysis result corresponding to S i ; C i,j is the analysis result obtained by analyzing the j-th search result corresponding to S i ;

[0072] perform iterative search on S i to obtain a search sequence H i = (H i , H i,1 , …, H i,2 , …, H i,j ) corresponding to S i,t ; wherein, H i,j is the j-th search content corresponding to S i ; H i,j = C i,1 ∪ C i,2 ∪ … ∪ C i,j-1 ;

[0073] call an external search tool to search H i,j performing search, obtaining S i corresponding knowledge base K i =K i,1 ∪K i,2 ∪…∪K i,j ∪…∪K i,t ; wherein, K i,j is S i corresponding jth search result;

[0074] calculating output of K i , obtaining A i .

[0075] Preferably, the t≤T; T is preset maximum iteration number; the step S04 further comprises: when it is determined according to C i,t that the current knowledge base has met the demand of the report to be generated, ending the current iteration search analysis, at this time t<T.

[0076] Preferably, if it is determined according to C i,t that the current knowledge base does not meet the demand of the report to be generated, continuing to execute the current iteration search analysis until the current knowledge base meets the demand of the report to be generated or the number of iteration search analysis currently executed is T.

[0077] Preferably, the iteration search analysis module 34 is further configured to: convert K i,j obtained by calling the external search tool to search H i,j into a specified format.

[0078] Preferably, when the iteration search analysis module 34 executes analysis, S i corresponds to think label; when the iteration search analysis module 34 executes search, S i corresponds to search label; when A i is obtained, S i corresponds to answer label.

[0079] Preferably, when the parser detects that S i corresponds to answer label, the iteration search analysis module 34 is further configured to: inform the coordinator to save A i , and terminate the iteration search analysis corresponding to S i .

[0080] Figure 3 The embodiment is a system embodiment corresponding to the method of the present application, and the specific technical process is similar to the foregoing method embodiment, so the description of the embodiment is relatively simple, and the corresponding parts are referred to the foregoing method embodiment. Figure 3 The embodiment is a system embodiment corresponding to the method of the present application, and the specific technical process is similar to the foregoing method embodiment, so the description of the embodiment is relatively simple, and the corresponding parts are referred to the foregoing method embodiment.

[0081] To further illustrate the present application, a report generation flowchart is provided as shown in Figure 4

[0082] Embodiments of the present application also provide a non-transitory computer readable storage medium, which can be arranged in an electronic device to save at least one instruction or at least one program segment related to a method in the method embodiments, and the at least one instruction or the at least one program segment is loaded and executed by the processor to implement the method provided by the above embodiments.

[0083] Embodiments of the present application also provide an electronic device, comprising a processor and the aforementioned non-transitory computer readable storage medium.

[0084] Embodiments of the present application also provide a computer program product comprising program code for causing an electronic device to perform the steps of the methods according to the various exemplary embodiments of the present application described above in the present specification when the program product is run on the electronic device.

[0085] Although some specific embodiments of the present application have been described in detail by way of examples, it should be understood that the examples are only for illustration and not intended to limit the scope of the present application. Those skilled in the art should understand that various modifications can be made to the embodiments without departing from the scope and spirit of the present application. The scope of the present application is defined by the appended claims.​< / information>

Claims

1. A report generation method applied to a large language model, characterized in that, The method comprises the following steps: Step S01: acquiring query information Q input by a user; the query information Q comprises a subject of a report to be generated; Step S02: Invoke the task decomposition prompt instruction to obtain the prompt word sequence P = (P1, P2, ..., P) corresponding to Q. i , ..., P n ); where i = 1, 2, ..., n; P i Let be the i-th prompt word corresponding to Q; n is the number of chapters in the report to be generated; each prompt word corresponds to one chapter. Step S03: Obtain the subquery sequence S = (S1, S2, ..., S...) corresponding to Q. i S n ); where S i S is the i-th subquery corresponding to Q; i = (Q, P) i ); Step S04: performing an iterative search analysis on S i to obtain a text output sequence A= (A1, A2, …, A i , …, A n ); wherein A i is the corresponding text output of S i ; for each chapter title, first combine it with the main query to form a more specific sub-query, then initialize a brand new, independent dialogue history for the chapter title, and generate exclusive iterative search analysis guidance instructions, the core of which is to require the LLM model to enter a deliberative mode of operation; the iterative search analysis includes performing at least one analysis, and calling an external search tool to perform a search according to the result of each analysis; the first analysis object is S i , and the analysis object is updated according to the search result obtained in the current execution after each analysis; the first search object is determined according to the result of the first analysis, and the search object is updated according to the analysis result obtained in the current execution after each search; each search result is written into a knowledge base; A i is the output obtained from the current knowledge base after performing the last search. Step S05: Generate report R = (R1, R2, ..., R i , ..., R n ); where R i =(P i A i ).

2. The method of claim 1, wherein, The step S04 comprises: S i Performing iterative analysis, obtaining S i The corresponding analysis sequence C i = (C i,1 , C i,2 , …, C i,j , …, C i,t ); Wherein, j = 1, 2, …, t; t is the number of iterations performed; C i,1 is the corresponding analysis result of S i ; C i,j is the analysis result obtained by analyzing the jth search result corresponding to S i ; S i Performing iterative search, obtaining S i The corresponding search sequence H i = (H i,1 , H i,2 , …, H i,j , …, H i,t ); wherein H i,j is the jth search content corresponding to S i H i,j =C i,1 ∪C i,2 ∪…∪C i,j-1 ; Call external search tool to H i,j perform search, obtain S i corresponding knowledge base K i =K i,1 ∪K i,2 ∪…∪K i,j ∪…∪K i,t ; wherein K i,j is the jthsearch result corresponding to S i ; Compute K i the output of A i .

3. The method of claim 2, wherein, The t≤T; T is a preset maximum iteration number; The step S04 further comprises: when according to C i,t determining that the current knowledge base has met the demand of the report to be generated, ending the current iterative search analysis, at this time t 4. The method of claim 3, wherein, If according to C i,t If it is determined that the current knowledge base does not satisfy the requirements of the report to be generated, the current iteration search analysis is continued to be executed until the current knowledge base satisfies the requirements of the report to be generated or the number of iteration search analyses currently executed is T.

5. The method of claim 4, wherein, The external search tool is called to search for H i,j K i,j converted into a prescribed format.

6. The method of claim 5, wherein, When performing the analysis in step S04, S i Corresponding to the think tag; when performing the search in step S04, S i Corresponding search tag; when A is obtained i S i The corresponding answer tag.

7. The method of claim 5, wherein, When the parser detects S i corresponding answer tag, the coordinator is informed to save A i , and terminates S i the corresponding iterative search analysis.

8. A report generation system applied to a large language model, characterized in that, The system comprises: A query information acquisition module, configured to acquire query information Q input by a user; the query information Q comprises a subject of a report to be generated; The chapter retrieval module is used to invoke the task decomposition hint instruction and obtain the hint word sequence P = (P1, P2, ..., P) corresponding to Q. i , ..., P n ); where i = 1, 2, ..., n; P i Let be the i-th prompt word corresponding to Q; n is the number of chapters in the report to be generated; each prompt word corresponds to one chapter. The subquery retrieval module is used to retrieve the subquery sequence S = (S1, S2, ..., S...) corresponding to Q. i S n ); where S i S is the i-th subquery corresponding to Q; i = (Q, P) i ); iterative search analysis module, to S i perform iterative search analysis to obtain a text output sequence A= (A1, A2, …, A i , …, A n ); wherein A i is the corresponding text output of S i For each chapter title, first combine it with the main query to form a more specific sub-query, then initialize a brand new, independent dialogue history for the chapter title, and generate exclusive iterative search analysis guidance instructions, the core of which is to require the LLM model to enter a deliberative mode of operation; the iterative search analysis includes performing at least one analysis, and calling an external search tool to perform a search according to the result of each analysis; the first analysis object is S i , and the analysis object is updated according to the search result obtained in the current execution after each analysis; the first search object is determined according to the result of the first analysis, and the search object is updated according to the analysis result obtained in the current execution after each search; each search result is written into a knowledge base; A i is the output obtained from the current knowledge base after the last search is performed; The report generation module is used to generate reports R = (R1, R2, ..., R...). i , ..., R n ); where R i =(P i A i ).

9. A non-transitory computer readable storage medium, the storage medium having stored therein at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement the method of any one of claims 1-5.

10. An electronic device, comprising: A system comprising a processor and the non-transitory computer readable storage medium of claim 9.

Citation Information

Patent Citations

  • Model design report generation method and device and storage medium

    CN117610534A

  • Method, device and equipment for automatically generating travel research report and storage medium

    CN119988566A