Reasoning method and device, electronic equipment and storage medium

CN122886794APending Publication Date: 2026-10-09BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611062484.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-16
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

但是,由于大语言模型的推理路径单一,在处理复杂的推理任务时,很容易出现推理不完整、推理质量不稳定等现象

Benefits of technology

[0032]本公开实施例提供的方案,在回答针对推理对象提出的目标问题时,通过大语言模型在推理树中搜索目标推理路径,在经过一次或多次搜索后,在目标推理路径满足回答条件时,才基于目标推理路径上至少一个节点的答案确定目标问题对应的目标答案,向用户输出目标答案。本公开实施例不再局限于采用链式推理路径,而是将推理过程显式建模为可搜索的决策过程,在推理树中对候选的推理路径进行系统化探索后,再确定最终的目标推理路径,从而提升了推理结果的稳定性、可靠性和可控性,减少了推理不完整、推理质量不稳定等现象。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122886794A_ABST
    Figure CN122886794A_ABST
Patent Text Reader

Abstract

The present disclosure relates to a reasoning method and device, electronic equipment and storage medium, belonging to the technical field of computers. The method comprises: obtaining target information input on the electronic equipment, the target information comprising a reasoning object and a target question; obtaining a reasoning tree through a large language model; searching for a target reasoning path for answering the target question in the reasoning tree through the large language model; and in the case that the target reasoning path meets the answering condition, determining a target answer corresponding to the target question based on the answer of at least one node on the target reasoning path, and outputting the target answer to the user. The present disclosure explicitly models the reasoning process as a searchable decision-making process, and after systematically exploring the candidate reasoning path in the reasoning tree, the final target reasoning path is determined, thereby improving the stability, reliability and controllability of the reasoning result, and reducing phenomena such as incomplete reasoning and unstable reasoning quality.
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 particularly to a reasoning method, apparatus, electronic device, and storage medium. Background Technology

[0002] Large language models are natural language processing models based on deep learning technology. They have the ability to understand and reason, and can be used to perform a variety of reasoning tasks.

[0003] Large language models often employ a chained generation approach to perform inference tasks. That is, based on the input information, the large language model sequentially performs multiple rounds of text generation until it outputs the final inference result. However, because the inference path of large language models is singular, incomplete inference and unstable inference quality are prone to occur when handling complex inference tasks. Summary of the Invention

[0004] This disclosure provides a reasoning method, apparatus, electronic device, and storage medium that improves the stability, reliability, and controllability of reasoning results, and reduces phenomena such as incomplete reasoning and unstable reasoning quality.

[0005] According to one aspect of the embodiments of this disclosure, a reasoning method is provided, the method comprising: Acquire target information input from an electronic device, the target information including a reasoning object and a target question, the target question being a question posed in response to the reasoning object, the reasoning object being an object of any type; A reasoning tree is obtained through a large language model. The reasoning tree includes a root node and multiple non-root nodes, and each non-root node corresponds to an answer for answering the target question. Using the large language model, a target reasoning path for answering the target question is searched in the reasoning tree; If the target reasoning path satisfies the answer conditions, the target answer corresponding to the target question is determined based on the answer of at least one node on the target reasoning path, so as to output the target answer to the user.

[0006] In some embodiments, obtaining the reasoning tree through a large language model includes: The first node is the current leaf node of the inference tree. Based on the target information and the inference history of the first node, multiple candidate inference actions of the first node are determined through the large language model. The inference history includes each inference action on the first inference path from the root node to the first node. Multiple second nodes are created in the inference tree, each second node being a child node of the first node, and each second node corresponding to the answer obtained after performing one of the candidate inference actions on the inference object.

[0007] In some embodiments, searching for a target reasoning path in the reasoning tree to answer the target question using the large language model includes: Using the large language model, the target reasoning action with the highest matching degree to the target question is determined from multiple candidate reasoning actions; The path formed by the first reasoning path and the third node is determined as the target reasoning path, and the third node is the second node corresponding to the target reasoning action.

[0008] In some embodiments, determining the target reasoning action with the highest matching degree to the target question from multiple candidate reasoning actions using the large language model includes: Based on the inference statistics parameters of each second node, an inference success parameter is determined for each second node, wherein the inference success parameter is used to represent the inference success probability of the second node; the inference statistics parameters include the number of inference successes of the second node, the total number of times the second node is visited, and the total number of times the parent node of the second node is visited. Using the large language model, the original matching degree between the candidate reasoning action of each second node and the target question is obtained; Based on the reasoning success parameters of each second node, the original matching degree of the candidate reasoning action of each second node is adjusted to obtain the target matching degree of each candidate reasoning action. From the multiple candidate reasoning actions, determine the target reasoning action with the highest target matching degree.

[0009] In some embodiments, the step of determining the target answer corresponding to the target question based on the answer of at least one node on the target reasoning path, when the target reasoning path satisfies the answer condition, and outputting the target answer to the user, includes: If the quality parameter of the answer at the termination node of the target reasoning path is not less than a first threshold, the answer is determined as the target answer.

[0010] In some embodiments, the method further includes: Using the large language model, the matching degree between the answer and the target question is determined; based on the matching degree, a quality parameter of the answer is determined, and the quality parameter is positively correlated with the matching degree; or... Using the large language model, the average answer features are determined based on the answer features corresponding to each answer in the reasoning history of the terminal node; and the quality parameters of the answer are determined based on the difference between the answer features corresponding to the answer and the average answer features.

[0011] In some embodiments, the method further includes: If the target reasoning path does not meet the answer conditions but meets the expansion conditions, multiple child nodes of the termination node of the target reasoning path are created in the reasoning tree through the large language model to obtain the updated reasoning tree.

[0012] In some embodiments, when the target inference path does not satisfy the answer condition but satisfies the expansion condition, creating multiple child nodes of the termination node of the target inference path in the inference tree through the large language model to obtain the updated inference tree includes: If the quality parameter of the answer at the termination node is not less than the second threshold and is less than the first threshold, multiple child nodes of the termination node are created in the inference tree using the large language model to obtain the updated inference tree.

[0013] In some embodiments, the method further includes: If the target reasoning path does not meet the answer condition and does not meet the extended condition, the reasoning result of the target reasoning path is determined to be a reasoning failure.

[0014] In some embodiments, the method further includes: Starting from any leaf node in the inference tree that has not yet yielded a reasoning result, a new target reasoning path is searched within the inference tree.

[0015] In some embodiments, the method further includes: Given the inference result of the target inference path, update the inference statistics parameters of each non-root node in the target inference path; the inference statistics parameters include the number of successful inferences of the non-root node, the total number of times the non-root node is visited, and the total number of times the parent node of the non-root node is visited, and the inference result is either successful or failed.

[0016] In some embodiments, the method further includes: When the target reasoning path satisfies the answer conditions, a reasoning thought chain is generated through the large language model. The reasoning thought chain includes reasoning steps to obtain the target answer from the target information.

[0017] According to another aspect of the present disclosure, a reasoning apparatus is provided, the apparatus comprising: An information acquisition unit is configured to acquire target information input from an electronic device, the target information including a reasoning object and a target question, the target question being a question posed to the reasoning object, the reasoning object being an object of any type; The reasoning tree acquisition unit is configured to acquire a reasoning tree through a large language model, the reasoning tree including a root node and multiple non-root nodes, each of the non-root nodes corresponding to an answer for answering the target question; The path search unit is configured to search for a target reasoning path in the reasoning tree to answer the target question using the large language model. The answer determination unit is configured to determine the target answer corresponding to the target question based on the answer of at least one node on the target reasoning path, provided that the target reasoning path satisfies the answer conditions, so as to output the target answer to the user.

