Information generation method and computer program product

By employing a dual-stream large language model generation method, which separates the main generation stream and the tool execution stream, the problems of excessively long context and resource consumption when generating data analysis reports using large language models are solved, thereby improving the readability and accuracy of the analysis information.

CN121543553APending Publication Date: 2026-02-17BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511735796.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

When generating data analysis reports, existing large language models tend to generate excessively long contextual information, leading to high resource consumption and making the reports difficult for users to read, as the report length increases and the number of tool calls increases.

Method used

A dual-stream information generation method is adopted, which separates the main generation stream and the tool execution stream, uses marker information to switch the process, realizes tool invocation, reduces resource consumption, and retains only analysis information in the main generation stream to avoid tool execution traces.

Benefits of technology

It reduces resource consumption, improves the readability and accuracy of analytical information, ensures convenient viewing for users, and enhances the accuracy and efficiency of multi-step tool reasoning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121543553A_ABST
    Figure CN121543553A_ABST
Patent Text Reader

Abstract

The invention provides an information generation method and a computer program product, and relates to the technical field of computers.The method comprises the steps that input information of a large language model is obtained, autoregression text generation is conducted on the input information through a main generation stream, and first analysis information is output; determining that a tool needs to be called, generating mark information for calling the tool in the main generation stream, and triggering to switch the main generation stream to a tool execution stream based on the mark information; acquiring context information of the main generation stream, performing at least one tool call on the context information and the mark information based on the tool execution stream, and determining second analysis information of the mark information; and returning the second analysis information to the main generation stream, continuously obtaining the first analysis information based on the main generation stream and / or obtaining the second analysis information based on the tool execution stream from the position of the mark information, and generating an analysis result of the input information according to the first analysis information and the second analysis information. The present disclosure can shorten context information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to an information generation method and a computer program product. Background Technology

[0002] In data analysis and other application scenarios, the input and output content is data-intensive. During the process of generating analysis reports, a large language model is needed to understand and accurately generate a large number of numerical indicators. Some of these indicators are often not provided directly in the input but need to be calculated.

[0003] From the perspective of the context of large language models, current large language models generally use a single-stream mode for tool calls during the generation process. Each generation corresponds to one set of context information, which includes three parts: the main text generated by the large language model, the large language model's request to call the tool, and the result returned by the tool.

[0004] As report length increases and tool calls become more frequent, the context information from a single large language model can easily become excessively long, making it difficult for users to view. Excessively long context information also exceeds the processing capacity of the large language model and consumes significant resources. Summary of the Invention

[0005] The purpose of this disclosure is to provide an information generation method and a computer program product, thereby overcoming, at least to some extent, the problem of excessively long context information caused by the limitations and defects of related technologies.

[0006] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part by practice of this disclosure.

[0007] According to one aspect of this disclosure, an information generation method is provided, comprising: Obtain the input information of the large language model, perform autoregressive text generation on the input information through the main generation stream of the large language model, and output the first analysis information; When the large language model determines that a tool needs to be invoked, marker information for invoking the tool is generated in the main generation stream, and the main generation stream is switched to the tool execution stream based on the marker information. Obtain the context information of the main generation stream, and perform at least one tool call on the context information and the tagging information based on the tool execution stream to determine the second analysis information of the tagging information; The second analysis information is returned to the main generation stream. The first analysis information is obtained from the location of the marked information based on the main generation stream and / or the second analysis information is obtained based on the tool execution stream. The analysis result of the input information is generated based on the first analysis information and the second analysis information.

[0008] In one exemplary embodiment of this disclosure, when the large language model determines that a tool needs to be invoked, generating tagging information for invoking the tool in the main generation stream includes: The large language model determines the text information in the input information that needs to be analyzed by the model as the target type, or the large language model determines the step that requires calling a tool, and determines that a tool needs to be called. The tagging information is generated after the first analysis information. The tagging information is used to switch the main generation stream to the tool execution stream for tool invocation.

[0009] In one exemplary embodiment of this disclosure, the step of performing at least one tool call based on the tool execution flow to infer the context information and the tagging information to determine the second analysis information of the tagging information includes: The context information and the tagging information are input into the tool execution flow to determine the current analysis information; Based on the tool execution flow, the tagging information and the current analysis information of the tool execution flow are input into the large language model for inference, and the inference result is output. If the reasoning result is determined to meet the preset conditions, the current analysis information is used as the second analysis information.

[0010] In one exemplary embodiment of this disclosure, the tagging information includes a tool name and tool processing requirements; the step of inputting the context information and the tagging information into the tool execution flow to determine the current analysis information includes: The context information and the tagging information are input into the tool execution flow, the tool corresponding to the tool name in the tagging information is called, and the large language model is controlled to generate current analysis information that conforms to the context information based on the tool processing requirements of the tool.

