PFDial: A Structured Dialogue Instruction Fine-tuning Method Based on UML Flowcharts
Authors: Ming Zhang, Yuhui Wang, Yujiong Shen, Tingyi Yang, Changhao Jiang, Yilong Wu, Shihan Dou, Qinhao Chen, Zhiheng Xi, Zhihao Zhang, Yi Dong, Zhen Wang, Zhihui Fei, Mingyang Wan, Tao Liang, Guojun Ma, Qi Zhang, Tao Gui, Xuanjing Huang
Accepted at: acl25

PFDial: A Structured Dialogue Instruction Fine-tuning Method Based on UML Flowcharts

Ming Zhang1*, Yuhui Wang1†, Yujiang Shen1*, Tingyi Yang1, Changhao Jiang1, Yilong Wu1, Shihan Dou1, Qinhao Chen5, Zhiheng Xi1, Zhihao Zhang1, Yi Dong1, Zhen Wang2, Zhihui Fei2, Mingyang Wan2, Tao Liang2, Guojun Ma2‡, Qi Zhang1,4‡, Tao Gui3,4, Xuanjing Huang1,3,4
1 College of Computer Science and Artificial Intelligence, Fudan University
2 Douyin Co., Ltd.
3 Institute of Modern Languages and Linguistics, Fudan University
4 Institute of Trustworthy Embodied Artificial Intelligence, Fudan University
5 Graduate School of Arts and Sciences, Columbia University
mingzhang23@m.fudan.edu.cn
maguojun@bytedance.com
qz@fudan.edu.cn

Abstract

Process-driven dialogue systems, which operate under strict predefined process constraints, are essential in customer service and equipment maintenance scenarios. Although Large Language Models (LLMs) have shown remarkable progress in dialogue and reasoning, they still struggle to solve these strictly constrained dialogue tasks. To address this challenge, we construct Process Flow Dialogue (PFDial) dataset, which contains 12,705 high-quality Chinese dialogue instructions derived from 440 flowcharts containing 5,055 process nodes. Based on PlantUML specification, each UML flowchart is converted into atomic dialogue units i.e., structured five-tuples. Experimental results demonstrate that a 7B model trained with merely 800 samples, and a 0.5B model trained on total data both can surpass 90% accuracy. Additionally, the 8B model can surpass GPT-4o up to 43.88% with an average of 11.00%. We further evaluate models’ performance on challenging backward transitions in process flows and conduct an in-depth analysis of various dataset formats to reveal their impact on model performance in handling decision and sequential branches. The data is released in https://github.com/KongLongGeFUD/PFDial.

1 Introduction

Process-driven dialogue systems (Yi et al., 2024), as a special type of task-oriented dialogue systems, play a crucial role in various real-world applications, particularly in scenarios such as customer service, equipment maintenance, and medical consultation, where strict adherence to predefined process constraints is essential. In these contexts, dialogue systems must navigate through complex decision trees while maintaining precise control over the conversation flow, ensuring both compliance with established procedures and effective user interaction. These process flows typically contain two types of branch: sequential branches that follow a linear progression and decision branches that require conditional routing based on user input. Figure 1 illustrates an example scenario of process-driven dialogue systems.

The emergence of Large Language Models (LLMs) has brought unprecedented capabilities in natural language understanding and generation, demonstrating remarkable performance in both dialogue and reasoning tasks. These advances suggest

Figure 1: In this scenario, the system interacts with the user based on a flowchart that checks whether the power supply is functioning properly. If the power supply is faulty, the system guides the user to remove the battery. This interaction follows the decision-making process outlined in the flowchart.
potential solutions for process-driven dialogue systems (Yi et al., 2024; Zhang et al., 2023; Wu et al., 2020). However, our empirical evaluation reveals that even state-of-the-art (SOTA) LLMs such as GPT-4o (OpenAI, 2023) struggle to consistently maintain process constraints while engaging in dialogue. Specifically, these models often deviate from predefined process constraints, make incorrect state transitions, or fail to properly handle complex decision branches, highlighting the need for more specialized solutions.

To address this challenge, we construct Process Flow Dialogue (PFDial) dataset, which contains 12,705 high-quality dialogue instructions derived from 440 flowcharts containing 5,055 process nodes. Based on PlantUML specification, each UML flowchart is converted into atomic dialogue units, forming structured five-tuples (flowchart description, current state, user input, next state, robot output). This structured representation enables models to learn precise state transitions while maintaining natural dialogue capabilities. Through supervised fine-tuning (SFT) on PFDial, models can acquire strong controlled reasoning capabilities for process flows effectively following the prescribed state transitions and decision logic.

We conducted comprehensive experiments to address four key questions:

(1) How does our approach perform compared to SOTA LLMs? Our main experimental results demonstrate that models with varying parameter sizes can achieve excellent results after SFT on total data of PFDial. For instance, even a 0.5B model can achieve accuracy of 98.99% and 92.79% on in-domain and out-of-domain tests, respectively. More impressively, an 8B model achieves 97.02% accuracy on out-of-domain tests, surpassing GPT-4o by 11.00%, with over 43.88% improvement in decision branches.

(2) How does model performance scale with training data size? Our data scaling experimental results show that a 7B model can surpass 90% accuracy with only 800 training samples. As the training dataset increases, the overall performance of the model continues to improve. This underscores PFDial’s exceptional effectiveness in enhancing the model’s capability for controlled reasoning tasks with minimal data.

(3) How effective is our approach in handling backward transitions? We evaluated the model’s performance on more challenging backward transitions in decision branches using our constructed dataset, PFDial-H. This specialized benchmark focuses on cases where the next state returns to a previous point in the process flow. These transitions are particularly challenging due to their relative scarcity and the complex reasoning they require. Results on PFDial-H further validate our approach’s superiority in challenging controlled reasoning tasks.

(4) How do different state representation formats affect model performance? Through systematic analysis of three different dataset formats, we provide interpretable insights into how different formats impact model performance on decision and sequential branches, offering valuable guidance for future research.

Overall, our contributions can be summarized as follows:

• We have developed the Process Flow Dialogue (PFDial) dataset, which is derived from 440 flowcharts encompassing 5,055 process nodes. This dataset contains 12,705 high-quality dialogue instructions, serving as a valuable resource for training process-driven dialogue systems.

• The comprehensive experiments demonstrate that the PFDial dataset is highly effective. Even models with a smaller number of parameters (e.g., 0.5B, 1B, 1.5B) or those trained on relatively limited data (800 training samples) can achieve high accuracy. An 8B model achieves 97.02% accuracy on out-of-domain tests, surpassing GPT-4o by 11.00%, with over 43.88% improvement in decision branches.

• We demonstrate our model’s superior performance on complex backward transitions in decision branches using the PFDial-H benchmark, highlighting its capability in handling rare and intricate reasoning tasks. Additionally, we provide insights into the impact of different dataset formats on model performance, offering guidance for future research.

2 PFDial

In this section, we introduce PFDial, a Chinese dataset specifically designed for process-driven dialogue systems.
Figure 2: The left side illustrates the data construction process. The right side shows an example of the five-tuple dataset generated based on the leftside flowchart.

<table>
  <tr>
    <th>Statistics</th>
    <th>Train</th>
    <th>ID Test</th>
    <th>OOD Test</th>
  </tr>
  <tr>
    <td>Flowcharts</td>
    <td>440</td>
    <td>80</td>
    <td>80</td>
  </tr>
  <tr>
    <td>State Nodes</td>
    <td>5055</td>
    <td>902</td>
    <td>1262</td>
  </tr>
  <tr>
    <td>Sequential Samples</td>
    <td>9029</td>
    <td>1628</td>
    <td>2265</td>
  </tr>
  <tr>
    <td>Decision Samples</td>
    <td>3676</td>
    <td>645</td>
    <td>698</td>
  </tr>
  <tr>
    <td>Dialogue Samples</td>
    <td>12705</td>
    <td>2273</td>
    <td>2963</td>
  </tr>
  <tr>
    <td>Avg. Length</td>
    <td>277.16</td>
    <td>270.57</td>
    <td>326.10</td>
  </tr>
</table>

Table 1: Statistics of the PFDial Dataset

2.1 Dataset Overview

PFDial The construction of PFDial follows a systematic pipeline, including flow chart collection, textual representation conversion, state transition Information extraction, prompt generation, and data validation. The dataset combines real-world scenarios and synthetic data, achieving broad coverage of practical applications while maintaining high quality and diversity. Table 1 presents detailed statistics of the PFDial dataset.

PFDial-H Considering the prevalence and importance of backward transitions in practical applications, we specifically constructed a supplementary dataset that incorporates backward transition mechanisms called PFDial-Hard (PFDial-H). By strategically adding backward transition nodes to existing flowcharts using GPT-4o, we implemented backward transition functionality for cases where conditions are not met. This improvement was applied to both the out-of-domain test and training flowcharts, generating new training samples through the same prompt augmentation process. Table 5 in Appendix B.2 presents detailed statistics of the PFDial-H dataset.

2.2 Dataset Construction Process

Flow Chart Collection Through extensive research, we identified and categorized 90 specific business scenarios, details of which can be found in the Appendix 18. Additionally, we designed a carefully constructed template dataset. After identifying the business scenarios, we collected the flowcharts manually or automatically, depending on whether pre-existing flowcharts were available. This process, combining automation with human review, significantly improved the efficiency and
accuracy of UML flowchart generation.

Textual Representation Conversion To efficiently convert flowcharts into machine-readable formats, we conducted a comparative study of several text-based representation schemes, including PlantUML1, chart-mage2, nomnoml3, and Mermaid4. After comprehensive evaluation, we selected PlantUML as the standard format. This decision was made for several reasons: First, PlantUML employs a code-like structured representation utilizing syntax features such as indentation, branching, and loops, making flowchart descriptions both intuitive to read and convenient for program processing. Second, a preliminary experiment using GPT-4o demonstrated that the PlantUML format exhibited superior accuracy compared to other approaches. Details can be find in Table 4 in Appendix B.1. During data processing, we represented all flowcharts in PlantUML format and generated standardized state nodes and their transition relationships through parsing, providing a unified representation for subsequent five-tuple dataset generation.

