When Prompt Engineering Meets Software Engineering: CNL-P as Natural and Robust "APIs'' for Human-AI Interaction
Zhenchang XingYang LiuZhuo ChengQing HuangDehai ZhaoDaniel SUNChenhua Liu
Zhenchang Xing
Yang Liu
Zhuo Cheng
Qing Huang
Dehai Zhao
Daniel SUN
Chenhua Liu
+7
We propose CNL-P, a Controlled Natural Language for Prompt that combines prompt-engineering best practices with software-engineering principles. By introducing precise grammar structures and strict semantic norms, CNL-P eliminates natural-language ambiguity, enabling declarative, structured, and accurate expression of intent for more consistent, higher-quality LLM outputs. We provide an LLM-based NL2CNL-P conversion tool, a static-analysis linting tool, and an AI-native IDE (UGAiForge), with experiments showing enhanced response quality through this PE-SE synergy.

OpenReview ·
· September 27, 2024