Inference path allocation method and device for structured data question answering, medium

By using a teacher model to filter path trajectories and fine-tuning the student model, and updating path labels based on computational cost and answer correctness, the problems of path consistency and resource consumption in structured data question-answering systems are solved, achieving efficient question-answering accuracy and low-cost path allocation.

CN123180385APending Publication Date: 2026-11-27ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611676133.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-28
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing structured data question answering systems struggle to simultaneously balance answer accuracy, computational resource consumption, and consistency between processing paths and actual execution behavior when handling inputs of varying difficulty.

Method used

The teacher model filters out path trajectories that are correct and conform to the path protocol. The student model is then fine-tuned to determine the first path label that meets the requirements based on computational cost from low to high. The student model is then updated based on the consistency between the actual path and the path label of the output trajectory, computational cost, and correctness of the answer.

Benefits of technology

While ensuring the accuracy of question answering and the compliance of the path, priority is given to allocating efficient inference paths with lower costs, thereby reducing average computational overhead and response latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123180385A_ABST
    Figure CN123180385A_ABST
Patent Text Reader

Abstract

The application discloses a structured data question-answering oriented reasoning path allocation method and device, and a medium, comprising: obtaining training samples containing structured data, questions and standard answers, and presetting a plurality of candidate reasoning paths with different path protocols and different calculation costs; performing each candidate path by a teacher model, screening path trajectories with correct answers and in line with the protocol to fine-tune a student model; performing the candidate paths by the fine-tuned student model from low to high cost, taking the first correct path in line with the protocol as a path label, and training the student model in combination with the corresponding trajectory; generating output trajectories under each candidate path and free output trajectories of paths not previously specified, determining rewards according to the consistency of actual paths and labels, calculation costs and answer correctness, and updating the student model with the multi-trajectory rewards of the same sample; during reasoning, the student model generates a path label according to input structured data and questions, reasons according to the corresponding path protocol and outputs an answer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of structured data processing technology, and in particular relates to a method, device, and medium for reasoning path allocation for structured data question answering. Background Technology

[0002] With the development of natural language processing and large language modeling technologies, question answering technology based on structured data has been widely applied to information retrieval and analysis of databases, spreadsheets, and other structured data objects. The process of structured data question answering typically involves receiving structured data and questions posed based on that data, and then using a language model to understand the semantics of the questions, analyze the data content, and generate corresponding answers.

[0003] Existing structured data question answering systems can employ different processing methods for different types of questions. For example, for simple questions that can be directly determined by the model, the answer can be generated directly; for questions involving multi-step analysis, the natural language reasoning process can be generated first, and then the answer can be output; for questions involving data filtering, aggregation statistics, multi-row comparisons, etc., structured query statements can be generated, and the query results can be obtained with the help of external tools such as database executors. The amount of model generation, processing steps, and number of external tool calls required by the above processing methods are different, and the requirements for the model's reasoning ability also vary.

[0004] Existing technologies employ pre-defined, fixed processing flows, uniformly executing processes such as direct response, explicit reasoning, structured querying, table decomposition, iterative validation, or multi-module collaboration for different inputs. However, the processing difficulty varies among different structured data question-answering inputs. Using a complex flow involving multi-step reasoning or external tool calls for simple inputs increases unnecessary model forward generation steps, output data volume, and tool call volume; conversely, using a simpler flow for complex inputs may result in insufficient computation to accurately complete data filtering, aggregation, or comparison, thus affecting the accuracy of the question-answering results. Therefore, fixed processing flows struggle to balance question-answering accuracy with computational resource consumption.

[0005] In approaches employing multiple processing paths, if the training process only supervises path categories without constraining the correspondence between path categories and actual execution processes, the path labels output by the model may be inconsistent with their actual behavior. For example, the model might output path labels representing multi-step reasoning but fail to generate a valid reasoning process; or it might output path labels representing structured queries but fail to actually invoke an external executor. If further optimization is based solely on answer correctness, generated length, or nominal path categories, the model may obtain superficially low-cost results by omitting necessary processing steps, causing the path labels to lose their verifiable behavioral meaning and affecting the reliability of the deployment phase.

