REVIEW 3 major objections 5 minor 37 references
An Agentic Flow for Finite State Machine Extraction using Prompt Chaining
T0 review · 3 major / 5 minor · reviewed 2026-08-06 · deepseek-v4-flash
Pith's one-line read FlowFSM claims that a three-stage prompt-chaining agent can extract protocol finite-state machines from raw RFC documents with precision above 81%, recall above 85%, and few hallucinated transitions.
desk verdict A clearly-described, honest LLM pipeline for RFC-to-FSM extraction, but the headline numbers rest on an unpublished ground truth and no baseline comparison, so the evaluation is not yet trustworthy. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The operative mechanism is prompt chaining, formalized as $R_{i+1}=M(P_i(R_i))$, where the $i$-th prompt is constructed from the previous model response so the LLM iteratively refines its own extraction rather than attempting the whole task at once. FlowFSM's chain has three named stages: command extraction, state-transition analysis, and rulebook synthesis. The rulebook's three-chapter structure is the concrete output that functions as the FSM, and the chained format is what the paper credits for reducing false positive transitions while preserving coverage.
What would settle it
Publish the full set of true FTP and RTSP transitions before running the pipeline, then have a separate annotator or a reference implementation score the same outputs; if precision or recall falls materially under that pre-registered ground truth, the claim of high-fidelity extraction is not supported.
Extended reading notes
Core claim
The central claim is that the chained prompting procedure, not a larger model or hand-built parser, is what makes accurate FSM extraction possible: each stage outputs a structured intermediate artifact, and the next stage consumes it until a rulebook encodes the protocol's states and transitions. The rulebook organizes every command into three chapters: its purpose and effect on state, the valid commands that must precede it, and the valid commands that may follow it. The authors argue that this decomposition suppresses hallucinated transitions while keeping recall high enough for security applications where a missed transition is more harmful than an extra candidate.
Load-bearing premise
The ground-truth labels for every reported precision and recall number come from the authors' own manual reading of the RFCs, with no published transition list or second annotator; if those judgments are off, every metric loses its anchor.
Editorial extensions
If this is right
- A protocol analyst could obtain a first-pass state machine from an RFC alone, before any source code or traffic trace is available.
- The rulebook output is structured enough to hand to downstream verification or fuzzing tools without additional parsing.
- The recall-over-precision tilt is the safe direction for security work: extra transitions can be filtered later, but a missed transition is invisible to any downstream analysis.
- The small spread between FTP and RTSP results suggests the same three-stage chain may carry across protocol families with different document styles.
Reading between the lines
- Going beyond the paper, the real test of these rulebooks would be behavioral: feed them to a protocol fuzzer and see whether the extracted states improve coverage or expose deviations in real implementations.
- The authors' manual labeling is the only ground truth; an independent evaluator with a pre-published transition list would reveal how much of the reported precision is the method's and how much reflects the annotator's expectations.
- The same command-extraction / state-transition / rulebook chain could be applied to other semi-structured specification corpora, such as API documentation, where 'states' are implicit rather than labeled.
- Ablating the chain—running each stage alone against the same RFCs—would separate the contribution of chaining from the raw capability of the underlying LLM.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper introduces FlowFSM, an agent-based LLM pipeline that extracts finite-state machines from RFC documents via three chained prompts (command extraction, state-transition analysis, and rulebook synthesis) operating on a parsed RFC tree. The authors report experimental results for FTP and RTSP: FTP precision 83.33%, recall 88.24%, and F1 85.71%; RTSP precision 81.82%, recall 85.71%, and F1 83.72%. They interpret these numbers as evidence that FlowFSM 'achieves high extraction precision while minimizing hallucinated transitions' and that the method generalizes across protocols. The evaluation is based on manual validation of extracted transitions against the RFCs, but the manuscript does not define or release the ground-truth transition sets used for that validation.
Significance. If the empirical claims were fully supported, FlowFSM would be a modest but useful contribution to protocol reverse engineering, with a clearly described prompt-chaining architecture and open-sourced code. The method is anchored to external RFC documents rather than to the model's own outputs, so the central derivation is not circular, and the arithmetic in Table I is correct. However, the current lack of a defined ground truth, an annotation protocol, baselines, and repeated runs means that the quantitative contributions are not yet established. The work's significance therefore hinges on whether the evaluation can be made reproducible and comparative in revision.
major comments (3)
- [Section V-A, Table I] The metrics in Table I are computed against an unpublished and undefined ground truth. Section V-A defines TP, FP, and FN only in terms of 'official protocol behavior' and manual verification, but the manuscript never enumerates the set of protocol states or the valid transition set for FTP or RTSP, nor does it map extracted transitions to the RFC 959 state table or any other reference enumeration. The sample rulebook in Section IV-D shows one command but no state inventory. Consequently precision and recall are not well-defined: different annotators could enumerate different valid transitions from the same RFCs, and the reported 83.33% and 88.24% figures may measure agreement with the authors' implicit reading rather than correctness against the protocols. This is the load-bearing condition for the abstract's central claim, and it is not met in the current manuscript.
- [Section V-A] Manual validation is described but not operationalized. There is no inter-annotator agreement, no annotation guideline, no release of the ground-truth transition lists, and no statement of how disagreements would be resolved. Since every TP/FP/FN count in Table I depends on these manual judgments, the reported precision and recall are not reproducible. The authors should release the exact ground-truth transition sets (or an independently derivable abstraction, such as the RFC 959 state table) and report agreement measures such as Cohen's kappa for the validation step.
- [Section VI, RQ2] The generalization claim rests on only two protocols, FTP and RTSP, both relatively simple and structurally similar text-based protocols. No comparison is made to existing extraction systems such as PROSPER, RFCNLP, or ProtocolGPT, even though Section II describes those systems and reports their quantitative results. In addition, LLM outputs are stochastic, but the paper reports a single set of counts without repeated runs or variance. Without baselines, ablations, and multiple runs, the results do not establish that prompt chaining, rather than the underlying LLM, is responsible for the reported accuracy, and they do not support the conclusion that FlowFSM 'minimizes hallucinated transitions' beyond what a single unbaselined run can show.
minor comments (5)
- [Section I, contributions] The phrase 'reduced false postives' contains a typo; it should read 'false positives'.
- [Section VII] The sentence 'as a limitation of FlowFSM it it's high computational and runtime cost' is grammatically broken; it should be rewritten, for example as 'a limitation of FlowFSM is its high computational and runtime cost'.
- [Section IV-D, Figure caption] The figure is captioned 'Figure IV-D', which mixes section numbering with figure numbering; it should be numbered consistently with other figures.
- [Section II, reference [14]] The title of ProtocolGPT is mistyped as 'large langeuage model'; it should be 'large language model'.
- [Section V] The paper states that three LLMs were used but does not explain how their outputs were combined or whether Table I reports results from a single model, an ensemble, or a consensus; this should be clarified.
Circularity Check
No significant circularity: FlowFSM's metrics come from manual validation against RFC documents rather than from fitting to its own outputs; the one same-author citation is motivational and not load-bearing.
full rationale
The paper's claimed derivation is not circular in the formal sense. FlowFSM's outputs are rule-book transitions extracted from RFC text, and Table I reports precision, recall, and F1 computed by manually comparing extracted transitions against RFC documents. The RFC documents are external to the method, and no fitted parameter is later renamed as a prediction: the only formulas are the standard metric definitions, and no equation in Section V equates a reported quantity to an input of the prompt-chaining pipeline. The main caveat is that the ground-truth transition lists are not enumerated in the paper, so the manual annotations are not independently auditable; this threatens reproducibility and construct validity, but it is an evaluation-quality problem rather than a circular derivation. The only same-author citation is reference [36], used in Section III-B to support the motivational claim that retrieval-augmented generation plus chain-of-thought improves LLM accuracy for network packet generation. That reference is not used to justify the architecture choice as forced, nor does any result in Table I depend on it; it is a minor self-citation that is not load-bearing. No self-definitional reduction, fitted-input-as-prediction, imported uniqueness theorem, or renamed known result is present. Therefore the appropriate circularity verdict is 'no significant circularity.'
Assumptions & free parameters
assumptions (3)
- domain assumption The authors' manual validation of extracted transitions against RFC documents is an accurate and objective ground truth.
- domain assumption The two protocols, FTP and RTSP, are representative enough to support the generalization claim (RQ2).
- domain assumption LLM outputs in the pipeline are stable enough that a single run per protocol is meaningful.
Cite this review
Pith. "Pith review of An Agentic Flow for Finite State Machine Extraction using Prompt Chaining." pith.science (2026). https://pith.science/paper/2J347PV3
@misc{pith2026250711222,
author = {Pith},
title = {Pith review of: An Agentic Flow for Finite State Machine Extraction using Prompt Chaining},
year = {2026},
howpublished = {\url{https://pith.science/paper/2J347PV3}},
note = {Machine review of arXiv:2507.11222}
}
read the original abstract
Finite-State Machines (FSMs) are critical for modeling the operational logic of network protocols, enabling verification, analysis, and vulnerability discovery. However, existing FSM extraction techniques face limitations such as scalability, incomplete coverage, and ambiguity in natural language specifications. In this paper, we propose FlowFSM, a novel agentic framework that leverages Large Language Models (LLMs) combined with prompt chaining and chain-of-thought reasoning to extract accurate FSMs from raw RFC documents. FlowFSM systematically processes protocol specifications, identifies state transitions, and constructs structured rule-books by chaining agent outputs. Experimental evaluation across FTP and RTSP protocols demonstrates that FlowFSM achieves high extraction precision while minimizing hallucinated transitions, showing promising results. Our findings highlight the potential of agent-based LLM systems in the advancement of protocol analysis and FSM inference for cybersecurity and reverse engineering applications.
Figures
Reference graph
Works this paper leans on
-
[36]
Y . Maklad, F. Wael, W. Elsersy, and A. Hamdi, “Retrieval augmented generation based llm evaluation for protocol state machine inference with chain-of-thought reasoning,” arXiv preprint arXiv:2502.15727 , 2025
arXiv 2025
-
[1]
Sutton, A
M. Sutton, A. Greene, and P. Amini, Fuzzing: brute force vulnerability discovery. Pearson Education, 2007
2007
-
[2]
Verified models and reference implementations for the tls 1.3 standard candidate,
K. Bhargavan, B. Blanchet, and N. Kobeissi, “Verified models and reference implementations for the tls 1.3 standard candidate,” in 2017 IEEE Symposium on Security and Privacy (SP) . IEEE, 2017, pp. 483– 502
work page 2017
-
[3]
A survey on the development of network protocol fuzzing techniques,
Z. Zhang, H. Zhang, J. Zhao, and Y . Yin, “A survey on the development of network protocol fuzzing techniques,” Electronics, vol. 12, no. 13, p. 2904, 2023
2023
-
[4]
Large language models based fuzzing techniques: A survey,
L. Huang, P. Zhao, H. Chen, and L. Ma, “Large language models based fuzzing techniques: A survey,” arXiv preprint arXiv:2402.00350 , 2024
arXiv 2024
-
[5]
A survey of automatic protocol reverse engineering tools,
J. Narayan, S. K. Shukla, and T. C. Clancy, “A survey of automatic protocol reverse engineering tools,” ACM Computing Surveys (CSUR) , vol. 48, no. 3, pp. 1–26, 2015
2015
-
[6]
“About RFCs — ietf.org,” https://www.ietf.org/process/rfcs/, [Accessed 28-04-2025]
work page 2025
-
[7]
Extracting protocol format as state machine via controlled static loop analysis,
Q. Shi, X. Xu, and X. Zhang, “Extracting protocol format as state machine via controlled static loop analysis,” in 32nd USENIX Security Symposium (USENIX Security 23) , 2023, pp. 7019–7036
work page 2023
Show all 37 references
-
[8]
Ferry: {State-Aware} symbolic execution for exploring {State- Dependent} program paths,
S. Zhou, Z. Yang, D. Qiao, P. Liu, M. Yang, Z. Wang, and C. Wu, “Ferry: {State-Aware} symbolic execution for exploring {State- Dependent} program paths,” in 31st USENIX Security Symposium (USENIX Security 22) , 2022, pp. 4365–4382
2022
-
[9]
State selection algorithms and their impact on the performance of stateful network protocol fuzzing,
D. Liu, V .-T. Pham, G. Ernst, T. Murray, and B. I. Rubinstein, “State selection algorithms and their impact on the performance of stateful network protocol fuzzing,” in 2022 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER). IEEE, 2022, p...
2022
-
[10]
Attention is all you need,
A. Vaswani, “Attention is all you need,” Advances in Neural Information Processing Systems, 2017
2017
-
[11]
Evaluating large language models trained on code,
M. Chen, J. Tworek, H. Jun, Q. Yuan, H. P. D. O. Pinto, J. Kaplan, H. Edwards, Y . Burda, N. Joseph, G. Brockman et al., “Evaluating large language models trained on code,” arXiv preprint arXiv:2107.03374 , 2021
2021 arXiv
-
[12]
Language models can solve computer tasks,
G. Kim, P. Baldi, and S. McAleer, “Language models can solve computer tasks,” Advances in Neural Information Processing Systems , vol. 36, pp. 39 648–39 677, 2023
2023
-
[13]
Generative ai and large language models for cyber security: All insights you need,
M. A. Ferrag, F. Alwahedi, A. Battah, B. Cherif, A. Mechri, and N. Tihanyi, “Generative ai and large language models for cyber security: All insights you need,” Available at SSRN 4853709 , 2024
2024
-
[14]
Inferring state machine from the protocol implementation via large langeuage model,
H. Wei, Z. Du, H. Huang, Y . Liu, G. Cheng, L. Wang, and B. Mao, “Inferring state machine from the protocol implementation via large langeuage model,” arXiv preprint arXiv:2405.00393 , 2024
2024 arXiv
-
[15]
Prosper: Extracting protocol specifica- tions using large language models,
P. Sharma and V . Yegneswaran, “Prosper: Extracting protocol specifica- tions using large language models,” in Proceedings of the 22nd ACM Workshop on Hot Topics in Networks , 2023, pp. 41–47
2023
-
[16]
Large language model guided protocol fuzzing,
R. Meng, M. Mirchev, M. B ¨ohme, and A. Roychoudhury, “Large language model guided protocol fuzzing,” in Proceedings of the 31st Annual Network and Distributed System Security Symposium (NDSS) , 2024
2024
-
[17]
Fsm: A finite state machine based zero-shot prompting paradigm for multi-hop question answering,
X. Wang, J. He, Y . Wang, X. Meng, K. Pan, Z. Sui et al. , “Fsm: A finite state machine based zero-shot prompting paradigm for multi-hop question answering,” arXiv preprint arXiv:2407.02964 , 2024
2024 arXiv
-
[18]
Can large language models help developers with robotic finite state machine modification?
X. R. Gan, Y . R. Song, N. Walker, and M. Cakmak, “Can large language models help developers with robotic finite state machine modification?” arXiv preprint arXiv:2412.05625 , 2024
2024 arXiv
-
[19]
React: Synergizing reasoning and acting in language models,
S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. Narasimhan, and Y . Cao, “React: Synergizing reasoning and acting in language models,” arXiv preprint arXiv:2210.03629, 2022
2022 arXiv
-
[20]
Ai chains: Transparent and controllable human-ai interaction by chaining large language model prompts,
T. Wu, M. Terry, and C. J. Cai, “Ai chains: Transparent and controllable human-ai interaction by chaining large language model prompts,” in Proceedings of the 2022 CHI conference on human factors in computing systems, 2022, pp. 1–22
2022
-
[21]
Aflnet: a greybox fuzzer for network protocols,
V .-T. Pham, M. B¨ohme, and A. Roychoudhury, “Aflnet: a greybox fuzzer for network protocols,” in 2020 IEEE 13th International Conference on Software Testing, Validation and Verification (ICST) . IEEE, 2020, pp. 460–465
2020
-
[22]
Automated attack synthesis by extracting finite state machines from protocol specification documents,
M. L. Pacheco, M. von Hippel, B. Weintraub, D. Goldwasser, and C. Nita-Rotaru, “Automated attack synthesis by extracting finite state machines from protocol specification documents,” in 2022 IEEE Sym- posium on Security and Privacy (SP) . IEEE, 2022, pp. 51–68
2022
-
[23]
Hermes: unlocking security analysis of cellular network protocols by synthesizing finite state machines from natural language specifications,
A. Al Ishtiaq, S. S. S. Das, S. M. M. Rashid, A. Ranjbar, K. Tu, T. Wu, Z. Song, W. Wang, M. Akon, R. Zhang et al. , “Hermes: unlocking security analysis of cellular network protocols by synthesizing finite state machines from natural language specifications,” in 33rd USENIX S...
2024
-
[24]
Netplier: Probabilistic network protocol reverse engineering from message traces
Y . Ye, Z. Zhang, F. Wang, X. Zhang, and D. Xu, “Netplier: Probabilistic network protocol reverse engineering from message traces.” in NDSS, 2021
2021
-
[25]
Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning,
D. Guo, D. Yang, H. Zhang, J. Song, R. Zhang, R. Xu, Q. Zhu, S. Ma, P. Wang, X. Bi et al., “Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning,” arXiv preprint arXiv:2501.12948 , 2025
2025 arXiv
-
[26]
Chatphishdetector: Detecting phishing sites using large language models,
T. Koide, H. Nakano, and D. Chiba, “Chatphishdetector: Detecting phishing sites using large language models,” IEEE Access, 2024
2024
-
[27]
Pentestagent: Incorporating llm agents to automated penetration testing,
X. Shen, L. Wang, Z. Li, Y . Chen, W. Zhao, D. Sun, J. Wang, and W. Ruan, “Pentestagent: Incorporating llm agents to automated penetration testing,” arXiv preprint arXiv:2411.05185 , 2024
2024 arXiv
-
[28]
Erpa: Efficient rpa model integrating ocr and llms for intelligent document processing,
O. H. Abdellaif, A. N. Hassan, and A. Hamdi, “Erpa: Efficient rpa model integrating ocr and llms for intelligent document processing,” in 2024 International Mobile, Intelligent, and Ubiquitous Computing Conference (MIUCC). IEEE, 2024, pp. 295–300
2024
-
[29]
Lmrpa: Large lan- guage model-driven efficient robotic process automation for ocr,
O. H. Abdellaif, A. Nader, and A. Hamdi, “Lmrpa: Large lan- guage model-driven efficient robotic process automation for ocr,” arXiv preprint arXiv:2412.18063, 2024
2024 arXiv
-
[30]
Lmv-rpa: Large model voting- based robotic process automation,
O. Abdellatif, A. Ayman, and A. Hamdi, “Lmv-rpa: Large model voting- based robotic process automation,” arXiv preprint arXiv:2412.17965 , 2024
2024 arXiv
-
[31]
Llm-daas: Llm-driven drone-as-a-service operations from text user requests,
L. Wassim, K. Mohamed, and A. Hamdi, “Llm-daas: Llm-driven drone-as-a-service operations from text user requests,” arXiv preprint arXiv:2412.11672, 2024
2024 arXiv
-
[32]
Codamosa: Escaping coverage plateaus in test generation with pre-trained large language models,
C. Lemieux, J. P. Inala, S. K. Lahiri, and S. Sen, “Codamosa: Escaping coverage plateaus in test generation with pre-trained large language models,” in 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE). IEEE, 2023, pp. 919–931
2023
-
[33]
Augmenting greybox fuzzing with generative ai,
J. Hu, Q. Zhang, and H. Yin, “Augmenting greybox fuzzing with generative ai,” arXiv preprint arXiv:2306.06782 , 2023
2023 arXiv
-
[34]
Harnessing large lan- guage models for seed generation in greybox fuzzing,
W. Shi, Y . Zhang, X. Xing, and J. Xu, “Harnessing large lan- guage models for seed generation in greybox fuzzing,” arXiv preprint arXiv:2411.18143, 2024
2024 arXiv
-
[35]
Retrieval- augmented generation for knowledge-intensive nlp tasks,
P. Lewis, E. Perez, A. Piktus, F. Petroni, V . Karpukhin, N. Goyal, H. K ¨uttler, M. Lewis, W.-t. Yih, T. Rockt ¨aschel et al. , “Retrieval- augmented generation for knowledge-intensive nlp tasks,” Advances in Neural Information Processing Systems , vol. 33, pp. 9459–9474, 2020
2020
-
[37]
“CrewAI,” https://www.crewai.com/, [Accessed 27-04-2025]
2025
Reviewed August 6, 2026 · model on record in the stance chip above.
Discussion (0). Sign in to comment.