[0018] In some embodiments, the first node is the current leaf node of the inference tree, and the inference tree acquisition unit includes: An extended subunit is configured to determine multiple candidate reasoning actions for the first node based on the target information and the reasoning history of the first node using the large language model; the reasoning history includes each reasoning action on a first reasoning path from the root node to the first node; and to create multiple second nodes in the reasoning tree, each second node being a child node of the first node, and each second node corresponding to the answer obtained after performing one of the candidate reasoning actions on the reasoning object.

[0019] In some embodiments, the search unit is configured to determine the target reasoning action with the highest matching degree to the target question from a plurality of candidate reasoning actions using the large language model; and to determine the path composed of the first reasoning path and the third node as the target reasoning path, wherein the third node is the second node corresponding to the target reasoning action.

[0020] In some embodiments, the search unit is configured to determine a reasoning success parameter for each second node based on the reasoning statistics parameters of each second node, the reasoning success parameter representing the reasoning success probability of the second node; the reasoning statistics parameters include the number of reasoning successes of the second node, the total number of times the second node is visited, and the total number of times the parent node of the second node is visited; obtain the original matching degree between the candidate reasoning actions of each second node and the target question through the large language model; adjust the original matching degree of the candidate reasoning actions of each second node based on the reasoning success parameters of each second node to obtain the target matching degree of each candidate reasoning action; and determine the target reasoning action with the highest target matching degree from multiple candidate reasoning actions.

[0021] In some embodiments, the answer determination unit is configured to determine the answer as the target answer if the quality parameter of the answer at the termination node of the target reasoning path is not less than a first threshold.

[0022] In some embodiments, the apparatus further includes a quality acquisition unit configured to: Using the large language model, the matching degree between the answer and the target question is determined; based on the matching degree, a quality parameter of the answer is determined, and the quality parameter is positively correlated with the matching degree; or... Using the large language model, the average answer features are determined based on the answer features corresponding to each answer in the reasoning history of the terminal node; and the quality parameters of the answer are determined based on the difference between the answer features corresponding to the answer and the average answer features.

[0023] In some embodiments, the inference tree acquisition unit is further configured to, when the target inference path does not satisfy the answer condition but satisfies the extension condition, create multiple child nodes of the termination node of the target inference path in the inference tree through the large language model, thereby obtaining the updated inference tree.

[0024] In some embodiments, the reasoning tree acquisition unit is configured to, when the quality parameter of the answer at the termination node is not less than a second threshold and is less than a first threshold, create multiple child nodes of the termination node in the reasoning tree through the large language model to obtain an updated reasoning tree.

[0025] In some embodiments, the apparatus further includes: The reasoning failure unit is configured to determine that the reasoning result of the target reasoning path is a reasoning failure if the target reasoning path does not meet the answer condition and does not meet the extended condition.

[0026] In some embodiments, the method further includes: Starting from any leaf node in the inference tree that has not yet yielded a reasoning result, a new target reasoning path is searched within the inference tree.

[0027] In some embodiments, the apparatus further includes: The parameter update unit is configured to update the inference statistics parameters of each non-root node in the target inference path when the inference result of the target inference path is determined; the inference statistics parameters include the number of successful inferences of the non-root node, the total number of times the non-root node is visited, and the total number of times the parent node of the non-root node is visited, and the inference result is either successful or failed inference.

[0028] In some embodiments, the answer configuration unit is further configured to generate a reasoning thought chain through the large language model when the target reasoning path satisfies the answer condition, the reasoning thought chain including reasoning steps to obtain the target answer from the target information.

[0029] According to another aspect of the present disclosure, an electronic device is provided, the electronic device comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the inference method as described above.

[0030] According to another aspect of the present disclosure, a computer-readable storage medium is provided, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the reasoning method as described above.

[0031] According to another aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the reasoning method as described above.

[0032] The solution provided in this disclosure, when answering a target question posed to a reasoning object, searches for a target reasoning path in the reasoning tree using a large language model. After one or more searches, only when the target reasoning path meets the answer conditions is the target answer determined based on the answer of at least one node on the target reasoning path, and the target answer is then output to the user. This disclosure is no longer limited to using a chain-like reasoning path, but explicitly models the reasoning process as a searchable decision-making process. After systematically exploring candidate reasoning paths in the reasoning tree, the final target reasoning path is determined, thereby improving the stability, reliability, and controllability of the reasoning results and reducing phenomena such as incomplete reasoning and unstable reasoning quality.

[0033] 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

[0034] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0035] Figure 1 This is a schematic diagram illustrating an implementation environment according to an exemplary embodiment.

[0036] Figure 2 This is a flowchart illustrating a reasoning method according to an exemplary embodiment.

[0037] Figure 3 This is a schematic diagram of a reasoning tree according to an exemplary embodiment.

[0038] Figure 4 This is a schematic diagram illustrating a video frame in a video according to an exemplary embodiment.

[0039] Figure 5 This is a block diagram illustrating an inference device according to an exemplary embodiment.

[0040] Figure 6 This is a block diagram illustrating an electronic device according to an exemplary embodiment.

[0041] Figure 7 This is a block diagram illustrating a server according to an exemplary embodiment. Detailed Implementation

[0042] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0043] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0044] It should be noted that the user information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this disclosure are all authorized by the user or fully authorized by all parties. The collection, use, and processing of related data shall comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0045] Figure 1 This is a schematic diagram of an implementation environment provided by an embodiment of this disclosure. The implementation environment includes a terminal 101 and a server 102. The terminal 101 is connected to the server 102 via a wireless network or a wired network.

[0046] In some embodiments, terminal 101 includes at least one of a smartphone, smartwatch, tablet computer, game console, smart bracelet, virtual reality device, laptop computer, and desktop computer.

[0047] In some embodiments, server 102 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. Server 102 is used to provide backend services to terminal 101. Exemplarily, server 102 undertakes the primary computing work, and terminal 101 undertakes the secondary computing work; or, server 102 undertakes the secondary computing work, and terminal 101 undertakes the primary computing work; or, server 102 and terminal 101 collaborate on computing using a distributed computing architecture.

[0048] Those skilled in the art will understand that the number of terminals described above can be more or less. For example, there may be only one terminal, or there may be 10 or more terminals. This disclosure does not limit the number of terminals or the type of device.

[0049] In this embodiment, the user inputs target information to be reasoned on terminal 101. The target information includes a reasoning object and a target question. The target question is a question posed in response to the reasoning object, which can be any type of object, such as video, image, text, or audio. Terminal 101 sends the target information to server 102. Server 101 uses the reasoning method provided in this embodiment to reason about the target information, obtains the target answer corresponding to the target question, and returns it to terminal 101. Terminal 101 can then output the target answer, thereby answering the target question raised by the user. Server 102 is deployed with a large language model, and server 102 uses the large language model to reason about the target information.

[0050] For example, terminal 101 has a client installed on it, which is provided by server 102. Terminal 101 can use this client to perform question-and-answer functions. Of course, the client can also have other functions, such as online social networking, video sharing, or chat functions. For example, the client is either a client in the operating system of terminal 101 or a client provided by a third party. For example, the client can be a video client, a live streaming client, a game client, a social networking client, or other types of clients.

[0051] The above implementation environment is merely an example. Other implementation environments can also be used in this embodiment, which will not be elaborated here.

[0052] Figure 2 This is a flowchart illustrating a reasoning method according to an exemplary embodiment, see [link to flowchart]. Figure 2 This method is performed by an electronic device, which can be the aforementioned Figure 1 The terminal 101 or server 102 in the implementation environment shown may also be other devices. The method includes the following steps: In step 201, the electronic device acquires the input target information, which includes the reasoning object and the target question.

