Compositional Hardness of Code in Large Language Models -- A Probabilistic Perspective
Yotam Wolf, Binyamin Rothberg, Dorin Shteyman, Amnon Shashua

TL;DR
This paper investigates the limitations of large language models in solving complex, compositional tasks within a single context, highlighting the advantages of multi-agent systems for improved efficiency and success rates.
Contribution
It introduces a formal measure of in-context hardness of composition and demonstrates the exponential growth in complexity, advocating for multi-agent approaches over single-agent solutions.
Findings
Hardness of composition increases exponentially with task length.
Distributing tasks among multiple agents reduces the number of generations needed.
Theoretical proofs support empirical results on composition complexity.
Abstract
A common practice in large language model (LLM) usage for complex analytical tasks such as code generation, is to sample a solution for the entire task within the model's context window. Previous works have shown that subtask decomposition within the model's context (chain of thought), is beneficial for solving such tasks. In this work, we point a limitation of LLMs' ability to perform several sub-tasks within the same context window - an in-context hardness of composition, pointing to an advantage for distributing a decomposed problem in a multi-agent system of LLMs. The hardness of composition is quantified by a generation complexity metric, i.e., the number of LLM generations required to sample at least one correct solution. We find a gap between the generation complexity of solving a compositional problem within the same context relative to distributing it among multiple agents,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNatural Language Processing Techniques
