Composable Effect Handling for Programming LLM-integrated Scripts

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autore principale: Wang, Di
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866911081978396672
author Wang, Di
author_facet Wang, Di
contents Implementing LLM-integrated scripts introduces challenges in modularity and performance, as scripts are often coupled to specific LLM implementations and fail to exploit parallelization opportunities. This paper proposes using composable effect handling to separate workflow logic from effectful operations, such as LLM calls, I/O, and concurrency, enabling modularity without sacrificing the opportunity for performance optimization. By treating these operations as abstract interfaces and discharging them via effect handlers, this paper shows that scripts can achieve significant speedups (e.g., 10$\times$ in a Tree-of-Thoughts case study) without compromising modularity. This paper aims to promote composable effect handling as a programming style for LLM scripting.
format Preprint
id arxiv_https___arxiv_org_abs_2507_22048
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Composable Effect Handling for Programming LLM-integrated Scripts
Wang, Di
Programming Languages
Implementing LLM-integrated scripts introduces challenges in modularity and performance, as scripts are often coupled to specific LLM implementations and fail to exploit parallelization opportunities. This paper proposes using composable effect handling to separate workflow logic from effectful operations, such as LLM calls, I/O, and concurrency, enabling modularity without sacrificing the opportunity for performance optimization. By treating these operations as abstract interfaces and discharging them via effect handlers, this paper shows that scripts can achieve significant speedups (e.g., 10$\times$ in a Tree-of-Thoughts case study) without compromising modularity. This paper aims to promote composable effect handling as a programming style for LLM scripting.
title Composable Effect Handling for Programming LLM-integrated Scripts
topic Programming Languages
url https://arxiv.org/abs/2507.22048