菜单

关于 🐙 GitHub
arXiv 提交日期: 2025-12-16
📄 Abstract - Sharing State Between Prompts and Programs

The rise of large language models (LLMs) has introduced a new type of programming: natural language programming. By writing prompts that direct LLMs to perform natural language processing, code generation, reasoning, etc., users are writing code in natural language -- natural language code -- for the LLM to execute. An emerging area of research enables interoperability between natural language code and formal languages such as Python. We present a novel programming abstraction, shared program state, that removes the manual work required to enable interoperability between natural language code and program state. With shared program state, programmers can write natural code that directly writes program variables, computes with program objects, and implements control flow in the program. We present a schema for specifying natural function interfaces that extend programming systems to support natural code and leverage this schema to specify shared program state as a natural function interface. We implement shared program state in the Nightjar programming system. Nightjar enables programmers to write Python programs that contain natural code that shares the Python program state. We show that Nightjar programs achieve comparable or higher task accuracy than manually written implementations (+4-19%), while decreasing the lines of code by 39.6% on average. The tradeoff to using Nightjar is that it may incur runtime overhead (0.4-4.3x runtime of manual implementations).

顶级标签: llm systems agents
详细标签: programming abstraction natural language programming human-ai collaboration llm integration code generation 或 搜索:

共享程序状态:一种提升自然语言与形式化代码互操作性的编程抽象 / Sharing State Between Prompts and Programs


1️⃣ 一句话总结

本文提出了一种名为“共享程序状态”的新型编程抽象,允许自然语言代码直接读写宿主程序(如Python)的变量、操作对象并控制程序流程,消除了传统方法中手动序列化数据和连接代码的负担,并通过在NIGHTJAR系统中的实现与评估,证明了其在减少代码量和提升任务准确率方面的有效性。


2️⃣ 论文创新点

1. 共享程序状态(Shared Program State)

2. 自然函数接口(Natural Function Interface, NFI)模式

3. NIGHTJAR系统实现与优化


3️⃣ 主要结果与价值

结果亮点

实际价值


4️⃣ 术语表

源自 arXiv: 2512.14805