[0011] In one exemplary embodiment of this disclosure, the method further includes: If the reasoning result does not meet the preset conditions, the tagging information for calling the tool is generated again; Based on the tool execution flow, the context information and the tagging information are input into the large language model to determine the next analysis information; The next analysis information and the tagging information are input into the large language model for reasoning, and the reasoning result is output until the reasoning result determined by the next analysis information meets the preset conditions. The next analysis information that meets the preset conditions is used as the second analysis information.

[0012] In one exemplary embodiment of this disclosure, returning the second analysis information to the main generation stream includes: The marker information is deleted, and the second analysis information is displayed at the location where the marker information was.

[0013] In one exemplary embodiment of this disclosure, the method further includes: Record the starting point, calling process, and second analysis information of the tool execution flow, and display the tool execution flow as an index.

[0014] In one exemplary embodiment of this disclosure, the method further includes: In response to a click on the index, the system locates the display area of ​​the tool execution flow and presents the invocation process of the tool execution flow and the second analysis information of the tool execution flow in the display area.

[0015] In one exemplary embodiment of this disclosure, the tagging information includes a dynamically generated reference identifier; returning the second analysis information to the main generation stream includes: The reference identifier is embedded at the location of the marked information, and the second analysis information is displayed in association with the reference identifier.

[0016] According to one aspect of this disclosure, a computer program product is provided, which, when executed by a processor, implements the information generation method described in any of the preceding claims.

[0017] In the technical solution provided by this disclosure, on the one hand, when it is determined that a tool needs to be invoked, the main generation stream is switched to the tool execution stream by activating the marker information in the main generation stream. The tool invocation is then implemented through the tool execution stream, preventing tool execution details from occupying the context window space of the main generation stream, thus reducing resource consumption. On the other hand, the main generation stream only contains the first analysis information and the second analysis information, and the analysis information does not contain tool execution traces or the tool execution process, resulting in more readable analysis results that are easier for users to view. Furthermore, multi-step tool reasoning is implemented without context constraints. Since the context information in the main generation stream is reduced, it does not exceed the processing capacity of the large language model, thus improving the accuracy and precision of the generated analysis information.

[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0020] Figure 1 This illustration shows a schematic diagram of the specific process of generating a company's financial information using a large language model in an embodiment of this disclosure.

[0021] Figure 2 The schematic diagram illustrates a flowchart of an information generation method according to an embodiment of the present disclosure.

[0022] Figure 3 The schematic diagram illustrates the display interface of the main generation stream in an embodiment of this disclosure.

[0023] Figure 4 This illustration shows a flowchart of the tool execution flow for tool invocation in an embodiment of the present disclosure.

[0024] Figure 5 The schematic diagram illustrates the process of generating analysis results according to an embodiment of this disclosure.

[0025] Figure 6 The diagram illustrates the main generation flow and tool execution flow of an embodiment of this disclosure. Detailed Implementation

[0026] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0027] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0028] A major difference between data analysis report generation scenarios and common large language model application scenarios is that both the input and output content are data-intensive. For example, in the process of generating analysis reports, large language models need to understand and accurately generate a large number of numerical indicators, some of which are often not provided directly in the input but need to be calculated.

[0029] In related technologies, from the perspective of the context of large language models, the current large language models generally use a "single-stream" mode for tool calls during the generation process. Each generation corresponds to one context, which includes three parts: the main text generated by the large language model, the large language model's request to call the tool, and the result returned by the tool.

[0030] For example, the data analysis report generation scenario involves analyzing Company A's financial situation for 2022-2023. When analyzing Company A's financial situation for 2022-2023, two key indicators need to be considered: year-on-year growth rate and profit margin. The specific process of generating Company A's financial situation for 2022-2023 using a large language model can be as follows: Figure 1 As shown in the diagram. Specifically, the process of generating a report using a large language model includes a tool request section 101, a tool return section 102, and the remaining part is the large language model text generation section.

[0031] The above method is simple and direct. However, as the report length increases and the number of tool calls becomes extremely high, the context of a single large language model can easily become excessively long, exceeding the processing capacity of the large language model and consuming significant resources. Excessively long contexts also lead to cluttered display, making them difficult for users to read.

[0032] In order to solve the technical problems existing in the related technologies, this disclosure provides an information generation method that can be applied to the scenario of generating data analysis reports.

[0033] Based on this Figure 2 The flowchart illustrating the information generation method is shown in the image. (Reference) Figure 2 As shown, the main steps include: Step S210: Obtain the input information of the large language model, perform autoregressive text generation on the input information through the main generation stream of the large language model, and output the first analysis information.

[0034] In this embodiment of the disclosure, the input information can be any type of information used to generate the report. The input information can be text information in any language, or it can be image information and text information.

