arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2308.15645cs.PLcs.AIcs.SE
收藏

AskIt:用于大型语言模型编程的统一编程接口

AskIt: Unified Programming Interface for Programming with Large Language Models

CSAIL, MIT(麻省理工学院计算机科学与人工智能实验室);Mitsubishi Electric Corporation(三菱电机株式会社)

Katsumi Okuda, Saman Amarasinghe

AI总结:

本文提出AskIt,一种专为大型语言模型设计的领域特定语言,通过统一接口支持直接任务执行和代码生成,实现提示长度减少16.14%及效率提升。

摘要:

大型语言模型(LLMs)展现出一种称为涌现能力的独特现象,在从文本摘要到代码生成的众多任务中表现出熟练度。虽然这些能力为软件设计和开发开辟了新的途径,但它们的整合也带来了重大挑战。开发者需要决定是否使用LLMs在应用程序中直接执行任务,以及生成和执行代码来完成这些任务。此外,鉴于从自然语言输出中提取数据的必要性,有效的提示设计成为一个关键问题。为了解决这些复杂性,本文介绍了AskIt,一种专门为LLMs设计的领域特定语言(DSL)。AskIt通过提供统一接口简化了LLM集成,该接口不仅允许使用LLMs直接执行任务,还支持代码生成和执行的完整周期。这种双重能力通过(1)类型引导的输出控制,(2)基于模板的函数定义,以及(3)针对两种使用模式的提示生成来实现。我们的评估强调了AskIt的有效性。在50个任务中,AskIt生成了简洁的提示,与基准相比,提示长度减少了16.14%。此外,通过实现在应用程序中直接使用LLMs与生成代码之间的无缝转换,AskIt实现了显著的效率提升,正如我们在GSM8K基准实验中所观察到的那样。AskIt在TypeScript和Python中的实现分别可在https://github.com/katsumiok/ts-askit和https://github.com/katsumiok/pyaskit获取。

英文摘要:

Large Language Models (LLMs) exhibit a unique phenomenon known as emergent abilities, demonstrating adeptness across numerous tasks, from text summarization to code generation. While these abilities open up novel avenues in software design and crafting, their incorporation presents substantial challenges. Developers face decisions regarding the use of LLMs for directly performing tasks within applications as well as for generating and executing code to accomplish these tasks. Moreover, effective prompt design becomes a critical concern, given the necessity of extracting data from natural language outputs. To address these complexities, this paper introduces AskIt, a domain-specific language (DSL) specifically designed for LLMs. AskIt simplifies LLM integration by providing a unified interface that not only allows for direct task execution using LLMs but also supports the entire cycle of code generation and execution. This dual capability is achieved through (1) type-guided output control, (2) template-based function definitions, and (3) prompt generation for both usage modes. Our evaluations underscore AskIt's effectiveness. Across 50 tasks, AskIt generated concise prompts, achieving a 16.14 % reduction in prompt length compared to benchmarks. Additionally, by enabling a seamless transition between using LLMs directly in applications and for generating code, AskIt achieved significant efficiency improvements, as observed in our GSM8K benchmark experiments. The implementations of AskIt in TypeScript and Python are available at https://github.com/katsumiok/ts-askit and https://github.com/katsumiok/pyaskit, respectively.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