State Transition Information Extraction Based on the standardized PlantUML representation, we developed a specialized algorithm to extract complete state transition information, which is shown in Algorithm 1 in Appendix A.1. During this process, we got all existing paths and identified 5,055 distinct state nodes from the training set. Each state transition pair (current state -> next state) strictly corresponds to a specific path in the flowchart, ensuring the accuracy and consistency of the state information extraction.

Prompt Generation To create quality training samples, we used the GPT-4o model for bidirectional prompt augmentation for each state transition. This involved generating user input and robot output based on the current and next states, along with the flowchart. Detailed prompts can be found in Appendix D.

Data Validation To ensure the reliability of the dataset, we implemented a rigorous multi-level validation process: first, ensuring that all state nodes strictly correspond to the original flowcharts; second, validating the syntax correctness of the PlantUML; and finally, checking the logical consistency between user inputs and state transitions. Any data that does not meet these criteria will be regenerated.

This dataset construction methodology not only ensures data quality and diversity, but also provides a solid foundation for subsequent model training. Through systematic construction processes and strict quality control, the PFDiaI dataset effectively balances authenticity, standardization, and scalability requirements. Figure 2 illustrates the data construction process flowchart and an example of the five-tuple dataset generated based on the data construction flowchart.

3 Experiments

In this chapter, we present a series of comprehensive experiments to address the four key questions mentioned in Section 1. We conducted the main experiment, data scaling experiment, backward transition studies, and format ablation studies respectively.

3.1 Experimental Setup

Base Models We evaluate our method using two series of base models with varying parameter sizes. The first series includes Qwen2.5 models (Yang et al., 2024) ranging from 0.5B to 7B parameters (Qwen2.5-0.5B, Qwen2.5-1.5B, Qwen2.5-3B, and Qwen2.5-7B). The second series consists of Llama3 models (Dubey et al., 2024) spanning from 1B to 8B parameters (Llama3.2-1B, Llama3.2-3B, and Llama3.1-8B). This diverse selection of models enables us to comprehensively analyze the impact of model scale on performance.

Baselines For comparison, we select a comprehensive set of both open-source and proprietary state-of-the-art (SOTA) LLMs that have demonstrated strong performance across various NLP tasks. These include proprietary models like GPT-4o (OpenAI, 2023), GPT-3.5-turbo (Ouyang et al., 2022a), Gemini-2.0-flash-exp (Anil et al., 2023), and Claude-3.5-sonnet 5, as well as open-source models such as DeepSeek-v3 (DeepSeek-Al et al., 2024), Llama3.1-8b-instruct (Dubey et al., 2024), and Qwen2.5-7b-instruct (Yang et al., 2024). These models represent the current frontier of language model capabilities and serve as strong baselines for evaluating our approach.

1https://plantuml.com/
2https://chartmage.com/intro.html
3https://www.nomnoml.com/
4https://mermaid.js.org/
5https://www.anthropic.com/news/clause-3-family
<table>
  <tr>
    <th rowspan="2">Model</th>
    <th colspan="3">ID-test</th>
    <th colspan="3">OOD-test</th>
  </tr>
  <tr>
    <th>Acc</th>
    <th>Decision Acc</th>
    <th>Sequential Acc</th>
    <th>Acc</th>
    <th>Decision Acc</th>
    <th>Sequential Acc</th>
  </tr>
  <tr>
    <th colspan="7">Baselines</th>
  </tr>
  <tr>
    <td>LLaMA-3.1-8B-Instruct</td>
    <td>--</td>
    <td>--</td>
    <td>--</td>
    <td>13.20</td>
    <td>2.16</td>
    <td>15.00</td>
  </tr>
  <tr>
    <td>Claude-3.5-Sonnet</td>
    <td>--</td>
    <td>--</td>
    <td>--</td>
    <td>62.74</td>
    <td>22.06</td>
    <td>69.40</td>
  </tr>
  <tr>
    <td>Qwen2.5-7B-Instruct</td>
    <td>--</td>
    <td>--</td>
    <td>--</td>
    <td>65.87</td>
    <td>37.88</td>
    <td>71.34</td>
  </tr>
  <tr>
    <td>Gemini-2.0-Flash-Exp</td>
    <td>--</td>
    <td>--</td>
    <td>--</td>
    <td>75.17</td>
    <td>47.48</td>
    <td>79.66</td>
  </tr>
  <tr>
    <td>DeepSeek-v3</td>
    <td>--</td>
    <td>--</td>
    <td>--</td>
    <td>79.02</td>
    <td>47.72</td>
    <td>84.11</td>
  </tr>
  <tr>
    <td>GPT-3.5-Turbo</td>
    <td>--</td>
    <td>--</td>
    <td>--</td>
    <td>79.76</td>
    <td>39.57</td>
    <td>86.29</td>
  </tr>
  <tr>
    <td>GPT-4o</td>
    <td>--</td>
    <td>--</td>
    <td>--</td>
    <td>86.29</td>
    <td>51.80</td>
    <td>91.90</td>
  </tr>
  <tr>
    <th colspan="7">FineTuned on PFDial</th>
  </tr>
  <tr>
    <td>LLaMA-3.2-1B</td>
    <td>98.90</td>
    <td><b>98.59</b></td>
    <td>98.96</td>
    <td>93.57</td>
    <td>87.05</td>
    <td>94.62</td>
  </tr>
  <tr>
    <td>LLaMA-3.2-3B</td>
    <td>98.77</td>
    <td>98.02</td>
    <td>98.91</td>
    <td>95.81</td>
    <td>91.37</td>
    <td>96.53</td>
  </tr>
  <tr>
    <td>LLaMA-3.1-8B</td>
    <td><b>99.03</b></td>
    <td>98.31</td>
    <td><b>99.17</b></td>
    <td><b>97.29</b></td>
    <td><b>96.88</b></td>
    <td>97.35</td>
  </tr>
  <tr>
    <td>Qwen2.5-0.5B</td>
    <td>98.99</td>
    <td>98.02</td>
    <td><b>99.17</b></td>
    <td>91.35</td>
    <td>89.45</td>
    <td>91.66</td>
  </tr>
  <tr>
    <td>Qwen2.5-1.5B</td>
    <td>98.90</td>
    <td>97.46</td>
    <td><b>99.17</b></td>
    <td>94.00</td>
    <td>88.97</td>
    <td>94.82</td>
  </tr>
  <tr>
    <td>Qwen2.5-3B</td>
    <td>98.77</td>
    <td>98.31</td>
    <td>98.85</td>
    <td>94.97</td>
    <td>89.69</td>
    <td>95.84</td>
  </tr>
  <tr>
    <td>Qwen2.5-7B</td>
    <td>98.94</td>
    <td>98.02</td>
    <td>99.11</td>
    <td>96.51</td>
    <td>90.65</td>
    <td><b>97.47</b></td>
  </tr>
</table>

Table 2: Results on PFDial: Decision Acc represents the accuracy of the decision branch, and Sequential Acc reflects the accuracy of the sequential branch. Acc is The overall accuracy.

![Two line plots showing accuracy vs data size for ID and OOD tests](page_101_670_646_312.png)

Figure 3: Results on Data Scaling: The left plot shows the accuracy of ID and OOD tests using data scaling strategy (a), while the right plot shows the accuracy using data scaling strategy (b).

Datasets Our main experiments utilize the PFDial dataset containing 12,705 training samples. For evaluation, we maintain two test sets: our out-of-domain test set comprising 698 decision branches and 2,963 sequential branches, and an in-domain test set containing 645 decision branches and 1628 sequential branches. For backward transition experiments, we use the specially constructed PFDial-H dataset. For format ablation studies, we construct corresponding training and test sets in three different state representation formats to systematically evaluate their impact on model performance.

Implementation Details We combine the PFDial dataset with the general dialogue dataset BELLE (BELLEGroup, 2023; Wen et al., 2023) in a 1:1 ratio for SFT. For the training process, we utilize the OpenRLHF(Hu et al., 2024) framework. For instance, the training of Qwen2.5-7B model is conducted on 8 H20 GPUs, with a total training time of approximately 1 hour. For detailed hyper-parameter configurations, please refer to Table 6 in Appendix C.1.

