mlsanityData to 7 Oct 2026

Structured Prompt Language: Declarative Context Management for LLMs

arXiv 2602.21257 ↗First posted 23 Feb 2026cs.CL cs.DB cs.PLcited by 1

Not on the map. Why?

Abstract (arXiv)

We present SPL (Structured Prompt Language), a declarative SQL-inspired language that treats large language models as generative knowledge bases and their context windows as constrained resources. SPL provides explicit WITH BUDGET/LIMIT token management, an automatic query optimizer, EXPLAIN transparency analogous to SQL's EXPLAIN ANALYZE, and native integration of retrieval-augmented generation (RAG) and persistent memory in a single declarative framework. SPL-flow extends SPL into resilient agentic pipelines with a three-tier provider fallback strategy (Ollama -> OpenRouter -> self-healing retry) fully transparent to the .spl script. Five extensions demonstrate the paradigm's breadth: (1) Text2SPL (multilingual NL->SPL translation); (2) Mixture-of-Models (MoM) routing that dispatches each PROMPT to a domain-specialist model at runtime; (3) Logical Chunking, an intelligent strategy for documents exceeding a single context window--expressed naturally through SPL's existing CTE syntax with no new constructs, decomposing a large query into a Map-Reduce pipeline that reduces attention cost from O(N2) to O(N2/k) and runs identically on cloud (parallel) or local hardware (sequential); (4) SPL-flow, a declarative agentic orchestration layer with resilient three-tier provider fallback; and (5) BENCHMARK for parallel multi-model comparison with automatic winner persistence. We provide a formal EBNF grammar, two pip-installable Python packages (spl-llm, spl-flow), and comparison against Prompty, DSPy, and LMQL. SPL reduces prompt boilerplate by 65% on average, surfaces a 68x cost spread across model tiers as a pre-execution signal, and runs the identical .spl script at 0.002 on OpenRouter or at zero marginal cost on a local Ollama instance--without modification.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 13 of its 30 references that are in the map. First posted on arXiv 23 Feb 2026.

Builds on

13 of 30 references.

References · 13

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  4. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  5. 2017Billion-scale similarity search with GPUscited by 2,477
  6. 2023AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversationcited by 1,906
  7. 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,120
  8. 2023DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelinescited by 803
  9. 2026GLM-5: from Vibe Coding to Agentic Engineeringcited by 502
  10. 2024Token-Budget-Aware LLM Reasoningcited by 242
  11. 2019SParC: Cross-Domain Semantic Parsing in Contextcited by 141
  12. 2022Prompting Is Programming: A Query Language for Large Language Modelscited by 110
1 more
  1. 2025SelfBudgeter: Adaptive Token Allocation for Efficient LLM Reasoningcited by 47

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2023How to Prompt LLMs for Text-to-SQL: A Study in Zero-shot, Single-domain, and Cross-domain Settings
  2. 2024Can Long-Context Language Models Subsume Retrieval, RAG, SQL, and More?
  3. 2023ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thought
  4. 2025Auto prompt sql: a resource-efficient architecture for text-to-sql translation in constrained environments
  5. 2024RB-SQL: A Retrieval-based LLM Framework for Text-to-SQL
  6. 2024PET-SQL: A Prompt-Enhanced Two-Round Refinement of Text-to-SQL with Cross-consistency
  7. 2025Beyond Quacking: Deep Integration of Language Models and RAG into DuckDB
  8. 2025DynaQuery: A Self-Adapting Framework for Querying Structured and Multimodal Data