[0035] A large language model can include a main generation flow and a tool execution flow. The main generation flow is the primary path for generating the content output to the user, mainly used to generate the content displayed to the user. The tool execution flow refers to the temporary computational branch that handles tool calls. The tool execution flow is mainly used to implement tool calls and does not make the context of the main generation flow cluttered or excessively long.

[0036] In this embodiment of the disclosure, the main generation stream in the large language model can perform autoregressive text generation on the input information, generating first analysis information corresponding to the input information. The first analysis information is the analysis result generated for the portion of the input information that does not require the invocation of tools. Autoregressive text generation refers to word-by-word prediction and autoregressive iterative processing.

[0037] For example, in the large language model, the input information is first segmented and encoded, converting the text into numerical codes. Then, the numerical codes are converted into high-dimensional vectors, i.e., embedding vectors, via an embedding layer. In the encoder, three matrices—query, key, and value—are calculated from the embedding vectors. A multi-head attention mechanism is used, employing matrix dot product, scaling, and softmax operations to derive the attention weight matrix. This weighted summation and multi-head parallel computation generate the multi-head attention output. Further, the multi-head attention output is processed through a feedforward neural network, incorporating residual connections and layer normalization, to extract features. Finally, the decoder iteratively decodes the extracted features to generate an output token that matches the first character in the input information. This output token is then concatenated with the numerical code of the input information, serving as new input to the large language model to generate another output token. This process is repeated, and when a tool needs to be invoked from the output token, the concatenated output token serves as the first analysis information. This first analysis information can be a part of the generated analysis results.

[0038] Step S220: If the large language model determines that a tool needs to be invoked, generate marker information for invoking the tool in the main generation stream, and trigger the switching of the main generation stream to the tool execution stream based on the marker information.

[0039] In this embodiment of the disclosure, during the generation of the first analysis information by the main generation stream, the large language model can detect whether a tool needs to be invoked. For example, the large language model can detect whether the analysis intent of the text information in the input information that needs model analysis is a target type. If the analysis intent of the text information in the input information that needs model analysis is a target type, the large language model can determine that a tool needs to be invoked. If the analysis intent of the text information in the input information that needs model analysis is not a target type, the large language model can determine that a tool does not need to be invoked. The target type can be numerical calculation, table search, etc.

[0040] In addition, large language models can pre-plan the steps for obtaining the analysis results of input information and determine whether each step requires calling a tool based on the functions supported by the large language model itself. When it is determined that a step requires calling a tool, it can be considered that a tool call is necessary. For example, if it is determined that the third step requires calling a tool, then when the third step is executed, it can be determined that a tool call is needed.

[0041] When the large language model determines that a tool needs to be invoked, marker information can be generated in the main generation stream. This marker information is used to trigger the tool invocation. The location of the marker information can be defined as the tool invocation point in the main generation stream, which refers to the pause point where the generation of the first analysis information is suspended. At the tool invocation point indicated by the marker information, the generation of the first analysis information through the main generation stream stops, and the tool execution stream is triggered to generate the second analysis information. The invoked tool can be a tool not included in the large language model, which can assist the large language model in generating complete analysis information. The type of invoked tool can be a calculator, search tool, conversion tool, etc. Optionally, when it is determined that a tool needs to be invoked, the generated marker information can be displayed after the first analysis information generated in the main generation stream, for example, the marker information can be concatenated and displayed after the first analysis information. By generating and displaying marker information in the main generation stream, the main generation stream can be switched to the tool execution stream, thereby invoking the tool in the tool execution stream. The marker information in the main generation stream can be represented as follows:<tool_call> The tagging information may include the tool name and the tool processing requirements corresponding to that tool. The tool name indicates the type of tool being invoked, and is determined based on the context information in the main generation stream. For example, the tool name could be "calculator," "web_search," etc. The tool processing requirements refer to the processing rules or specifications of the tool. For example, when the tool is a calculator, the tool processing requirements could be calculation formulas; when the tool is a search tool, the tool processing requirements could be search requirements and search scope, etc., specifically determined based on the generation task and context information.

[0042] It should be noted that for the main generation stream, the tool can be called multiple times, and the generated tagging information can be the same each time the tool is called; for example, they can all be represented as...<tool_call> However, the tool name and tool processing requirements included in the generated tagging information can be the same or different each time, depending on the actual needs. Furthermore, since the tool can be invoked multiple times, for each tool invocation, the process from the starting point to the first tool invocation point is the first main generation flow obtaining the first analysis information. After activating the tool execution flow based on the tagging information, this can be considered the first process of obtaining the second analysis information through the tool execution flow. The process from the first tool invocation point to the second tool invocation point after obtaining the second analysis information is the second main generation flow obtaining the first analysis information. Here, we will first explain the processes of obtaining the first and second analysis information.

