Sharing State Between Prompts and Programs
Not on the map. Why?
Abstract (arXiv)
The rise of large language models (LLMs) has introduced a new type of programming: natural language programming. Users write prompts, which are instructions in natural language, to direct LLMs to perform tasks such as natural language processing, code generation, reasoning, etc. An emerging area of research enables interoperability between prompts and programs. We present a novel programming abstraction, shared program state, that removes the manual work required to enable interoperability between prompts and program states. With shared program state, programmers can write prompts that directly access program variables, compute with program objects, and implement control flow in the program. We present a schema for specifying natural function interfaces that extend programming systems to support programs with prompts 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 containing prompts that share 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 is that Nightjar may incur runtime overhead (0.4-4.3x manual implementations).
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 39 of its 119 references that are in the map. First posted on arXiv 16 Dec 2025.
Builds on
39 of 119 references.
References · 39
- 2023GPT-4 Technical Reportcited by 18,396
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2022Emergent Abilities of Large Language Modelscited by 2,512
- 2023A Survey on Evaluation of Large Language Modelscited by 1,242
- 2023SGLang: Efficient Execution of Structured Language Model Programscited by 1,141
- 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,076
- 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,045
- 2023DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelinescited by 832
- 2023Automatic Prompt Optimization with "Gradient Descent" and Beam Searchcited by 653
27 more
- 2023Promptbreeder: Self-Referential Self-Improvement Via Prompt Evolutioncited by 551
- 2023Is ChatGPT a General-Purpose Natural Language Processing Task Solver?cited by 488
- 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrationscited by 431
- 2020ONION: A Simple and Effective Defense Against Textual Backdoor Attackscited by 263
- 2023LLM Self Defense: By Self Examination, LLMs Know They Are Being Trickedcited by 244
- 2024Does Prompt Formatting Have Any Impact on LLM Performance?cited by 141
- 2022Prompting Is Programming: A Query Language for Large Language Modelscited by 110
- 2024Let Me Speak Freely? A Study on the Impact of Format Restrictions on Performance of Large Language Modelscited by 96
- 2023InstructZero: Efficient Instruction Optimization for Black-Box Large Language Modelscited by 68
- 2025Learning Adaptive Parallel Reasoning with Language Modelscited by 58
- 2024Symbolic Prompt Program Search: A Structure-Aware Approach to Efficient Compile-Time Prompt Optimizationcited by 30
- 2025Multiverse: Your Language Models Secretly Decide How to Parallelize and Merge Generationcited by 30
- 2025Learning to Keep a Promise: Scaling Language Model Decoding Parallelism with Learned Asynchronous Decodingcited by 28
- 2024APAR: LLMs Can Do Auto-Parallel Auto-Regressive Decodingcited by 24
- 2023Test-time Backdoor Mitigation for Black-Box Large Language Models with Defensive Demonstrationscited by 21
- 2024Prompts Are Programs Too! Understanding How Developers Build Software Containing Promptscited by 19
- 2022Text Adversarial Purification as Defense against Adversarial Attackscited by 16
- 2023CoPrompt: Supporting Prompt Sharing and Referring in Collaborative Natural Language Programmingcited by 16
- 2024PDL: A Declarative Prompt Programming Languagecited by 14
- 2023ANPL: Towards Natural Programming with Interactive Decompositioncited by 13
- 2025PromptPex: Automatic Test Generation for Language Model Promptscited by 9
- 2024APPL: A Prompt Programming Language for Harmonious Integration of Programs and Large Language Model Promptscited by 8
- 2013Handling Algebraic Effectscited by 5
- 2025Quasar: A Programming Language Specialized for LLM Code Actionscited by 4
- 2024Bridging Worlds: Achieving Language Interoperability between Julia and Python in Scientific Computingcited by 2
- 2019The Case for Writing Network Drivers in High-Level Programming Languagescited by 1
- 2020Copy-and-Patch Compilation: A fast compilation algorithm for high-level languages and bytecodecited by 1
Built on by
Citing papers per year: 2026: 2.
2 papers.
- 2026Natural-Language Agent Harnessescited by 61
- 2026NVIDIA-labs OO Agents: Native Python Object-Oriented Agentscited by 3
- 2026NVIDIA-labs OO Agents: Native Python Object-Oriented Agents22 Jul 2026
- 2026Natural-Language Agent Harnesses26 Mar 2026