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(N^2) to O(N^2/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.
Prompt4Vis: Prompting Large Language Models with Example Mining and Schema Filtering for Tabular Data Visualization
The Hong Kong Polytechnic University(香港理工大学);University of Chinese Academy of Sciences(中国科学院大学);The Hong Kong University of Science and Technology(香港科技大学);WeBank Co., Ltd(微众银行);University of Liverpool(利物浦大学)
针对自然语言转数据可视化查询性能不足的问题,提出基于大语言模型与上下文学习的 Prompt4Vis 框架,通过多目标示例挖掘和模式过滤模块显著提升了生成性能,在 NVBench 数据集上大幅超越现有 SOTA 方法。
TokenPilot: Cache-Efficient Context Management for LLM Agents
Zhejiang University(浙江大学);University of Electronic Science and Technology of China(电子科技大学);Xi’an University of Electronic Science and Technology(西安电子科技大学);HomologyAI(同源人工智能)
Automated Thematic Analyses Using LLMs: Xylazine Wound Management Social Media Chatter Use Case
Emory University(埃默里大学);Wheeler High School(惠勒高中);Rutgers New Jersey Medical School(罗格斯新泽西医学院);Perelman School of Medicine, University of Pennsylvania(宾夕法尼亚大学佩雷尔曼医学院)