[0043] For example, when the tool name is "calculator", the tool processing requirement of this tool can be "(100-84) / 84". 100". When the tool name is "web_search", the tool processing requirement can be "XXX Company's 2022-2023 XX Report".

[0044] In some embodiments, to save resource space, only tagging information is displayed in the main generated stream.<tool_call> Instead of displaying the tool name included in the tag information and the tool processing requirements corresponding to that tool name, the tag information is not displayed.

[0045] Figure 3 The diagram illustrates the display interface of the main generation stream. (See reference...) Figure 3 As shown, the main stream can display the following: "We need to analyze the company's profit margin. The company reports an annual profit of 15.2 million, and based on total revenue of 100 million, the profit margin is..."<tool_call> "15.2%". This includes first analysis information 301, tagging information 302, and second analysis information 303. First analysis information 301 refers to the response information generated by the main generation stream itself based on the input information; tagging information 302 refers to...<tool_call> The second analysis information is calculated by calling the tool based on the tool execution flow. For example, the second analysis information can be 15.2%.

[0046] Step S230: Obtain the context information of the main generation stream, and perform at least one tool call on the context information and the tag information based on the tool execution stream to determine the second analysis information of the tag information.

[0047] In this embodiment of the disclosure, after extracting the context information of the main generation stream and generating marker information to trigger the main generation stream to switch to the tool execution stream, the context information of the main generation stream can be transmitted to the tool execution stream so that the main generation stream and the tool execution stream share the same context information until the tool invocation point.

[0048] After receiving the context information, the tool execution flow can perform at least one tool invocation on the context information and tagging information of the transmitted main generation flow to perform inference and determine the second analysis information of the tagging information. The number of tool invocations can be determined based on whether the inference result meets preset conditions. During the inference process of the tool execution flow, the local context information of the tool invocation point can be relied upon to reduce the context length.

[0049] Figure 4 The diagram illustrates a flowchart of the tool execution flow for tool invocation. (See reference) Figure 4 As shown, the main steps include: Step S410: Input the context information and tagging information into the tool execution flow to determine the current analysis information; Step S420: Based on the tool execution flow, the tagging information and the current analysis information of the tool execution flow are input into the large language model for inference, and the inference result is output. Step S430: Determine that the reasoning result meets the preset conditions, and use the current analysis information as the second analysis information.

[0050] In this embodiment, the tool execution flow determines the tool to be invoked based on the tool name in the tagging information, and controls the large language model to invoke the tool according to the tool processing requirements in the tagging information, generating current analysis information that conforms to the context information. Current analysis information refers to the response information generated by this tool invocation, i.e., the intermediate result. For example, it could be the analysis information generated by the first invocation, or the analysis information generated by the second invocation, etc. Here, we take the analysis information generated by the first invocation as an example for explanation.

[0051] Furthermore, the current analysis information and contextual information can be concatenated, and the concatenated information can be input into a large language model for inference. The inference result is then output to evaluate whether the current analysis information meets preset conditions. The preset conditions can be reaching an accuracy threshold or detecting a task completion flag.

[0052] For example, the concatenated information consisting of the labeled information and the current analysis information can be segmented and encoded to convert the text into numerical codes. Subsequently, the numerical codes are converted into embedding vectors through an embedding layer. The encoder calculates three matrices—query, key, and value—on the embedding vectors. Using a multi-head attention mechanism, an attention weight matrix is ​​derived through matrix dot product, scaling, and softmax operations. This weighted summation and multi-head parallel computation generate a multi-head attention output. Further, the multi-head attention output is processed through a feedforward neural network, combined with residual connections and layer normalization, to extract features. Finally, the decoder iteratively decodes the extracted features to generate an inference result. Based on this, the inference result is matched with context information to evaluate whether it meets preset conditions. For example, the inference result and context information can be matched from multiple dimensions to obtain a matching score. When the matching score is greater than a score threshold, the inference result is considered to meet the preset conditions. These multiple dimensions can include at least two of relevance, usability, accuracy, security, completeness, and descriptive granularity. A score can be determined for each dimension, and the scores for each dimension can be weighted and summed to obtain a matching score. This matching score can then be used to determine whether the inference result meets the preset conditions. The granularity of the description can be determined based on contextual information.

[0053] Once the reasoning result is determined to meet the preset conditions, the current analysis information can be considered to meet the preset conditions. Based on this, there is no need to further call the tool; the current analysis information can be directly used as the second analysis information obtained by calling the tool in the tool execution flow.

