A Roadmap for Tamed Interactions with Large Language Models

· Source: cs.SE updates on arXiv.org · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering · Depth: Intermediate, extended

Summary

A new vision paper proposes an LLM Scripting Language (LSL), a Domain Specific Language (DSL), to enhance the reliability, robustness, and trustworthiness of AI-powered applications. Despite their impressive capabilities, Large Language Models (LLMs) often produce unreliable or hallucinated content, hindering their adoption in automated workflows. LSL aims to address these limitations by applying Software Engineering (SE) principles to LLM interactions. It will enable developers to define interaction blocks, manage context, format input prompts, and crucially, constrain LLM output completions using formalisms like generative grammars or JSON schemas. The proposed LSL interpreter will manage interfaces, optimize resource usage, and integrate error correction, testing, and explainability, making LLM interaction programmable and decoupled from underlying model training.

Key takeaway

For AI Engineers building production-grade applications with Large Language Models, this roadmap suggests adopting a structured approach to mitigate inherent unreliability. You should consider implementing a Domain Specific Language (DSL) or similar framework to script LLM interactions, enforcing output constraints via generative grammars or JSON schemas. This strategy provides stronger guarantees on generated content, improves robustness through automated context management and error handling, and enables formal verification, moving beyond ad-hoc prompt engineering.

Key insights

Software Engineering principles can formalize LLM interactions, ensuring reliable and structured outputs through a dedicated scripting language.

Principles

Method

LSL, a DSL, defines interaction blocks, manages LLM context, formats input, and constrains output via an interpreter. It integrates error handling, testing, and explainability.

In practice

Topics

Code references

Best for: AI Architect, Machine Learning Engineer, NLP Engineer, Software Engineer, AI Engineer, MLOps Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by cs.SE updates on arXiv.org.