Plang: Efficient prompt engineering language for blending natural language and control flow in large language models
• Plang: A language blending natural prompt with control flow for precise LLM guidance. • Meta-prompt programming: Enables LLM to self-modify prompt programs during execution. • 40.75%-89.55% conciseness gain: Outperforms methods like LangChain in prompt coding. • Open-source solution: Enables multi-agent collaboration & tool use with minimal code. The advent of instruction-following large language models (LLMs), exemplified by ChatGPT, has significantly enhanced the performance of generative autoregressive natural language models on general tasks, marking a crucial milestone toward artificial general intelligence. While research has shown that LLM performance critically depends on prompt effectiveness, existing prompt construction approaches - including prompt string templates, prompt programming frameworks, and prompt programming syntactic sugar - suffer from limitations in imprecise generation control and deviation from natural language syntax, thereby impeding prompt engineering advancement. To address these challenges, we introduce PromptLanguage (Plang), a string-first programming language designed specifically for LLM prompt engineering. Our key innovation lies in utilizing font styles as syntax keywords to seamlessly integrate natural language prompt text with control flow code, enabling precise intervention in the generation process while maintaining the natural language affinity of prompt programs. Notably, Plang pioneers the concept of meta-prompt programming. Extensive experimental results across prompt engineering cases and quantitative analyses demonstrate that Plang-written prompt programs offer superior read/writability, intervention precision and up to 89.55% efficiency improvements. The Plang implementation is available as open-source software at https://github.com/HJZ-XDU/plang .
Authors
- Jiahui Zheng (ORCID: https://orcid.org/0009-0004-6908-5847)
- Jingzhao Hu (ORCID: https://orcid.org/0000-0001-9103-8618)
- Yangtao Zhou (ORCID: https://orcid.org/0009-0008-8561-922X)
- Wenjing Bi (ORCID: https://orcid.org/0009-0009-7806-4737)
- Lu Wang (ORCID: https://orcid.org/0000-0001-8414-4164)
- Qingshan Li (ORCID: https://orcid.org/0000-0001-8692-5132)
- Hua Chu (ORCID: https://orcid.org/0009-0006-0334-6375)
- Shuai Zhang (ORCID: https://orcid.org/0009-0006-4416-0999)
Institutions
- Xidian University (CN)
Publication Details
- Journal
- Expert Systems with Applications
- Published
- 2025-10-27
- DOI
- https://doi.org/10.1016/j.eswa.2025.130118
- Primary Topic
- Natural Language Processing Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00