[0054] In other embodiments, if the inference result does not meet preset conditions, the marker information for invoking the tool is regenerated. Specifically, the marker information for invoking the tool can be regenerated in the tool execution flow. The regenerated marker information for invoking the tool can be the same as the previously generated marker information. When the regenerated marker information for invoking the tool is the same as the marker information corresponding to the current analysis information, the next analysis information determined based on the regenerated marker information can be different from the current analysis information.

[0055] For example, the tool execution flow can input context information and regenerated tagging information into a large language model to determine the next analysis information. The tool execution flow determines the tool to be invoked based on the tool name in the tagging information, and controls the invoked tool to encode and decode the context information according to the tool processing requirements in the tagging information, thereby realizing the tool invocation and generating the next analysis information that conforms to the context information. The next analysis information refers to the analysis information regenerated based on the regenerated tagging information when the current analysis information does not meet preset conditions.

[0056] Furthermore, the next analysis information and the tagging information can be input into the large language model for reasoning, and the reasoning result can be output until the reasoning result corresponding to the next analysis information meets the preset conditions. The next analysis information that meets the preset conditions is then used as the second analysis information. For example, the next analysis information and the tagging information can be concatenated, and the concatenated information can be input into the large language model for reasoning, and the reasoning result can be output to evaluate whether the next analysis information meets the preset conditions. When the next analysis information meets the preset conditions, it can be used as the tool execution flow to call the second analysis information generated by the tool. When the next analysis information does not meet the preset conditions, tagging information can be generated again for calling the tool. The process of inputting context information and tagging information into the large language model based on the tool execution flow to determine the next analysis information is executed cyclically until the generated next analysis information meets the preset conditions. The next analysis information that meets the preset conditions is then used as the second analysis information generated by the tool execution flow, i.e., the last generated information is used as the second analysis information. The second analysis information refers to the result generated by calling the tool, such as a calculated value or a searched table, etc.

[0057] It should be noted that in this embodiment, the starting point of the tool execution flow can be recorded, and the execution process of the tool execution flow and the second analysis information obtained can also be recorded. On this basis, the tool execution flow can also be displayed as an index through the referencing system. In response to the click operation on the index, the display area of ​​the referenced tool execution flow can be located, and the calling process of the tool execution flow and the second analysis information obtained during the calling process can be presented in the display area. Specifically, the second analysis information can be displayed in the main generation flow, and the index can be displayed at the preset position of the second analysis information. The index is used to trigger the jump to the tool execution flow corresponding to the second analysis information, so as to realize quick and convenient viewing of the tool execution flow. The preset position can be, for example, the left or right side of the second analysis information. For example, the second analysis information obtained through the tool execution flow can be displayed as 16%[1]. 16% refers to the second analysis information obtained according to the tool execution flow,[1] which is used to index the corresponding tool execution flow. By referencing the tool execution flow, the traceability of the tool call can be realized.

[0058] Step S240: Return the second analysis information to the main generation stream, continue to obtain the first analysis information based on the main generation stream and / or obtain the second analysis information based on the tool execution stream from the location of the marked information, and generate the analysis result of the input information according to the first analysis information and the second analysis information.

[0059] In this embodiment of the disclosure, after the tool execution flow calls the tool to obtain the second analysis information based on the marker information, it can return the second analysis information to the main generation flow. For example, the marker information in the main generation flow can be deleted, and the second analysis information can be filled into the position where the marker information was located, thus concatenating the second analysis information into the first analysis information. Specifically, the marker information may include dynamically generated reference identifiers. Based on this, dynamically generated reference identifiers can be embedded at the position of the marker information, and the second analysis information can be displayed in association with the reference identifiers. Specifically, a mapping relationship between the second analysis information and the reference identifiers can be generated, and the second analysis information can be displayed in association with the reference identifiers according to the mapping relationship. The reference identifiers can correspond one-to-one with the second analysis information.

[0060] It should be noted that after the tool execution flow obtains the second analysis information and displays it at the location of the marked information, the main generation flow can continue to obtain the first analysis information from the location of the marked information based on the input information and context information. That is, it continues to generate the first analysis information through the main generation flow from the pause point. During the continued generation of the first analysis information, if the large language model determines that a tool needs to be called, it generates and displays the marked information for calling the tool in the main generation flow. Based on the marked information, it triggers a switch from the main generation flow to the tool execution flow again, calls the tool through the tool execution flow to obtain the second analysis information, and displays the second analysis information at the location of the marked information. The steps of obtaining the first analysis information from the location of the marked information using the main generation flow and / or obtaining the second analysis information by calling the tool through the tool execution flow are repeated until the model analysis of all the content in the input information is completed. Specifically, if there is input information that has not been analyzed and there is no need to call the tool, the steps of obtaining the first analysis information from the location of the marked information using the main generation flow can be repeated. If there is incomplete input information and it is necessary to call the tool, continue to repeat the steps of obtaining the first analysis information from the location of the marked information using the main generation stream and obtaining the second analysis information by calling the tool through the tool execution stream.

