Large language models (LLMs) are incredibly powerful at comprehending and generating data in the form of text, but are brittle and error-prone. There has been an advent of toolkits and recipes centered around so-called prompt engineering-the process of asking an LLM to do something via a series of prompts. However, for LLM-powered data processing workflows, in particular, optimizing for quality, while keeping cost bounded, is a tedious, manual process. We put forth a vision for declarative prompt engineering. We view LLMs like crowd workers and leverage ideas from the declarative crowdsourcing literature-including leveraging multiple prompting strategies, ensuring internal consistency, and exploring hybrid-LLM-non-LLM approaches-to make prompt engineering a more principled process. Preliminary case studies on sorting, entity resolution, and imputation demonstrate the promise of our approach
翻译:大型语言模型(LLMs)在理解和生成文本数据方面极为强大,但同时也存在脆弱性和易错性。近年来,围绕所谓的“提示工程”(即通过一系列提示要求LLM执行任务的过程)涌现出大量工具包和方案。然而,在以LLM驱动的数据处理工作流中,特别是在控制成本的同时优化质量,仍是一个繁琐的人工过程。我们提出了一种声明式提示工程的愿景。我们将LLM视为众包工作者,并借鉴声明式众包文献中的思想——包括利用多种提示策略、确保内部一致性以及探索LLM与非LLM混合方法——使提示工程成为更具原则性的流程。基于排序、实体解析和插值等初步案例研究,证明了我们方法的潜力。