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

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Dong, Honghua, Su, Qidong, Gao, Yubo, Li, Zhaoyu, Ruan, Yangjun, Pekhimenko, Gennady, Maddison, Chris J., Si, Xujie
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866914840283447296
author Dong, Honghua
Su, Qidong
Gao, Yubo
Li, Zhaoyu
Ruan, Yangjun
Pekhimenko, Gennady
Maddison, Chris J.
Si, Xujie
author_facet Dong, Honghua
Su, Qidong
Gao, Yubo
Li, Zhaoyu
Ruan, Yangjun
Pekhimenko, Gennady
Maddison, Chris J.
Si, Xujie
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2406_13161
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle APPL: A Prompt Programming Language for Harmonious Integration of Programs and Large Language Model Prompts
Dong, Honghua
Su, Qidong
Gao, Yubo
Li, Zhaoyu
Ruan, Yangjun
Pekhimenko, Gennady
Maddison, Chris J.
Si, Xujie
Artificial Intelligence
Computation and Language
Machine Learning
Programming Languages
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.
title APPL: A Prompt Programming Language for Harmonious Integration of Programs and Large Language Model Prompts
topic Artificial Intelligence
Computation and Language
Machine Learning
Programming Languages
url https://arxiv.org/abs/2406.13161