[0061] Furthermore, the first and second analysis information can be integrated to obtain the analysis results of the input information. The analysis results can be, for example, a complete analysis report obtained by analyzing the data of the input information, without being specifically limited here.

[0062] In this embodiment, when a tool needs to be invoked, the main generation stream is switched to the tool execution stream by activating the marker information in the main generation stream, preventing tool execution details from occupying context window space. The main generation stream contains only the first and second analysis information; the analysis information does not contain tool execution traces or the tool execution process, resulting in more readable analysis results that are easier for users to view. Multi-step tool reasoning is implemented without context constraints, improving the accuracy and precision of the generated analysis information. The tool invocation process in the tool execution stream can be retained as a reference, improving debugging convenience and interpretability.

[0063] Figure 5 The diagram illustrates the specific flowchart for generating analysis results. (See reference...) Figure 5 As shown, the main steps include: In step S502, the main generation stream performs autoregressive text generation on the input information and outputs the first analysis information.

[0064] Step S504: Determine whether a tool needs to be invoked. If yes, proceed to step S506. If no, proceed to step S502 to continue executing the step of generating the first analysis information until all input information has been analyzed.

[0065] Step S506: Generate tag information.

[0066] Step S508 triggers the switch from the main generation stream to the tool execution stream.

[0067] In step S510, the tool execution flow calls the context information and tag information of the main generation flow to determine the current analysis information.

[0068] Step S512: Determine whether the current analysis information meets the preset conditions. If yes, proceed to step S514; if no, return to step S506 to generate the marker information again, and continue to execute steps S508 to S512 to determine the next analysis information until the next analysis information meets the preset conditions. The next analysis information that meets the preset conditions is taken as the second analysis information to obtain the analysis result.

[0069] Step S514: Use the current analysis information as the second analysis information and return the second analysis information to the main generation stream.

[0070] Step S516: Replace the tag information in the main generation stream with the second analysis information, and combine the first analysis information and the second analysis information to obtain the analysis result.

[0071] Figure 6 The diagram illustrates the main generation flow and tool execution flow. (See reference...) Figure 6As shown, the main generation stream includes first analysis information and tagging information. After obtaining the second analysis information, the tagging information can be deleted, and the second analysis information can be displayed at the location where the tagging information was.

[0072] refer to Figure 6 As shown, when the growth rate is included in the context information of the main generation stream, the intent information can be considered as calculating the growth rate. Therefore, the tool to be invoked can be a calculator, and the tool name in the tag information is "calculator". The tool processing requirement can be "(100-84) / 84". The calculated second analysis information can be 16%, and this 16% can be used to replace the tagging information of the main generation stream.<tool_call> When the profit margin is included in the context information of the main generation stream, the intent information can be considered as calculating the profit margin. Therefore, the tool to be invoked can be a calculator, and the tool name in the label information is "calculator". The calculated second analysis information can be 15.2%, which replaces the label information of the main generation stream with 16%.<tool_call> When financial performance is included in the context information of the main generated stream, the intent information can be considered as determining financial performance. Therefore, the tool to be invoked can be a search engine, the tool name in the tag information can be "web_search", the tool processing requirement can be "XXX Company's 2022-2023 XX Report", and the obtained second analysis information can be the report document. The second analysis information can be represented, for example, as... <doc> …< / doc> Based on this, the second analysis information can be used <doc> …< / doc> Replace the tag information of the main generated stream<tool_call> .

[0073] In this embodiment, a dual-stream large language model generation and tool invocation framework is used to separate the main generation and tool execution flows. This reduces the length of context information required for report generation via the large language model, alleviating the problem of excessively long context and high computational resource consumption caused by a single large language model context as the analysis report length and tool invocation frequency increase. This reduces resource consumption, facilitates user viewing, prevents tool execution details from occupying context window space, and improves context window display efficiency. It generates more readable text without tool execution traces, improving the clarity of the output analysis information. Multi-step tool inference is implemented without context constraints, improving the accuracy of the analysis information. The tool execution flow invocation process can be stored as a reference; by storing the tool execution flow through a reference system, traceability of tool invocation is achieved.

[0074] To alleviate the problem of excessively long contexts and high computational resource consumption caused by a single LLM context as the analysis report length and tool call frequency increase, a dual-stream LLM generation and tool call framework is proposed. This framework separates the main generation and tool execution flows, significantly reducing the context length required for LLM report generation. The main generation and tool execution flows can be branched generation architectures of the same LLM, belonging to different but interconnected execution flows. The main generation flow generates the final content path for user output. The tool execution flow refers to the temporary computational branch handling tool calls, preventing the main context of the main generation flow from becoming cluttered or excessively long. A memory storage module stores the intermediate results of the tool execution flow.