Evaluation Metrics Model performance is evaluated by exact match accuracy between predicted and ground truth next states. For a prediction to be considered correct, it must exactly match the ground truth state transition. Specifically, our dataset contains two types of samples: sequential samples and decision samples. Sequential samples refer to cases where there is only one unique next state given the current state. Decision samples
<table>
  <tr>
    <th rowspan="2">Model</th>
    <th colspan="3">PFDial-H</th>
    <th colspan="3">OOD-test of PFDial</th>
  </tr>
  <tr>
    <th>Acc</th>
    <th>Backward Acc(Dist < 5)</th>
    <th>Backward Acc(Dist ≥ 5)</th>
    <th>Acc</th>
    <th>Decision Acc</th>
    <th>Sequential Acc</th>
  </tr>
  <tr>
    <th colspan="7">Baselines</th>
  </tr>
  <tr>
    <td>LLaMA-3.1-8B-Instruct</td>
    <td>15.00</td>
    <td>13.64</td>
    <td>15.52</td>
    <td>13.20</td>
    <td>2.16</td>
    <td>15.00</td>
  </tr>
  <tr>
    <td>Claude-3.5-Sonnet</td>
    <td>57.50</td>
    <td>59.09</td>
    <td>56.90</td>
    <td>62.74</td>
    <td>22.06</td>
    <td>69.40</td>
  </tr>
  <tr>
    <td>Qwen2.5-7B-Instruct</td>
    <td>31.25</td>
    <td>31.82</td>
    <td>31.03</td>
    <td>65.87</td>
    <td>37.88</td>
    <td>71.34</td>
  </tr>
  <tr>
    <td>Gemini-2.0-Flash-Exp</td>
    <td>26.25</td>
    <td>22.73</td>
    <td>27.59</td>
    <td>75.17</td>
    <td>47.48</td>
    <td>79.66</td>
  </tr>
  <tr>
    <td>DeepSeek-v3</td>
    <td>40.00</td>
    <td>31.82</td>
    <td>43.10</td>
    <td>79.02</td>
    <td>47.72</td>
    <td>84.11</td>
  </tr>
  <tr>
    <td>GPT-3.5-Turbo</td>
    <td>51.25</td>
    <td>54.55</td>
    <td>50.00</td>
    <td>79.76</td>
    <td>39.57</td>
    <td>86.29</td>
  </tr>
  <tr>
    <td>GPT-4o</td>
    <td>58.75</td>
    <td>68.18</td>
    <td>55.17</td>
    <td>86.29</td>
    <td>51.80</td>
    <td>91.90</td>
  </tr>
  <tr>
    <th colspan="7">Secondary Fine-tuning</th>
  </tr>
  <tr>
    <td>Qwen2.5-0.5B</td>
    <td>58.75</td>
    <td>77.27</td>
    <td>51.72</td>
    <td>50.77</td>
    <td>52.67</td>
    <td>39.09</td>
  </tr>
  <tr>
    <td>Qwen2.5-1.5B</td>
    <td>47.50</td>
    <td>45.45</td>
    <td>48.28</td>
    <td>87.90</td>
    <td>88.82</td>
    <td>82.25</td>
  </tr>
  <tr>
    <td>Qwen2.5-3B</td>
    <td>57.50</td>
    <td>59.09</td>
    <td>56.90</td>
    <td>79.73</td>
    <td>80.91</td>
    <td>72.42</td>
  </tr>
  <tr>
    <td>Qwen2.5-7B</td>
    <td>66.25</td>
    <td>90.91</td>
    <td>56.90</td>
    <td>76.04</td>
    <td>76.82</td>
    <td>71.22</td>
  </tr>
  <tr>
    <th colspan="7">Integrated Training</th>
  </tr>
  <tr>
    <td>Qwen2.5-0.5B</td>
    <td>65.00</td>
    <td>72.73</td>
    <td>62.07</td>
    <td>92.76</td>
    <td>93.22</td>
    <td>89.93</td>
  </tr>
  <tr>
    <td>Qwen2.5-1.5B</td>
    <td>70.00</td>
    <td>72.73</td>
    <td>68.97</td>
    <td>93.87</td>
    <td>94.82</td>
    <td>88.01</td>
  </tr>
  <tr>
    <td>Qwen2.5-3B</td>
    <td>75.00</td>
    <td><b>90.91</b></td>
    <td>68.97</td>
    <td>94.57</td>
    <td>96.18</td>
    <td>84.65</td>
  </tr>
  <tr>
    <td>Qwen2.5-7B</td>
    <td><b>76.25</b></td>
    <td>86.36</td>
    <td><b>72.41</b></td>
    <td><b>96.31</b></td>
    <td><b>96.96</b></td>
    <td><b>92.33</b></td>
  </tr>
</table>

Table 3: Results on PFDial and PFDial-H: Backward Acc represents the accuracy of backward transition.

refer to cases where there are at least two possible next states for the current state. Accordingly, our accuracy can be further refined into two types: sequential accuracy and decision accuracy.

3.2 Main Results

Table 2 presents our detailed experimental results on the main experiments. Our experiments demonstrate significant improvements over baseline models across all parameter scales. Even our smallest 0.5B parameter model achieves 91.35% accuracy on out-of-domain tests, with particularly strong performance on decision branches. Our 8B model achieves sota performance with 97.29% accuracy on out-of-domain tests, surpassing GPT-4o by 11%. In decision branches, our 8B parameter model achieves 96.88% accuracy, surpassing GPT-4o by 43.88%. See Appendix E for a detailed case study analyzing the reasons behind model errors.

3.3 Data Scaling Experiments

Experimental Setup To investigate data efficiency, we conducted experiments with varying training data sizes from 100 to 12,705 samples. We employed two data scaling strategies: (a) keeping fixed 12,000 general dialogue data samples while gradually increasing PFDial data, and (b) maintaining a 1:1 ratio mixing of general dialogue data and PFDial data.

Results and Analysis Figure 3 presents our experimental results on the data scaling experiments. The results demonstrate remarkable performance even with limited data: using only 800 samples, a 7B model can surpass 90% accuracy on OOD test. Performance continues to improve consistently with increased data volume, though we observe diminishing returns after approximately 3,000 samples. The comparable performance across both data scaling strategies validates the effectiveness of our PFDial dataset, demonstrating its robust data efficiency regardless of the mixing approach. For comprehensive results on decision accuracy and sequential accuracy across various data scaling configurations, please refer to Appendix C.2.

3.4 Backward Transition Studies

Experimental Setup We evaluated models’ capability in handling complex backward transitions on the PFDial-H test set, which provides a more rigorous assessment of models’ ability to strictly follow process constraints. The details of PFDial-H test set is shown in table 5 in Appendix B.2. For handling backward transitions, we compared two approaches: integrated training, which incorporates 440 PFDial-H training data samples to our PFDial training data during initial training, and secondary fine-tuning, which applies a secondary fine-tuning phase using PFDial-H data on the SFT-completed model with 440 PFDial-H training data samples.

Results and Analysis Detailed experimental results are shown in Table 3. Our results demonstrate that our method achieves optimal performance in handling backward branches, with the integrated training approach yielding superior results by main-
Figure 4: Results on Model Performance with Different Formats: The left plot shows the sequential accuracy for different models across three different formats (Format-NL, Format-SC, and Format-Hybrid). The right plot shows the decision accuracy for the same models under the same formats.

Figure 5: Logits changes of Three formats

taining robust performance on forward transitions while significantly improving accuracy in backward transition cases. Specifically, with integrated training, the Qwen2.5-7B model achieves 76.25% overall accuracy on PFDial-H, with 86.36% accuracy on backward transitions with distance less than 5, and 72.41% accuracy on transitions with distance greater than or equal to 5. Meanwhile, the model maintains a high accuracy of 96.31% on the OOD test.

In contrast, secondary fine-tuning not only fails to improve performance on backward transition cases but also reduces performance on the PFDial dataset, with Qwen2.5-7B’s OOD test accuracy dropping from 96.31% to 76.04%. These results emphasize the importance of integrating backward transition samples during the initial training process rather than treating them as a post-hoc fine-tuning step.

3.5 Format Abliation Studies

Experimental Setup We conducted experiments for three state representation formats: Format-NL: natural language description (default method), Format-SC: state codes (e.g., S1, C2), and Format-Hybrid: combining codes and descriptions to explore the impact of different data formats on model performance and the underlying reasons. Specific cases of data in different formats and the visualization results can be seen in Appendix C.3. To ensure fairness, we fine-tuned the base model on data in all three formats and tested it with corresponding test sets containing the same content.

We then froze the attention heads of each layer and compared the model’s output logits with the original logits in these scenarios. By examining the logits changes , we assessed the impact of each attention head after fine-tuning with different formats. Finally, we visualized these attention heads to gain deeper insights into their roles.
Results and Analysis  The model performance with different formats are shown in Figure 4. The results indicate that Format B achieved the highest accuracy in most cases, particularly on Decision Accuracy, however, it performed slightly worse than other formats on Sequential Accuracy. The following experimental results, to some extent, shed light on the reasons behind this phenomenon.

The comparison results of the three formats’s attention heads are shown in Figure 5. The models fine-tuned with FormatB and FormatC showed a more uniform and diverse distribution of attention head contributions. This can be explained that both of the latter formats introduced code state identifiers, requiring the language model to learn both the sequence of state transitions and the correspondence between code states and natural language states. Thus more attention heads with different functions were activated.

In particular, head_layer27_head20 is crucial in all three formats. We visualized this attention head’s scores for all three formats in Figure 6, Figure 7, and Figure 8, respectively, focusing on significant differences. The attention scores for both the natural language and hybrid formats were concentrated at the intersection of the user’s current state and the corresponding state in the flowchart-Format-Hybrid, which includes some state codes, showed a more moderated concentration. In contrast, Format-SC did not exhibit such clustering. We hypothesize that the introduction of state codes allows the model’s attention to generalize across different input parts, rather than being confined to specific segments. This enables models to better understand user inputs and facilitates learning of global logic, such as condition checking and state selection. This also reasonably explains previous results.

4 Related Work

4.1 Controllable Reasoning in LLMs

Controllable reasoning in LLMs has gained significant attention in recent years. Ouyang et al. (2022b) pioneered instruction-guided control via Reinforcement Learning from Human Feedback (RLHF), combining supervised fine-tuning (SFT), reward model training, and Proximal Policy Optimization (PPO) to align outputs with human preferences. While effective, this approach requires complex annotation and training (Li and Liang, 2021). In contrast, our approach simplifies the process by encoding reasoning logic into structured UML state flowcharts, guiding learning through SFT alone. This provides a clear, human-readable control mechanism, addressing the ‘reasoning opacity’ challenge (Liang et al., 2024b).

4.2 Graph-based Enhanced Reasoning

Previous research (Pan et al., 2024) has explored graph-based approaches to enhance the reasoning capabilities of LLMs. Several works (Liang et al., 2024a; Luo et al., 2024a,b) have used Knowledge Graph (KG) structural information to reduce hallucinations by breaking reasoning into path extraction and inference steps. Similarly, Zhou et al. (2024) showed that graph-based training improves multi-hop reasoning accuracy. However, these methods mainly treat graphs as external knowledge sources rather than explicit control mechanisms.

