Lune

ACL2025顶会

APPL: A Prompt Programming Language for Harmonious Integration of Programs and Large Language Model Prompts

Honghua Dong, Qidong Su, Yubo Gao, Zhaoyu Li, Yangjun Ruan, Gennady Pekhimenko, Chris J. Maddison, Xujie Si

摘要

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 representative scenarios including Chain-of-Thought with self-consistency (CoT-SC) and ReAct tooluse agent. We further use LLMs to judge the language design between APPL and previous work, where the results indicate that codes written in APPL are more readable and intuitive. Our code, tutorial and documentation are available at https://github.com/appl-team/appl . 1 @ppl(ctx="copy") # copy the context from caller 2 def get_answer(question): 3 question # append to the prompt 4 return gen() # return the string response 5 @ppl # marks APPL function 6 def answer_questions(quotation, questions): 7 "Extract the name of the author from the quotation below and answer questions." → 8 quotation # append to the prompt 9 with AIRole(): # assistant message scope 10 f"The name of the author is gen()" 11 return [get_answer(q) for q in questions] # parallelize calls (a) The APPL program for answering questions. 1 def get_answer(messages, question): 2 return gen(messages + [user(question)]) # new message list with addon message → 3 def answer_questions(quotation, questions

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 3 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Tree of Thoughts: Deliberate Problem Solving with Large Language Models 引用了 Language Models are Few-Shot Learners
  • Tree of Thoughts: Deliberate Problem Solving with Large Language Models 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Gorilla: Large Language Model Connected with Massive APIs 引用了 Language Models are Few-Shot Learners
  • Gorilla: Large Language Model Connected with Massive APIs 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Generative Agents: Interactive Simulacra of Human Behavior 引用了 Language Models are Few-Shot Learners
  • Generative Agents: Interactive Simulacra of Human Behavior 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • PPDL: LLM-Based Flows as Probabilistic Programs 引用了 Tree of Thoughts: Deliberate Problem Solving with Large Language Models
  • PPDL: LLM-Based Flows as Probabilistic Programs 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • TypyBench: Evaluating LLM Type Inference for Untyped Python Repositories 引用了 Language Models are Few-Shot Learners
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper3

  1. Sharing State Between Prompts and ProgramsEllie Y. Cheng, Logan Weber, Tian Jin, Michael CarbinICLR 2026 · 3 次引用
  2. PPDL: LLM-Based Flows as Probabilistic ProgramsLouis Mandel, Guillaume Baudart, Mandana Vaziri, Martin HirzelICML 2026
  3. TypyBench: Evaluating LLM Type Inference for Untyped Python RepositoriesHonghua Dong, Jiacheng Yang, Xun Deng, Yuhe Jiang 等ICML 2025

它引用的 Paper17

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
  2. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  3. Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsShunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran 等NeurIPS 2023 · 5,068 次引用
  4. Generative Agents: Interactive Simulacra of Human BehaviorJoon Sung Park, Joseph C. O'Brien, Carrie Jun Cai, Meredith Ringel Morris 等UIST 2023 · 1,882 次引用
  5. Gorilla: Large Language Model Connected with Massive APIsShishir G. Patil, Tianjun Zhang, Xin Wang, Joseph E. GonzalezNeurIPS 2024 · 1,715 次引用

相关 Paper

  1. CoPrompt: Supporting Prompt Sharing and Referring in Collaborative Natural Language ProgrammingLi Feng, Ryan Yen, Yuzhe You, Mingming Fan 等CHI 2024 · 28 次引用
  2. When Prompt Engineering Meets Software Engineering: CNL-P as Natural and Robust "APIs" for Human-AI InteractionZhenchang Xing, Yang Liu, Zhuo Cheng, Qing Huang 等ICLR 2025
  3. Prompting Is Programming: A Query Language for Large Language ModelsLuca Beurer-Kellner, Marc Fischer, Martin T. VechevPLDI 2023 · 114 次引用
  4. Why Johnny Can't Prompt: How Non-AI Experts Try (and Fail) to Design LLM PromptsJ. D. Zamfirescu-Pereira, Richmond Y. Wong, Bjoern Hartmann, Qian YangCHI 2023 · 892 次引用
  5. Prompt-R1: Collaborative Automatic Prompting Framework via End-to-end Reinforcement LearningWenjin Liu, Haoran Luo, Xueyuan Lin, Haoming Liu 等ACL Findings 2026 · 1 次引用
黄昏的海面,两侧是细线勾勒的悬崖