[0006] In summary, existing structured data question answering technologies still struggle to simultaneously balance answer accuracy, computational resource consumption, and consistency between processing paths and actual execution behavior when handling inputs of varying difficulty. Therefore, a pressing technical challenge is how to rationally configure the computation process based on the processing requirements of different inputs and the actual processing capabilities of the model to be deployed, while ensuring the accuracy of structured data question answering, reducing unnecessary model generation and external tool calls, and guaranteeing that the adopted processing paths are actually executed. Summary of the Invention

[0007] To address the shortcomings of existing technologies, embodiments of the present invention provide a method, device, and medium for inference path allocation in structured data question answering.

[0008] In a first aspect, embodiments of the present invention provide a reasoning path allocation method for structured data question answering, the method comprising:

[0009] Acquire training samples including structured data, questions, and standard answers, and pre-set multiple candidate inference paths with different path protocols and computational costs;

[0010] The training samples are input into the teacher model, and each candidate reasoning path is executed. The path trajectories with correct answers and in accordance with the path protocol are retained to fine-tune the student model.

[0011] The student model is fine-tuned and executes each candidate reasoning path sequentially according to the computational cost from low to high. The first candidate reasoning path with the correct answer and conforming to the corresponding path protocol is used as the path label of the training sample, and the student model is trained according to the path label and the corresponding path trajectory.

[0012] The trained student model generates output trajectories for each candidate inference path for the same training sample, as well as at least one free output trajectory without a pre-specified candidate inference path; the reward for each output trajectory is calculated based on the consistency between the actual path and the path label, the computational cost, and the correctness of the answer; the student model is updated based on the rewards of each output trajectory for the same sample.

[0013] The structured data to be answered and the question are input into the updated student model to generate path labels. Reasoning is then performed according to the path protocol corresponding to the path label, and the answer is output.

[0014] In a second aspect, embodiments of the present invention provide an electronic device, comprising:

[0015] At least one processor; and

[0016] A memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores one or more computer programs that can be executed by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the above-described reasoning path allocation method for structured data question answering.

[0018] Thirdly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-described reasoning path allocation method for structured data question answering.

[0019] Fourthly, embodiments of the present invention provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements the above-described reasoning path allocation method for structured data question answering.

[0020] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0021] This invention uses a teacher model to select path trajectories with correct answers and conforming to the path protocol, and then enables the student model to determine the first path label that meets the requirements according to computational cost from low to high, learning the correspondence between questions and suitable inference paths. Furthermore, based on the output trajectories under multiple inference paths, a reward is calculated and updated for the student model by comprehensively considering path consistency, computational cost, and answer correctness. The updated student model is then deployed to perform structured data question answering. Therefore, this invention can prioritize the allocation of effective inference paths with lower costs while ensuring the accuracy and compliance of structured data question answering, thereby reducing average computational overhead and response latency. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A flowchart illustrating the reasoning path allocation method for structured data question answering provided in this embodiment of the invention;

[0024] Figure 2 This is a schematic diagram illustrating how the student model provided in this embodiment of the invention executes candidate inference paths one by one according to computational cost.

[0025] Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0026] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0027] It should be noted that, in the case of no conflict, the following embodiments and features in the implementation modes can be combined with each other.

[0028] As shown in Figure 1 , an embodiment of the present invention provides a reasoning path allocation method for structured data question answering, and the method includes the following steps:

[0029] Step S1: Obtain training samples including structured data, questions and standard answers, and preset multiple candidate reasoning paths with different path protocols and computational costs.

[0030] Specifically, in this embodiment, the WikitableQA, Tabfact, FeTaQA, and HiTab datasets are used as the training sample set, and the training samples are denoted as x=(T,q), where T represents the structured data and q represents the question corresponding to the structured data.

[0031] Set several candidate reasoning path sets R with different path protocols and computational costs for the structured data question answering task, for example: R={Direct, CoT, SQL}.

[0032] The direct answering path (Direct) is that the large language model directly generates an answer;

[0033] The Chain of Thought path (CoT) is that the large language model generates an answer after an internal reasoning process;

[0034] The Structured Query Language path (SQL) is that the large language model generates an SQL query, sends the SQL query to a database, and generates an answer according to the query result returned by the database.

[0035] In this embodiment, the path cost relationship is set as Direct<CoT<SQL, that is, the direct answering path has the lowest cost, the Chain of Thought path is next, and the Structured Query Language path has the highest cost.

[0036] Step S2: Input the training samples into a teacher model, execute each candidate reasoning path respectively, and retain path trajectories with correct answers and compliance with the path protocol, so as to fine-tune a student model.

