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

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Dantanarayana, Jayanaka L., Kang, Yiping, Sivasothynathan, Kugesan, Clarke, Christopher, Li, Baichuan, Kashmira, Savini, Flautner, Krisztian, Tang, Lingjia, Mars, Jason
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866915495769276416
author Dantanarayana, Jayanaka L.
Kang, Yiping
Sivasothynathan, Kugesan
Clarke, Christopher
Li, Baichuan
Kashmira, Savini
Flautner, Krisztian
Tang, Lingjia
Mars, Jason
author_facet Dantanarayana, Jayanaka L.
Kang, Yiping
Sivasothynathan, Kugesan
Clarke, Christopher
Li, Baichuan
Kashmira, Savini
Flautner, Krisztian
Tang, Lingjia
Mars, Jason
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2405_08965
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle MTP: A Meaning-Typed Language Abstraction for AI-Integrated Programming
Dantanarayana, Jayanaka L.
Kang, Yiping
Sivasothynathan, Kugesan
Clarke, Christopher
Li, Baichuan
Kashmira, Savini
Flautner, Krisztian
Tang, Lingjia
Mars, Jason
Programming Languages
Artificial Intelligence
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.
title MTP: A Meaning-Typed Language Abstraction for AI-Integrated Programming
topic Programming Languages
Artificial Intelligence
url https://arxiv.org/abs/2405.08965