Prompt Engineering (PE) has emerged as a critical technique for guiding Large Language Models (LLMs) in solving intricate tasks. Its importance is highlighted by its potential to significantly enhance the efficiency and effectiveness of human-machine interaction. As tasks grow increasingly complex, recent advanced PE methods have extended beyond the limitations of single-round interactions to embrace multi-round interactions, which allows for a deeper and more nuanced engagement with LLMs. In this paper, we propose an optimal control framework tailored for multi-round interactions with LLMs. This framework provides a unified mathematical structure that not only systematizes the existing PE methods but also sets the stage for rigorous analytical improvements. Furthermore, we extend this framework to include PE via ensemble methods and multi-agent collaboration, thereby enlarging the scope of applicability. By adopting an optimal control perspective, we offer fresh insights into existing PE methods and highlight theoretical challenges that warrant future research. Besides, our work lays a foundation for the development of more effective and interpretable PE methods.
翻译:提示工程(Prompt Engineering, PE)已成为引导大语言模型(Large Language Models, LLMs)解决复杂任务的关键技术。其重要性体现在显著提升人机交互效率与效果的潜力上。随着任务日趋复杂,近年来的先进PE方法已突破单轮交互的限制,转向多轮交互模式,从而实现对LLMs的更深入、更精细的引导。本文提出了一种面向LLMs多轮交互的最优控制框架。该框架提供统一的数学结构,不仅系统化现有PE方法,更为严谨的分析改进奠定基础。此外,我们将该框架拓展至集成方法与多智能体协作的PE场景,从而扩大其适用范围。通过最优控制的视角,我们为现有PE方法提供了全新见解,并揭示了值得未来研究的理论挑战。同时,本研究为开发更高效、更具可解释性的PE方法奠定了基础。