[0037] Specifically, step S2 includes the following sub-steps:

[0038] Step S201: Input the training samples into the teacher model, execute each candidate inference path respectively, and obtain the path trajectory of each training sample under each candidate inference path.

[0039] In this example, the teacher model does not choose the best path on its own, but instead executes the Direct path, CoT path, and SQL path for each training sample separately.

[0040] Step S202: Verify each path trajectory and retain successful path trajectories with correct answers and conforming to the path protocol.

[0041] The path protocol corresponding to the Direct path is:

[0042] <route> Direct< / route>

[0043] <answer> Final Answer< / answer>

[0044] The path protocol corresponding to the CoT path is:

[0045] <route> CoT< / route>

[0046] <reasoning> thought process< / reasoning>

[0047] <answer> Final Answer< / answer>

[0048] The path protocol corresponding to the SQL path is:

[0049] <route> SQL< / route>

[0050] <reasoning> thought process< / reasoning>

[0051] <sql> query statement< / sql>

[0052] <EXECUTION_RESULT> The execution result returned by the database< / EXECUTION_RESULT>

[0053] <answer> Final Answer< / answer>

[0054] Furthermore, the process by which the teacher model executes the structured query language path includes:

[0055] The teacher model generates SQL queries;

[0056] Send the SQL query to the database corresponding to the structured data for execution;

[0057] Inject the query results or error feedback returned by the database into the context of the teacher model, so that the teacher model can continue to generate answers or generate corrected SQL queries based on the query results or error feedback;

[0058] When the teacher model generates a revised SQL query, the SQL query is executed repeatedly and the corresponding query results or error feedback are injected into the context of the teacher model until the teacher model generates an answer or the preset termination condition is met.

[0059] The termination conditions include reaching the maximum number of execution rounds or the number of consecutive empty query results returned reaching a preset threshold.

[0060] Step S203: Fine-tune the student model using the successful path trajectory.

[0061] It should be noted that step S203 uses the successful path trajectory to fine-tune the student model, so that the student model can first master the actual execution method of each candidate inference path.

[0062] Step S3: According to the computational cost from low to high, the fine-tuned student model executes each candidate reasoning path in sequence, and the first candidate reasoning path with the correct answer and conforming to the corresponding path protocol is used as the path label of the training sample.

[0063] Furthermore, in this example, such as Figure 2 As shown, to reduce detection costs, the computational costs of the direct answer path, the thought chain path, and the structured query language path are increased sequentially from low to high. The fine-tuned student model is controlled to execute the direct answer path, the thought chain path, and the structured query language path in sequence. When any candidate reasoning path generates a correct answer and conforms to the corresponding path protocol, the candidate reasoning path is identified as a path label and the execution of other candidate reasoning paths is stopped. When all candidate reasoning paths fail, the corresponding training samples are not used for training the student model.

[0064] The process involves executing the Direct path first; if the Direct path fails, the CoT path is executed; and if both the Direct and CoT paths fail, the SQL path is executed. Once a candidate inference path succeeds, it is used as the path label for a training sample, and subsequent higher-cost candidate inference paths are discontinued.

[0065] Furthermore, the path label is defined as:

[0066]

[0067]

[0068] In the formula, Let x represent the path label corresponding to the training sample x, and r represent the candidate inference path; This indicates that the student model obtains the correct answer along the candidate inference path r on the training sample x, and its path trajectory satisfies the path protocol of the candidate inference path r. This represents the ranking of the computational costs of candidate inference paths r.

[0069] Step S4: Train the student model based on the path labels and corresponding path trajectories.

[0070] Specifically, the output lexical units are divided into path label lexical units used to represent path labels. and used to represent the remaining terms other than path tags ;

[0071] Based on the number of path label terms and the number of trajectory terms, respectively, construct the path label term prediction loss and the trajectory term prediction loss; the expressions are as follows:

[0072]

[0073]

[0074] In the formula, This represents the path tag term prediction loss. This represents the trajectory term prediction loss. This represents the set of position indices for path tag terms. This represents the set of position indices for all other terms except path tags. Indicates the number of path tag terms. Indicates the number of tokens other than path tags; Indicates the token's location index. This represents the predicted probability that the student model outputs the correct target token. This represents the target token at position j in the training sample.

[0075] The weighted sum of the path label term prediction loss and the trajectory term prediction loss is used as the joint loss function, and the student model is trained based on the joint loss function; the expression is as follows:

