APPL:一种实现程序与大语言模型提示和谐融合的提示编程语言
APPL: A Prompt Programming Language for Harmonious Integration of Programs and Large Language Model Prompts
AI总结:
针对大语言模型复杂工作流难实现维护的问题,提出提示编程语言APPL,实现提示与Python函数的无缝嵌入,具备并行运行时等特性,经多场景验证高效直观,并行加速效果接近估算值。
摘要:
大语言模型(LLM)在精心设计的提示与外部工具集成的辅助下,处理各类任务的能力日益增强,但随着任务复杂度提升,涉及LLM的工作流会变得复杂,因而难以实现和维护。为应对这一挑战,我们提出APPL(一种提示编程语言),它充当计算机程序与LLM之间的桥梁,支持将提示无缝嵌入Python函数,反之亦然。APPL提供直观的Python原生语法、具备异步语义的高效并行运行时,以及无需额外成本即可支持有效故障诊断与重放的追踪模块。我们通过三个典型场景:自一致性思维链(CoT-SC)、ReAct工具使用智能体、多智能体对话,证明APPL程序直观、简洁且高效。在三个可并行工作流上的实验进一步表明,APPL可有效并行化独立的LLM调用,加速比显著,几乎与估算值相符。
英文摘要:
Large Language Models (LLMs) have become increasingly capable of handling diverse tasks with the aid of well-crafted prompts and integration of external tools, but as task complexity rises, the workflow involving LLMs can be complicated and thus challenging to implement and maintain. To address this challenge, we propose APPL, A Prompt Programming Language that acts as a bridge between computer programs and LLMs, allowing seamless embedding of prompts into Python functions, and vice versa. APPL provides an intuitive and Python-native syntax, an efficient parallelized runtime with asynchronous semantics, and a tracing module supporting effective failure diagnosis and replaying without extra costs. We demonstrate that APPL programs are intuitive, concise, and efficient through three representative scenarios: Chain-of-Thought with self-consistency (CoT-SC), ReAct tool use agent, and multi-agent chat. Experiments on three parallelizable workflows further show that APPL can effectively parallelize independent LLM calls, with a significant speedup ratio that almost matches the estimation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。