Dialogue reasoning methods, equipment, media and products
By generating inference paths and agent processing methods, the problem of inference diversity and coherence of monologue inference methods in multi-tasks and complex tasks is solved, and the accuracy and efficiency of inference results are improved.
Patent Information
- Application Number
- CN202510685724.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-05-27
AI Technical Summary
The existing monologue inference methods are difficult to take into account the diversity of reasoning and the coherence of reasoning when dealing with multitasking or complex tasks. The lack of effective task allocation and scheduling mechanisms leads to unreasonable resource allocation and conflicts in reasoning paths.
By generating inference paths, using inference models to obtain inference tasks, generating paths containing multiple inference nodes, each node associates task type and scene information, uses agents to perform task processing, and generates final results through logical relationships and verification strategies, and introduces reinforcement learning algorithms to adjust the model.
Improve the accuracy and efficiency of inference results, avoid the problem of strategy fixation and distraction in monologue reasoning, and achieve diversity and coherence in complex tasks.
Smart Images

Figure CN120197714B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a dialogue reasoning method, device, medium and product. Background Art
[0002] With the rapid development of artificial intelligence (AI), large language models (LLMs) have demonstrated powerful capabilities in conversational reasoning. As a key research direction in AI, conversational reasoning aims to build intelligent systems that can understand user input questions and draw reasonable conclusions through a series of logical reasoning steps. However, current conversational reasoning technology still faces many challenges, particularly limited reasoning capabilities when handling complex tasks and multi-task scenarios.
[0003] Currently, reasoning methods based on large language models primarily employ a monologue format, where a single model completes the entire reasoning process from a first-person perspective. In monologue reasoning, natural language is first processed for intent recognition and process planning, followed by process planning and execution. Finally, the execution results are organized and the reasoning conclusion is output.
[0004] However, existing technologies still have the following shortcomings: First, existing monologue reasoning methods struggle to balance reasoning diversity and reasoning coherence when handling multiple or complex tasks, limiting the model's reasoning capabilities. Monologue models are prone to single-path dependency and struggle to flexibly switch strategies, resulting in insufficient reasoning diversity. Second, existing reasoning models lack a clear division of roles and management mechanisms during the reasoning process, leading to frequent attention shifts and insufficient coherence. Finally, existing technologies lack effective task allocation and scheduling mechanisms, resulting in irrational resource allocation and conflicting reasoning paths during the reasoning process. These issues seriously impact the application effectiveness of dialogue reasoning systems in complex scenarios. Summary of the Invention
[0005] To address the problem that existing monologue reasoning methods have difficulty balancing reasoning diversity and reasoning coherence when handling multi-tasks or complex tasks, we now provide a conversational reasoning method, device, medium and product designed to significantly improve reasoning diversity and coherence.
[0006] To achieve the above objectives, some embodiments of the present application provide the following aspects:
[0007] In a first aspect, some embodiments of the present application further provide a conversational reasoning method, including:
[0008] The reasoning model obtains the reasoning task;
[0009] generating a reasoning path based on the reasoning task, the reasoning path including at least one reasoning node, each reasoning node being associated with a task type and corresponding scenario information;
[0010] Reasoning is performed based on the reasoning path to obtain a reasoning result.
[0011] Optionally, generating a reasoning path based on the reasoning task includes:
[0012] Parsing the reasoning task to obtain scenario information and at least one subtask, each of the subtasks being associated with a task type;
[0013] The reasoning path is generated based on the subtasks, the task type, and the scenario information, and each subtask is associated with an inference node.
[0014] Optionally, performing reasoning based on the reasoning path to obtain a reasoning result includes:
[0015] The reasoning model generates an agent according to the reasoning nodes in the reasoning path, and each reasoning node corresponds to an agent;
[0016] Obtaining the logical relationship between the agents according to the association relationship between each of the inference nodes in the inference path;
[0017] Constructing logical connections between the agents based on the logical relationships;
[0018] Using the agent to process the subtask associated with the corresponding reasoning node to obtain a corresponding task result;
[0019] The reasoning result is obtained based on the logical connection between the agents and the task result.
[0020] Optionally, obtaining the reasoning result based on the logical connection between the agents and the task result includes:
[0021] Each of the subtasks corresponds to a verification strategy, and the task result associated with the subtask is verified according to the verification strategy to obtain the verification result associated with the subtask;
[0022] Based on the logical connection and the verification result, the inference result is generated.
[0023] Optionally, before the inference model acquires the inference task, the method further includes:
[0024] The initial inference model is trained to confirm the inference model.
[0025] Optionally, the training of the initial inference model and confirming the inference model includes:
[0026] The initial inference model obtains a training task set;
[0027] Parsing the training tasks in the training task set to obtain task type and scenario information;
[0028] Based on the task type and the scenario information, acquiring scenario information and at least one sub-training task, each of the sub-training tasks being associated with a task type;
[0029] generating an inference path based on the sub-training task, the task type, and the scenario information, the inference path comprising at least one inference node, each inference node being associated with a task type and corresponding scenario information;
[0030] The initial reasoning model generates an agent according to the reasoning nodes in the reasoning path, each of the reasoning nodes corresponds to an agent;
[0031] Obtaining the logical relationship between the agents according to the association relationship between each of the inference nodes in the inference path;
[0032] Constructing logical connections between the agents based on the logical relationships;
[0033] Using the intelligent agent to process the sub-training task associated with the corresponding inference node to obtain a corresponding task result;
[0034] Obtaining the training reasoning result based on the logical connection between the agents and the task result;
[0035] Adjust the initial reasoning model according to the training reasoning result and the standard result corresponding to the training task.
[0036] Optionally, adjusting the initial reasoning model according to the training reasoning result and a standard result corresponding to the training task includes:
[0037] The initial reasoning model is adjusted based on the training reasoning result and the standard result corresponding to the training task using the PPO strategy.
[0038] In a second aspect, some embodiments of the present application further provide an electronic device comprising: one or more processors; and a memory storing computer program instructions, wherein the computer program instructions, when executed, cause the processor to perform the steps of the method described above.
[0039] In a third aspect, some embodiments of the present application further provide a computer-readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method described above.
[0040] In a fourth aspect, some embodiments of the present application further provide a computer program product, comprising a computer program / instruction, which implements the steps of the above-described method when executed by a processor.
[0041] Compared to related technologies, the conversational reasoning method provided in the embodiments of this application uses a reasoning model to obtain reasoning tasks, generates a reasoning path based on the reasoning task, and then performs reasoning based on the reasoning path to obtain a reasoning result. By analyzing the reasoning task, a reasoning path that reflects both reasoning diversity and reasoning coherence is generated, allowing the reasoning model to analyze and process the reasoning task based on this reasoning path, thereby improving the accuracy of the reasoning result. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0043] Figure 1 A flowchart of an embodiment of the conversational reasoning method described in this application;
[0044] Figure 2 A flowchart of a method for generating an inference path for an embodiment of the present application;
[0045] Figure 3 A flowchart of a method for obtaining reasoning results according to an embodiment of the present application;
[0046] Figure 4 A flowchart of a method for training an initial reasoning model according to an embodiment of the present application;
[0047] Figure 5 This is an exemplary structural diagram of the electronic device of this application. DETAILED DESCRIPTION
[0048] The advantages of the present application are further described below with reference to the accompanying drawings and specific embodiments.
[0049] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0050] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0051] It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining."
[0052] In the description of this application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed. They are only used to facilitate the description of this application and to distinguish each step. Therefore, they cannot be understood as limitations on this application.
[0053] Example 1
[0054] This application proposes a dialogue reasoning method to address the shortcomings of existing monologue reasoning methods in that they are difficult to balance reasoning diversity and reasoning coherence when handling multiple or complex tasks. Figure 1 , which is a flowchart of a dialog reasoning method according to a preferred embodiment of the present application. As can be seen from the figure, a dialog reasoning method provided in this embodiment includes the following steps:
[0055] S1. The inference model obtains the inference task;
[0056] S2. Based on the reasoning task generating a reasoning path, the reasoning path includes at least one reasoning node, each reasoning node associated with a task type and corresponding scene information;
[0057] S3. Perform reasoning based on the reasoning path to obtain a reasoning result.
[0058] In this embodiment, the conversational reasoning method uses a reasoning model to obtain a reasoning task, generates a reasoning path based on the reasoning task, and then performs reasoning based on the reasoning path to obtain a reasoning result. By analyzing the reasoning task, a reasoning path that reflects both reasoning diversity and coherence is generated. This allows the reasoning model to analyze and process the reasoning task based on this reasoning path, thereby improving the accuracy of the reasoning result.
[0059] Example 2
[0060] The second embodiment of the present application relates to a method for dialogue reasoning. The second embodiment is an improvement based on the first embodiment. Figure 2 The specific improvements are:
[0061] Step S2 may include the following steps:
[0062] S21 parses the reasoning task to obtain scene information and at least one subtask, each of the subtasks associated with a task type;
[0063] S22. Based on the subtasks, the task type, and the scenario information, generate the reasoning path, where each subtask is associated with an inference node.
[0064] In this embodiment, the reasoning model can be a conversational reasoning system built on a large language model. This system receives reasoning tasks input by users and generates reasonable reasoning results through a series of reasoning steps. Reasoning tasks can be questions, commands, or requests posed by users, such as "Analyze a company's recent financial status" or "Evaluate the market prospects of a product." System prompts and analysis of reasoning tasks clarify the identities and functions of the roles corresponding to each subtask (e.g., problem solver, strategy proposer, solution verifier, etc.). Each subtask has clear responsibilities and reasoning tasks, ensuring the effective integration of multiple perspectives and strategies.
[0065] After the reasoning model obtains a reasoning task, it first parses the task to obtain scenario information and at least one subtask, each of which is associated with a task type. By way of example and not limitation, scenario information includes Socratic dialogue scenarios, classroom scenarios, teacher-student scenarios, and discussion scenarios. For example, for the reasoning task "Analyze a company's recent financial status," the system might parse out scenario information for "Financial Analysis," as well as subtasks such as "Collect Financial Data," "Calculate Key Financial Indicators," and "Analyze Financial Trends." These subtasks are associated with task types such as "Data Collection," "Data Calculation," and "Trend Analysis," respectively.
[0066] Based on the subtasks, the task type, and the scenario information, an inference path is generated, with each subtask associated with an inference node. An inference path is a directed graph structure, where each node represents an inference step, and the connections between nodes represent the logical order of inference. In the above example, the inference path may contain three inference nodes, corresponding to the three subtasks of "collecting financial data," "calculating key financial indicators," and "analyzing financial trends." These nodes are connected in a logical order to form a complete inference path.
[0067] Example 3
[0068] The third embodiment of the present application relates to a method for dialogue reasoning. The third embodiment is an improvement based on the first embodiment. Figure 3 The specific improvements are:
[0069] Step S3 may include:
[0070] S31. The reasoning model generates an agent based on the reasoning node in the reasoning path, each of the reasoning nodes corresponds to an agent;
[0071] In this embodiment, agents are functional modules capable of performing specific tasks and possessing independent reasoning capabilities. The interactive environment can be clarified based on the scenario information corresponding to each reasoning node. Agents can exchange information, propose strategies, and verify ideas through structured dialogue. The reasoning model includes features such as task logging, progress management, and dynamic feedback to support the stable advancement of the reasoning process. For example, the agent corresponding to the "Collect Financial Data" node has the ability to search and organize financial data; the agent corresponding to the "Calculate Key Financial Indicators" node has the ability to perform mathematical calculations and financial analysis; and the agent corresponding to the "Analyze Financial Trends" node has the ability to identify and predict trends.
[0072] S32 obtains the logical relationship between the agents according to the association relationship between the inference nodes in the inference path;
[0073] In the example above, there's a contextual dependency between the "Collect Financial Data" node and the "Calculate Key Financial Indicators" node, as financial indicators can only be calculated after financial data is collected. Similarly, there's a dependency between the "Calculate Key Financial Indicators" node and the "Analyze Financial Trends" node. These relationships determine the logical relationships between the corresponding agents.
[0074] S33 based on the logical relationship to build a logical connection between the agents;
[0075] Logical connections refer to the data transfer and collaboration mechanisms between agents. These connections are reflected in the interactions between agents, enabling consensus building, opinion negotiation, and strategy complementation. Through agent supervision, task objectives are dynamically adjusted and role responsibilities are updated, continuously refining and optimizing the reasoning process through multiple rounds of dialogue. For example, after completing a task, the "Collect Financial Data" agent will pass the collected financial data to the "Calculate Key Financial Indicators" agent. After the agent completes its calculations, the agent will pass the results to the "Analyze Financial Trends" agent. This data transfer and collaboration mechanism ensures the coherence and effectiveness of the entire reasoning process.
[0076] S34. Using the agent to process the subtask associated with the corresponding inference node to obtain the corresponding task results;
[0077] Each agent performs the corresponding subtask based on its own capabilities and the data received, and generates task results.
[0078] For example, a "Collect Financial Data" agent might generate a dataset containing a company's recent financial statements, a "Calculate Key Financial Indicators" agent might generate an analytical report containing indicators such as profit margin and return on assets, and an "Analyze Financial Trends" agent might generate forecasts about the company's financial trends.
[0079] S35. Obtain the reasoning result based on the logical connection between the agents and the task result.
[0080] Specifically, step S35 may include the following steps:
[0081] Each of the subtasks corresponds to a verification strategy, and the task result associated with the subtask is verified according to the verification strategy to obtain the verification result associated with the subtask; and the reasoning result is generated based on the logical connection and the verification result.
[0082] In this example, a verification strategy is a mechanism for ensuring the accuracy and reliability of task results. For example, for the "Collect Financial Data" subtask, the verification strategy might include checking the completeness, consistency, and timeliness of the data; for the "Calculate Key Financial Indicators" subtask, the verification strategy might include checking the correctness of the calculation process and the rationality of the results; and for the "Analyze Financial Trends" subtask, the verification strategy might include checking the rationality of the analysis logic and the credibility of the predicted results.
[0083] The inference result is the final output of the entire inference process. It combines the task results of each agent and takes into account the logical connections between agents. In the above example, the inference result might be a comprehensive report analyzing the company's recent financial status, including financial data, key indicators, and trend forecasts.
[0084] In this embodiment, a system prompt explicitly specifies the design space for subtask reasoning, including the structure of the reasoning task, role configuration, environment characteristics, and interaction mechanisms. Through scientific definition and flexible configuration, the reasoning model can adaptively construct an appropriate conversational reasoning framework for different task scenarios. The reasoning model performs task analysis based on the system prompt and automatically configures subtasks, including role assignment, dialogue task decomposition, reasoning chain construction, and result generation. Dynamic adjustment of the reasoning path ensures the flexible application of multi-strategy, multi-role collaborative reasoning in complex tasks. Verification strategies assess the accuracy and rationality of reasoning results. Using pre-set rules and multi-dimensional evaluation metrics, the reasoning results are analyzed layer by layer to generate a comprehensive score that quantifies the effectiveness of conversational reasoning. The evaluation scores are fed back to the reasoning model as rewards, and data is recorded based on the performance of the reasoning task, activating a reinforcement learning training process. Based on these reward signals, the reasoning model continuously adjusts its reasoning strategy and role interaction methods, gradually enhancing the reasoning capabilities of the dialogue body and improving the accuracy and efficiency of task processing.
[0085] Compared to current monologue-based reasoning models, this application introduces agent role division and environment deduction. Using reinforcement learning algorithms, it stimulates the reasoning model's ability to dynamically set and simulate agent-agent and agent-environment interactions. This enables dynamic strategy adjustment and multi-perspective analysis during reasoning, effectively addressing the diverse demands of complex tasks. Dialogue-based reasoning significantly improves reasoning diversity and coherence, avoiding the problems of fixed strategy, distraction, and task conflict inherent in monologue-based reasoning.
[0086] Take the reasoning task as a complex mathematical problem as an example:
[0087] The problems input into the reasoning model are complex, hybrid problems involving mathematics and physics. These problems include calculating the eigenvalues of quantum Hamiltonians, verifying the high-energy regularities of physical theories, analyzing the structure of chemical reactions, and calculating gyromagnetic moments. The reasoning model first analyzes the task characteristics, decomposing the problem into multiple subtasks and constructing a dialogue environment tailored to the specific disciplines. Within the "quantum energy" environment, the reasoning model creates three subtasks: a theoretical physics subtask, a mathematical subtask, and a vector analysis subtask. Each subtask is associated with a corresponding agent, which engages in dialogue to derive and calculate the eigenvalues of quantum operators, gradually verifying the correctness of the solution. During the reasoning process, the agents propose formula calculations, eigenvalue analysis, and physical interpretation, ultimately reaching a consensus and obtaining the correct answer to the first problem. When switching tasks, the reasoning environment is adjusted to "physical theory" based on the reasoning process, introducing subtasks dealing with physics and conducting discussions on the high-energy regularities of physics theories. Through agent dialogue, physical model assumptions and experimental verification are integrated to ultimately reach a scientifically sound conclusion. After completing the physics subtask, the environment was adjusted again based on the reasoning path to enter the "chemistry laboratory." The chemistry agent deduced the changes in the material structure during the chemical reaction and calculated related physical quantities to verify the correctness of the gyromagnetic moment. Through this division of agent roles and dialogue switching, the reasoning model can flexibly adjust its reasoning strategy when faced with multidisciplinary cross-disciplinary tasks, avoiding the problems of fixed strategies and task interference in traditional monologue reasoning models, significantly improving the diversity, coherence, and accuracy of reasoning.
[0088] Take the reasoning task as an example:
[0089] The reasoning model analyzes reasoning tasks based on their task type and generates symbolic agents, connectionist agents, and reasoning paths. The symbolic agent explains the concept of symbolism, representing knowledge using explicit symbols and logical rules, and emphasizing rule-driven reasoning. The connectionist agent uses neural networks and distributed learning to model knowledge, autonomously generating representations using data-trained models. The outputs of the symbolic and connectionist agents are discussed along the reasoning paths. For example, the word "bank" can refer to both a riverbank and a bank. The symbolic agent explicitly distinguishes between them using contextual rules, while the connectionist agent automatically infers polysemy through weighted connections. A comparison between the two approaches highlights the reliance of symbolic agents on manually defined rules, while the connectionist agent self-learns from data. Regarding reasoning stability, the symbolic agent performs stably within rules but lacks scalability. The connectionist agent performs poorly on distribution shift and zero-shot tasks, struggling to maintain robustness. The discussion ultimately led to a consensus: symbolic and connectionist agents each have their strengths and weaknesses, and combining them can achieve a balance between performance and interpretability. For example, by integrating neural perception with symbolic reasoning, a complementary AI model can be formed. This case demonstrates the advantages of dialogic reasoning in the analysis of open-ended questions: through multi-role expression of views and dialogue interaction, it can promote comprehensive analysis and in-depth interpretation of academic issues.
[0090] Example 4
[0091] The fourth embodiment of the present application relates to a method for dialogue reasoning. The fourth embodiment is an improvement on the first embodiment, and the specific improvements are:
[0092] Before executing step S1, the following steps may also be included:
[0093] The initial inference model is trained to confirm the inference model.
[0094] Further, see Figure 4 The training of the initial inference model and confirmation of the inference model may include the following steps:
[0095] A1. The initial inference model obtains a set of training tasks;
[0096] A training task set is a set of examples used to train a model. Each example contains an inference task and a corresponding standard result. For example, a training task set may include multiple inference tasks of varying complexity across different domains, such as financial analysis, market forecasting, and scientific research.
[0097] A2. Parse the training tasks in the training task set to obtain task type and scenario information;
[0098] The initial inference model needs to learn how to extract key information from the training tasks, including task types (such as analysis, prediction, evaluation, etc.) and scenario information (such as finance, market, science, etc.).
[0099] A3 based on the task type and the scene information, obtain scene information and at least one sub-training task, each of the sub-training tasks associated with a task type;
[0100] The initial inference model needs to learn how to decompose complex training tasks into multiple sub-training tasks and assign an appropriate task type to each sub-training task.
[0101] A4. Based on the sub-training task, the task type, and the scene information, generating an inference path, the inference path comprising at least one inference node, each inference node associated with a task type and corresponding scene information;
[0102] The initial inference model needs to learn how to build an effective inference path to ensure that the logical relationship between each inference node is reasonable and can effectively solve the training task.
[0103] A5. The initial reasoning model generates an agent based on the reasoning node in the reasoning path, each of the reasoning nodes corresponds to an agent;
[0104] The initial inference model needs to learn how to generate appropriate agents for different types of inference nodes, ensuring that each agent has the ability to perform the corresponding sub-training task.
[0105] A6. Obtaining the logical relationship between the agents based on the association relationship between the inference nodes in the inference path;
[0106] The initial reasoning model needs to learn how to identify the association relationships between reasoning nodes and convert these relationships into logical relationships between agents.
[0107] A7. Build a logical connection between the agents based on the logical relationship;
[0108] The initial reasoning model needs to learn how to establish data transmission and collaboration mechanisms between agents to ensure the consistency and effectiveness of the entire reasoning process.
[0109] A8. Using the agent to process the sub-training task associated with the corresponding inference node to obtain the corresponding task results;
[0110] The initial reasoning model needs to learn how to coordinate various agents to perform corresponding sub-training tasks and generate task results.
[0111] A9. Obtaining the training reasoning results based on the logical connection between the agents and the task results;
[0112] The initial reasoning model needs to learn how to integrate the task results of each agent and consider the logical connections between agents to generate the final training reasoning results.
[0113] A10. Adjust the initial inference model based on the training inference results and the standard results corresponding to the training task.
[0114] The initial reasoning model needs to continuously adjust its own parameters and strategies to improve its reasoning ability by comparing the differences between the training reasoning results and the standard results.
[0115] Furthermore, step A10 may include: using a PPO (Proximal Policy Optimization) strategy to adjust the initial reasoning model based on the training reasoning result and a standard result corresponding to the training task.
[0116] Proximal Policy Optimization (PPO) is a reinforcement learning algorithm that optimizes a policy function to maximize expected return. In this example, PPO adjusts the parameters of the initial inference model so that its training inference results are closer to the benchmark results. Specifically, PPO calculates the difference between the training inference results and the benchmark results to generate gradient information, which is then used to update the model parameters. This adjustment process is repeated until the model performance reaches the expected level.
[0117] Example 5
[0118] A conversational reasoning method may include the following steps:
[0119] The reasoning model obtains the reasoning task;
[0120] generating a reasoning path based on the reasoning task, the reasoning path including at least one reasoning node, each reasoning node being associated with a task type and corresponding scenario information;
[0121] Reasoning is performed based on the reasoning path to obtain a reasoning result.
[0122] In this embodiment, the reasoning model can be a conversational reasoning system built on a neural network. This system can receive reasoning tasks input by users and generate reasonable reasoning results through a series of reasoning steps. Reasoning tasks can be questions, commands, or requests posed by users, such as "analyze the market competitiveness of a product" or "evaluate the development prospects of a technology."
[0123] After the inference model acquires an inference task, it first parses it to obtain scenario information and at least one subtask. Each subtask is associated with a task type. For example, for the inference task "Analyze the market competitiveness of a product," the system might parse out the scenario information for "Market Analysis," as well as subtasks such as "Collect Market Data," "Analyze Competitive Product Situation," and "Evaluate Product Advantages." These subtasks are associated with task types such as "Data Collection," "Competitive Product Analysis," and "Advantage Evaluation," respectively.
[0124] Based on the subtasks, the task type, and the scenario information, the reasoning path is generated, with each subtask associated with an inference node. A reasoning path is a directed graph structure, where each node represents an inference step, and the connections between nodes represent the logical order of reasoning. In the above example, the reasoning path may contain three inference nodes, corresponding to the three subtasks of "collecting market data," "analyzing competitive products," and "evaluating product advantages." These nodes are connected in a logical order to form a complete reasoning path.
[0125] The inference model generates agents based on the inference nodes in the inference path, with each inference node corresponding to an agent. Agents are functional modules capable of performing specific tasks and possessing independent reasoning capabilities. For example, the agent corresponding to the "Collect Market Data" node has the ability to search and organize market data, the agent corresponding to the "Analyze Competitive Products" node has the ability to analyze and compare competitive products, and the agent corresponding to the "Evaluate Product Advantages" node has the ability to identify and evaluate advantages.
[0126] The logical relationships between the agents are derived based on the relationships between the inference nodes in the inference path. In the above example, there is a contextual dependency between the "Collect Market Data" node and the "Analyze Competitive Product Situation" node, as market data collection is necessary before competitive product analysis can take place. Similarly, there is a dependency between the "Analyze Competitive Product Situation" node and the "Evaluate Product Advantages" node. These relationships determine the logical relationships between the corresponding agents.
[0127] Based on these logical relationships, logical connections are established between the agents. Logical connections refer to the data transfer and collaboration mechanisms between agents. For example, after the "Collect Market Data" agent completes its task, it will pass the collected market data to the "Analyze Competitive Products" agent. After the latter completes its analysis, it will pass the results to the "Evaluate Product Advantages" agent. This data transfer and collaboration mechanism ensures the coherence and effectiveness of the entire reasoning process.
[0128] The agents are used to process the subtasks associated with the corresponding inference nodes and obtain corresponding task results. Each agent performs the corresponding subtask based on its own capabilities and the received data, and generates task results. For example, a "Collect Market Data" agent might generate a dataset containing information such as market size and growth rate; an "Analyze Competitive Product Situation" agent might generate an analysis report containing information such as competitive product characteristics and market share; and an "Evaluate Product Advantages" agent might generate an assessment of a product's competitive advantages.
[0129] Each subtask corresponds to a verification strategy. The task results associated with the subtask are verified according to the verification strategy to obtain the verification results associated with the subtask. A verification strategy is a mechanism for ensuring the accuracy and reliability of task results. For example, for the "Collect Market Data" subtask, the verification strategy might include checking the completeness, consistency, and timeliness of the data; for the "Analyze Competitive Products" subtask, the verification strategy might include checking the rationality of the analysis logic and the objectivity of the results; and for the "Evaluate Product Advantages" subtask, the verification strategy might include checking the rationality of the evaluation criteria and the credibility of the results.
[0130] The reasoning result is obtained based on the logical connections between the agents and the task results. Alternatively, the reasoning result is generated based on the logical connections and the verification results. The reasoning result is the final output of the entire reasoning process, integrating the task results of each agent and taking into account the logical connections between agents. In the above example, the reasoning result may be a report comprehensively analyzing the product's market competitiveness, including market data, competitive product status, and product advantages.
[0131] Before the inference model acquires the inference task, the initial inference model needs to be trained to confirm the inference model. The training process includes the following steps:
[0132] The initial inference model acquires a training task set. A training task set is a set of samples used to train the model. Each sample contains a reasoning task and a corresponding standard result. For example, the training task set may include multiple reasoning tasks of varying complexity across different domains, such as market analysis, technology assessment, and product development.
[0133] The training tasks in the training task set are parsed to obtain task type and scenario information. The initial inference model needs to learn how to extract key information from the training tasks, including task type (such as analysis, evaluation, prediction, etc.) and scenario information (such as market, technology, product, etc.).
[0134] Based on the task type and the scenario information, scenario information and at least one sub-training task are obtained, each of which is associated with a task type. The initial inference model needs to learn how to decompose complex training tasks into multiple sub-training tasks and assign an appropriate task type to each sub-training task.
[0135] Based on the sub-training task, the task type, and the scenario information, an inference path is generated. The inference path includes at least one inference node, each associated with a task type and corresponding scenario information. The initial inference model needs to learn how to construct an effective inference path, ensuring that the logical relationships between the inference nodes are reasonable and can effectively solve the training task.
[0136] The initial inference model generates agents based on the inference nodes in the inference path, with each inference node corresponding to an agent. The initial inference model needs to learn how to generate appropriate agents for different types of inference nodes, ensuring that each agent has the ability to perform the corresponding sub-training task.
[0137] According to the association relationship between each of the inference nodes in the inference path, the logical relationship between the agents is obtained. The initial inference model needs to learn how to identify the association relationship between the inference nodes and convert these relationships into logical relationships between agents.
[0138] Based on the logical relationships, the logical connections between the agents are constructed. The initial reasoning model needs to learn how to establish a data transfer and collaboration mechanism between the agents to ensure the coherence and effectiveness of the entire reasoning process.
[0139] The agent is used to process the sub-training task associated with the corresponding inference node to obtain the corresponding task result. The initial inference model needs to learn how to coordinate each agent to perform the corresponding sub-training task and generate the task result.
[0140] The training reasoning result is obtained based on the logical connection between the agents and the task results. The initial reasoning model needs to learn how to integrate the task results of each agent and consider the logical connection between agents to generate the final training reasoning result.
[0141] The initial reasoning model is adjusted based on the training reasoning results and the standard results corresponding to the training task. The initial reasoning model needs to continuously adjust its own parameters and strategies by comparing the differences between the training reasoning results and the standard results to improve its reasoning ability.
[0142] An A2C strategy is employed to adjust the initial inference model based on the training inference results and the standard results corresponding to the training task. A2C (Advantage Actor-Critic) is a reinforcement learning algorithm that combines the advantages of policy gradients and value function approximation. In this embodiment, the A2C strategy is used to adjust the parameters of the initial inference model so that the training inference results it generates are closer to the standard results. Specifically, the A2C strategy calculates the difference between the training inference results and the standard results to generate gradient information, which is then used to update the model parameters. This adjustment process is repeated until the model performance reaches the expected level.
[0143] It should be noted that Example 1, Example 2, Example 3, Example 4, and Example 5 are all a type of dialogue reasoning method.
[0144] In addition, some embodiments of the present application further provide an electronic device. The electronic device may be various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, etc. The electronic device may also be various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices.
[0145] The electronic device includes: one or more processors; and a memory storing computer program instructions, wherein the computer program instructions, when executed, enable the processor to perform the steps of the method provided in any one or more of the above embodiments. Figure 5 An exemplary structural diagram of the electronic device is disclosed. Figure 5 As shown, the electronic device includes: one or more processors 1101, memory 1102, and interfaces for connecting various components, including high-speed and low-speed interfaces. The various components are interconnected using different buses and can be mounted on a common motherboard or in other ways as needed. The processor can process instructions executed within the electronic device, including instructions stored in or on the memory for displaying graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, if desired, multiple processors and / or multiple buses can be used with multiple memories and multiple storage devices. Similarly, multiple electronic devices can be connected, with each device providing some of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.
[0146] The electronic device may further include: an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103 and the output device 1104 may be connected via a bus or other means. Figure 5 The bus connection is taken as an example.
[0147] Input device 1103 can receive input digital or character information and generate key signal input related to user settings and function control of the electronic device. Examples include a touch screen, keypad, mouse, trackpad, touchpad, pointing stick, one or more mouse buttons, trackball, joystick, and other input devices. Output device 1104 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibration motors). The display device may include, but is not limited to, a liquid crystal display (LCD), a light-emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touch screen.
[0148] To provide user interaction, the electronic device may be a computer. The computer includes a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user, as well as a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices may also be used to provide user interaction; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback), and input from the user may be received in any form, including acoustic input, voice input, or tactile input.
[0149] In the embodiments of the present application, a computer program / instruction is stored on a computer-readable medium. When executed by a processor, the computer program / instruction implements the steps of the method provided in any one or more of the above embodiments. The computer-readable medium may be included in the electronic device described in the above embodiments, or it may exist independently and not be incorporated into the device. The computer-readable medium carries one or more computer-readable instructions.
[0150] The memory 1102 can be used as a non-transitory computer-readable storage medium to store non-transitory software programs, non-transitory computer executable programs, and modules. The processor 1101 executes the non-transitory software programs, instructions, and modules stored in the memory 1102 to execute various functional applications and data processing of the server, thereby implementing the program instructions / modules corresponding to the method provided in any one or more of the above embodiments of the present application.
[0151] The memory 1102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device, etc. In addition, the memory 1102 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1102 may optionally include a memory remotely located relative to the processor 1101, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0152] It should be noted that the computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable media may include, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component.
[0153] Computer-readable media includes both permanent and non-permanent, removable and non-removable media, and can be implemented using any method or technology for information storage. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc-read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0154] Computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0155] In the above embodiments, all or part of the embodiments may be implemented using software, hardware, firmware, or any combination thereof. For example, implementation may be achieved using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In some embodiments, the software program of the present application may be executed by a processor to implement the above steps or functions. Similarly, the software program of the present application (including related data structures) may be stored in a computer-readable recording medium, such as a RAM memory, a magnetic or optical drive, a floppy disk, or the like. In addition, some steps or functions of the present application may be implemented using hardware, for example, as a circuit that cooperates with a processor to perform the various steps or functions.
[0156] The computer program product provided in the embodiments of the present application includes one or more computer programs / instructions, which, when executed by a processor, generate, in whole or in part, the processes or functions described in the embodiments of the present application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).
[0157] The flowcharts or block diagrams in the accompanying drawings illustrate the possible architectures, functions and operations of the devices, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of code, and the module, program segment or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-specific system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0158] The scope of this application is defined by the appended claims rather than the foregoing description and is therefore intended to encompass within this application all changes that come within the meaning and range of equivalents of the claims. Any reference signs in the claims should not be construed as limiting the claims to which they relate. In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in a device claim may also be implemented by one unit or device through software or hardware. Words such as "first" and "second" are only used to distinguish the description and do not indicate any particular order, nor should they be understood as indicating or implying relative importance.
[0159] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art may easily propose variations or substitutions within the technical scope disclosed in the present application, and such variations or substitutions shall be encompassed within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the scope of protection of the claims, and the above embodiments shall be regarded as exemplary and non-limiting.
Claims
1. A conversational reasoning method, characterized in that: The method is applied to at least one scenario of financial analysis, market forecasting and scientific research, including: The reasoning model obtains the reasoning task; generating a reasoning path based on the reasoning task, the reasoning path including at least one reasoning node, each reasoning node being associated with a task type and corresponding scenario information; Perform reasoning based on the reasoning path to obtain a reasoning result; Generating a reasoning path based on the reasoning task includes: Parsing the reasoning task to obtain scenario information and at least one subtask, each of the subtasks being associated with a task type; Based on the subtasks, the task type, and the scenario information, generating the reasoning path, each subtask being associated with an inference node; Performing reasoning based on the reasoning path to obtain reasoning results includes: The reasoning model generates an agent according to the reasoning nodes in the reasoning path, and each reasoning node corresponds to an agent; Obtaining the logical relationship between the agents according to the association relationship between each of the inference nodes in the inference path; Constructing logical connections between the agents based on the logical relationships; Using the agent to process the subtask associated with the corresponding reasoning node to obtain a corresponding task result; The reasoning result is obtained based on the logical connection between the agents and the task result.
2. The dialogue reasoning method according to claim 1, characterized in that: The obtaining of the reasoning result based on the logical connection between the agents and the task result includes: Each of the subtasks corresponds to a verification strategy, and the task result associated with the subtask is verified according to the verification strategy to obtain the verification result associated with the subtask; Based on the logical connection and the verification result, the inference result is generated.
3. The dialogue reasoning method according to claim 1, characterized in that: Before the inference model acquires the inference task, the method further includes: The initial inference model is trained to confirm the inference model.
4. The dialogue reasoning method according to claim 3, characterized in that: The training of the initial inference model and confirmation of the inference model include: The initial inference model obtains a training task set; Parsing the training tasks in the training task set to obtain task type and scenario information; Based on the task type and the scenario information, acquiring scenario information and at least one sub-training task, each of the sub-training tasks being associated with a task type; generating an inference path based on the sub-training task, the task type, and the scenario information, the inference path comprising at least one inference node, each inference node being associated with a task type and corresponding scenario information; The initial reasoning model generates an agent according to the reasoning nodes in the reasoning path, each of the reasoning nodes corresponds to an agent; Obtaining the logical relationship between the agents according to the association relationship between each of the inference nodes in the inference path; Constructing logical connections between the agents based on the logical relationships; Using the intelligent agent to process the sub-training task associated with the corresponding inference node to obtain a corresponding task result; Obtaining the training reasoning result based on the logical connection between the agents and the task result; Adjust the initial reasoning model according to the training reasoning result and the standard result corresponding to the training task.
5. The dialogue reasoning method according to claim 4, characterized in that: The adjusting the initial reasoning model according to the training reasoning result and the standard result corresponding to the training task includes: The initial reasoning model is adjusted based on the training reasoning result and the standard result corresponding to the training task using the PPO strategy.
6. An electronic device, characterized in that: The electronic device comprises: one or more processors; and A memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the method according to any one of claims 1 to 5.
7. A computer-readable medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Intelligent question and answer method based on cooperation of large language model and knowledge graph
CN118797017A
Online reasoning method and device, electronic equipment and storage medium
CN119149221A