[0053] The number of inference objects can be one or more, and the inference objects can be of any type, including video, image, text, audio, etc. This disclosure does not limit this.

[0054] In addition, the target question is a question posed in relation to the object of reasoning, and the electronic device needs to answer the target question. For example, the target question might be used to ask for the name of a person in the object of reasoning, the time when a certain keyword appeared, or an event that occurred in the object of reasoning. The target question is in text format and can be entered by the user who initiates the question-and-answer session.

[0055] In some embodiments, a user inputs a reasoning object and a target question on an electronic device. For example, the electronic device runs a client with question-and-answer functionality and is associated with a large language model. The electronic device displays a question-and-answer interface provided by the client, which is used to answer the user's input question. After the user inputs the reasoning object and the target question in the question-and-answer interface, steps 202-204 below are performed to determine the target answer corresponding to the target question, and then the target answer is displayed in the question-and-answer interface.

[0056] In other embodiments, the user inputs the reasoning object and the target question on another electronic device and sends it to that electronic device. The electronic device then performs steps 202-204 below to determine the target answer corresponding to the target question and sends it to the electronic device that initiated the question-and-answer session.

[0057] In step 202, the electronic device obtains a reasoning tree through a large language model. The reasoning tree includes a root node and multiple non-root nodes, each of which corresponds to an answer used to answer the target question.

[0058] After acquiring the target information, the electronic device obtains a reasoning tree. The reasoning tree includes a root node, and the node information that identifies the target information as the root node. The reasoning tree may also include multiple non-root nodes, and each node in the reasoning tree has corresponding node information that represents the meaning of the node. The node information of non-root nodes includes the answer to the target question.

[0059] For example, the node information of a non-root node includes a reasoning action and an answer, which is obtained by the electronic device after performing the reasoning action on the reasoning object.

[0060] For example, there exists a reasoning path from the root node to a non-root node, and this reasoning path includes at least one reasoning action. The electronic device, using a large language model, determines the answer for the non-root node based on its reasoning history and the reasoning actions performed on that non-root node. Since the reasoning history has been considered in determining the answer, and this history can include each reasoning action on the reasoning path to which the non-root node belongs, the answer is essentially obtained by performing each reasoning action on the reasoning object along that reasoning path.

[0061] For example, see Figure 3The reasoning object is a video, and the target question is "Where is John saying 'Hello'?" Initially, the reasoning tree includes a root node. After expanding the root node, the reasoning tree includes the root node, node 1, and node 2. Node 1 and node 2 are both child nodes of the root node. The reasoning action corresponding to node 1 is "locating the keyword 'Hello'". The answer corresponding to node 1 is determined after locating the keyword "Hello" in the video, specifically for the target question. The reasoning action corresponding to node 2 is "identifying the target person 'John'". The answer corresponding to node 2 is determined after identifying the target person "John" in the video, specifically for the target question.

[0062] Furthermore, electronic devices can expand the inference tree once or multiple times using a large language model. Expansion refers to creating child nodes of leaf nodes on the basis of the original inference tree to increase the number of levels of the inference tree and find nodes that can answer the target question. The specific process of expanding the inference tree is detailed in the following steps 2021-2022, and will not be explained here.

[0063] It should be noted that after acquiring the target information, the electronic device can create a new reasoning tree, expand the existing reasoning tree, and perform reasoning based on it to determine the target answer to the target question. Alternatively, the electronic device can acquire an existing reasoning tree that has already been used to perform other reasoning tasks and has learned and trained during the process. In this case, the electronic device can continue to use this reasoning tree for reasoning after acquiring the target information. During the reasoning process, the candidate reasoning actions of each non-root node in the reasoning tree remain unchanged, and the answer for each non-root node can be redefined based on the target question presented this time.

[0064] In step 203, the electronic device searches the reasoning tree for a target reasoning path to answer the target question using a large language model.

[0065] As the reasoning tree expands, the number of nodes it includes increases, and the number of reasoning paths also increases. Electronic devices can search for a target reasoning path in the reasoning tree to answer the target question. This target reasoning path can be considered the most likely reasoning path to successfully answer the target question.

[0066] The electronic device inputs the inference tree and the node information of each node in the inference tree into a large language model, and searches for the target inference path through the large language model. Alternatively, the electronic device starts from the root node, and each time it expands a node in the inference tree through the large language model, it selects the child node with the highest matching degree with the target question from the multiple child nodes expanded from that node, thus obtaining a new inference path. This new inference path is then used as the updated target inference path.

[0067] It should be noted that the process of expanding the inference tree and the process of searching for the target inference path in the inference tree can be executed one after the other, or they can be executed in an alternating order, or other orders can be used. This disclosure does not limit this.

[0068] In step 204, if the target reasoning path satisfies the answer conditions, the electronic device determines the target answer corresponding to the target question based on the answer of at least one node on the target reasoning path, so as to output the target answer to the user.

[0069] The answer conditions refer to the conditions that the reasoning path that can correctly answer the target question should meet. These conditions can be preset by electronic devices or set by technical personnel.

[0070] In some embodiments, if the target reasoning path satisfies the answer conditions, the electronic device also generates a reasoning thought chain through a large language model. This reasoning thought chain includes reasoning steps to obtain the target answer from the target information. Where the reasoning thought chain includes multiple reasoning steps, these multiple reasoning steps are semantically continuous.

[0071] In some embodiments, if the target reasoning path satisfies the answer conditions, the answer of the terminal node of the target reasoning path is determined as the target answer corresponding to the target question.

[0072] For example, the electronic device inputs the target information, reasoning history, and the answer to the termination node of the target reasoning path into a large language model, which then determines the reasoning thought chain. The reasoning history may include only the reasoning history of the current target reasoning path, or it may include the reasoning history of other reasoning paths searched prior to the target reasoning path.

[0073] By outputting the reasoning chain, complex reasoning tasks can be broken down into consecutive reasoning steps and the reasoning logic can be explicitly expressed in text form. This increases the amount of information in the answer, allowing users to fully understand the intermediate reasoning steps, trace the reasoning process, and further improve the reliability of the reasoning results.

[0074] In some embodiments, if a user enters the target information on a local electronic device, the electronic device will determine the target answer and then output the target answer. Alternatively, if a user enters the target information on another electronic device, the electronic device will determine the target answer and then send the target answer to that other electronic device so that the target answer can be output on that other electronic device.

[0075] In other embodiments, the electronic device outputs the target answer, including: displaying the target answer, playing audio containing the target answer, or displaying an image or video containing the target answer, etc.

[0076] The method provided in this disclosure, when answering a target question posed to a reasoning object, searches for a target reasoning path in the reasoning tree using a large language model. After one or more searches, only when the target reasoning path meets the answer conditions is the target answer determined based on the answer of at least one node on the target reasoning path, and the target answer is output to the user. This disclosure is no longer limited to using chain-like reasoning paths, but explicitly models the reasoning process as a searchable decision-making process. After systematically exploring candidate reasoning paths in the reasoning tree, the final target reasoning path is determined, thereby improving the stability, reliability, and controllability of the reasoning results and reducing phenomena such as incomplete reasoning and unstable reasoning quality.

[0077] In the above Figure 2 Based on the illustrated embodiment, the following describes the expansion process of the reasoning tree.

[0078] In some embodiments, taking the first node as the current leaf node of the reasoning tree as an example, the process of expanding the reasoning tree includes the following steps 2021-2022: In step 2021, the electronic device uses a large language model to determine multiple candidate reasoning actions for the first node based on the target information and the reasoning history of the first node.

