ClarifySTL: An Interactive LLM Agent Framework for STL Transformation through Requirements Clarification

Signal Temporal Logic (STL) is a formal language for specifying real-time behaviors of cyber-physical systems (CPS). Automatically transforming natural language requirements into STL specifications has received growing attention. Recent efforts leveraging large language models (LLMs) have demonstrated impressive performance, but some natural language requirements in practice contain vague or ambiguous information, which remains challenging for LLMs to handle. To address these challenges, we propose ClarifySTL, an interactive LLM-agent framework that enhances STL transformation through requirements clarification. ClarifySTL first detects vague expressions that indicate underspecified information in a requirement. If any vagueness is detected, it generates targeted clarification queries to guide users in supplementing the requirement until all necessary details are provided. Subsequently, if ClarifySTL detects ambiguities, it formulates focused ambiguity clarification queries and updates the requirements based on user feedback until all ambiguities are resolved. Finally, the requirements with vagueness and ambiguity clarified are transformed into STL specifications using LLMs. This interactive framework ensures that the resulting STL formulas faithfully capture user intent while reducing the burden on the user. We evaluate ClarifySTL on the representative benchmarks DeepSTL and STL-DivEn, as well as our newly introduced AmbiEval benchmark, which is specifically designed to assess the performance of the agents in handling vagueness and ambiguity, including both detection and query generation. The experimental results show that ClarifySTL outperforms the state-of-the-art model by 13.92% and 12.08% in Formula Accuracy and Template Accuracy on the DeepSTL benchmark, and by 12.57% and 12.99% in the same metrics on the STL-DivEn benchmark respectively, and achieves an average 90.9% detection accuracy for vagueness and ambiguity. Human evaluations further validate the effectiveness of our framework, which clarifies 93.8% of defective requirements and generates effective queries for vagueness and ambiguity at rates of 93.3% and 94.3%, respectively.

Authors

Institutions

Publication Details

Journal
ACM Transactions on Software Engineering and Methodology
Published
2026-08-24
DOI
https://doi.org/10.1145/3842391
Primary Topic
Formal Methods in Verification
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

ClarifySTL: An Interactive LLM Agent Framework for STL Transformation through Requirements Clarification

Naijun Zhan, Jia Li, Xiaohong Chen, Yue Fang et al.
ACM Transactions on Software Engineering and Methodology
Formal Methods in Verification
article

ClarifySTL: An Interactive LLM Agent Framework for STL Transformation through Requirements Clarification

Naijun Zhan, Jia Li, Xiaohong Chen, Yue Fang, Zhi Jin, Jie An, Xiaohong Chen
article en

Abstract

Signal Temporal Logic (STL) is a formal language for specifying real-time behaviors of cyber-physical systems (CPS). Automatically transforming natural language requirements into STL specifications has received growing attention. Recent efforts leveraging large language models (LLMs) have demonstrated impressive performance, but some natural language requirements in practice contain vague or ambiguous information, which remains challenging for LLMs to handle. To address these challenges, we propose ClarifySTL, an interactive LLM-agent framework that enhances STL transformation through requirements clarification. ClarifySTL first detects vague expressions that indicate underspecified information in a requirement. If any vagueness is detected, it generates targeted clarification queries to guide users in supplementing the requirement until all necessary details are provided. Subsequently, if ClarifySTL detects ambiguities, it formulates focused ambiguity clarification queries and updates the requirements based on user feedback until all ambiguities are resolved. Finally, the requirements with vagueness and ambiguity clarified are transformed into STL specifications using LLMs. This interactive framework ensures that the resulting STL formulas faithfully capture user intent while reducing the burden on the user. We evaluate ClarifySTL on the representative benchmarks DeepSTL and STL-DivEn, as well as our newly introduced AmbiEval benchmark, which is specifically designed to assess the performance of the agents in handling vagueness and ambiguity, including both detection and query generation. The experimental results show that ClarifySTL outperforms the state-of-the-art model by 13.92% and 12.08% in Formula Accuracy and Template Accuracy on the DeepSTL benchmark, and by 12.57% and 12.99% in the same metrics on the STL-DivEn benchmark respectively, and achieves an average 90.9% detection accuracy for vagueness and ambiguity. Human evaluations further validate the effectiveness of our framework, which clarifies 93.8% of defective requirements and generates effective queries for vagueness and ambiguity at rates of 93.3% and 94.3%, respectively.

ACM Transactions on Software Engineering and Methodology
Chinese Academy of Sciences (CN), Peking University (CN), Wuhan University (CN), Jingdong (China) (CN), Institute of Software (CN), East China Normal University (CN)
Openalex Percentile: Top 54%
Formal Methods in Verification
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.