In plain words: A formal framework predicts how accuracy and efficiency of algorithms built around language-model calls change with design choices like how tasks are split and what prompts are used. Instead of trial-and-error tuning, it yields general rules across many workflow shapes, confirmed on synthetic tests.
Abstract · Designing Algorithms Empowered by Language Models: An Analytical Framework, Case Studies, and Insights
This work presents an analytical framework for the design and analysis of LLM-based algorithms, i.e., algorithms that contain one or multiple calls of large language models (LLMs) as sub-routines and critically rely on the capabilities of LLMs. While such algorithms, ranging from basic LLM calls with prompt engineering to complicated LLM-powered agentic workflows and compound AI systems, have achieved remarkable empirical success, their design and optimization oftentimes require extensive trial-and-errors and case-by-case analysis. Our proposed framework serves as an attempt to mitigate such headaches, offering a formal and systematic approach for analyzing how the accuracy and efficiency of an LLM-based algorithm will be impacted by critical design choices, such as the pattern and granularity of task decomposition, or the prompt for each LLM call. Through a wide range of case studies covering diverse algorithm patterns (including parallel/hierarchical/recursive task decomposition and generic directed acyclic graphs), we demonstrate the proposed framework in action and derive interesting insights that generalize across scenarios, accompanied by systematic empirical validation in synthetic settings.
Yanxi Chen, Yaliang Li, Bolin Ding, Jingren Zhou
arXiv:2407.14788 · cs.LG, cs.AI, cs.CL · submitted Jul 20, 2024 · updated Oct 12, 2025
abstract · pdf · html · TMLR camera-ready version