[0079] The reasoning path from the root node to the first node is called the first reasoning path, which includes at least one reasoning action. Each candidate reasoning action of the first node refers to a reasoning action that may be performed after executing the reasoning actions on the first reasoning path on the reasoning object. Each candidate reasoning action can describe a possible direction of analysis for the reasoning object. The candidate reasoning actions for the reasoning object may include: examining the content of a specific time period in the video, parsing the audio or letters in the video, and recognizing objects in key visual regions of the video, etc.

[0080] The electronic device can predetermine the number of candidate inference actions, and for each node, determine that number of candidate inference actions, which is greater than 1. Alternatively, the electronic device can predetermine the maximum number of candidate inference actions, and for each node, determine a number of candidate inference actions that does not exceed that maximum number.

[0081] In some embodiments, the electronic device inputs target information and the reasoning history of the first node into a large language model so that the large language model can determine multiple candidate reasoning actions for the first node.

[0082] For example, the electronic device is pre-set with a first prompt word template for determining candidate reasoning actions. The target information and the reasoning history of the first node are filled into the first prompt word template to obtain the first prompt word. The first prompt word is input into the large language model, and the large language model will reason according to the instructions of the first prompt word to obtain multiple candidate reasoning actions of the first node.

[0083] The reasoning history includes each reasoning action on the first reasoning path from the root node to the first node. Additionally, the reasoning history may include information about other nodes on the first reasoning path. For example, the reasoning history may also include at least one of the observation results and the answer for each node on the first reasoning path.

[0084] Additionally, when filling the first prompt word template with target information, you can either fill in the target question and the object of reasoning themselves, in which case the first prompt word will include the target question and the object of reasoning; or you can fill in the identifiers of the target question and the object of reasoning, in which case the first prompt word will include the identifiers of the target question and the object of reasoning, where the identifiers of the object of reasoning are the file name and file link corresponding to the object of reasoning, etc. The process of filling other prompt word templates with target information is similar.

[0085] The process of determining the answer to a node is called the forward simulation process. The forward simulation process includes: performing the reasoning action of the node on the reasoning object to obtain the observation result of the node, which is used to describe the information in the reasoning object related to the reasoning action; and answering the target question based on the observation result to obtain the answer.

[0086] The difference between an observation result and an answer lies in the fact that an observation result is an objective descriptive information, providing an objective description of the facts within the object of reasoning, thus representing the specific information revealed by the reasoning action. An answer, on the other hand, is a stage-specific reasoning conclusion determined by the large language model based on the aforementioned objective descriptive information and the target question. The answer reflects a temporary response to the target question within the current reasoning path.

[0087] See Figure 3 The reasoning action corresponding to node 1 is "locating the keyword 'Hello'". The observation result obtained after performing this reasoning action on the video is: the keyword "Hello" appears at the 6th second of the video. There is a person named "John" in the 6th second of the video. The person "John" is sitting in the living room. Therefore, the answer determined based on this observation result is "John is in the living room when he says Hello".

[0088] In step 2022, the electronic device creates multiple second nodes in the reasoning tree, each second node being a child node of the first node, and each second node corresponding to the answer obtained after performing a candidate reasoning action on the reasoning object.

[0089] For example, each second node corresponds to a candidate reasoning action and the answer obtained after performing the candidate reasoning action on the reasoning object.

[0090] The electronic device creates a second node for each candidate reasoning action, which serves as a child node of the first node. Then, using a large language model, based on the target information, the reasoning history of the first node, and the candidate reasoning actions of the second node, it determines the answer for the second node, using the candidate reasoning actions and the answer as the node information for the second node. The process of determining the answer for the second node is similar to the forward simulation process described above and will not be detailed here.

[0091] For example, the electronic device is pre-set with a second prompt word template for determining the answer. The target information, the reasoning history of the first node and one of the candidate reasoning actions are filled into the second prompt word template to obtain the second prompt word. The second prompt word is input into the large language model, and the large language model will reason according to the instructions of the second prompt word to obtain the answer corresponding to the candidate reasoning action, which is the answer of the second node to which the candidate reasoning action belongs.

[0092] See Figure 3 After determining the two candidate reasoning actions for node 1, nodes 3 and 4 were created. Both nodes 3 and 4 are child nodes of node 1, and each node 3 and 4 corresponds to a candidate reasoning action.

[0093] Steps 2021-2022 above are the expansion process of the first node. Through this expansion process, multiple potential reasoning branches can be constructed at the lower level of the first node, providing candidate reasoning paths for subsequent reasoning path search.

[0094] In this embodiment of the disclosure, for the current leaf node, multiple candidate reasoning actions are generated through a large language model, and a child node corresponding to each candidate reasoning action is created. This expands upon the original leaf node, increasing the number of layers in the reasoning tree. Furthermore, each candidate reasoning action corresponds to a potential information acquisition or analysis direction for the reasoning object. Therefore, the reasoning space is effectively expanded, enriching the types of reasoning actions that can be executed for the reasoning object. Searching for the target reasoning path within the expanded reasoning space can improve the reasoning quality and find the optimal target answer as much as possible.

[0095] In some embodiments, based on steps 2021-2022 performed by the electronic device, step 203 includes the following steps 2031-2032: In step 2031, the electronic device uses a large language model to determine the target reasoning action that has the highest matching degree with the target question from multiple candidate reasoning actions.

[0096] The matching degree between the candidate reasoning action and the target question represents the amount of effective information provided by the candidate reasoning action in answering the target question, based on the integrated existing reasoning history and multiple candidate reasoning actions. The matching degree between each candidate reasoning action and the target question is determined through a large language model.

[0097] The electronic device inputs the target information, the reasoning history of the first node, and multiple candidate reasoning actions into the large language model so that the large language model can determine the matching degree between the multiple candidate reasoning actions and the target question, and determine the target reasoning action with the highest matching degree from the multiple candidate reasoning actions.

[0098] See Figure 3 The electronic device selects node 3 as the target reasoning action from the candidate reasoning actions of node 3 and node 4.

[0099] For example, the electronic device is pre-set with a third prompt word template for determining the target reasoning action. The target information, the reasoning history of the first node, and multiple candidate reasoning actions are filled into the third prompt word template to obtain the third prompt word. This third prompt word is then input into the large language model, which will perform reasoning according to the instructions of the third prompt word to obtain the target reasoning action of the first node. Alternatively, the first prompt word template in step 2021 above can also be used to instruct the large language model to determine the target reasoning action. Therefore, when the large language model performs reasoning according to the instructions of the first prompt word, it can determine not only multiple candidate reasoning actions but also the target reasoning action.

[0100] For example, each non-root node in the inference tree has corresponding inference statistics parameters, including the number of successful inferences for the non-root node, the total number of times the non-root node is visited, and the total number of times its parent nodes are visited. The number of successful inferences for a non-root node refers to the number of times the inference path containing that non-root node is successfully inferred. Each node being visited means that the inference action corresponding to that node is performed on the inference object and an answer is obtained. The total number of times each node is visited is the sum of the total number of times the node itself is visited and the total number of times its child nodes are visited. During one or more searches in the inference tree, the electronic device can collect the inference statistics parameters for each non-root node, thereby gradually improving the accuracy of the inference statistics parameters as the number of searches increases. Accordingly, step 2031 includes: determining the reasoning success parameter of each second node based on the reasoning statistical parameters of each second node, the reasoning success parameter being used to represent the reasoning success probability of the second node; obtaining the original matching degree between the candidate reasoning action and the target question of each second node through a large language model; adjusting the original matching degree of the candidate reasoning action of each second node based on the reasoning success parameter of each second node to obtain the target matching degree of each candidate reasoning action; and determining the target reasoning action with the highest target matching degree from multiple candidate reasoning actions.

