Prompting Is Programming: A Query Language for Large Language Models
summary
Introduces LMQL, a small query language that combines templated prompts, Python control flow and constraint decoding to steer off‑the‑shelf LLMs by masking illegal tokens at decode time rather than post‑validating. Implements logit masking with “follow” and “final” semantics to provably avoid constraints violations, supports branching decoders and function calls, and runs as a Python runtime plus web playground. Evaluations show LMQL preserves or improves accuracy while delivering 26–85% cost savings by reducing LLM calls.
AI-written summary · about
chapters (20)
- 0:00Prompting as programming
- 1:51Core LLM challenges
- 3:35Introducing LMQL
- 5:20LLM text generation
- 7:05LMQL prompt templates
- 9:12Dynamic prompt construction
- 10:17Constraint enforcement
- 12:24Constraint semantics
- 14:13LMQL accuracy and efficiency
- 15:17LMQL future directions
- 16:22Q&A: Constraints for NL outputs
- 18:08Q&A: External systems
- 18:52Q&A: Microsoft guidance
- 20:14Q&A: Tools and function calls
- 21:37Q&A: Robustness measurement
- 22:42Q&A: LLMs as classifiers
- 24:30Q&A: LMQL vs LangChain
- 25:51Q&A: Parallel queries
- 28:21Q&A: Constraints in alignment
- 29:46Summary
related talks
46mBeyond Basic Prompting: Supercharging Open Source LLMs with LMQL's Structured Generation
01h 39mMastering LLMs: From Prompt Engineering to Agentic AI
47mBuilding Python based AI Systems with LLMs
49mA Practical Approach to Using LLMs: Peculiarities and Pitfalls
40mSurviving the Agentic Hype with Small Language Models
17mRLM: Recursive Language Models for Large Codebases
19mUnlocking the Full Potential of LLMs: Advanced Prompt Engineering Techniques
51mTowards a Pragmatic Understanding of Large Language Models
