Prompting Is Programming: A Query Language for Large Language Models
Not on the map. Why?
Abstract (arXiv)
Large language models have demonstrated outstanding performance on a wide range of tasks such as question answering and code generation. On a high level, given an input, a language model can be used to automatically complete the sequence in a statistically-likely way. Based on this, users prompt these models with language instructions or examples, to implement a variety of downstream tasks. Advanced prompting methods can even imply interaction between the language model, a user, and external tools such as calculators. However, to obtain state-of-the-art performance or adapt language models for specific tasks, complex task- and model-specific programs have to be implemented, which may still require ad-hoc interaction. Based on this, we present the novel idea of Language Model Programming (LMP). LMP generalizes language model prompting from pure text prompts to an intuitive combination of text prompting and scripting. Additionally, LMP allows constraints to be specified over the language model output. This enables easy adaption to many tasks while abstracting language model internals and providing high-level semantics. To enable LMP, we implement LMQL(short for Language Model Query Language), which leverages the constraints and control flow from an LMP prompt to generate an efficient inference procedure that minimizes the number of expensive calls to the underlying language model. We show that LMQL can capture a wide range of state-of-the-art prompting methods in an intuitive way, especially facilitating interactive flows that are challenging to implement with existing high-level APIs. Our evaluation shows that we retain or increase the accuracy on several downstream tasks, while also significantly reducing the required amount of computation or cost in the case of pay-to-use APIs (26-85% cost savings).
Key facts. Cited by 110 papers in the map (data through 7 Oct 2026). Builds on 24 of its 43 references that are in the map. First posted on arXiv 12 Dec 2022.
Builds on
24 of 43 references.
References · 24
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021Training Verifiers to Solve Math Word Problemscited by 9,743
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2022Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language modelscited by 1,970
- 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,057
12 more
- 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,020
- 2022PAL: Program-aided Language Modelscited by 635
- 2021Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigmcited by 599
- 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 402
- 2022PromptSource: An Integrated Development Environment and Repository for Natural Language Promptscited by 288
- 2021Constrained Language Models Yield Few-Shot Semantic Parserscited by 162
- 2022Synchromesh: Reliable code generation from pre-trained language modelscited by 156
- 2021OpenPrompt: An Open-source Framework for Prompt-learningcited by 148
- 2022PromptChainer: Chaining Large Language Model Prompts through Visual Programmingcited by 134
- 2022Language Model Cascadescited by 104
- 2019Giving BERT a Calculator: Finding Operations and Arguments with Reading Comprehensioncited by 51
- 2022ThinkSum: Probabilistic reasoning over sets using large language modelscited by 23
Built on by
Citing papers per year: 2022: 2; 2023: 23; 2024: 18; 2025: 24; 2026: 43.
110 papers.
Sort:
By area:
- 2023SGLang: Efficient Execution of Structured Language Model Programscited by 1,107
- 2023DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelinescited by 803
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2023Prompt Cache: Modular Attention Reuse for Low-Latency Inferencecited by 255
- 2022Reasoning with Language Model Prompting: A Surveycited by 251
- 2026Meta-Harness: End-to-End Optimization of Model Harnessescited by 248
- 2023ART: Automatic multi-step reasoning and tool-use for large language modelscited by 193
- 2023Efficient Guided Generation for Large Language Modelscited by 192
- 2023Amortizing intractable inference in large language modelscited by 94
- 2023ChainForge: A Visual Toolkit for Prompt Engineering and LLM Hypothesis Testingcited by 88
- 2023Sequential Monte Carlo Steering of Large Language Models using Probabilistic Programscited by 79
- 2024Safeguarding Large Language Models: A Surveycited by 73
38 more
- 2025JSONSchemaBench: A Rigorous Benchmark of Structured Outputs for Language Modelscited by 66
- 2022Parsel: Algorithmic Reasoning with Language Models by Composing Decompositionscited by 62
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2026Natural-Language Agent Harnessescited by 54
- 2024Tutor CoPilot: A Human-AI Approach for Scaling Real-Time Expertisecited by 46
- 2023Neural Graph Reasoning: Complex Logical Query Answering Meets Graph Databasescited by 35
- 2023What's Left? Concept Grounding with Logic-Enhanced Foundation Modelscited by 33
- 2024SPML: A DSL for Defending Language Models Against Prompt Attackscited by 33
- 2025Type-Constrained Code Generation with Language Modelscited by 32
- 2024IterGen: Iterative Semantic-aware Structured LLM Generation with Backtrackingcited by 28
- 2023DSPy Assertions: Computational Constraints for Self-Refining Language Model Pipelinescited by 27
- 2024StructuredRAG: JSON Response Formatting with Large Language Modelscited by 22
- 2024UQE: A Query Engine for Unstructured Databasescited by 18
- 2024AgentKit: Structured LLM Reasoning with Dynamic Graphscited by 12
- 2023Kani: A Lightweight and Highly Hackable Framework for Building Language Model Applicationscited by 11
- 2024Natural language is not enough: Benchmarking multi-modal generative AI for Verilog generationcited by 11
- 2024ScenicNL: Generating Probabilistic Scenario Programs from Natural Languagecited by 10
- 2023Numeracy from Literacy: Data Science as an Emergent Skill from Large Language Modelscited by 8
- 2023A Unified Industrial Large Knowledge Model Framework in Industry 4.0 and Smart Manufacturingcited by 8
- 2024APPL: A Prompt Programming Language for Harmonious Integration of Programs and Large Language Model Promptscited by 8
- 2024A Perspective for Adapting Generalist AI to Specialized Medical AI Applications and Their Challengescited by 8
- 2026SEVerA: Verified Synthesis of Self-Evolving Agentscited by 6
- 2023AskIt: Unified Programming Interface for Programming with Large Language Modelscited by 5
- 2024Understanding the Logic of Direct Preference Alignment through Logiccited by 5
- 2025Leveraging Vision-Language Models for Open-Vocabulary Instance Segmentation and Trackingcited by 4
- 2025Semantic Probabilistic Control of Language Modelscited by 4
- 2026The Constraint Tax: Measuring Validity-Correctness Tradeoffs in Structured Outputs for Small Language Modelscited by 4
- 2023Toward Reproducing Network Research Results Using Large Language Modelscited by 3
- 2023Automatically Testing Functional Properties of Code Translation Modelscited by 3
- 2023Prompt Sketching for Large Language Modelscited by 3
- 2024MTP: A Meaning-Typed Language Abstraction for AI-Integrated Programmingcited by 3
- 2024AutoFeedback: An LLM-based Framework for Efficient and Accurate API Request Generationcited by 3
- 2025Earley-Driven Dynamic Pruning for Efficient Structured Decodingcited by 3
- 2025Constrained Decoding for Safe Robot Navigation Foundation Modelscited by 3
- 2025Constrained Adaptive Rejection Samplingcited by 3
- 2026SkillSmith: Compiling Agent Skills into Boundary-Guided Runtime Interfacescited by 3
- 2026From Prompts to Contracts: Harness Engineering for Auditable Enterprise LLM Agentscited by 3
- 2026NVIDIA-labs OO Agents: Native Python Object-Oriented Agentscited by 3
50 most cited of 110 All 110 (JSON)
- 2026NL2Hull: A Natural Language-Driven Constrained Ship Design Decision Framework7 Oct 2026
- 2026JevSpawn: Adaptive Agentic Inference through Compositional Action Spaces30 Sep 2026
- 2026Agents as Software: A Programming Languages Agenda for Agent Reliability26 Sep 2026
- 2026How Reproducible Are Evaluation Conclusions? A Self-Audit of LLM-Inferred Prompt Structure24 Sep 2026
- 2026Provenance Before Prose: Claim-Locked Reporting for Statistical Text Generation26 Aug 2026
- 2026Trie Automata for Constrained Decoding over Large Finite Sets12 Aug 2026
- 2026PPDL: LLM-Based Flows as Probabilistic Programs5 Aug 2026
- 2026An Inline Control Architecture for Language Models in Intelligent Transportation Systems4 Aug 2026
- 2026GenOS: Compositional Certificates for Semantic Robustness in AI Code Generation4 Aug 2026
- 2026What makes prompts a graph: necessary and sufficient conditions for prompt graph engineering30 Jul 2026
- 2026Evolving Safety Landscape of Multi-modal Large Language Models: A Survey of Emerging Threats and Safeguards27 Jul 2026
- 2026NVIDIA-labs OO Agents: Native Python Object-Oriented Agents22 Jul 2026
38 more
- 2026Skillware: A Software Ontology and Engineering Lifecycle for Persistent Behavioral Artifacts21 Jul 2026
- 2026Imprompt: A Language Framework for Prompt Programming13 Jul 2026
- 2026Ceci n'est pas une pipe: AI systems as semantic abstractions10 Jul 2026
- 2026From Prompts to Contracts: Harness Engineering for Auditable Enterprise LLM Agents9 Jul 2026
- 2026SHARC: SHAP-Based Interpretability in Machine Learning Risk Models for Regulatory Capital under ICAAP and CCAR6 Jul 2026
- 2026Nexus: Depth-Adaptive KV-Cache Splicing and Retrieval-Decoupled Tool Routing for Agentic LLMs on Unified Memory1 Jul 2026
- 2026Is Your Agent Playing Dead? Deployed LLM Agents Exhibit Constraint-Evasive Fabrication and Thanatosis12 Jun 2026
- 2026Vector Map as Language: Toward Unified Remote Sensing Vector Mapping9 Jun 2026
- 2026Projectional Decoding: Towards Semantic-Aware LLM Generation28 May 2026
- 2026The Constraint Tax: Measuring Validity-Correctness Tradeoffs in Structured Outputs for Small Language Models20 May 2026
- 2026Verifier-Guided Code Translation via Meta-Step Decoding17 May 2026
- 2026TruncProof: A Guardrail for LLM-based JSON Generation under Token-Length Constraints13 May 2026
- 2026SkillSmith: Compiling Agent Skills into Boundary-Guided Runtime Interfaces12 May 2026
- 2026It's Not the Size: Harness Design Determines Operational Stability in Small Language Models12 May 2026
- 2026From Agent Loops to Deterministic Graphs: Execution Lineage for Reproducible AI-Native Work7 May 2026
- 2026Phionyx: A Deterministic AI Runtime Architecture with Structured State Management and Pre-Response Governance4 May 2026
- 2026Learning Evidence Highlighting for Frozen LLMs24 Apr 2026
- 2026When Agents Go Quiet: Output Generation Capacity and Format-Cost Separation for LLM Document Synthesis17 Apr 2026
- 2026VineLM: Trie-Based Fine-Grained Control for Agentic Workflows9 Apr 2026
- 2026HYVE: Hybrid Views for LLM Context Engineering over Machine Data7 Apr 2026
- 2026Meta-Harness: End-to-End Optimization of Model Harnesses30 Mar 2026
- 2026Natural-Language Agent Harnesses26 Mar 2026
- 2026SEVerA: Verified Synthesis of Self-Evolving Agents26 Mar 2026
- 2026Formal Semantics for Agentic Tool Protocols: A Process Calculus Approach25 Mar 2026
- 2026LLMON: An LLM-native Markup Language to Leverage Structure and Semantics at the LLM Interface23 Mar 2026
- 2026Using Vision Language Foundation Models to Generate Plant Simulation Configurations via In-Context Learning9 Mar 2026
- 2026Lexara: A User-Centered Toolkit for Evaluating Large Language Models for Conversational Visual Analytics6 Mar 2026
- 2026Attention Meets Reachability: Structural Equivalence and Efficiency in Grammar-Constrained LLM Decoding4 Mar 2026
- 2026Structured Prompt Language: Declarative Context Management for LLMs23 Feb 2026
- 2026PCN-Rec: Agentic Proof-Carrying Negotiation for Reliable Governance-Constrained Recommendation14 Jan 2026
- 2026GenAI-DrawIO-Creator: A Framework for Automated Diagram Generation8 Jan 2026
- 2025Sharing State Between Prompts and Programs16 Dec 2025
- 2025AutoICE: Automatically Synthesizing Verifiable C Code via LLM-driven Evolution8 Dec 2025
- 2025Prompt Less, Smile More: MTP with Semantic Engineering in Lieu of Prompt Engineering24 Nov 2025
- 2025Serve Programs, Not Prompts29 Oct 2025
- 2025Prompt Decorators: A Declarative and Composable Syntax for Reasoning, Formatting, and Control in LLMs21 Oct 2025
- 2025From Flows to Words: Can Zero-/Few-Shot LLMs Detect Network Intrusions? A Grammar-Constrained, Calibrated Evaluation on UNSW-NB1518 Oct 2025
- 2025Where to Search: Measure the Prior-Structured Search Space of LLM Agents16 Oct 2025
50 newest of 110 All 110 (JSON)
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2026SEVerA: Verified Synthesis of Self-Evolving Agentscited by 6
- 2026SkillSmith: Compiling Agent Skills into Boundary-Guided Runtime Interfacescited by 3
- 2026From Prompts to Contracts: Harness Engineering for Auditable Enterprise LLM Agentscited by 3
- 2026NVIDIA-labs OO Agents: Native Python Object-Oriented Agentscited by 3
- 2026From Agent Loops to Deterministic Graphs: Execution Lineage for Reproducible AI-Native Workcited by 2
- 2026PCN-Rec: Agentic Proof-Carrying Negotiation for Reliable Governance-Constrained Recommendationcited by 1
- 2025Representing Prompting Patterns with PDL: Compliance Agent Case Studycited by 0
- 2026Formal Semantics for Agentic Tool Protocols: A Process Calculus Approachcited by 0
- 2026When Agents Go Quiet: Output Generation Capacity and Format-Cost Separation for LLM Document Synthesiscited by 0
- 2026VineLM: Trie-Based Fine-Grained Control for Agentic Workflowscited by 0
- 2026Is Your Agent Playing Dead? Deployed LLM Agents Exhibit Constraint-Evasive Fabrication and Thanatosiscited by 0
12 most cited of 14 All 14 (JSON)
- 2026GenOS: Compositional Certificates for Semantic Robustness in AI Code Generation4 Aug 2026
- 2026NVIDIA-labs OO Agents: Native Python Object-Oriented Agents22 Jul 2026
- 2026From Prompts to Contracts: Harness Engineering for Auditable Enterprise LLM Agents9 Jul 2026
- 2026Nexus: Depth-Adaptive KV-Cache Splicing and Retrieval-Decoupled Tool Routing for Agentic LLMs on Unified Memory1 Jul 2026
- 2026Is Your Agent Playing Dead? Deployed LLM Agents Exhibit Constraint-Evasive Fabrication and Thanatosis12 Jun 2026
- 2026SkillSmith: Compiling Agent Skills into Boundary-Guided Runtime Interfaces12 May 2026
- 2026From Agent Loops to Deterministic Graphs: Execution Lineage for Reproducible AI-Native Work7 May 2026
- 2026When Agents Go Quiet: Output Generation Capacity and Format-Cost Separation for LLM Document Synthesis17 Apr 2026
- 2026VineLM: Trie-Based Fine-Grained Control for Agentic Workflows9 Apr 2026
- 2026SEVerA: Verified Synthesis of Self-Evolving Agents26 Mar 2026
- 2026Formal Semantics for Agentic Tool Protocols: A Process Calculus Approach25 Mar 2026
- 2026PCN-Rec: Agentic Proof-Carrying Negotiation for Reliable Governance-Constrained Recommendation14 Jan 2026
12 newest of 14 All 14 (JSON)
- 2022Reasoning with Language Model Prompting: A Surveycited by 251
- 2023ART: Automatic multi-step reasoning and tool-use for large language modelscited by 193
- 2022Parsel: Algorithmic Reasoning with Language Models by Composing Decompositionscited by 62
- 2023Neural Graph Reasoning: Complex Logical Query Answering Meets Graph Databasescited by 35
- 2023What's Left? Concept Grounding with Logic-Enhanced Foundation Modelscited by 33
- 2024AgentKit: Structured LLM Reasoning with Dynamic Graphscited by 12
- 2025Prompt Decorators: A Declarative and Composable Syntax for Reasoning, Formatting, and Control in LLMscited by 1
- 2026Verifier-Guided Code Translation via Meta-Step Decodingcited by 1
- 2023Structured Thoughts Automaton: First Formalized Execution Model for Auto-Regressive Language Modelscited by 0
- 2025Where to Search: Measure the Prior-Structured Search Space of LLM Agentscited by 0
- 2026JevSpawn: Adaptive Agentic Inference through Compositional Action Spacescited by 0
- 2026JevSpawn: Adaptive Agentic Inference through Compositional Action Spaces30 Sep 2026
- 2026Verifier-Guided Code Translation via Meta-Step Decoding17 May 2026
- 2025Prompt Decorators: A Declarative and Composable Syntax for Reasoning, Formatting, and Control in LLMs21 Oct 2025
- 2025Where to Search: Measure the Prior-Structured Search Space of LLM Agents16 Oct 2025
- 2024AgentKit: Structured LLM Reasoning with Dynamic Graphs17 Apr 2024
- 2023What's Left? Concept Grounding with Logic-Enhanced Foundation Models24 Oct 2023
- 2023Structured Thoughts Automaton: First Formalized Execution Model for Auto-Regressive Language Models16 Jun 2023
- 2023Neural Graph Reasoning: Complex Logical Query Answering Meets Graph Databases26 Mar 2023
- 2023ART: Automatic multi-step reasoning and tool-use for large language models16 Mar 2023
- 2022Parsel: Algorithmic Reasoning with Language Models by Composing Decompositions20 Dec 2022
- 2022Reasoning with Language Model Prompting: A Survey19 Dec 2022
- 2025Leveraging Vision-Language Models for Open-Vocabulary Instance Segmentation and Trackingcited by 4
- 2026Using Vision Language Foundation Models to Generate Plant Simulation Configurations via In-Context Learningcited by 0
- 2026Evolving Safety Landscape of Multi-modal Large Language Models: A Survey of Emerging Threats and Safeguardscited by 0
- 2026Evolving Safety Landscape of Multi-modal Large Language Models: A Survey of Emerging Threats and Safeguards27 Jul 2026
- 2026Using Vision Language Foundation Models to Generate Plant Simulation Configurations via In-Context Learning9 Mar 2026
- 2025Leveraging Vision-Language Models for Open-Vocabulary Instance Segmentation and Tracking18 Mar 2025
- 2024Understanding the Logic of Direct Preference Alignment through Logiccited by 5
- 2023The Problem of Alignmentcited by 1
- 2024Understanding the Logic of Direct Preference Alignment through Logic23 Dec 2024
- 2023The Problem of Alignment30 Dec 2023
- 2025Astrolabe: Balancing Load in LLM Serving with Randomized Prediction-Guided Schedulingcited by 2
- 2025Serve Programs, Not Promptscited by 0
- 2025Serve Programs, Not Prompts29 Oct 2025
- 2025Astrolabe: Balancing Load in LLM Serving with Randomized Prediction-Guided Scheduling5 Aug 2025
- 2023SGLang: Efficient Execution of Structured Language Model Programscited by 1,107
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2023Prompt Cache: Modular Attention Reuse for Low-Latency Inferencecited by 255
- 2026Meta-Harness: End-to-End Optimization of Model Harnessescited by 248
- 2023Efficient Guided Generation for Large Language Modelscited by 192
- 2023Amortizing intractable inference in large language modelscited by 94
- 2023ChainForge: A Visual Toolkit for Prompt Engineering and LLM Hypothesis Testingcited by 88
- 2023Sequential Monte Carlo Steering of Large Language Models using Probabilistic Programscited by 79
- 2025JSONSchemaBench: A Rigorous Benchmark of Structured Outputs for Language Modelscited by 66
- 2026Natural-Language Agent Harnessescited by 54
- 2024Tutor CoPilot: A Human-AI Approach for Scaling Real-Time Expertisecited by 46
- 2024SPML: A DSL for Defending Language Models Against Prompt Attackscited by 33
12 most cited of 73 All 73 (JSON)
- 2026NL2Hull: A Natural Language-Driven Constrained Ship Design Decision Framework7 Oct 2026
- 2026Agents as Software: A Programming Languages Agenda for Agent Reliability26 Sep 2026
- 2026How Reproducible Are Evaluation Conclusions? A Self-Audit of LLM-Inferred Prompt Structure24 Sep 2026
- 2026Provenance Before Prose: Claim-Locked Reporting for Statistical Text Generation26 Aug 2026
- 2026Trie Automata for Constrained Decoding over Large Finite Sets12 Aug 2026
- 2026PPDL: LLM-Based Flows as Probabilistic Programs5 Aug 2026
- 2026What makes prompts a graph: necessary and sufficient conditions for prompt graph engineering30 Jul 2026
- 2026Skillware: A Software Ontology and Engineering Lifecycle for Persistent Behavioral Artifacts21 Jul 2026
- 2026Imprompt: A Language Framework for Prompt Programming13 Jul 2026
- 2026Ceci n'est pas une pipe: AI systems as semantic abstractions10 Jul 2026
- 2026SHARC: SHAP-Based Interpretability in Machine Learning Risk Models for Regulatory Capital under ICAAP and CCAR6 Jul 2026
- 2026Vector Map as Language: Toward Unified Remote Sensing Vector Mapping9 Jun 2026
12 newest of 73 All 73 (JSON)