[0101] For example, based on the inference statistics of the second node, the electronic device uses the following formula to determine the inference success parameters of the second node: ;in, This indicates the parameters for successful inference in the second node. This indicates the number of successful inferences for the second node. This indicates the number of times the second node has been visited. This indicates the number of times the parent node of the second node has been visited. This indicates the exploration parameters, which can be set by default by the electronic device.

[0102] In this embodiment, the inference statistics parameters of the second node can count the number of successful inferences, the total number of visits, and the total number of visits to the parent node during the historical inference process. This provides a comprehensive summary of the performance of the second node during the historical search process. Based on the inference statistics parameters of the second node, the inference success parameters of the second node are predicted, and the matching degree of the second node is adjusted. The target inference path is searched based on the adjusted target matching degree. Nodes with high inference success probability can be selected first, and processing resources can be concentrated on the most valuable inference path, thereby improving search accuracy and saving processing resources.

[0103] For example, the method further includes updating the inference statistics parameters of each non-root node in the target inference path when the inference result of the target inference path is determined. For instance, if the target inference path is successfully inferred, the success count of each non-root node in the target inference path is incremented by 1. During one or more searches in the inference tree, the electronic device calculates the inference statistics parameters of each non-root node, and updates the inference statistics parameters of each non-root node in the path each time the inference result of the target inference path is determined. This improves the accuracy of the inference statistics parameters, achieving the purpose of training the inference tree and facilitating the inference tree to use the latest inference statistics parameters to perform subsequent inference tasks.

[0104] In step 2032, the electronic device determines the path consisting of the first reasoning path and the third node as the target reasoning path, and the third node is the second node corresponding to the target reasoning action.

[0105] Based on the first inference path, the electronic device selects an optimal target inference action and connects the first inference path with the third node corresponding to the target inference action, thereby searching for a new target inference path.

[0106] See Figure 3 The original target inference path was "root node - node 1". After the electronic device selects node 3 in step 2031, the new target inference path becomes "root node - node 1 - node 3". The target inference path is then expanded and inferred until it becomes "root node - node 1 - node 3 - node 7". When the electronic device determines the inference result of node 7, the inference statistics parameters of node 7, node 3, node 1 and the root node are updated.

[0107] It should be noted that steps 2021-2022 and 2031-2032 are used as examples to illustrate the process of expansion and reasoning, starting from the first node. The first node is any leaf node of the current reasoning tree.

[0108] In practice, starting from the root node, each time a node is reached, the electronic device expands the node to include multiple child nodes and selects the optimal child node. The original target inference path is then combined with the selected child node to form a longer target inference path, which is to execute steps 2021-2022 and 2031-2032, in order to achieve guided search progress in the current inference round. The other child nodes temporarily stop inference.

[0109] In this embodiment of the disclosure, after expanding the nodes, the node with the best candidate reasoning action is selected from multiple child nodes to form a new target reasoning path. This realizes the forward simulation of the reasoning path, guides the large language model to focus on key information, eliminates the need to reason for each child node, reduces the search workload, and improves search efficiency while ensuring sufficient search.

[0110] Step 204 above assumes the target reasoning path satisfies the answer condition. However, in another embodiment, the answer may not satisfy the answer condition. The following describes other cases besides step 204.

[0111] In some embodiments, after step 203, the method further includes step 205: In step 205, if the target reasoning path does not meet the answer conditions but meets the expansion conditions, the electronic device creates multiple child nodes of the termination node of the target reasoning path in the reasoning tree through the large language model, thereby obtaining the updated reasoning tree.

[0112] The extended condition refers to the condition that an answer with the potential to answer the target question should satisfy. That is, although the answer cannot answer the target question accurately and comprehensively at the moment, the answer has the potential to answer the target question. If reasoning continues along the current reasoning path, it is very likely that an answer that can answer the target question will be obtained.

[0113] Therefore, the expansion condition is also the condition that a node must satisfy to allow the expansion of its child nodes. The expansion condition may include the quality parameter of the answer to the terminating node of the target reasoning path falling within a preset quality parameter range, or the matching degree between the answer and the target question falling within a preset matching degree range, etc.

[0114] If the target reasoning path does not meet the answer conditions but meets the expansion conditions, multiple child nodes of the terminal node are created in the reasoning tree to obtain an updated reasoning tree, so that reasoning and searching for the target reasoning path can continue based on the terminal node.

[0115] The process of creating multiple child nodes of the termination node is the same as steps 2021-2022 above, and will not be repeated here.

[0116] In this embodiment of the disclosure, answer conditions and extended conditions are set separately. The processing method of the target inference path is determined by the conditions satisfied by the target inference path. It is no longer limited to using a fixed search depth, nor does it over-search on the same inference path, which improves flexibility and balances search efficiency and search quality.

[0117] In some other embodiments, after step 203, the method further includes step 206: In step 206, if the target reasoning path does not meet the answer conditions and does not meet the expansion conditions, the reasoning result of the target reasoning path is determined to be a reasoning failure.

[0118] If the target reasoning path does not meet either the answer condition or the expansion condition, it means that the answer cannot currently answer the target question and has no potential to answer it. Continuing reasoning based on the termination node will also fail to answer the target question. Therefore, no child nodes of the termination node are created, and the target reasoning path is directly determined to have failed.

[0119] In some embodiments, besides determining that the target inference path has failed when it does not meet the answer conditions and expansion conditions, expansion can also be stopped and the target inference path can be determined to have failed when the number of nodes contained in the target inference path reaches a target number. Using a target number to control the number of nodes contained in the inference path can control the maximum number of levels in the inference tree, avoiding excessive inference on a single path and thus reducing inference efficiency. Alternatively, if there are no candidate inference actions at the terminating node of the target inference path, and inference cannot continue, the target inference path can also be determined to have failed, avoiding unnecessary searches, saving processing resources, and improving search efficiency.

[0120] After determining that the reasoning result of the current target reasoning path is a reasoning failure, a new target reasoning path can be searched in the reasoning tree until a target answer that meets the answer conditions is found.

[0121] In some embodiments, if the reasoning result of the target reasoning path is determined to be a reasoning failure, the method further includes step 207: In step 207, the electronic device starts from any leaf node in the inference tree that has not yet yielded a reasoning result and searches for a new target reasoning path in the inference tree.

[0122] Taking the first node as an example, expansion and reasoning begin from the first node, determining the target reasoning path from the root node to the first node, and then to the third node. During this process, the other second nodes besides the third node have not yet yielded reasoning results, but the path search is paused. If the reasoning on the target reasoning path, or its extended form, fails, the path search can continue from any other second node besides the third node. This fully utilizes nodes that still have reasoning potential from the previous reasoning process, allowing for targeted searching of new target reasoning paths and avoiding disordered searching that wastes processing resources.

[0123] See Figure 3If the reasoning for node 7 fails, i.e. the target reasoning path is "root node-node 1-node 3-node 7", then the path search for node 7 will no longer be performed, and the path search will start from node 6.

[0124] Based on the above embodiments, the process of determining whether the answer meets the answer conditions and whether it meets the extended conditions will be explained below.

[0125] In some embodiments, the method further includes: determining a quality parameter of the answer to the terminal node of the target inference path using a large language model. The quality parameter represents the quality of the answer; a larger quality parameter indicates a better quality answer, and a smaller quality parameter indicates a worse quality answer.