4.3 LLM-based Dialogue Systems

Task-Oriented Dialogue (TOD) systems help users achieve specific goals through conversations (Yi et al., 2024). Current approaches fall into two main categories: Pipeline-based Approaches, which separate dialogue systems into modules with LLMs handling specific tasks (Comi et al., 2023; Parikh et al., 2023; Chen et al., 2019; Nguyen et al., 2023), and End-to-End Approaches, which use LLMs to generate responses based on the entire dialogue history (Hemanthage et al., 2023; Zhang et al., 2024, 2023; Wu et al., 2020; Algherairy and Ahmed, 2025). Pipeline-based Approaches offer better transparency but require extensive annotated data, while End-to-End Approaches are simpler but less controllable and demand higher model capabilities.

5 Conclusion

In this paper, we introduce the PFDial dataset, a novel resource designed to enhance process-driven dialogue systems. By utilizing structured dialogue instructions derived from UML flowcharts, PFDial provides a robust framework for training models to handle complex decision-making and sequential processes. Our experiments demonstrate that models fine-tuned on PFDial achieve high accuracy, even with limited training data, and outperform sota LLMs like GPT-4o on specific tasks.

We conducted an in-depth analysis of backward transitions using the PFDial-H dataset, highlighting the importance of integrated training approaches for maintaining strong performance across diverse
dialogue scenarios. Additionally, we explored the impact of various data representation formats, finding that structured state codes significantly improve the accuracy of state transition predictions.

Overall, our work underscores the potential of structured datasets like PFIDial to advance process-driven dialogue systems, offering new insights into the design and training of models for precise and controlled reasoning. Future research will focus on expanding the dataset to cover more scenarios and refining training methodologies to enhance model generalization and adaptability.

Limitations

Our research presents a comprehensive set of experiments, yet it is not without limitations. First, the Chinese-centric nature of our dataset introduces potential cross-lingual generalization constraints. Second, the scarcity of standardized flowchart benchmarks in Chinese process specifications increases the risk of domain-specific biases, despite our rigorous validation framework. Besides, the potential residual inconsistencies in flow-to-text conversion may emerge from the inherent subjectivity in interpreting semantic structures.

Acknowledgments

The authors wish to thank anonymous reviewers for their helpful comments. This work was partially funded by National Natural Science Foundation of China (No.62376061,62206057), Shanghai Rising-Star Program (23QA1400200), Natural Science Foundation of Shanghai (23ZR1403500), Program of Shanghai Academic Research Leader under grant 22XD1401100.

References

Atheer Algherairy and Moataz Ahmed. 2025. Prompting large language models for user simulation in task-oriented dialogue systems. Comput. Speech Lang., 89:101697.

Rohan Anil, Sebastian Borgeaud, Yonghui Wu, Jean-Baptiste Alayrac, Jiahui Yu, Radu Soricut, Johan Schalkwyk, Andrew M. Dai, Anja Hauth, Katie Millican, David Silver, Slav Petrov, Melvin Johnson, Ioannis Antonoglou, Julian Schrittwieser, Amelia Glaese, Jilin Chen, Emily Pitler, Timothy P. Lillicrap, Angeliki Lazaridou, Orhan Firat, James Molloy, Michael Isard, Paul Ronald Barham, Tom Hennigan, Benjamin Lee, Fabio Viola, Malcolm Reynolds, Yuanzhong Xu, Ryan Doherty, Eli Collins, Clemens Meyer, Eliza Rutherford, Erica Moreira, Kareem Ayoub, Megha Goel, George Tucker, Enrique Piqueras, Maxim Krikun, Iain Barr, Nikolay Savinov, Ivo Danihelka, Becca Roelofs, Anaïs White, Anders Andreassen, Tamara von Glehn, Lakshman Yagati, Mehran Kazemi, Lucas Gonzalez, Misha Khalmian, Jakub Sygnowski, and et al. 2023. Gemini: A family of highly capable multimodal models. CoRR, abs/2312.11805.

BELLEGroup. 2023. Belle: Be everyone’s large language model engine. https://github.com/LianJiaTech/BELLE.

Qian Chen, Zhu Zhuo, and Wen Wang. 2019. BERT for joint intent classification and slot filling. CoRR, abs/1902.10909.

Daniele Comi, Dimitrios Christofidellis, Pier Francesco Piazza, and Matteo Manica. 2023. Zero-shot-bert-adapters: a zero-shot pipeline for unknown intent detection. In Findings of the Association for Computational Linguistics: EMNLP 2023, Singapore, December 6-10, 2023, pages 650–663. Association for Computational Linguistics.

DeepSeek-AI, Aixin Liu, Bei Feng, Bing Xue, Bingxuan Wang, Bochao Wu, Chengda Lu, Chenggang Zhao, Chengqi Deng, Chenyu Zhang, Chong Ruan, Damai Dai, Daya Guo, Dejian Yang, Deli Chen, Dongjie Ji, Erhang Li, Fangyun Lin, Fucong Dai, Fuli Luo, Guangbo Hao, Guanting Chen, Guowei Li, H. Zhang, Han Bao, Hanwei Xu, Haocheng Wang, Haowei Zhang, Honghui Ding, Huajian Xin, Huaotu Gao, Hui Li, Hui Qu, J. L. Cai, Jian Liang, Jianzhong Guo, Jiaqi Ni, Jiashi Li, Jiawei Wang, Jin Chen, Jingchang Chen, Jingyang Yuan, Junjie Qiu, Junlong Li, Junxiao Song, Kai Dong, Kai Hu, Kaige Gao, Kang Guan, Kexin Huang, Kuai Yu, Lean Wang, Lecong Zhang, Lei Xu, Leyi Xia, Liang Zhao, Litong Wang, Liyue Zhang, Meng Li, Miaojun Wang, Mingchuan Zhang, Minghua Zhang, Minghui Tang, Mingming Li, Ning Tian, Panpan Huang, Peiyi Wang, Peng Zhang, Qiancheng Wang, Qihao Zhu, Qinyu Chen, Qiushi Du, R. J. Chen, R. L. Jin, Ruiqi Ge, Ruisong Zhang, Ruizhe Pan, Runji Wang, Runxin Xu, Ruoyu Zhang, Ruyi Chen, S. S. Li, Shanghao Lu, Shangyan Zhou, Shanhuan Chen, Shaqoing Wu, Shengfeng Ye, Shengfeng Ye, Shirong Ma, Shiyu Wang, Shuang Zhou, Shuiping Yu, Shunfeng Zhou, Shuting Pan, T. Wang, Tao Yun, Tian Pei, Tianyu Sun, W. L. Xiao, and Wangding Zeng. 2024. Deepseek-v3 technical report. CoRR, abs/2412.19437.

Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, Anirudh Goyal, Anthony Hartshorn, Aobo Yang, Archi Mitra, Archie Sravan Kumar, Artem Korenev, Arthur Hinsvark, Arun Rao, Aston Zhang, Aurélien Rodriguez, Austen Gregerson, Ava Spataru, Baptiste Rozière, Bethany Biron, Binh Tang, Bobbie Chern, Charlotte Caucheteux, Chaya Nayak, Chloe Bi, Chris Marra, Chris McConnell, Christian Keller, Christophe Touret, Chunyang Wu, Corinne Wong,
Cristian Canton Ferrer, Cyrus Nikolaidis, Damien Alionsius, Daniel Song, Danielle Pintz, Danny Livshits, David Esiobu, Dhruv Choudhary, Dhruv Mahajan, Diego Garcia-Olano, Diego Perino, Dieuwke Hupkes, Egor Lakomkin, Ehab AlBadawy, Elina Lobanova, Emily Dinan, Eric Michael Smith, Filip Radenovic, Frank Zhang, Gabriel Synnaeve, Gabrielle Lee, Georgia Lewis Anderson, Graeme Nail, Grégoire Mialon, Guan Pang, Guillem Cucurell, Hailey Nguyen, Hannah Korevaar, Hu Xu, Hugo Touvron, Iliyan Zarov, Imanol Arrieta Ibarra, Isabel M. Kloumann, Ishan Misra, Ivan Evtimov, Jade Copet, Jaewon Lee, Jan Geffert, Jana Vranes, Jason Park, Jay Mahadeokar, Jeet Shah, Jelmer van der Linde, Jennifer Billock, Jenny Hong, Jenya Lee, Jeremy Fu, Jianfeng Chi, Jianyu Huang, Jiawen Liu, Jie Wang, Jiecao Yu, Joanna Bitton, Joe Spisak, Jongsoo Park, Joseph Rocca, Joshua Johnstun, Joshua Saxe, Junteng Jia, Kalyan Vasudevanwala, Kartikeya Upasani, Kate Plawiak, Ke Li, Kenneth Heafield, Kevin Stone, and et al. 2024. The llama 3 herd of models. CoRR, abs/2407.21783.

Bhathiya Hemanthage, Christian Dondrup, Phil Bartie, and Oliver Lemon. 2023. Simpletmod: A simple language model for multimodal task-oriented dialogue with symbolic scene representation. CoRR, abs/2307.04907.

Jian Hu, Xibin Wu, Weixun Wang, Xianyu, Dehao Zhang, and Yu Cao. 2024. Openrlhf: An easy-to-use, scalable and high-performance RLHF framework. CoRR, abs/2405.11143.

Xiang Lisa Li and Percy Liang. 2021. Prefix-tuning: Optimizing continuous prompts for generation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, ACL/IJCNLP 2021, (Volume 1: Long Papers), Virtual Event, August 1-6, 2021, pages 4582–4597. Association for Computational Linguistics.

Xun Liang, Hanyu Wang, Shichao Song, Mengting Hu, Xunzhi Wang, Zhiyu Li, Feiyu Xiong, and Bo Tang. 2024a. Controlled text generation for large language model with dynamic attribute graphs. In Findings of the Association for Computational Linguistics, ACL 2024, Bangkok, Thailand and virtual meeting, August 11-16, 2024, pages 5797–5814. Association for Computational Linguistics.

