SHERPA: A Model-Driven Framework for Large Language Model Execution
Not on the map. Why?
Abstract (arXiv)
Recently, large language models (LLMs) have achieved widespread application across various fields. Despite their impressive capabilities, LLMs suffer from a lack of structured reasoning ability, particularly for complex tasks requiring domain-specific best practices, which are often unavailable in the training data. Although multi-step prompting methods incorporating human best practices, such as chain-of-thought and tree-of-thought, have gained popularity, they lack a general mechanism to control LLM behavior. In this paper, we propose SHERPA, a model-driven framework to improve the LLM performance on complex tasks by explicitly incorporating domain-specific best practices into hierarchical state machines. By structuring the LLM execution processes using state machines, SHERPA enables more fine-grained control over their behavior via rules or decisions driven by machine learning-based approaches, including LLMs. We show that SHERPA is applicable to a wide variety of tasks-specifically, code generation, class name generation, and question answering-replicating previously proposed approaches while further improving the performance. We demonstrate the effectiveness of SHERPA for the aforementioned tasks using various LLMs. Our systematic evaluation compares different state machine configurations against baseline approaches without state machines. Results show that integrating well-designed state machines significantly improves the quality of LLM outputs, and is particularly beneficial for complex tasks with well-established human best practices but lacking data used for training LLMs.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 35 of its 64 references that are in the map. First posted on arXiv 29 Aug 2025.
Builds on
35 of 64 references.
References · 35
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2024Qwen2.5 Technical Reportcited by 4,942
- 2024GPT-4o System Cardcited by 4,588
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,211
23 more
- 2023ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIscited by 1,947
- 2023Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflectioncited by 1,839
- 2023MetaGPT: Meta Programming for A Multi-Agent Collaborative Frameworkcited by 1,808
- 2023A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questionscited by 1,601
- 2016CLEVR: A Diagnostic Dataset for Compositional Language and Elementary Visual Reasoningcited by 1,457
- 2023MemGPT: Towards LLMs as Operating Systemscited by 1,389
- 2024Qwen2.5-Coder Technical Reportcited by 1,203
- 2023Encouraging Divergent Thinking in Large Language Models through Multi-Agent Debatecited by 1,011
- 2024A Survey on Large Language Models for Code Generationcited by 658
- 2023Instruction Tuning for Large Language Models: A Surveycited by 623
- 2023Active Retrieval Augmented Generationcited by 516
- 2024Understanding the planning of LLM agents: A surveycited by 421
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2022Demonstrate-Search-Predict: Composing retrieval and language models for knowledge-intensive NLPcited by 318
- 2017Inferring and Executing Programs for Visual Reasoningcited by 130
- 2024StateFlow: Enhancing LLM Task-Solving through State-Driven Workflowscited by 65
- 2025A Survey of Large Language Model Agents for Question Answeringcited by 48
- 2025A Survey on Large Language Models for Automated Planningcited by 17
- 2022Towards using Few-Shot Prompt Learning for Automating Model Completioncited by 13
- 2024On the use of Large Language Models in Model-Driven Engineeringcited by 13
- 2023On Codex Prompt Engineering for OCL Generation: An Empirical Studycited by 8
- 2024ChainBuddy: An AI Agent System for Generating LLM Pipelinescited by 6
- 2023LLM-SAP: Large Language Models Situational Awareness Based Planningcited by 4
Built on by
Citing papers per year: 2026: 2.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2025Method-Based Reasoning for Large Language Models: Extraction, Reuse, and Continuous Improvement
- 2025Recursive Language Models
- 2024A NotSo Simple Way to Beat Simple Bench
- 2025Advancing Reasoning in Large Language Models: Promising Methods and Approaches
- 2023Large Language Model Programs
- 2025Training an LLM-as-a-Judge Model: Pipeline, Insights, and Practical Lessons
- 2023Batch Prompting: Efficient Inference with Large Language Model APIs
- 2024RoT: Enhancing Large Language Models with Reflection on Search Trees