[0126] Accordingly, the answer conditions include: the quality parameter of the answer at the terminal node of the target reasoning path is not less than the first threshold. Therefore, if the quality parameter of the answer at the terminal node is not less than the first threshold, it means that the target reasoning path meets the answer conditions, and the answer is determined as the target answer corresponding to the target question.

[0127] In this embodiment of the disclosure, if the quality parameter of the answer at the termination node of the target reasoning path is not less than a first threshold, the target reasoning path is successfully reasoned, and the answer is determined as the target answer. Instead of continuing to expand and search for paths, unnecessary searching of high-quality target reasoning paths is avoided, processing resources are saved, and search efficiency is improved.

[0128] The extended conditions include: the quality parameter is not less than the second threshold and is less than the first threshold. The second threshold is less than the first threshold. Therefore, if the quality parameter of the answer at the terminating node is not less than the second threshold and is less than the first threshold, it indicates that the target reasoning path does not meet the answer conditions but does meet the extended conditions. In this case, multiple child nodes of the terminating node are created in the reasoning tree using the large language model, resulting in an updated reasoning tree.

[0129] In addition, if the quality parameter of the answer at the terminating node is less than the second threshold, it means that the target reasoning path does not meet the answer condition and does not meet the expansion condition, and the reasoning result of the target reasoning path is determined to be a reasoning failure.

[0130] In this embodiment, different quality parameter ranges are divided using a first threshold and a second threshold, thereby distinguishing between setting answer conditions and extension conditions. The first threshold is the required value of the quality parameter to satisfy the answer condition, and the second threshold is the required value of the quality parameter to satisfy the extension condition. If the quality parameter of the answer at the termination node is not less than the second threshold and is less than the first threshold, the current inference path is considered to have the potential to answer the target question, and a deeper search is performed based on the current inference path. However, if the quality parameter is less than the first threshold, a deeper search is not performed. This avoids directly returning inaccurate answers and filters out inference paths that have no potential to answer the target question, improving flexibility, balancing search efficiency and search quality, and ensuring search reliability.

[0131] For example, the electronic device inputs the target information, the reasoning history of the termination node, and the answer into a large language model, and determines the quality parameters of the answer to the termination node through the large language model.

[0132] For example, the electronic device uses a large language model to determine the quality parameters of the answer at the terminal node, including any one of the following 1 and 2: 1. Using a large language model, determine the degree of matching between the answer to the terminal node and the target question; determine the quality parameters based on the degree of matching, and the quality parameters are positively correlated with the degree of matching.

[0133] For example, the electronic device inputs the target information, the reasoning history of the termination node, and the answer into a large language model, and determines the degree of matching between the answer and the target question through the large language model.

[0134] For example, the electronic device determines the quality parameter of the answer as the degree of matching between the answer and the target question, or the electronic device determines the quality parameter of the answer as the product of the degree of matching and a preset coefficient. Alternatively, the electronic device normalizes the degree of matching between the answer and the target question at the terminal node based on the degree of matching between each answer in the reasoning history and the target question to obtain the quality parameter. Or, other methods can be used to determine the quality parameter based on the degree of matching.

[0135] 2. Using a large language model, determine the average answer features based on the answer features corresponding to each answer in the reasoning history; determine the quality parameters based on the difference between the answer features corresponding to the answer at the terminal node and the average answer features.

[0136] Answer features are used to quantify answers; the more similar the answer features, the more similar the answers. The reasoning history includes the reasoning actions and answers at each node along the reasoning path. This allows us to determine the answer features corresponding to each answer in the reasoning history, thereby determining the average answer feature. This average answer feature can be used to describe the average answer that has appeared in the reasoning history.

[0137] For the answer at the terminal node, the greater the difference between the answer's corresponding feature and the average answer's feature, the greater the difference between this answer and other answers in the reasoning history, and thus the lower the quality of the answer is considered. Conversely, the smaller the difference between the answer's corresponding feature and the average answer's feature, the smaller the difference between this answer and other answers in the reasoning history, and thus the higher the quality of the answer is considered. Therefore, the quality parameter of the answer is determined based on the difference between the answer's corresponding feature and the average answer's feature.

[0138] For example, the absolute value of the difference between the answer feature corresponding to the answer and the average answer feature is determined, and a quality parameter negatively correlated with the absolute value of the difference is determined. This quality parameter can be the reciprocal of the absolute value of the difference, or the difference between a preset value and the absolute value of the difference, or other parameters negatively correlated with the absolute value of the difference, etc.

[0139] In this embodiment of the disclosure, when determining the target reasoning path each time, the quality parameter of the answer to the termination node is determined, the reasoning quality of the target reasoning path is evaluated and backtracked, and if the quality parameter does not meet the answer condition but meets the expansion condition, the expansion continues. This allows for the gradual screening and retention of high-quality reasoning paths during multiple rounds of reasoning, thereby improving the stability and reliability of the reasoning results.

[0140] In this embodiment of the disclosure, the quality of the answer is evaluated based on the matching degree between the answer and the target question, and the accuracy of the answer in answering the target question is measured. This controls whether the current reasoning path is successful, whether to continue the search, or whether the reasoning fails, thereby improving the accuracy of decision-making.

[0141] In this embodiment of the disclosure, considering that multiple searches have been performed in the reasoning history, the average answer can reflect the conditions that the correct answer should meet to a certain extent. Therefore, the quality of the answer is evaluated based on the difference between the answer of the current reasoning path and the average answer in the reasoning history, which measures whether the answer answers the target question accurately, thus ensuring the accuracy of the evaluation.

[0142] It should be noted that the above-mentioned optional embodiments can be combined in any form to constitute optional solutions of the embodiments of this disclosure, and will not be described in detail here.

[0143] The solutions in this disclosure have the following beneficial effects: 1. Search-based modeling of multimodal reasoning process: The traditional multimodal reasoning process that relies on single generation is explicitly modeled as a searchable reasoning tree. A multi-round search mechanism is introduced to enable the reasoning process to be gradually expanded, evaluated and optimized in multiple rounds of interaction.

[0144] 2. Action-based multimodal reasoning extension mechanism: At each reasoning node, multiple semantically distinguishable candidate reasoning actions are generated through a multimodal large language model. Each action corresponds to a potential information acquisition or analysis direction, thereby achieving an effective extension of the multimodal reasoning space.

[0145] 3. Combining inference action selection with forward simulation: Select the inference action with the highest information gain from multiple candidate inference actions and execute it. Obtain new observation results from multimodal inference objects such as videos or images, and combine them with existing inference history to generate intermediate answers in stages, thereby realizing forward simulation of the inference path.

[0146] 4. Scoring-based reasoning path evaluation and backtracking control: By quantitatively scoring intermediate answers, the quality of the reasoning path is evaluated, and the continued expansion, termination, or backtracking of the reasoning path is controlled based on the expansion conditions, thereby suppressing low-quality reasoning paths and ensuring the stability and reliability of the reasoning process.

[0147] For the same target information and the same large language model, the multi-round reasoning mechanism and the single-step reasoning mechanism of related technologies provided in the embodiments of this disclosure are used to reason about the target information and obtain the reasoning results.