Xun Liang, Hanyu Wang, Yezhaohui Wang, Shichao Song, Jiawei Yang, Simin Niu, Jie Hu, Dan Liu, Shunyu Yao, Feiyu Xiong, and Zhiyu Li. 2024b. Controllable text generation for large language models: A survey. CoRR, abs/2408.12599.

Haoran Luo, Haihong E, Zichen Tang, Shiyao Peng, Yikai Guo, Wentai Zhang, Chenghao Ma, Guanting Dong, Meina Song, Wei Lin, Yifan Zhu, and Anh Tuan Luu. 2024a. Chatkba: A generate-then-retrieve framework for knowledge base question answering with fine-tuned large language models. In Findings of the Association for Computational Linguistics, ACL 2024, Bangkok, Thailand and virtual meeting, August 11-16, 2024, pages 2039–2056. Association for Computational Linguistics.

Linhao Luo, Yuan-Fang Li, Gholamreza Haffari, and Shirui Pan. 2024b. Reasoning on graphs: Faithful and interpretable large language model reasoning. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net.

Hoang Nguyen, Ye Liu, Chenwei Zhang, Tao Zhang, and Philip S. Yu. 2023. Cof-cot: Enhancing large language models with coarse-to-fine chain-of-thought prompting for multi-domain NLU tasks. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, EMNLP 2023, Singapore, December 6-10, 2023, pages 12109–12119. Association for Computational Linguistics.

OpenAI. 2023. GPT-4 technical report. CoRR, abs/2303.08774.

Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul F. Christiano, Jan Leike, and Ryan Lowe. 2022a. Training language models to follow instructions with human feedback. In Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022.

Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul F. Christiano, Jan Leike, and Ryan Lowe. 2022b. Training language models to follow instructions with human feedback. In Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022.

Shirui Pan, Linhao Luo, Yufei Wang, Chen Chen, Jiapu Wang, and Xindong Wu. 2024. Unifying large language models and knowledge graphs: A roadmap. IEEE Trans. Knowl. Data Eng., 36(7):3580–3599.

Soham Parikh, Mitul Tiwari, Prashil Tumbade, and Quaziar Vohra. 2023. Exploring zero and few-shot techniques for intent classification. In Proceedings of the The 61st Annual Meeting of the Association for Computational Linguistics: Industry Track, ACL 2023, Toronto, Canada, July 9-14, 2023, pages 744–751. Association for Computational Linguistics.

Cheng Wen, Xianghui Sun, Shuaijiang Zhao, Xiaoquan Fang, Liangyu Chen, and Wei Zou. 2023. Chathome:
Development and evaluation of a domain-specific language model for home renovation. arXiv preprint arXiv:2307.15290.

Chien-Sheng Wu, Steven C. H. Hoi, Richard Socher, and Caiming Xiong. 2020. TOD-BERT: pre-trained natural language understanding for task-oriented dialogue. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 917–929. Association for Computational Linguistics.

An Yang, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chengyuan Li, Dayiheng Liu, Fei Huang, Haoran Wei, Huan Lin, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Yang, Jiaxi Yang, Jingren Zhou, Junyang Lin, Kai Dang, Keming Lu, Keqin Bao, Kexin Yang, Le Yu, Mei Li, Mingfeng Xue, Pei Zhang, Qin Zhu, Rui Men, Runji Lin, Tianhao Li, Tingyu Xia, Xingzhang Ren, Xuancheng Ren, Yang Fan, Yang Su, Yichang Zhang, Yu Wan, Yuqiong Liu, Zeyu Cui, Zhenru Zhang, and Zihan Qiu. 2024. Qwen2.5 technical report. CoRR, abs/2412.15115.

Zihao Yi, Jiariu Ouyang, Yuwen Liu, Tianhao Liao, Zhe Xu, and Ying Shen. 2024. A survey on recent advances in llm-based multi-turn dialogue systems. CoRR, abs/2402.18013.

Ming Zhang, Caishuang Huang, Yilong Wu, Shichun Liu, Huiyuan Zheng, Yurui Dong, Yujiqiong Shen, Shihan Dou, Jun Zhao, Junjie Ye, Qi Zhang, Tao Gui, and Xuanjing Huang. 2024. Transfertod: A generalizable chinese multi-domain task-oriented dialogue system with transfer capabilities. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, EMNLP 2024, Miami, FL, USA, November 12-16, 2024, pages 12750–12771. Association for Computational Linguistics.

Xiaoying Zhang, Baolin Peng, Kun Li, Jingyan Zhou, and Helen Meng. 2023. SGP-TOD: building task bots effortlessly via schema-guided LLM prompting. In Findings of the Association for Computational Linguistics: EMNLP 2023, Singapore, December 6-10, 2023, pages 13348–13369. Association for Computational Linguistics.

Jiaming Zhou, Abbas Ghaddar, Ge Zhang, Liheng Ma, Yaochen Hu, Soumyasundar Pal, Mark Coates, Bin Wang, Yingxue Zhang, and Jianye Hao. 2024. Enhancing logical reasoning in large language models through graph-based synthetic data. CoRR, abs/2409.12437.

A Algorithm

A.1 Parse PlantUML Code

This algorithm parses the given PlantUML code by line by line. It initializes an empty dictionary, nodeDict, to store state nodes. Then, it calls PARSESEQUENTIAL (Algorithm 2) to process the sequential flow. Finally, it returns all paths originating from the start node, representing the complete execution flow.

Algorithm 1 Parse PlantUML Code
1: function PARSEPLANTUML(code)
2:   Split code into lines
3:   Initialize an empty dictionary nodeDict to store nodes
4:   Call PARSESEQUENTIAL
5:   return all paths originating from the start node
6: end function

A.2 Parse Sequential Blocks

This algorithm parses the sequential execution flow by processing each line to identify states. Sequential states create and merge new nodes, while decision states call PARSEDECISION (Algorithm 3) for further processing.

Algorithm 2 Parsing Sequential Blocks
1: function PARSESEQUENTIAL(startNode, lines, nodeDict)
2:   root ← startNode
3:   for each line in lines do
4:     Trim whitespace
5:     if the line represents a sequential state then
6:       Create a new node into nodeDict
7:       Merge new nodes
8:     else if the line represents a decision state then
9:       Call PARSEDECISION
10:      Connect new nodes
11:    else
12:      Continue processing
13:    end if
14:  end for
15:  return
16: end function

A.3 Parse Decision Blocks

This algorithm handles decision structures by first parsing the "if" block using PARSESEQUENTIAL (Algorithm 2). If an "else if" block is encountered, it recursively calls itself to process nested conditions. For an "else" block, it parses the sequence and connects the resulting nodes using PARSESEQUENTIAL (Algorithm 2). This ensures correct
branching and flow control within decision blocks.

Algorithm 3 Parsing Decision Blocks

function PARSEDECISION(startNode, lines, nodeDict)
    root ← startNode
    Call PARSESEQUENTIAL to parse “if” block
    if meet “else if” block then
        Recursively call PARSEDECISION
        Connect new nodes
        return
    else if meet “else” block then
        Parse the “else” block using PARSESEQUENTIAL
        Connect new nodes
        return
    else
        return
    end if
end function

B Dataset

B.1 Different Format to Represent Flowchart
In Table 4, we compares different formats to represent flowchart. We select a complex flowchart with 21 paths, and let GPT-4o to find all paths and count the number paths. Only with PlantUML, GPT-4o correctly output the right path number, which means flowchart with PlantUML is easy for models to understand. Moreover, syntax features, as is shown in Table 4, such as indentation branching, and loops, making PlantUML a good format to read and convenient for program processing.

B.2 PFDialog-H Tests
Table 5 presents the details of PFDialog-H tests, including the total number of dialogues in the test set, average dialogue length in turns, and the proportion of dialogues with backward transition distances divided by the threshold of 5.

C Experimental Details

C.1 Implementation Details
To ensure reproducibility of our experiments, we provide detailed hyper-parameter configurations used in our training process. All experiments were conducted using the AdamW optimizer with cosine annealing learning rate scheduling. The complete set of training hyper-parameters is presented in Table 6. We maintained consistent hyper-parameter settings across models of different scales to ensure fair comparison.

C.2 Supplementary Data for Data Scaling Experiment
While the section 3.3 presents the overall accuracy trend with increasing training samples, here we provide the complete experimental results. Tables 13 and 14 present the performance results for Strategy A and Strategy B respectively. Each table shows overall accuracy, decision accuracy, and sequential accuracy metrics on both ID and OOD tests across different training sample sizes. The information of dataset with different training sample sizes is shown in Table 12.

C.3 Details in Format Ablation Study
In this section, we present specific cases of data in different formats and the visualization results for head_layer27_head20. As shown in Figure 6, 7, and 8, we visualize the attention patterns for Format-NL (Natural Language) in Table 15, Format-SC (State Code) in Table 16, and Format-Hybrid in Table 17 respectively.

D Prompt

D.1 Prompt for generating User Input
We use the prompt from Table 7 to generate user inputs. This prompt helps us create appropriate user input text based on the given state transitions.

D.2 Prompt for generating Robot Output
We use the prompt from Table 8 to generate robot outputs. This prompt helps us create appropriate robot responses based on the current state, next state, and user input.
<table>
  <tr>
    <th>Format</th>
    <th>PlantUML</th>
    <th>ChartMage</th>
    <th>NomNoml</th>
    <th>Meamaid</th>
  </tr>
  <tr>
    <td rowspan="2">Decision Block</td>
    <td>if (D) then (C1)<br>S1<br>else (C2)<br>S2</td>
    <td>D - C1 ->> S1<br>D - C2 ->> S2</td>
    <td>[D] C1-> [Block1]<br>[D] C2-> [Block2]</td>
    <td>A{D} – C1 -> B[S1]<br>A – C2 -> C[S2]</td>
  </tr>
  <tr>
    <td colspan="4"></td>
  </tr>
  <tr>
    <td>Input</td>
    <td colspan="4">Here is the flowchart code:<br>[a UML flowchart with 21 paths, expressed in the corresponding format]<br>Show all possible complete paths and count how many there are.</td>
  </tr>
  <tr>
    <td>Path Count</td>
    <td>21</td>
    <td>15</td>
    <td>19</td>
    <td>17</td>
  </tr>