[0075] In some embodiments of this disclosure, an information generation apparatus is provided, the information generation apparatus comprising: The main generation stream execution module is used to obtain the input information of the large language model, perform autoregressive text generation on the input information through the main generation stream of the large language model, and output the first analysis information. The tag information generation module is used to generate tag information for calling the tool in the main generation stream when the large language model determines that the tool needs to be called, and to trigger the switching of the main generation stream to the tool execution stream based on the tag information; The tool invocation module is used to obtain the context information of the main generation stream, and perform at least one tool invocation on the context information and the tag information based on the tool execution stream to determine the second analysis information of the tag information; The analysis result acquisition module is used to return the second analysis information to the main generation stream, continue to obtain the first analysis information based on the main generation stream and / or obtain the second analysis information based on the tool execution stream from the location of the marked information, and generate the analysis result of the input information according to the first analysis information and the second analysis information.

[0076] In one exemplary embodiment of this disclosure, when the large language model determines that a tool needs to be invoked, generating tagging information for invoking the tool in the main generation stream includes: The large language model determines the text information in the input information that needs to be analyzed by the model as the target type, or the large language model determines the step that requires calling a tool, and determines that a tool needs to be called. The tagging information is generated after the first analysis information. The tagging information is used to switch the main generation stream to the tool execution stream for tool invocation.

[0077] In one exemplary embodiment of this disclosure, the step of performing at least one tool call based on the tool execution flow to infer the context information and the tagging information to determine the second analysis information of the tagging information includes: The context information and the tagging information are input into the tool execution flow to determine the current analysis information; Based on the tool execution flow, the tagging information and the current analysis information of the tool execution flow are input into the large language model for inference, and the inference result is output. If the reasoning result is determined to meet the preset conditions, the current analysis information is used as the second analysis information.

[0078] In one exemplary embodiment of this disclosure, the tagging information includes a tool name and tool processing requirements; the step of inputting the context information and the tagging information into the tool execution flow to determine the current analysis information includes: The context information and the tagging information are input into the tool execution flow, the tool corresponding to the tool name in the tagging information is called, and the large language model is controlled to generate current analysis information that conforms to the context information based on the tool processing requirements of the tool.

[0079] In one exemplary embodiment of this disclosure, the apparatus further includes: If the reasoning result does not meet the preset conditions, the tagging information for calling the tool is generated again; Based on the tool execution flow, the context information and the tagging information are input into the large language model to determine the next analysis information; The next analysis information and the tagging information are input into the large language model for reasoning, and the reasoning result is output until the reasoning result determined by the next analysis information meets the preset conditions. The next analysis information that meets the preset conditions is used as the second analysis information.

[0080] In one exemplary embodiment of this disclosure, returning the second analysis information to the main generation stream includes: The marker information is deleted, and the second analysis information is displayed at the location where the marker information was.

[0081] In one exemplary embodiment of this disclosure, the apparatus is further configured to perform: Record the starting point, calling process, and second analysis information of the tool execution flow, and display the tool execution flow as an index.

[0082] In one exemplary embodiment of this disclosure, the apparatus is further configured to perform: In response to a click on the index, the system locates the display area of ​​the tool execution flow and presents the invocation process of the tool execution flow and the second analysis information of the tool execution flow in the display area.

[0083] In one exemplary embodiment of this disclosure, the tagging information includes a dynamically generated reference identifier; returning the second analysis information to the main generation stream includes: The reference identifier is embedded at the location of the marked information, and the second analysis information is displayed in association with the reference identifier.

[0084] It should be noted that the specific details of each part of the above-mentioned information generation device have been described in detail in some embodiments of the corresponding method. For details that are not disclosed, please refer to the embodiments of the method section, and therefore will not be repeated here.

[0085] Exemplary embodiments of this disclosure also provide an electronic device. This electronic device may be the aforementioned terminal device or server. Generally, the electronic device may include a processor and a memory, the memory for storing executable instructions of the processor, and the processor configured to perform the aforementioned information generation method by executing the executable instructions. Furthermore, the electronic device may also include a display for displaying an operating interface.

[0086] The electronic device is described below as an example in the form of a general-purpose computing device. This electronic device is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0087] The components of an electronic device may include, but are not limited to: at least one processing unit, at least one storage unit, a bus connecting different system components (including storage units and processing units), and a display unit.

[0088] The storage unit stores program code that can be executed by the processing unit, causing the processing unit to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit can perform actions such as... Figure 2 The steps are shown in the figure.

[0089] The storage unit may include readable media in the form of volatile storage units, such as random access memory (RAM) and / or cache storage units, and may further include read-only memory (ROM).

