Imprompt: A Language Framework for Prompt Programming
Abstract
With the unprecedented success of Language Models (LMs), the science of Prompt Engineering has evolved the powerful idea of Prompt Programming, where prompts are treated as a programmable control surface for describing complex tasks and leveraging LM capabilities. However, existing prompt programming frameworks suffer from various complexities and inelegances, which make them hard to utilize in practice for effectively describing tasks. We propose Imprompt, a new language framework for the study and practice of prompt programming. We undertake a foundational investigation of prompt programming, and contend that prompt programs must contain only the task descriptions and must be decoupled from lower-level 'execution' details. We further develop this position by illustrating structured prompting as a combination of prompt programming and prompt program 'compilation'. We exemplify this view by formally defining two compilers for Imprompt programs. We then explore the idea of typing for prompt programs and draw a correspondence between type checking and constrained decoding. Finally, we implement our compilers and type checkers and evaluate them on a variety of case studies. We believe our work contributes programming-language foundations toward the emerging area of prompt programming.
Create a lesson
Metadata
- Categories
- cs.AI, cs.CL, cs.PL
- Comments
- 28 pages, 24 figures, 2 tables
Related papers
Navigent: A Geometry-Grounded Agentic Framework for Vision Language Navigation
Shared title terminologycs.AIXinyu Zhou, Weiren Cai, Yitong Chen et al.
InterGenEHR^+: An Interactive Framework for Natural Language-Conditioned Generation of Longitudinal Patient Trajectories
Shared title terminologycs.AIYu Yang, Jiafeng Song, Baraa F Abed et al.
TPvG: A Moral Decision Framework for Large Language Models from One-Shot to Sequential Feedback
Shared title terminologycs.AIFangyuan Zhang, Dong Yu, Pengyuan Liu
A Threshold Exceedance Framework for CBRN Uplift Evaluation in Frontier Language Models
Shared title terminologycs.AIRahul Gupta, Abhinav Mohanty, Payal Motwani et al.
Large language model agents accelerate inverse design of metal-organic frameworks for gas separation
Shared title terminologycs.AIZhaolin Hu, Hehe Fan, Wangyihan Guo et al.
A Failure-Driven Data Flywheel for Post-Training Vision-Language-Action Models
Shared title terminologycs.AIYuhao Luo, Zihao Sheng, Zilin Huang et al.