</table>

Table 4: Comparison of Flowchart Formats

<table>
  <tr>
    <th>Backward Distance &lt; 5</th>
    <th>22</th>
  </tr>
  <tr>
    <th>Backward Distance \( \geq 5 \)</th>
    <th>58</th>
  </tr>
  <tr>
    <th>Dialogue Samples</th>
    <th>80</th>
  </tr>
  <tr>
    <th>Avg. Length</th>
    <th>534.36</th>
  </tr>
</table>

Table 5: PFDial-H Tests Data Overview

<table>
  <tr>
    <th>Hyperparameter</th>
    <th>Value</th>
  </tr>
  <tr>
    <td>Optimizer</td>
    <td>AdamW</td>
  </tr>
  <tr>
    <td>Learning Rate</td>
    <td>\( 5 \times 10^{-6} \)</td>
  </tr>
  <tr>
    <td>Learning Rate Scheduling</td>
    <td>Cosine Annealing</td>
  </tr>
  <tr>
    <td>Adam Beta1</td>
    <td>0.9</td>
  </tr>
  <tr>
    <td>Adam Beta2</td>
    <td>0.95</td>
  </tr>
  <tr>
    <td>Batch Size</td>
    <td>128</td>
  </tr>
  <tr>
    <td>Batch Size Per-Device</td>
    <td>4</td>
  </tr>
  <tr>
    <td>Training Epochs</td>
    <td>5</td>
  </tr>
</table>

Table 6: Training Hyper Parameters

<table>
  <tr>
    <th>User</th>
    <th></th>
  </tr>
  <tr>
    <td colspan="2">These examples are five-tuples consisting of the PlantUML diagram, the current state, the next state, user input, and the robot output.</td>
  </tr>
</table>

[several examples]

The user’s input explains the change in state from the current state to the next state. The robot output is related to next state. Robot acts as the server-provider. For example, if the current state is A, tobot might output "Now process A." or, when a choice is required, robot lets user to make a choice. Now I have a five-tuple consisting of the PlantUML diagram, the current state next state, and the user input, without robot output. Your task is to generate the robot’s output based on the rules provided.

This is the five-tuple need to be filled:
[five-tuple to be filled]

Table 8: The prompt for generating the robot’s output.

<table>
  <tr>
    <th>User</th>
    <th></th>
  </tr>
  <tr>
    <td colspan="2">These examples are four-tuples consisting of the PlantUML diagram, the current state, the next state, and the user input.</td>
  </tr>
</table>

[several examples]

The user’s input explains the change in state from the current state to the next state. For example, if the original state is A, the user might input "A has been completed." or, when a choice is required, the user selects an option based on the next state.
Now I have a four-tuple consisting of the PlantUML diagram, the current state, and the next state, without user input. Your task is to generate the user’s input based on the rules provided.

This is the four-tuple need to be filled:
[four-tuple to be filled]

Table 7: The prompt for generating the user’s input.
D.3 Prompt for Adding Backward Transition

In the third step, we use the prompt from Table 9 to add backward transitions. This prompt guides us in adding logical loop structures to the flowchart.

<table>
  <tr>
    <th>User</th>
  </tr>
  <tr>
    <td>This is a flowchart in PlantUML syntax and the result after adding a loop to itself:</td>
  </tr>
  <tr>
    <th>[original PlantUML and revised PlantUML]</th>
  </tr>
  <tr>
    <td>Your task is to follow this modification rule ro add a loop to the plantuml that I will give you next. The following conditions must be met:
      1. The added loop is logical
      2. The conditional state of “repeat while” cannot be repeated with the any conditional state that already exists in the original PlantUML
      3. Ensure that the syntax of PlantUML is correct
      4. Add is([need to loop]) not([jump out of loop]) statements after repeat while as much as possible.

    PlantUML to be modified:
    [original PlantUML]
    </td>
  </tr>
</table>

Table 9: The prompt for Adding Backward Transition.

E Case Study

We analyzed specific cases to provide intuitive explanations in Table 10 and 11. First, generally speaking, these models fail because they don’t precisely provide complete descriptions of the next state, or they generate states related to user input but not in the original flowchart, or they don’t follow the format required in the system prompt. Our task examines models’ ability to predict the next state in sequential branches and decision branches. Below we provide examples and analyze why GPT-4o performs poorly in these areas.

E.1 Sequential Branch

For sequential branches, the model only need to capture the current state and state transition. This is typically simple because adjacent states in PlantUML are usually adjacent lines. However, when multiple decision branches are nested, things become complicated and the line distance between adjacent states increases. For example, in Table 10, after "Repeatedly check if printing is complete", all nested loops have ended and should transition to "Customer leaves the photo shop". However, due to the high complexity caused by multiple nested sequential branches, GPT-4o struggles to accurately capture the contextual state relationships, resulting in errors.

E.2 Decision Branch

For decision branches, the model needs to precisely transition to the next state based on the current state and user input. Unfortunately, in most wrong cases, due to the high similarity between user input and the first state of the correct branch during condition judgment, the model tends to skip this first state and directly enter subsequent states, failing to accurately follow the agreed path. More challenging issues arise when decision branch conditions involve more than just yes/no decisions, requiring models to comprehensively understand user input and judge their true intentions. For example, in Table 11, when the user inputs "The position of the lighting fixture needs to be adjusted.", it indicates that the lighting position needs to be modified at this point. However, the model struggles to strictly adhere to the process constraints and makes an incorrect state prediction based on the user input, skipping the correct state of this branch.
PlantUML
@startuml
start
:Customer arrives at photo shop;
:Submit photo files for printing;
:Select print size and quantity;
:Choose paper quality and surface effect;
:Confirm print order and price;
if (Photo quality check passed?) then (yes)
    :Pay fee;
    :Photo printing in progress;
    if (Printing completed?) then (yes)
        :Display printed photos;
        :Customer satisfied?;
        if (Customer satisfied?) then (yes)
            :Complete transaction;
        else (no)
            :Reselect photos;
            :Reprint;
            :Complete transaction;
        endif
    else (no)
        :Wait for photo printing;
        :Repeatedly check if printing is complete;
    endif
else (no)
    :Notify poor photo quality;
    :Reselect photos;
    :Reprint;
    :Complete transaction;
endif
:Customer leaves the photo shop;
stop
@enduml

<table>
  <tr>
    <th>Current State</th>
    <td>Repeatedly check if printing is complete</td>
  </tr>
  <tr>
    <th>User Input</th>
    <td>Printing is completed.</td>
  </tr>
  <tr>
    <th>Predicted Next State</th>
    <td><span style="color:red;">Display printed photos (Incorrect)</span></td>
  </tr>
  <tr>
    <th>Correct Next State</th>
    <td>Customer leaves the photo shop (Correct)</td>
  </tr>
</table>

Table 10: Case Study in Sequential Branch
PlantUML
@startuml
start
:Communicate lighting design plan with construction team;
:Explain design requirements and fixture layout;
:Provide technical support and guidance;
:Coordinate installation time and progress;
:Supervise fixture installation process;
:Perform fixture debugging and brightness adjustment;
repeat
:Confirm fixture layout and installation position;
:Supervise fixture installation process;
repeat while(Installation and debugging unsuccessful)
:Check fixture installation quality and safety;
if (Need to adjust fixture position?) then (yes)
    :Negotiate adjustment plan;
    :Reinstall or adjust fixture position;
else (no)
    :Confirm final installation result;
endif
:Final acceptance of lighting system;
:Ensure lighting system meets design requirements;
:Complete construction documents and records;
stop
@enduml

<table>
  <tr>
    <th>Current State</th>
    <td>Need to adjust fixture position?</td>
  </tr>
  <tr>
    <th>User Input</th>
    <td>The position of the lighting fixture needs to be adjusted.</td>
  </tr>
  <tr>
    <th>Predicted Next State</th>
    <td><span style="color:red">Reinstall or adjust fixture position (Incorrect)</span></td>
  </tr>
  <tr>
    <th>Correct Next State</th>
    <td>Negotiate adjustment plan (Correct)</td>
  </tr>
</table>

Table 11: Case Study in Decision Branch
<table>
  <tr>
    <th>Training Sample Size</th>
    <th>100</th>
    <th>200</th>
    <th>400</th>
    <th>800</th>
    <th>1600</th>
    <th>3200</th>
    <th>6400</th>
    <th>9600</th>
    <th>12705</th>
  </tr>
  <tr>
    <td>Flowcharts</td>
    <td>3</td>
    <td>5</td>
    <td>12</td>
    <td>29</td>
    <td>.59</td>
    <td>113</td>
    <td>208</td>
    <td>308</td>
    <td>440</td>
  </tr>
  <tr>
    <td>State Nodes</td>
    <td>49</td>
    <td>79</td>
    <td>149</td>
    <td>304</td>
    <td>612</td>
    <td>1236</td>
    <td>2473</td>
    <td>3772</td>
    <td>5055</td>
  </tr>
  <tr>
    <td>Sequential Samples</td>
    <td>62</td>
    <td>134</td>
    <td>264</td>
    <td>561</td>
    <td>1099</td>
    <td>2185</td>
    <td>4293</td>
    <td>6717</td>
    <td>9029</td>
  </tr>
  <tr>
    <td>Decision Samples</td>
    <td>38</td>
    <td>66</td>
    <td>136</td>
    <td>239</td>
    <td>501</td>
    <td>1015</td>
    <td>2107</td>
    <td>2883</td>
    <td>3676</td>
  </tr>
  <tr>
    <td>Avg. Length</td>
    <td>386.22</td>
    <td>368.19</td>
    <td>320.24</td>
    <td>286.92</td>
    <td>275.63</td>
    <td>272.29</td>
    <td>273.00</td>
    <td>280.90</td>
    <td>277.16</td>
  </tr>