[0148] Comparative analysis reveals that the performance of the large language model in complex information understanding and reasoning tasks significantly improves after adopting the multi-round reasoning mechanism provided in this embodiment. Introducing this mechanism allows for the expansion, selection, and verification of multiple candidate reasoning actions, gradually correcting intermediate answers until the correct answer is obtained. This effectively guides the large language model to focus on key information, corrects single-step reasoning errors, improves answer reliability, and reduces reasoning bias caused by a single response, thereby significantly improving overall reasoning accuracy. It effectively alleviates the instability caused by single-step reasoning and significantly enhances the accuracy and credibility of reasoning results. Furthermore, the reasoning results demonstrate that the solution in this embodiment does not simply rely on the scale of the large language model, but rather releases its potential multimodal reasoning capabilities through structured search and multi-round decision-making mechanisms, showcasing good method effectiveness and versatility.

[0149] The following examples will illustrate this.

[0150] Example 1: The object of reasoning is an instructional video, and three consecutive video frames in the instructional video are as follows: Figure 4 As shown, the target problem is: "In the given iterative solution, at step k=2, T(n) is expressed as T(n-(1))+(2); at step k=3, the equation becomes T(n)=T(n-(3))+4+4+4.

[0151] Please tell me, what are (1), (2), and (3) respectively? A, 2, 8, 3 B, 1, 4, 2 C, 3, 4, 1 D、2、4、3” The solution using related technologies yields the answer "C, 3, 4, 1", while the solution using the present disclosure yields the answer "D, 2, 4, 3".

[0152] The solution in this embodiment addresses the three candidate reasoning actions provided by the instructional video as follows: 1. Analyze the iterative process shown in the video to understand how the recursive relationship evolves with each step.

[0153] 2. Compare the visual representation of the recursive relationship with the provided options to identify the correct pattern.

[0154] 3. Listen to the instructor's explanation of each step of the recursive relationship to ensure you understand the iterative process.

[0155] From the three candidate reasoning actions mentioned above, reasoning action 1, which is most likely to answer the target question, was selected. The observation results determined based on reasoning action 1 are as follows: "This video demonstrates the process of solving a recurrence relation using an iterative method, given the following recurrence relation:"

[0156] This process reveals the pattern by progressively unfolding the recursive relationship. The following is a detailed breakdown of the steps in the video: ... in conclusion: This video effectively demonstrates the iterative process of solving recurrence relations, showing how the expression evolves with each step until a closed form is derived. Based on the detailed breakdown of the steps in the video from the above observation information, it can be determined that the target answer to the target question should be "D, 2, 4, 3".

[0157] Figure 5 This is a block diagram illustrating an inference device according to an exemplary embodiment. See also: Figure 5 The device includes: The information acquisition unit 501 is configured to acquire target information input on an electronic device. The target information includes a reasoning object and a target question. The target question is a question posed to the reasoning object, and the reasoning object is an object of any type. The reasoning tree acquisition unit 502 is configured to acquire a reasoning tree through a large language model. The reasoning tree includes a root node and multiple non-root nodes, each of which corresponds to an answer used to answer the target question. The path search unit 503 is configured to search for a target reasoning path in the reasoning tree to answer the target question using a large language model. The answer determination unit 504 is configured to determine the target answer corresponding to the target question based on the answer of at least one node on the target reasoning path, and output the target answer to the user, provided that the target reasoning path meets the answer conditions.

[0158] In some embodiments, the first node is the current leaf node of the reasoning tree, and the reasoning tree acquisition unit 502 includes: The extended subunit is configured to determine multiple candidate reasoning actions for the first node based on the target information and the reasoning history of the first node using a large language model; the reasoning history includes each reasoning action on the first reasoning path from the root node to the first node; multiple second nodes are created in the reasoning tree, each second node being a child node of the first node, and each second node corresponding to the answer obtained after performing a candidate reasoning action on the reasoning object.

[0159] In some embodiments, the search unit is configured to determine the target reasoning action with the highest matching degree to the target question from multiple candidate reasoning actions using a large language model; and to determine the path composed of the first reasoning path and the third node as the target reasoning path, wherein the third node is the second node corresponding to the target reasoning action.

[0160] In some embodiments, the search unit is configured to determine the reasoning success parameter of each second node based on the reasoning statistics parameters of each second node, wherein the reasoning success parameter represents the reasoning success probability of the second node; the reasoning statistics parameters include the number of reasoning successes of the second node, the total number of times the second node is visited, and the total number of times the parent node of the second node is visited; the original matching degree between the candidate reasoning actions of each second node and the target question is obtained through a large language model; based on the reasoning success parameter of each second node, the original matching degree of the candidate reasoning actions of each second node is adjusted to obtain the target matching degree of each candidate reasoning action; and the target reasoning action with the highest target matching degree is determined from multiple candidate reasoning actions.

[0161] In some embodiments, the answer determination unit 504 is configured to determine the answer as the target answer if the quality parameter of the answer at the termination node of the target reasoning path is not less than a first threshold.

[0162] In some embodiments, the apparatus further includes: a quality acquisition unit configured to: Using a large language model, the matching degree between the answer and the target question is determined; based on the matching degree, the quality parameters of the answer are determined, and the quality parameters are positively correlated with the matching degree; or... Using a large language model, the average answer features are determined based on the answer features corresponding to each answer in the reasoning history of the terminal node; and the quality parameters of the answer are determined based on the difference between the answer features corresponding to the answer and the average answer features.

[0163] In some embodiments, the inference tree acquisition unit 502 is further configured to, when the target inference path does not meet the answer conditions but meets the expansion conditions, create multiple child nodes of the termination node of the target inference path in the inference tree through a large language model to obtain an updated inference tree.

[0164] In some embodiments, the reasoning tree acquisition unit 502 is configured to, when the quality parameter of the answer at the termination node is not less than a second threshold and is less than a first threshold, create multiple child nodes of the termination node in the reasoning tree through a large language model to obtain an updated reasoning tree. The second threshold is less than the first threshold.

[0165] In some embodiments, the apparatus further includes: The reasoning failure unit is configured to determine the reasoning result of the target reasoning path as reasoning failure if the target reasoning path does not meet the answer conditions and the expansion conditions.

[0166] In some embodiments, the method further includes: Starting from any leaf node in the reasoning tree that has not yet yielded a reasoning result, search for a new target reasoning path in the reasoning tree.

[0167] In some embodiments, the apparatus further includes: The parameter update unit is configured to update the inference statistics parameters of each non-root node in the target inference path when the inference result of the target inference path is determined. The inference statistics parameters include the number of successful inferences of the non-root node, the total number of times the non-root node is visited, and the total number of times the parent node of the non-root node is visited. The inference result is either successful or failed.

[0168] In some embodiments, the answer configuration unit is further configured to generate a reasoning thought chain through a large language model when the target reasoning path satisfies the answer conditions. The reasoning thought chain includes reasoning steps to obtain the target answer from the target information.

[0169] Regarding the apparatus in the above embodiments, the specific manner in which each unit performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0170] This disclosure provides an electronic device including a processor and a memory for storing processor-executable instructions. The processor is configured to execute the instructions to implement the reasoning method described above.

[0171] Figure 6 This is a block diagram illustrating an electronic device according to an exemplary embodiment. The electronic device 600 may be: a smartphone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer, or a desktop computer. The electronic device 600 may also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal, or other names.

[0172] Typically, electronic device 600 includes a processor 601 and a memory 602.

[0173] Processor 601 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 601 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 601 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 601 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 601 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0174] The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 602 are used to store at least one program code, which is executed by the processor 601 to implement the reasoning method provided in the method embodiments of this disclosure.

[0175] In some embodiments, the electronic device 600 may optionally include a peripheral device interface 603 and at least one peripheral device. The processor 601, memory 602, and peripheral device interface 603 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 603 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 604, a display screen 605, a camera assembly 606, an audio circuit 607, and a power supply 608.