[0076]

[0077] In the formula, γ is the path label weight. In one embodiment, γ = 5.

[0078] Step S5: The trained student model generates output trajectories for each candidate inference path for the same training sample, as well as at least one free output trajectory without a pre-specified candidate inference path; the reward for each output trajectory is calculated based on the consistency between the actual path and the path label, the computational cost, and the correctness of the answer; the student model is updated based on the rewards of each output trajectory for the same sample.

[0079] Specifically, the trained student model generates output trajectories under controlled Direct path, controlled CoT path, and controlled SQL path for the same training sample, as well as at least one free output trajectory (i.e., non-fixed output path) without pre-specified candidate inference path.

[0080] The reward for each output trajectory is:

[0081]

[0082] In the formula, This represents the format anchoring benefit determined by the validity of the path label and the non-empty answer label. A valid closed path label is awarded +0.10, and a closed and non-empty answer label is awarded +0.05. This indicates the result of determining whether the answer to a structured data question-answering task is correct. Indicates consistency of behavior; Indicates the basic benefits of correctness; For the actual generation and tool call costs, This is an indicator function that returns 1 if the condition is true and 0 otherwise.

[0083] The correctness-based basic benefit set here. Greater than the maximum possible cost deduction ( In this example, we take 0.05 + 0.10 = 0.15 and the format-anchored return. This ensures that a correct output with consistent behavior is always superior to any incorrect or inconsistent output. Therefore, correctness of the answer is the primary optimization objective, and cost only plays a decisive role among multiple successful behaviors.

[0084] Among them, behavioral consistency The expression is as follows:

[0085]

[0086] For each output trajectory, the declared path label, the number of inferred terms, and the database execution record in the output trajectory are parsed to determine the behavior consistency indicator. When the declared path label is a direct answer path, if the number of inferred terms is less than a preset threshold (for example, the threshold is set to 40) and there is no database execution record, the behavior consistency indicator is set to 1; otherwise, it is set to 0. When the declared path label is a thought chain path, if the number of inferred terms is not less than the preset threshold and there is no database execution record, the behavior consistency indicator is set to 1; otherwise, it is set to 0. When the declared path label is a structured query language path and there is at least one database execution result, the behavior consistency indicator is set to 1; otherwise, it is set to 0.

[0087] Furthermore, for the output trajectory y generated by each candidate inference path, record the actual number of tokens n(y) generated by the model and the actual number of tool calls m(y), and calculate the normalized cost. The expression is as follows:

[0088]

[0089] In the formula, B represents the normalized baseline for the number of tokens; K represents the normalized baseline for the number of tool calls; Indicates the cost weight of the token; This represents the cost weight of tool calls; min(·,1) is used to truncate the cost of a single item to prevent an abnormally long output or a large number of tool calls from causing the cost to increase indefinitely.

[0090] In one embodiment, the process of updating the student model based on the rewards of each output trajectory of the same sample includes: first performing a correctness warm-up update with zero cost weight, and then continuing with cost-aware updates from that checkpoint. Online updates can employ group-relative strategy optimization: centering rewards within the output group of the same input, using a relative advantage update strategy, without requiring an additional value model. Alternatively, other strategy optimization algorithms that satisfy the above-mentioned behavioral consistency gating and reward order relationship can also be used.

[0091] For example, the basic reward for correctness is 1; the maximum cost of tokens is 0.10, and the normalization benchmark for tokens is 1024; the maximum cost of tools is 0.05, and the normalization benchmark for tools is 2; 192 correctness warm-up updates are performed first, followed by 192 cost-aware updates.

[0092] Step S6: Input the structured data to be answered and the question into the updated student model, generate path labels, perform reasoning according to the path protocol corresponding to the path label, and output the answer.

[0093] Specifically, the structured data to be answered and the questions are input into the updated student model. The student model first generates path labels, and then generates corresponding path trajectories according to the path labels: if it is a Direct path, the answer is generated directly; if it is a CoT path, the answer is generated after an internal reasoning process; if it is an SQL path, an SQL query is generated and interacted with the database before the answer is generated.

[0094] Example 1

[0095] This embodiment is used to verify the implementation effect of the reasoning path allocation method provided by the present invention in a table-based question-and-answer task.

[0096] Experimental data was constructed using four types of table-based tasks: HiTab, FeTaQA, TabFact, and WikiTableQuestions. The input data included at least the table to be processed and the corresponding question. For each input sample, three candidate inference paths—Direct, CoT, and SQL—were pre-defined.

[0097] The Direct path enables the student model to directly generate answers based on the table and the question, without generating explicit intermediate reasoning processes; the CoT path enables the student model to first generate intermediate reasoning processes corresponding to the current question, and then generate answers based on the intermediate reasoning processes; the SQL path enables the student model to generate structured query statements for the current table based on the question, and determine the answers based on the execution results of the structured query statements.

[0098] The method of this application was implemented using student models with parameter sizes of 1.7B, 4B, and 8B, respectively. For each student model, a frozen test set containing 2,000 samples was used for evaluation.

[0099] A fixed CoT strategy was set as the first control strategy. In the fixed CoT strategy, inference paths were no longer assigned based on input samples; instead, all test samples were forced to be processed using the CoT path. On student models of 1.7B, 4B, and 8B sizes, the method of this invention reduced the number of model-generated tokens by 31.0% to 49.8% compared to the fixed CoT strategy. At the same time, the task success rate of the method of this invention was on par with the fixed CoT strategy, or improved by 0.4 to 4.3 percentage points.

[0100] The above results show that the method of the present invention can allocate inference paths according to the processing requirements of input samples, so that samples that do not require complex inference adopt processing paths with shorter generation lengths, and samples that require multi-step inference or structured queries adopt corresponding CoT paths or SQL paths, thereby reducing the number of tokens generated by the model without reducing the success rate of the task.

[0101] Example 2

[0102] This embodiment uses a student model with a parameter scale of 1.7B to perform ablation verification on path label supervision and behavioral consistency.

[0103] When training only path labels, the success rate was 14.8% and the protocol effectiveness rate was 0.4%; after training the path labels together with the complete trajectory, the success rate and protocol effectiveness rate reached 63.8% and 98.1%, respectively.

[0104] Removing behavioral consistency reduces success rate, increases overall computational cost, and decreases protocol efficiency, indicating that joint supervision and behavioral consistency gating are both effective technical means to maintain path semantics.

[0105] In summary, this invention uses a teacher model to select path trajectories with correct answers that conform to the path protocol, and then enables the student model to determine the first path label that meets the requirements according to computational cost from low to high, learning the correspondence between questions and suitable inference paths. Furthermore, based on the output trajectories under multiple inference paths, it calculates rewards by integrating path consistency, computational cost, and answer correctness, and updates the student model accordingly. The updated student model is then deployed to perform structured data question answering. Therefore, this invention can prioritize the allocation of effective inference paths with lower costs while ensuring the accuracy and compliance of structured data question answering, thereby reducing average computational overhead and response latency.

[0106] Accordingly, this application also provides an electronic device, including: one or more processors; a memory for storing one or more programs; and, when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the inference path allocation method for structured data question answering as described above. Figure 3 The diagram shown illustrates a hardware structure of any device with data processing capabilities for the inference path allocation method for structured data question answering provided in this embodiment of the invention, except... Figure 3 In addition to the processor, memory, and network interface shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.

[0107] Accordingly, this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the inference path allocation method for structured data question answering as described above. The computer-readable storage medium can be an internal storage unit of any data-processing device as described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units of any data-processing device and external storage devices. The computer-readable storage medium is used to store the computer program and other programs and data required by the data-processing device, and can also be used to temporarily store data that has been output or will be output.

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

[0109] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. A reasoning path allocation method for structured data question answering, characterized in that, The method includes: Acquire training samples including structured data, questions, and standard answers, and pre-set multiple candidate inference paths with different path protocols and computational costs; The training samples are input into the teacher model, and each candidate reasoning path is executed. The path trajectories with correct answers and in accordance with the path protocol are retained to fine-tune the student model. The student model is fine-tuned and executes each candidate reasoning path sequentially according to the computational cost from low to high. The first candidate reasoning path with the correct answer and conforming to the corresponding path protocol is used as the path label of the training sample, and the student model is trained according to the path label and the corresponding path trajectory. The trained student model generates output trajectories for each candidate inference path for the same training sample, as well as at least one free output trajectory without a pre-specified candidate inference path; the reward for each output trajectory is calculated based on the consistency between the actual path and the path label, the computational cost, and the correctness of the answer; the student model is updated based on the rewards of each output trajectory for the same sample. The structured data to be answered and the question are input into the updated student model to generate path labels. Reasoning is then performed according to the path protocol corresponding to the path label, and the answer is output.

2. The reasoning path allocation method for structured data question answering according to claim 1, characterized in that, Candidate reasoning paths include: direct answer path, thought chain path, and structured query language path; Among them, the direct answer path involves the large language model directly generating the answer; The thought process involves a large language model generating an answer through an internal reasoning process. The Structured Query Language path generates SQL queries for the large language model, sends the SQL queries to the database, and generates answers based on the query results returned by the database.

3. The reasoning path allocation method for structured data question answering according to claim 2, characterized in that, The process of executing a structured query language path in a teacher model or student model includes: Generate SQL queries from teacher or student models; Send the SQL query to the database corresponding to the structured data for execution; Inject the query results or error feedback returned by the database into the context of the teacher model or student model, so that the teacher model or student model can continue to generate answers or generate corrected SQL queries based on the query results or error feedback; When the teacher model or student model generates a revised SQL query, the SQL query is executed repeatedly and the corresponding query results or error feedback are injected into the context of the teacher model or student model until the teacher model or student model generates an answer or meets the preset termination condition. The termination conditions include reaching the maximum number of execution rounds or the number of consecutive empty query results returned reaching a preset threshold.

4. The reasoning path allocation method for structured data question answering according to claim 2, characterized in that, The process of sequentially executing candidate inference paths according to computational cost from low to high, and using the first candidate inference path with the correct answer and conforming to the corresponding path protocol as the path label for the training sample, includes: The computational cost increases sequentially from the direct answer path, the thought chain path, to the structured query language path. Based on computational cost from low to high, the fine-tuned student model is controlled to execute the direct answer path, the thought chain path, and the structured query language path in sequence. When any candidate reasoning path generates a correct answer and conforms to the corresponding path protocol, the candidate reasoning path is identified as a path label and the execution of other candidate reasoning paths is stopped. When all candidate reasoning paths fail, the corresponding training samples are not used for training the student model.

5. The reasoning path allocation method for structured data question answering according to claim 1, characterized in that, The process of training a student model based on path labels and corresponding path trajectories includes: The output tokens are divided into path tag tokens, which represent path tags, and trajectory tokens, which represent the corresponding path trajectories. Based on the number of path label words and the number of trajectory words, respectively construct path label word prediction loss and trajectory word prediction loss; The weighted result of the path label term prediction loss and the trajectory term prediction loss is used as the joint loss function, and the student model is trained based on the joint loss function.

6. The reasoning path allocation method for structured data question answering according to claim 2, characterized in that, The calculation process for the consistency between the actual path and the path label of the output trajectory includes: For each output trajectory, the path labels declared in the output trajectory, the number of inferred terms, and the database execution records are analyzed to determine the behavior consistency indicator. When the declared path label is a direct answer path, if the number of inference terms is less than the preset threshold and there is no database execution record, the behavior consistency indicator is set to 1; otherwise, it is set to 0. When the declared path label is a thought chain path, if the number of inference terms is not less than the preset threshold and there is no database execution record, the behavior consistency indicator is set to 1; otherwise, it is set to 0. The behavior consistency indicator is set to 1 if the declared path label is a Structured Query Language path and there is at least one database execution result; otherwise, it is set to 0.

7. The reasoning path allocation method for structured data question answering according to claim 1, characterized in that, The process of determining the computational cost of the output trajectory includes: Obtain the number of model-generated lexical units and the actual number of tool calls generated when generating the output trajectory; The ratio of the number of tokens generated by the calculation model to the preset normalized benchmark of the number of tokens is used to determine the smaller value between this ratio and the normalization upper limit as the token cost. The ratio of the actual number of times the tool is called to the preset normalized baseline of the number of calls is used to determine the smaller value between the ratio and the normalization upper limit as the tool call cost. The lexical cost and tool call cost are weighted according to the preset lexical cost weight and tool call cost weight respectively, and the sum of the weighted results is determined as the calculation cost of the output trajectory.

8. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs that can be executed by the at least one processor, the one or more of the computer programs being executed by the at least one processor to enable the at least one processor to perform the reasoning path allocation method for structured data question answering as described in any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the reasoning path allocation method for structured data question answering as described in any one of claims 1-7.

10. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the reasoning path allocation method for structured data question answering as described in any one of claims 1-7.