</table>

Table 12: Statistics of the PFDial Dataset with Different Training Sample Sizes.

<table>
  <tr>
    <th rowspan="2">Training Sample Size</th>
    <th colspan="3">ID-test</th>
    <th colspan="3">OOD-test</th>
  </tr>
  <tr>
    <th>Acc</th>
    <th>Decision Acc</th>
    <th>Sequential Acc</th>
    <th>Acc</th>
    <th>Decision Acc</th>
    <th>Sequential Acc</th>
  </tr>
  <tr>
    <td>100-all</td>
    <td>77.61</td>
    <td>54.52</td>
    <td>81.87</td>
    <td>73.59</td>
    <td>39.81</td>
    <td>79.08</td>
  </tr>
  <tr>
    <td>200-all</td>
    <td>84.82</td>
    <td>83.33</td>
    <td>85.10</td>
    <td>80.83</td>
    <td>62.35</td>
    <td>83.83</td>
  </tr>
  <tr>
    <td>400-all</td>
    <td>88.91</td>
    <td>90.68</td>
    <td>88.59</td>
    <td>87.80</td>
    <td>76.50</td>
    <td>89.64</td>
  </tr>
  <tr>
    <td>800-all</td>
    <td>90.37</td>
    <td>92.37</td>
    <td>89.99</td>
    <td>88.44</td>
    <td>78.90</td>
    <td>89.99</td>
  </tr>
  <tr>
    <td>1600-all</td>
    <td>93.84</td>
    <td>94.92</td>
    <td>93.64</td>
    <td>91.59</td>
    <td>84.17</td>
    <td>92.79</td>
  </tr>
  <tr>
    <td>3200-all</td>
    <td>96.61</td>
    <td>97.46</td>
    <td>96.46</td>
    <td>93.26</td>
    <td>89.69</td>
    <td>93.84</td>
  </tr>
  <tr>
    <td>6400-all</td>
    <td>97.89</td>
    <td>97.18</td>
    <td>98.02</td>
    <td>95.34</td>
    <td>91.85</td>
    <td>95.91</td>
  </tr>
  <tr>
    <td>9600-all</td>
    <td>98.86</td>
    <td><b>98.31</b></td>
    <td>98.96</td>
    <td>96.45</td>
    <td>90.17</td>
    <td><b>97.47</b></td>
  </tr>
  <tr>
    <td>all</td>
    <td><b>98.94</b></td>
    <td>98.02</td>
    <td><b>99.11</b></td>
    <td><b>96.51</b></td>
    <td><b>90.65</b></td>
    <td><b>97.47</b></td>
  </tr>
</table>

Table 13: Performance with different training sample sizes across ID and OOD datasets after training on Qwen2.5-7B, with data scaling strategy (a).

<table>
  <tr>
    <th rowspan="2">Training Sample Size</th>
    <th colspan="3">ID-test</th>
    <th colspan="3">OOD-test</th>
  </tr>
  <tr>
    <th>Acc</th>
    <th>Decision Acc</th>
    <th>Sequential Acc</th>
    <th>Acc</th>
    <th>Decision Acc</th>
    <th>Sequential Acc</th>
  </tr>
  <tr>
    <td>100-100</td>
    <td>61.37</td>
    <td>23.45</td>
    <td>68.37</td>
    <td>59.12</td>
    <td>13.91</td>
    <td>66.46</td>
  </tr>
  <tr>
    <td>200-200</td>
    <td>82.31</td>
    <td>84.46</td>
    <td>81.92</td>
    <td>77.88</td>
    <td>65.47</td>
    <td>79.90</td>
  </tr>
  <tr>
    <td>400-400</td>
    <td>89.71</td>
    <td>89.55</td>
    <td>89.73</td>
    <td>86.03</td>
    <td>75.30</td>
    <td>87.77</td>
  </tr>
  <tr>
    <td>800-800</td>
    <td>91.55</td>
    <td>92.66</td>
    <td>91.35</td>
    <td>90.01</td>
    <td>81.06</td>
    <td>91.47</td>
  </tr>
  <tr>
    <td>1600-1600</td>
    <td>93.80</td>
    <td>93.50</td>
    <td>93.85</td>
    <td>91.79</td>
    <td>85.13</td>
    <td>92.87</td>
  </tr>
  <tr>
    <td>3200-3200</td>
    <td>97.01</td>
    <td>98.02</td>
    <td>96.82</td>
    <td>94.30</td>
    <td>90.65</td>
    <td>94.90</td>
  </tr>
  <tr>
    <td>6400-6400</td>
    <td>97.98</td>
    <td>98.31</td>
    <td>97.92</td>
    <td>95.54</td>
    <td>90.65</td>
    <td>96.34</td>
  </tr>
  <tr>
    <td>9600-9600</td>
    <td>98.90</td>
    <td>97.46</td>
    <td><b>99.17</b></td>
    <td>95.95</td>
    <td>89.45</td>
    <td>97.00</td>
  </tr>
  <tr>
    <td>all</td>
    <td><b>98.94</b></td>
    <td><b>98.02</b></td>
    <td><b>99.11</b></td>
    <td><b>96.51</b></td>
    <td><b>90.65</b></td>
    <td><b>97.47</b></td>
  </tr>
</table>

Table 14: Performance with different training sample sizes across ID and OOD datasets after training on Qwen2.5-7B, with data scaling strategy (b).
(a) Format-NL

Figure 6: local attention score of \( head_{layer_{27}} \cdot head_{20} \) using Format-NL
(b) Format-SC

Figure 7: local attention score of \( head_{layer27\_head20} \) using Format-SC
(c) Format-Hybrid

Figure 8: local attention score of head_layer27_head20 using Format-Hybrid
<table>
  <tr>
    <th>Format</th>
    <th>Data Example</th>
  </tr>
  <tr>
    <td>Format-NL</td>
    <td><b>PlantUML:</b><br>@startuml start :College entrance exam results announced; :Student obtains college entrance exam score report; :Student checks the exam results and determines the range of colleges and majors to apply for; if (Do you need to research colleges and majors in advance?) then (Yes) :Student conducts research on colleges and majors; else (No) :Skip this step; endif :Student logs into the application system; :System provides the application entry and instructions; :Student fills out the application, prioritizing choices; :After completing the application, the system generates an application form; :Student confirms the form and submits it; if (Application deadline?) then (Yes) :System closes the application entry; :Wait for the admission results to be announced; else (No) :Student can modify the application before the deadline; :Wait for the application deadline; endif :Admission results announced; if (Admitted?) then (Yes) :Student completes registration procedures according to the admission notice; else (No) :Student applies for supplementary applications or participates in the supplementary application process; endif :Enroll in the school; stop @enduml<br><b>Current state:</b><br>System closes the application entry<br><b>Next state:</b><br>Wait for the admission results to be announced<br><b>User input:</b><br>The application deadline has passed, and the application system is now closed.<br><b>Robot output:</b><br>Please patiently wait for the announcement of the admission results.</td>
  </tr>
</table>

Table 15: Example Data Display - Format-NL
<table>
  <tr>
    <th>Format</th>
    <th>Data Example</th>
  </tr>
  <tr>
    <td>Format-SC</td>
    <td>
      <b>PlantUML:</b><br>
      @startuml start :S1; :S2; :S3; if (C1) then (Yes) :S4; else (No) :S5; endif :S6; :S7; :S8; :S9; :S10; if (C2) then (Yes) :S11; :S12; else (No) :S13; :S14; endif :S15; if (C3) then (Yes) :S16; else (No) :S17; endif :S18; stop @enduml<br>
      <b>Dictionary of the state codes:</b><br>
      { "College entrance exam results announced": "S1", "Student obtains college entrance exam score report": "S2", "Student checks the exam results and determines the range of colleges and majors to apply for": "S3", "Do you need to research colleges and majors in advance?": "C1", "Student conducts research on colleges and majors": "S4", "Skip this step": "S5", "Student logs into the application system": "S6", "System provides the application entry and instructions": "S7", "Student fills out the application, prioritizing choices": "S8", "After completing the application, the system generates an application form": "S9", "Student confirms the form and submits it": "S10", "Application deadline?": "C2", "System closes the application entry": "S11", "Wait for the admission results to be announced": "S12", "Student can modify the application before the deadline": "S13", "Wait for the application deadline": "S14", "Admission results announced": "S15", "Admitted?": "C3", "Student completes registration procedures according to the admission notice": "S16", "Student applies for supplementary applications or participates in the supplementary application process": "S17", "Enroll in the school": "S18" }
      <b>Current state:</b><br>
      System closes the application entry
      <b>Next state:</b><br>
      Wait for the admission results to be announced
      <b>User input:</b><br>
      The application deadline has passed, and the application system is now closed.
      <b>Robot output:</b><br>
      Please patiently wait for the announcement of the admission results.
    </td>
  </tr>
</table>

