An LLM Compiler for Parallel Function Calling

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Kim, Sehoon, Moon, Suhong, Tabrizi, Ryan, Lee, Nicholas, Mahoney, Michael W., Keutzer, Kurt, Gholami, Amir
Formato: Preprint
Publicado: 2023
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866914824220311552
author Kim, Sehoon
Moon, Suhong
Tabrizi, Ryan
Lee, Nicholas
Mahoney, Michael W.
Keutzer, Kurt
Gholami, Amir
author_facet Kim, Sehoon
Moon, Suhong
Tabrizi, Ryan
Lee, Nicholas
Mahoney, Michael W.
Keutzer, Kurt
Gholami, Amir
contents The reasoning capabilities of the recent LLMs enable them to execute external function calls to overcome their inherent limitations, such as knowledge cutoffs, poor arithmetic skills, or lack of access to private data. This development has allowed LLMs to select and coordinate multiple functions based on the context to tackle more complex problems. However, current methods for function calling often require sequential reasoning and acting for each function which can result in high latency, cost, and sometimes inaccurate behavior. To address this, we introduce LLMCompiler, which executes functions in parallel to efficiently orchestrate multiple function calls. Drawing inspiration from the principles of classical compilers, LLMCompiler enables parallel function calling with three components: (i) a Function Calling Planner, formulating execution plans for function calling; (ii) a Task Fetching Unit, dispatching function calling tasks; and (iii) an Executor, executing these tasks in parallel. LLMCompiler automatically generates an optimized orchestration for the function calls and can be used with both open-source and closed-source models. We have benchmarked LLMCompiler on a range of tasks with different patterns of function calling. We observe consistent latency speedup of up to 3.7x, cost savings of up to 6.7x, and accuracy improvement of up to ~9% compared to ReAct. Our code is available at https://github.com/SqueezeAILab/LLMCompiler.
format Preprint
id arxiv_https___arxiv_org_abs_2312_04511
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle An LLM Compiler for Parallel Function Calling
Kim, Sehoon
Moon, Suhong
Tabrizi, Ryan
Lee, Nicholas
Mahoney, Michael W.
Keutzer, Kurt
Gholami, Amir
Computation and Language
The reasoning capabilities of the recent LLMs enable them to execute external function calls to overcome their inherent limitations, such as knowledge cutoffs, poor arithmetic skills, or lack of access to private data. This development has allowed LLMs to select and coordinate multiple functions based on the context to tackle more complex problems. However, current methods for function calling often require sequential reasoning and acting for each function which can result in high latency, cost, and sometimes inaccurate behavior. To address this, we introduce LLMCompiler, which executes functions in parallel to efficiently orchestrate multiple function calls. Drawing inspiration from the principles of classical compilers, LLMCompiler enables parallel function calling with three components: (i) a Function Calling Planner, formulating execution plans for function calling; (ii) a Task Fetching Unit, dispatching function calling tasks; and (iii) an Executor, executing these tasks in parallel. LLMCompiler automatically generates an optimized orchestration for the function calls and can be used with both open-source and closed-source models. We have benchmarked LLMCompiler on a range of tasks with different patterns of function calling. We observe consistent latency speedup of up to 3.7x, cost savings of up to 6.7x, and accuracy improvement of up to ~9% compared to ReAct. Our code is available at https://github.com/SqueezeAILab/LLMCompiler.
title An LLM Compiler for Parallel Function Calling
topic Computation and Language
url https://arxiv.org/abs/2312.04511