[0090] The storage unit may also include a program / utility having a set (at least one) of program modules, including but not limited to: an operating system, one or more applications, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0091] A bus can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus that uses any of the various bus structures.

[0092] The electronic device can also communicate with one or more external devices (such as keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (such as routers, modems, etc.). This communication can be performed via input / output (I / O) interfaces. Furthermore, the electronic device can communicate with one or more networks (such as local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter. As shown in the figure, the network adapter communicates with other modules of the electronic device via a bus. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0093] It should be noted that some embodiments of this disclosure also provide a computer program product, which includes a computer program that implements the above-described method when executed by a processor.

[0094] In one implementation, the computer program product can be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The readable storage medium can be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory, hard disk drive (HDD), solid-state drive (SSD), etc. For example, the computer program product can be implemented as a non-volatile storage medium storing a computer program, such as read-only memory, NAND flash memory, etc.

[0095] In one implementation, the computer program product can be an intangible product containing a computer program. For example, the computer program product can be implemented as a virtual digital product, such as an executable file, installation package, or other digital file storing the computer program.

[0096] Computer program code can be written in one or more programming languages. Examples of programming languages ​​include C, Java, and C++. Program code can execute entirely on the user's computing device, partially on the user's computing device, or as a standalone software package. It can also execute partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via an internet connection provided by a mobile network operator).

[0097] Computer programs can be carried or transmitted via signals such as electrical, magnetic, optical, electromagnetic, and infrared rays. Electronic devices can convert signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program runs on an electronic device, its code is used to cause the electronic device to execute (more specifically, to be executed by the processor of the electronic device) the method steps of various exemplary embodiments of this disclosure.

[0098] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0099] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0100] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. An information generation method characterized by comprising: The method comprises: obtaining input information of a large language model, performing self-recurrent text generation on the input information through a main generation flow of the large language model, and outputting first analysis information; in the case where the large language model determines that a tool needs to be called, generating mark information for calling the tool in the main generation flow, triggering switching of the main generation flow to a tool execution flow based on the mark information; obtaining context information of the main generation flow, performing at least one tool call on the context information and the mark information based on the tool execution flow, and determining second analysis information of the mark information; returning the second analysis information to the main generation flow, continuing to obtain first analysis information based on the main generation flow and / or second analysis information based on the tool execution flow from the position of the mark information, and generating an analysis result of the input information according to the first analysis information and the second analysis information.

2. The information generation method according to claim 1, characterized by, In the case where the large language model determines that a tool needs to be called, the method comprises: the large language model determines that the analysis intention of the text information in the input information that needs to be analyzed by the model is a target type, or the large language model determines that a step of calling the tool is executed, and it is determined that the tool needs to be called; generating the mark information after the first analysis information, the mark information being used to switch the main generation flow to the tool execution flow for tool calling.

3. The information generation method according to claim 1, characterized by, The method comprises: inputting the context information and the mark information into the tool execution flow to determine current analysis information; based on the tool execution flow, inputting the mark information and the current analysis information of the tool execution flow into the large language model for reasoning to output a reasoning result; determining that the reasoning result meets a preset condition, and taking the current analysis information as the second analysis information.

4. The information generation method according to claim 3, characterized by, The mark information comprises a tool name and a tool processing requirement; and the method comprises: inputting the context information and the mark information into the tool execution flow, calling a tool corresponding to the tool name in the mark information, and controlling the large language model to generate current analysis information meeting the context information based on the tool processing requirement of the tool.

5. The information generation method according to claim 3, characterized by, The method further comprises: determining that the reasoning result does not meet the preset condition, and generating mark information for calling the tool again; based on the tool execution flow, inputting the context information and the mark information into the large language model to determine next analysis information; inputting the next analysis information and the mark information into the large language model for reasoning to output a reasoning result, until the reasoning result of the next analysis information meets the preset condition, and taking the next analysis information meeting the preset condition as the second analysis information.

6. The information generation method according to claim 1, characterized by, The method further comprises: deleting the mark information and displaying the second analysis information at the position of the mark information.

7. The information generation method according to claim 1, characterized by, The method further comprises: record the calling starting point, calling process and second analysis information of the tool execution flow, and display the tool execution flow as an index.

8. The information generation method according to claim 7, characterized by, The method further comprises: in response to a click operation on the index, positioning to a display area of the tool execution flow, and presenting the calling process of the tool execution flow and the second analysis information of the tool execution flow in the display area.

9. The information generation method according to claim 1, characterized by, The mark information comprises a dynamically generated reference identifier; and the returning of the second analysis information to the main generation flow comprises: embedding the reference identifier at the position of the mark information, and displaying the second analysis information in association with the reference identifier.

10. A computer program product, characterised in that, The computer program, when executed by a processor, implements the information generation method of any one of claims 1-9.