Table 16: Example Data Display - Format-SC
<table>
  <tr>
    <th>Format</th>
    <th>Data Example</th>
  </tr>
  <tr>
    <td>Format-Hybrid</td>
    <td>
      <b>PlantUML:</b><br>
      @startuml start :S1: College entrance exam results announced; :S2: Student obtains college entrance exam score report; :S3: Student checks the exam results and determines the range of colleges and majors to apply for; if (C1: Do you need to research colleges and majors in advance?) then (Yes) :S4: Student conducts research on colleges and majors; else (No) :S5: Skip this step; endif :S6: Student logs into the application system; :S7: System provides the application entry and instructions; :S8: Student fills out the application, prioritizing choices; :S9: After completing the application, the system generates an application form; :S10: Student confirms the form and submits it; if (C2: Application deadline?) then (Yes) :S11: System closes the application entry; :S12: Wait for the admission results to be announced; else (No) :S13: Student can modify the application before the deadline; :S14: Wait for the application deadline; endif :S15: Admission results announced; if (C3: Admitted?) then (Yes) :S16: Student completes registration procedures according to the admission notice; else (No) :S17: Student applies for supplementary applications or participates in the supplementary application process; endif :S18: Enroll in the school; stop @enduml<br>
      <b>Current state:</b><br>
      System closes the application entry<br>
      <b>Next state:</b><br>
      Wait for the admission results to be announced<br>
      <b>User input:</b><br>
      The application deadline has passed, and the application system is now closed.<br>
      <b>Robot output:</b><br>
      Please patiently wait for the announcement of the admission results.
    </td>
  </tr>
</table>

Table 17: Example Data Display - Format-Hybrid
<table>
  <tr>
    <th>Category</th>
    <th>Senarios</th>
  </tr>
  <tr>
    <td>Lifestyle Services</td>
    <td>Hairdressing, Phone Card, Car Wash, Agritainment, Printing & Copying, Lawyer, Yoga Studio, Music Classroom, Internship</td>
  </tr>
  <tr>
    <td>Daily Convenience</td>
    <td>Takeout, Scenic Spots, Furniture Cleaning, Wedding Photography, Movie, Cleaning Service, Self-service Car Wash, Second-hand Car Trading, Visa Application</td>
  </tr>
  <tr>
    <td>Food & Education</td>
    <td>Catering, Training Courses, Physiotherapy & Massage, Lighting Design, Gym, Express Delivery, Travel Group Purchase, Health Check-up, Group Tour</td>
  </tr>
  <tr>
    <td>Entertainment & Transportation</td>
    <td>Concert, Car Rental, Baking Studio, Digital Repair, Airplane Ticket, Water Delivery, Florist Shop, Photo Studio, Course Selection</td>
  </tr>
  <tr>
    <td>Business & Professional Services</td>
    <td>Commercial Photography, Hospital, Pet Boarding, Café, Dentist, Pet Grooming, Tea House, Outdoor Expansion, Electrician Inspection</td>
  </tr>
  <tr>
    <td>Luxury & Specialized Services</td>
    <td>Beauty Salon, Museum, Horticultural Design, Car Maintenance, Cruise, Photography Studio Rental, Piano Tuning, Basketball Court, Cargo Delivery into Cabin</td>
  </tr>
  <tr>
    <td>Living-related Services</td>
    <td>Laundry, House Rental, Education Consultation, Library, Cultural Exhibition, Health Consultation, Holiday Villa, Interior Design, Bank Account Operation</td>
  </tr>
  <tr>
    <td>Maintenance & Care Services</td>
    <td>Home Appliance Repair, Hotel, Leather Goods Care, Arcade, Furniture Installation, Medical Check-up, Car Insurance Claim, Bicycle Rental, Parts Inspection</td>
  </tr>
  <tr>
    <td>Comprehensive Services</td>
    <td>Moving, Resort, Language Translation, Medical Aesthetics, Driving School, Wedding Planning, Pet Hospital, Manicure, Document Approval</td>
  </tr>
  <tr>
    <td>Shopping & Other Activities</td>
    <td>Shopping, Train Ticket, Water & Electricity Repair, Ski Resort, Credit Card, College Entrance Examination Volunteer Filling, Cooking, DIY Handicraft, Content Creation</td>
  </tr>
</table>

Table 18: Senarios

Reviewer paper summaries: This paper proposes a new dataset - Process Flow Dialogue Dataset (PFDial). This dataset can adapt to process-driven discussion scenarios and prevent dialogue systems from operating within precisely defined processes. The flowchart is based on PlantUML and converts the structural diagram into a structured quintuple. This paper also evaluate models' performance on challenging backward transitions in process flows and different dataset formats on model performance. The 7B model trained with only 800 samples and the 0.5B model trained on all data can both achieve an accuracy rate of over 90%. The 8B model can surpass GPT-4o by up to 43.88%, with an average of 11.00%.

This paper introduces PFDial, a dataset and methodology designed to enhance process-driven dialogue systems. These systems are crucial in scenarios requiring strict adherence to predefined workflows, such as customer service and equipment maintenance. The authors propose converting UML flowcharts into structured five-tuple dialogue instructions (flowchart description, current state, user input, next state, robot output) using the PlantUML specification. The dataset includes 12,705 high-quality Chinese dialogue instructions derived from 440 flowcharts and 5,055 process nodes. The authors conduct extensive experiments to evaluate the effectiveness of their approach. Results show that models fine-tuned on PFDial outperform state-of-the-art large language models (e.g., GPT-4o) in handling decision branches and backward transitions, achieving significant performance improvements with minimal training data. They also analyze the impact of different dataset formats on model performance and provide insights into training methodologies for controlled reasoning tasks.

This paper introduces PFDial, a structured dialogue instruction fine-tuning method for process-driven dialogue systems based on UML flowcharts. The authors convert flowcharts into atomic dialogue units (five-tuples containing flowchart description, current state, user input, next state, and robot output) to train language models to strictly follow predefined processes. The dataset contains 12,705 high-quality Chinese dialogue instructions derived from 440 flowcharts with 5,055 process nodes. Experiments show that even small models (0.5B parameters) or models trained on limited data (800 samples) can achieve over 90% accuracy on dialogue state transitions. Their 8B model outperforms GPT-4o by 11% overall and by 43.88% on decision branches. The authors also analyze model performance on backward transitions and different state representation formats.
Summary of strengths: 1. Created a streaming dialogue dataset and gathered dialogues from various contexts.  
2. Fine-tuning using a tiny quantity of PFDial data can result in large improvements.  
3. The model can conduct rare and complex reasoning tasks. It also provides insights into how alternative dataset formats affect model performance, guiding future research.

1. The PFDial dataset is a valuable contribution, providing a structured and high-quality resource for training process-driven dialogue systems. The inclusion of backward transitions (PFDial-H) addresses a critical gap in existing datasets.
  
2. The paper demonstrates that even smaller models (e.g., 0.5B parameters) achieve high accuracy on in-domain and out-of-domain tests after fine-tuning on PFDial. The 8B model surpasses GPT-4o by up to 43.88% on decision branches, showcasing the dataset's effectiveness.

1. This paper is well-motivated and I do think the dialogue system with state transition is a needing requirement in modern LLM application.
2. Strong empirical results demonstrate effectiveness, with even small models (0.5B parameters) achieving 91.35% accuracy on out-of-domain tests.
3. The comparison with state-of-the-art models like GPT-4o provides convincing evidence of their approach's superiority.
Summary of weaknesses: 1. The experimental effect is significant, but there are some problems in the experimental design, such as the lack of data on the model's performance prior to fine-tuning and the lack of a clear correlation between the baseline and fine-tuned model. The experimental results cannot accurately reflect the dataset's effectiveness.
2. The current dataset is a pure Chinese dataset, and its adaptability is relatively limited.

1. The methodology relies heavily on the structured nature of UML flowcharts and the PlantUML format. It is unclear how well the approach generalizes to less structured or noisy datasets.
2. Despite improvements, the accuracy of backward transitions (e.g., 76.25% for the best model) is still relatively low compared to forward transitions, indicating room for improvement in handling complex reasoning tasks.
3. The underlying reasons for the performance differences among open-source models (e.g., Qwen2.5, Llama3), closed-source models (e.g., GPT-4o), and models fine-tuned with PFDial have not been thoroughly explored. This is particularly true regarding why closed-source models struggle to achieve accurate results.

1. The dataset is exclusively in Chinese, which may limit cross-lingual generalization
2. In most of the cases we expect larger models to do better in most tasks. However, the paper did not analyze the reason why Larger LLM like GPT-4o did not do well on this kind of task. This is imperative and it's probably simply because of the formatting issue.
3. The evaluation primarily focuses on next-state prediction accuracy rather than overall dialogue quality or naturalness.
Comments, suggestions and typos: 1. Is there an imbalance in the percentage of human-machine collaboration in the process of creating flow charts? Is it appropriate to use a tiny amount of GPT to create manual verification, but a significant quantity of manual verification?
 2. Why is returning from the next state to the previous state an uncommon and complex endeavor, with no obvious explanation or explanation for the difficulty?

There are no obvious grammatical issues.

1. Are there any case study on the errors that LLM's doing incorrectly on the datasets?
2. How is the 2 OOD and ID test sets divided? I think they come from the same source?
3. I would highly recommend to change the "Format A", stuff in the figure to the actual words or abbreviations to make the figure readable.
Overall assessment scores: 3

3.5

3
Metareview score: 3.5
Metareview: This paper introduces PFDial, a structured dialogue instruction fine-tuning method for process-driven dialogue systems based on UML flowcharts. The authors convert flowcharts into atomic dialogue units (five-tuples containing flowchart description, current state, user input, next state, and robot output) to train language models to strictly follow predefined processes. The dataset contains 12,705 high-quality Chinese dialogue instructions derived from 440 flowcharts with 5,055 process nodes. Experiments show that even small models (0.5B parameters) or models trained on limited data (800 samples) can achieve over 90% accuracy on dialogue state transitions. Their 8B model outperforms GPT-4o by 11% overall and by 43.88% on decision branches. The authors also analyze model performance on backward transitions and different state representation formats.
Summary of reasons to publish: 1. The paper is well motivated and PFDial dataset is a valuable contribution, providing a structured and high-quality resource for training process-driven dialogue systems. 
2. Strong empirical results demonstrate effectiveness, with even small models (0.5B parameters) achieving 91.35% accuracy on out-of-domain tests. The comparison with state-of-the-art models like GPT-4o provides convincing evidence of their approach's superiority.