arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2405.08965cs.PLcs.AI
收藏

MTP:面向AI集成编程的含义类型化语言抽象

MTP: A Meaning-Typed Language Abstraction for AI-Integrated Programming

University of Michigan(密歇根大学);Jaseci Labs(Jaseci实验室)

Jayanaka L. Dantanarayana, Yiping Kang, Kugesan Sivasothynathan, Christopher Clarke, Baichuan Li, Savini Kashmira, Krisztian Flautner, Lingjia Tang, Jason Mars

AI总结:

本文提出MTP(含义类型化编程)新范式,通过by操作符、MT-IR和MT-Runtime自动化LLM集成,在Python超集语言Jac中实现,显著降低开发复杂度与成本,任务完成速度提升3.2倍且代码量减少45%。

摘要:

软件开发正从传统编程转向在运行时利用生成式AI和大型语言模型(LLMs)的AI集成应用。然而,集成LLMs仍然复杂,需要开发者手动构造提示词并处理输出。现有工具试图辅助提示词工程,但通常会引入额外的复杂性。本文提出了Meaning-Typed Programming (MTP)(含义类型化编程),一种通过直观的语言级结构抽象LLM集成的新范式。通过利用代码固有的语义丰富性,MTP能自动完成提示词生成和响应处理,无需开发者额外费力。我们引入了:(1) 用于无缝调用LLM的by操作符;(2) MT-IR,一种用于语义提取的基于含义的中间表示;(3) MT-Runtime,一个管理LLM交互的自动化系统。我们在作为Python超集的编程语言Jac中实现了MTP,并发现MTP在保持准确性和效率的同时显著降低了编码复杂性。MTP大幅降低了开发复杂性、所需修改的代码行数和成本,同时提升了运行时性能,并保持或超越了现有方法的准确性。我们的用户研究表明,与现有框架相比,使用MTP的开发者完成任务的速度快了3.2倍,代码行数减少了45%。此外,即使高达50%的命名约定遭到降级,MTP也展现出了弹性,证明其对次优代码具有鲁棒性。MTP作为Jaseci开源项目的一部分开发,可通过byLLM模块使用。

英文摘要:

Software development is shifting from traditional programming to AI-integrated applications that leverage generative AI and large language models (LLMs) during runtime. However, integrating LLMs remains complex, requiring developers to manually craft prompts and process outputs. Existing tools attempt to assist with prompt engineering, but often introduce additional complexity. This paper presents Meaning-Typed Programming (MTP), a novel paradigm that abstracts LLM integration through intuitive language-level constructs. By leveraging the inherent semantic richness of code, MTP automates prompt generation and response handling without additional developer effort. We introduce the (1) by operator for seamless LLM invocation, (2) MT-IR, a meaning-based intermediate representation for semantic extraction, and (3) MT-Runtime, an automated system for managing LLM interactions. We implement MTP in Jac, a programming language that supersets Python, and find that MTP significantly reduces coding complexity while maintaining accuracy and efficiency. MTP significantly reduces development complexity, lines of code modifications needed, and costs while improving run-time performance and maintaining or exceeding the accuracy of existing approaches. Our user study shows that developers using MTP completed tasks 3.2x faster with 45% fewer lines of code compared to existing frameworks. Moreover, MTP demonstrates resilience even when up to 50% of naming conventions are degraded, demonstrating robustness to suboptimal code. MTP is developed as part of the Jaseci open-source project, and is available under the module byLLM.

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

↑