Designing Algorithms Empowered by Language Models: An Analytical Framework, Case Studies, and Insights

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Chen, Yanxi, Li, Yaliang, Ding, Bolin, Zhou, Jingren
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866909838214168576
author Chen, Yanxi
Li, Yaliang
Ding, Bolin
Zhou, Jingren
author_facet Chen, Yanxi
Li, Yaliang
Ding, Bolin
Zhou, Jingren
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2407_14788
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Designing Algorithms Empowered by Language Models: An Analytical Framework, Case Studies, and Insights
Chen, Yanxi
Li, Yaliang
Ding, Bolin
Zhou, Jingren
Machine Learning
Artificial Intelligence
Computation and Language
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.
title Designing Algorithms Empowered by Language Models: An Analytical Framework, Case Studies, and Insights
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2407.14788