## 3 Materials and Methods
### Question Answering Method  
**Dynamic Operation Tree Generation. ** The Planner is responsible for generating the operation tree at each step. As shown in Figure 2, when the number of samples is 1, the operation tree degrades into an operation chain. During each planning process, the Planner combines the current state of the table and the task goal to infer the optimal possible operation for the next step and assigns a confidence level to each operation. The Planner also takes into account the success rate and accuracy of the operation, dynamically adjusting the operation tree to improve the accuracy of the final table generation and the quality of corpus supplementation. The algorithm is presented in Algorithm 1. ```
0:\(T\) is the current state of the table, \(Q\) is the task goal, \(n\) is the number of samples, \(k\) is the number of operations to consider in each iteration, and \(P_{\text{threshold}}\) is the probability threshold. 0:\(A_{\text{final}}\) is the final sequence of candidate actions. 1: Initialize an empty list \(A_{\text{final}}\) for the final sequence of actions. 2:\(nextAction\leftarrow\) None
3:repeat
4: Initialize an empty list \(A\) for all candidate actions. 5:for\(i=1\) to \(n\)do\(\triangleright\) Sample \(n\) times
6:\(action_{i}\leftarrow\text{GenerateAction}(T,Q)\)\(\triangleright\) Generate \(action_{i}\)
7:\(logp_{i}\leftarrow\text{Generated log}p(action_{i})\)
8:\(p_{i}\gets e^{logp_{i}}\)
9:\(A.append((action_{i},p_{i}))\)
10:endfor
11: Sort \(A\) by \(p_{i}\) in descending order. 12:\(A_{\text{topk}}\leftarrow\text{SelectTopK}(A,k)\)\(\triangleright\) Select the top \(k\) highest probability actions. 13:\(A_{\text{candidate}}\leftarrow\text{FilterByThreshold}(A_{\text{topk}},P_{ \text{threshold}})\)\(\triangleright\) Filter actions based on the threshold. 14:\(A_{next}\leftarrow\text{SelectNextAction}(A_{\text{candidate}})\)\(\triangleright\) Select the next action. 15:if\(A_{next}\
eq\text{`}



1. **Planner Reads the Initial Table and the Question and Plans:** As a dynamic planner, the Planner generates and manages a series of action chains. Based on the current state of the table and the task goal, the Planner performs \(n\) samplings, selects the value of \(\log p_{i}\) as the confidence level, and infers the operation tree. By continuously optimizing the action chain, the Planner improves the decision-making efficiency and accuracy of the system. 2. **Worker Executes Specific Operations:** As the execution component, the Worker executes each operation formulated by the Planner step by step. According to the Planner's instructions, the Worker makes dynamic adjustments to the table data (such as adding a column with add_col, performing conditional selection with select_where_row, etc. ), and retrieves information from the external knowledge base or the knowledge embedded in the model when necessary through operations like retrieve_from_repo or query. The Worker feeds back the result of each step of execution to the Planner for further adjustment and optimization of the action chain. All table operations are managed based on Python's pandas' dataframe ([[https://pandas.pydata.org](https://pandas.pydata.org)]([https://pandas.pydata.org](https://pandas.pydata.org)), accessed on 7 March 2025) to ensure the efficiency and consistency of data processing. When the number of samples is \(n\), for each sample, the corresponding operation and its \(\log p_{i}\) are obtained. The term \(\log p_{i}\) refers to the logarithm of the probability of the first token of the next action generated by the LLM ([[https://platform.openai.com/docs/api-reference/chat/create#chat-create-logprobs](https://platform.openai.com/docs/api-reference/chat/create#chat-create-logprobs)]([https://platform.openai.com/docs/api-reference/chat/create#chat-create-logprobs](https://platform.openai.com/docs/api-reference/chat/create#chat-create-logprobs)), accessed on 7 March 2025).