[0176] Peripheral interface 603 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 601 and memory 602. In some embodiments, processor 601, memory 602 and peripheral interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 601, memory 602 and peripheral interface 603 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0177] The radio frequency (RF) circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 604 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. In some embodiments, the RF circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 604 can communicate with other electronic devices through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: metropolitan area networks (MANs), various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks (WLANs), and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 604 may also include circuitry related to NFC (Near Field Communication), which is not limited herein.

[0178] Display screen 605 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 605 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 601 for processing. In this case, display screen 605 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 605, which serves as the front panel of electronic device 600; in other embodiments, there may be at least two display screens, respectively disposed on different surfaces of electronic device 600 or in a folded design; in still other embodiments, display screen 605 may be a flexible display screen, disposed on a curved or folded surface of electronic device 600. Furthermore, display screen 605 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. Display screen 605 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).

[0179] The camera assembly 606 is used to acquire images or videos. In some embodiments, the camera assembly 606 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the electronic device, and the rear-facing camera is located on the back of the electronic device. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 606 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash is a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.

[0180] The audio circuit 607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting them into electrical signals that are input to the processor 601 for processing, or to the radio frequency circuit 604 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located in a different part of the electronic device 600. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 607 may also include a headphone jack.

[0181] Power supply 608 is used to supply power to the various components in electronic device 600. Power supply 608 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When power supply 608 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0182] Those skilled in the art will understand that Figure 6 The structure shown does not constitute a limitation on the electronic device 600, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0183] Figure 7 This is a schematic diagram of a server structure according to an exemplary embodiment. The server 700 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 701 and one or more memories 702. The memories 702 store at least one computer program, which is loaded and executed by the processor 701 to implement the methods provided in the various method embodiments described above. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated upon here.

[0184] In an exemplary embodiment, a computer-readable storage medium is also provided, which, when executed by a processor of an electronic device, enables the electronic device to perform the steps in the above-described reasoning method. For example, the computer-readable storage medium may be a ROM (Read Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, and optical data storage device, etc.

[0185] In an exemplary embodiment, a computer program product is also provided, including a computer program that, when executed by a processor of an electronic device, implements the steps in the above-described reasoning method.

[0186] 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 disclosure 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 following claims.

[0187] 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. A reasoning method, characterized in that, The method includes: Acquire target information input from an electronic device, the target information including a reasoning object and a target question, the target question being a question posed in response to the reasoning object, the reasoning object being an object of any type; A reasoning tree is obtained through a large language model. The reasoning tree includes a root node and multiple non-root nodes, and each non-root node corresponds to an answer for answering the target question. Using the large language model, a target reasoning path for answering the target question is searched in the reasoning tree; If the target reasoning path satisfies the answer conditions, the target answer corresponding to the target question is determined based on the answer of at least one node on the target reasoning path, so as to output the target answer to the user.

2. The method according to claim 1, characterized in that, The process of obtaining the inference tree through a large language model includes: The first node is the current leaf node of the inference tree. Based on the target information and the inference history of the first node, multiple candidate inference actions of the first node are determined through the large language model. The inference history includes each inference action on the first inference path from the root node to the first node. Multiple second nodes are created in the inference tree, each second node being a child node of the first node, and each second node corresponding to the answer obtained after performing one of the candidate inference actions on the inference object.

3. The method according to claim 2, characterized in that, The step of searching for a target reasoning path in the reasoning tree to answer the target question using the large language model includes: Using the large language model, the target reasoning action with the highest matching degree to the target question is determined from multiple candidate reasoning actions; The path formed by the first reasoning path and the third node is determined as the target reasoning path, and the third node is the second node corresponding to the target reasoning action.

4. The method according to claim 3, characterized in that, The step of determining the target reasoning action with the highest matching degree to the target question from multiple candidate reasoning actions using the large language model includes: Based on the inference statistics parameters of each second node, an inference success parameter is determined for each second node, wherein the inference success parameter is used to represent the inference success probability of the second node; the inference statistics parameters include the number of inference successes of the second node, the total number of times the second node is visited, and the total number of times the parent node of the second node is visited. Using the large language model, the original matching degree between the candidate reasoning action of each second node and the target question is obtained; Based on the reasoning success parameters of each second node, the original matching degree of the candidate reasoning action of each second node is adjusted to obtain the target matching degree of each candidate reasoning action. From the multiple candidate reasoning actions, determine the target reasoning action with the highest target matching degree.

5. The method according to any one of claims 1-3, characterized in that, The step of determining the target answer corresponding to the target question based on the answer of at least one node on the target reasoning path when the target reasoning path satisfies the answer conditions includes: If the quality parameter of the answer at the termination node of the target reasoning path is not less than a first threshold, the answer is determined as the target answer.

6. The method according to claim 5, characterized in that, The method further includes: Using the large language model, the matching degree between the answer and the target question is determined; based on the matching degree, a quality parameter of the answer is determined, and the quality parameter is positively correlated with the matching degree; or... Using the large language model, the average answer features are determined based on the answer features corresponding to each answer in the reasoning history of the terminal node; and the quality parameters of the answer are determined based on the difference between the answer features corresponding to the answer and the average answer features.

7. The method according to any one of claims 1-3, characterized in that, The method further includes: If the target reasoning path does not meet the answer conditions but meets the expansion conditions, multiple child nodes of the termination node of the target reasoning path are created in the reasoning tree through the large language model to obtain the updated reasoning tree.

8. The method according to claim 7, characterized in that, When the target inference path does not satisfy the answer condition but satisfies the expansion condition, the large language model is used to create multiple child nodes of the termination node of the target inference path in the inference tree to obtain the updated inference tree, including: If the quality parameter of the answer at the termination node is not less than the second threshold and is less than the first threshold, multiple child nodes of the termination node are created in the inference tree using the large language model to obtain the updated inference tree.

9. The method according to any one of claims 1-3, characterized in that, The method further includes: If the target reasoning path does not meet the answer condition and does not meet the extended condition, the reasoning result of the target reasoning path is determined to be a reasoning failure.

10. The method according to claim 9, characterized in that, The method further includes: Starting from any leaf node in the inference tree that has not yet yielded a reasoning result, a new target reasoning path is searched within the inference tree.

11. The method according to any one of claims 1-3, characterized in that, The method further includes: Given the inference result of the target inference path, update the inference statistics parameters of each non-root node in the target inference path; the inference statistics parameters include the number of successful inferences of the non-root node, the total number of times the non-root node is visited, and the total number of times the parent node of the non-root node is visited, and the inference result is either successful or failed.

12. The method according to any one of claims 1-3, characterized in that, The method further includes: When the target reasoning path satisfies the answer conditions, a reasoning thought chain is generated through the large language model. The reasoning thought chain includes reasoning steps to obtain the target answer from the target information.

13. A reasoning device, characterized in that, The device includes: An information acquisition unit is configured to acquire target information input from an electronic device, the target information including a reasoning object and a target question, the target question being a question posed to the reasoning object, the reasoning object being an object of any type; The reasoning tree acquisition unit is configured to acquire a reasoning tree through a large language model, the reasoning tree including a root node and multiple non-root nodes, each of the non-root nodes corresponding to an answer for answering the target question; The path search unit is configured to search for a target reasoning path in the reasoning tree to answer the target question using the large language model. The answer determination unit is configured to determine the target answer corresponding to the target question based on the answer of at least one node on the target reasoning path, provided that the target reasoning path satisfies the answer conditions, so as to output the target answer to the user.

14. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the reasoning method as described in any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the reasoning method as described in any one of claims 1 to 12.

16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the reasoning method according to any one of claims 1 to 12.