先说结论
GPTSwarm把提示词、工具调用和信息传递都放进计算图:节点决定做什么,边决定谁能看到谁的输出。它提供节点与连边优化,但并非文中所有结果都用了优化;GAIA主表展示的是人工组装的群体及答案汇总,不能拿它直接证明自动拓扑搜索有效。 (原文:PDF p.3, Section 2;PDF p.4, Sections 2.3–2.4;PDF p.7, Section 3.4;PDF p.7, Table 1;PDF p.8, Table 2;PDF p.8, Analysis after Table 2)
指标:只把智能体描述成“程序员、审核员”容易隐藏实际计算过程。这里每个节点是一次模型或工具操作,每条边携带前驱输出,终点节点给出答案。单个智能体本身就是一张图,多个智能体可连接成更大的图。计算被限制为有向无环图,便于按依赖顺序执行,并非任意循环对话都原样支持。
条件:本地全文 arXiv:2402.16823v3,Section 2;条件及比较对象见陈述
PDF p.3, Section 2 · PDF p.3
GPTSwarm: Language Agents as Optimizable Graphs to their topological order. Each node n ∈ N receives as 2.3. Edge Optimization input x and the output zn from its predecessor nodes. In Given a task τ and its associated utility function uτ that this work, inputs and outputs are strings in natural language, maps the candidate graphs to real numbers, we formulate but may take on other data types more generally. Node n an optimization problem about the choice of additional applies the computational routine fn (zn , x) and sends the edges. The goal is to identify the edges that connect var- output to its successor nodes. The graph output, denoted ious language agents in a swarm, maximizing the utility. ŷ = G(x), is the output fo (zo , x) from the output node o. This process involves determining the most effective pat- Note that in a DAG, some nodes will not have predecessors. terns of communication and information exchange among For such nodes, the context z will be empty. This graph agents for the task at hand. We consider a set of poten- execution procedure is summarized in Algorithm 1. tial edges {ei }di=1 = E, which leads to 2d possible edge configurations, symbolized as E ∈ {0, 1}d . We further re- Algorithm 1 Graph Execution strict the search space to only consider composite graphs Require: Computational graph G = (N, E, F, o), input x, that are DAGs. Formally, optimization of the composite empty context z for each node without predecessors. graph of language agents is achieved by solving the prob- for n in TopologicalSort(N ) do lem maxE uτ (GE ). zn ← {fv (zv , x) : v ∈ pre(n)} end for 2.3.1. P ROBLEM R EFORMULATION Ensure: fo (zo , x) DAG optimization through pruning of nodes and edges was already present in the first work on “deep learning” with deep feedforward networks (Ivakhnenko et al., 1965; In the context of language agents, for example, the input Ivakhnenko, 1968). Due to the combinatorial complexity x may correspond to a question in natural language. Each induced by DAGs, recent studies have increasingly focused node processes the input x and context information z from on the continuous optimization approach (Vowels et al., its predecessor nodes by applying a computational routine f . 2022). This is particularly relevant in scenarios where most Examples of routines include LLM queries with input data node executions require one or more queries to LLMs for from other agents, instructions to generate prompts for web moderate-scale applications. Moreover, the utility function searches that gather task-related information, or tool usage. is typically non-differentiable due to the tokenization of Although our formalization specifies that the input x is given LLMs, and this remains true even when a differentiable to each node, in practice, many routines might be designed DAG sampling technique is employed. Therefore, we refor- to ignore the input and operate solely in the context provided mulate our edge optimization as a continuous optimization by the predecessor nodes. Finally, the output provided by the problem. Instead of optimizing in a discrete space, our output node corresponds to the answer to the input question approach is to optimize over a continuum of probabilistic or, more generally, to the solution of the input task. distributions, each representing a distribution over the fea- sible DAGs. Formally, rather than solving the maximum Swarm of language agents as a composite graph. Given utility function arg maxE uτ (GE ), we propose solving a set of K language agents, each represented by a com- arg max EG′ ∼Dθ [uτ (G′ )], (1) putational graph {Gk = (Nk , Ek , Fk , ok )}K k=1 , one can θ∈Θ compose these agents to achieve high performance in spe- where Dθ is a parameterized distribution and Θ represents cific tasks. Let N ′ = ∪k Nk represent the union of the a feasible set of real-valued parameters. nodes of the agents, E ′ = ∪k Ek be the union of the edges of the agents, F ′ = ∪k Fk be the union of the computa- 2.3.2. S OLUTION PARAMETERIZATION tional routines of the agents, and o′ ∈ ∪k {ok } be the output node for the composite graph. Consider a selection of edges A straightforward way to define a parameterized probabilis- E ⊂ ∪i̸=j Ni ×Nj that describe a set of connections between tic distribution over DAGs with fixed nodes N and required nodes from different agents. We define the composite graph edges E is to assign a real-valued parameter θi ∈ R to each representing the swarm of agents as GE = (N ′ , EE , F ′ , o′ ), potential edge ei . Let θ = [θ1 ; θ2 ; . . . ; θd ] ∈ [0, 1]d . The where EE = E ′ ∪ E is the union of the edges of the agents probability of G′ = GE for G′ ∼ Dθ is and the new edges connecting them. Composite graphs are ( d restricted to DAGs. The composite graph GE can be exe- Y θi if (N, E ∪ ({ej }i−1 j=1 ∩ E) ∪ {ei }) is a DAG, cuted as described in Algorithm 1. In a swarm of language 0 otherwise. i=1 agents, the newly specified edges represent communication channels between agents. In the following sections, we A sampling method that realizes this distribution is first to explore how to optimize such a computational graph. initialize a graph G′ ← (N, E). Then, iteratively sample 3
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:连边优化给候选连接分配概率,采样一张可执行图,依据任务表现调整概率;造成环的边不会加入。节点优化则记录该节点的输入输出与反馈,用它改善节点提示。优化一个节点时把其他提示暂时视为固定。这里改变的是调用组织与提示,而不是反向传播修改大模型权重;效用函数和搜索样本本身仍需设计。
条件:本地全文 arXiv:2402.16823v3,Sections 2.3–2.4;条件及比较对象见陈述
PDF p.4, Sections 2.3–2.4 · PDF p.4
GPTSwarm: Language Agents as Optimizable Graphs whether to include edge ei in G′ for all i’s. If including ei also require a natural language description of the intended causes a cycle in current G′ , then the edge would not be function for each routine fnpn ∈ F denoted by dn . For ex- included. Otherwise, add the edge to G′ with probability θi . ample, a suitable description for a node designed to write Python programs would be “a Python code generator”. Here, 2.3.3. O PTIMIZATION A LGORITHM existing prompt optimization methods, such as OPRO (Yang To optimize the objective function (Equation (1)), we apply et al., 2023), can be described as a function I that iteratively the REINFORCE algorithm (Williams, 1992) by applying a maps a prompt, a function description, and a set of node gradient ascent variant (e.g., Adam (Kingma & Ba, 2014)) input-output pairs (which may include annotations such as with an unbiased gradient estimation: a quality measure for each pair) to an improved prompt. For example, I could take a prompt such as “generate Python M 1 X code”, a description “a Python code generator”, and an ∇θ EGE ∼Dθ [uτ (GE )] ≈ ûτ (Gi )∇θ log(pθ (Gi )), (2) M i=1 input-output pair “Input: evaluate two divided by one as an integer. Output: 2 / 1”, where the output yields 1.0 as the where G1 , G2 , . . . , GN ∼ Dθ are mutually independent result of execution. A prompt optimization method would and ûτ (Gi ) is an independent unbiased estimate of uτ (Gi ) return an improved prompt “generate Python code and pay for all i and some M ∈ N. Algorithm 2 describes the attention to data types”. optimization algorithm with vanilla gradient ascent. Formally, our method begins by initializing an empty his- Algorithm 2 Edge Optimization with REINFORCE tory set, denoted hn , one for each node n ∈ N . The process then proceeds iteratively: first, the graph GP (x) is executed Require: A parameterized probabilistic distribution over using a randomly sampled input x following Algorithm computation graphs Dθ , an unbiased utility estimator 1. Subsequently, for each node, a tuple consisting of the ûτ (·), and a learning rate α. input to the node (zn , x), where zn is the context vector Initialize θ ∈ Rd . that includes the outputs of the predecessor nodes, and the while terminate condition not met do node’s own output fnpn (zn , x), is added to the node’s his- Sample Gi ∼ Dθ forP i = 1, 2, . . . , M . α M tory hn . The final step involves updating the node prompts. Update θ ← θ + M i=1 ûτ (Gi )∇θ log(pθ (Gi )). This is done by applying I to the node’s updated history, end while its current prompt, and its function description, resulting in an improved prompt I(hn , pn , dn ). This iterative pro- 2.4. Node Optimization cess, described in Algorithm 3, continuously improves the operations of the nodes in the entire graph. In our framework, each node implements a fundamental operation, such as querying an LLM, using a tool, calling Algorithm 3 Node Optimization an API, etc. In a language agent, most of these operations Require: A parameterized graph GP = (N, E, F P , o), involve prompting an LLM once or several times. Optimiz- natural language function descriptions D = {dn }n∈N , ing the prompts of these nodes is crucial for improving the and a distribution of inputs DX . system’s overall performance. Initialize pn for all n ∈ N . Unlike many other works on prompt optimization, which Initialize hn ← ∅ for all n ∈ N . optimize a single global prompt (e.g., Yang et al., 2023; while terminate condition not met do Pryzant et al., 2023; Deng et al., 2022), our node optimiza- Sample input x ∼ DX . tion problem naturally involves several operations where y ← GP (x) following Algorithm 1. each of them consists of a node-level prompt. In our case, hn ← hn ∪ {((zn , x), fnpn (zn , x))} for all n ∈ N . the optimization problem is more complex due to prompts pn ← I(hn , pn , dn ), for all n ∈ N . affecting how other prompts operate on connected nodes. end while At the same time, our graph representation leads to a sepa- ration of concerns where each node has a specific purpose 2.5. General Applicability with its own associated prompt. Due to this separation of Frameworks such as AutoGPT (Torantulino et al., 2023) concerns, we hypothesize that, for every optimization step, and LangChain (Chase, 2022) have set a standard for flexi- it is sufficient to update each node-level prompt individually, bility and reusability in various language-based tasks. Our assuming that all other prompts are fixed. framework, GPTSwarm, introduces a graph-based design of Consider a parameterized computational graph GP = agents and swarms. This design further simplifies the reuse (N, E, F P , o), where F P = {fnpn } are computational rou- of modular components (nodes & agents) and the integra- tines, each parameterized by a prompt pn to be optimized tion of such modules. For instance, GPTSwarm supports for all n ∈ N . To enable effective node optimization, we 41 types of file analysis, web search (e.g., Google Search), 4
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:实验包含编程、推理和需要工具的GAIA任务。GAIA部分把多个同类树式推理智能体的答案进行汇总,比较不同工具与不同数量组合。作者明确说该组实验没有进行节点或连边优化;因此它检验框架的组合能力,而不是单独验证图优化算法的贡献。
条件:本地全文 arXiv:2402.16823v3,Section 3.4;条件及比较对象见陈述
PDF p.7, Section 3.4 · PDF p.7
GPTSwarm: Language Agents as Optimizable Graphs Optimization Curve on HumanEval Dataset 0.88 0.86 0.84 Accuracy 0.82 0.80 0.78 0.76 1 2 3 4 5 6 7 8 Number of Iterations Figure 5. Optimization curve on HumanEval. Accuracy as a function of the number of iterations. We observe significant im- Figure 6. Solving a wide range of tasks requires many different provements during the first five iterations. The results, including tools. The GAIA benchmark (Mialon et al., 2023) tests for many the mean and standard errors, are based on three repeated experi- of these capabilities by including questions that require several of ments. these tools for successful completion. Table 1. Performance on the GAIA Benchmark (Mialon et al., ReAct-style (Yao et al., 2022) agent. The agent first gener- 2023). Using our framework, we demonstrate significant improve- ates a Python program in response to a given question. If ments across several levels of difficulty. The ‘GPT-4 with plugins’ the generated program passes all test cases included in the baseline is less significant since it involves the manual selection problem statement, then the program is returned. Otherwise, of the appropriate tools per question. We report the mean and the agent regenerates a program based on the execution standard deviation across 5 runs. feedback. We optimize the prompts by adding input-output Method Level 1 Level 2 Level 3 Avg. pairs selected by assessing their effectiveness as demonstra- GPT-3.5 7.55 4.65 0 4.85 tion examples, particularly in improving the node operation GPT-4 15.09 2.33 0 6.06 applied to the node’s ten most recent inputs. To evaluate a GPT-4-Turbo 20.75 5.81 0 9.70 node operation, we determine if the generated program suc- AutoGPT 13.21 0 3.85 4.85 GPTSwarm 30.56±3.25 20.93±1.27 3.85±2.43 18.45 cessfully solves the unit tests provided in the input problem Improvement 47.3%↑ 260.2%↑ 0.0% 90.2%↑ statement. For more details on the node optimizer, please GPT4 with Plugins* 30.30 9.70 0 14.6 refer to Appendix E.3.1. Figure 5 shows the optimization results of the first eight iterations. After each iteration, the optimized solution is et al., 2022). We also experimented with adding different evaluated on the entire dataset. The mean and standard er- types of agents to the swarm and using prompt-based best rors are presented for three repeated runs. We observe that answer selection. The results indicate that prompt-based the accuracy increases during the first five iterations. We self-consistency yields the best performance. Note that also test our method in an online learning setting, contin- these experiments are meant to demonstrate the generic ca- uously optimizing and evaluating without restarting. An pabilities of our modular framework and include neither improvement is observed from 0.76 (no optimization) to edge-based nor node-level optimization, which is left for 0.88(±0.007) (mean and standard error). future work. Analysis: Table 1 shows the results of our swarm with 3.4. GAIA seven TOT agents and the self-consistency strategy for Motivation: GAIA is a benchmark specifically designed the final decision. We compare the performance of the for testing the generality of AI assistants focusing on real- GPT-Series (Achiam et al., 2023) with plugins and Auto- world questions (Mialon et al., 2023). Abilities required to GPT (Torantulino et al., 2023) performance as reported by answer GAIA questions include reasoning, multi-modality Mialon et al. (2023). Our methods significantly outperform processing, web browsing, and other tool use. Although these baselines. conceptually straightforward for humans, these questions Table 2 presents a more comprehensive set of results. We ex- present significant challenges for current AI systems. periment with varying numbers of agents and different node Using this benchmark, we evaluate the general applicabil- operations, such as different tool uses. Our observations ity of our framework. We construct swarms with multiple indicate that the time requirement of a swarm grows ap- agents of the same type and employ self-consistency (a proximately linearly with the number of agents. Despite the prompt-based majority vote) for the final decision (Wang increased computational time, incorporating more agents 7
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:GAIA表中GPTSwarm平均分18.45,GPT-4-Turbo为9.70;但最高难度Level 3仅为3.85。该结果说明在这组基线与工具条件下群体有收益,远非通用任务已经解决。表内GPT-4加插件还涉及人工为问题选工具,比较条件并不完全同质。
条件:本地全文 arXiv:2402.16823v3,Table 1;条件及比较对象见陈述
PDF p.7, Table 1 · PDF p.7
GPTSwarm: Language Agents as Optimizable Graphs Optimization Curve on HumanEval Dataset 0.88 0.86 0.84 Accuracy 0.82 0.80 0.78 0.76 1 2 3 4 5 6 7 8 Number of Iterations Figure 5. Optimization curve on HumanEval. Accuracy as a function of the number of iterations. We observe significant im- Figure 6. Solving a wide range of tasks requires many different provements during the first five iterations. The results, including tools. The GAIA benchmark (Mialon et al., 2023) tests for many the mean and standard errors, are based on three repeated experi- of these capabilities by including questions that require several of ments. these tools for successful completion. Table 1. Performance on the GAIA Benchmark (Mialon et al., ReAct-style (Yao et al., 2022) agent. The agent first gener- 2023). Using our framework, we demonstrate significant improve- ates a Python program in response to a given question. If ments across several levels of difficulty. The ‘GPT-4 with plugins’ the generated program passes all test cases included in the baseline is less significant since it involves the manual selection problem statement, then the program is returned. Otherwise, of the appropriate tools per question. We report the mean and the agent regenerates a program based on the execution standard deviation across 5 runs. feedback. We optimize the prompts by adding input-output Method Level 1 Level 2 Level 3 Avg. pairs selected by assessing their effectiveness as demonstra- GPT-3.5 7.55 4.65 0 4.85 tion examples, particularly in improving the node operation GPT-4 15.09 2.33 0 6.06 applied to the node’s ten most recent inputs. To evaluate a GPT-4-Turbo 20.75 5.81 0 9.70 node operation, we determine if the generated program suc- AutoGPT 13.21 0 3.85 4.85 GPTSwarm 30.56±3.25 20.93±1.27 3.85±2.43 18.45 cessfully solves the unit tests provided in the input problem Improvement 47.3%↑ 260.2%↑ 0.0% 90.2%↑ statement. For more details on the node optimizer, please GPT4 with Plugins* 30.30 9.70 0 14.6 refer to Appendix E.3.1. Figure 5 shows the optimization results of the first eight iterations. After each iteration, the optimized solution is et al., 2022). We also experimented with adding different evaluated on the entire dataset. The mean and standard er- types of agents to the swarm and using prompt-based best rors are presented for three repeated runs. We observe that answer selection. The results indicate that prompt-based the accuracy increases during the first five iterations. We self-consistency yields the best performance. Note that also test our method in an online learning setting, contin- these experiments are meant to demonstrate the generic ca- uously optimizing and evaluating without restarting. An pabilities of our modular framework and include neither improvement is observed from 0.76 (no optimization) to edge-based nor node-level optimization, which is left for 0.88(±0.007) (mean and standard error). future work. Analysis: Table 1 shows the results of our swarm with 3.4. GAIA seven TOT agents and the self-consistency strategy for Motivation: GAIA is a benchmark specifically designed the final decision. We compare the performance of the for testing the generality of AI assistants focusing on real- GPT-Series (Achiam et al., 2023) with plugins and Auto- world questions (Mialon et al., 2023). Abilities required to GPT (Torantulino et al., 2023) performance as reported by answer GAIA questions include reasoning, multi-modality Mialon et al. (2023). Our methods significantly outperform processing, web browsing, and other tool use. Although these baselines. conceptually straightforward for humans, these questions Table 2 presents a more comprehensive set of results. We ex- present significant challenges for current AI systems. periment with varying numbers of agents and different node Using this benchmark, we evaluate the general applicabil- operations, such as different tool uses. Our observations ity of our framework. We construct swarms with multiple indicate that the time requirement of a swarm grows ap- agents of the same type and employ self-consistency (a proximately linearly with the number of agents. Despite the prompt-based majority vote) for the final decision (Wang increased computational time, incorporating more agents 7
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:在GAIA较简单的子集,单个TOT准确率25.66、耗时约71.31秒,七个TOT汇总后30.56、耗时约414.89秒。增加群体大小不是免费提升:调用与运行时间同时增加。三个IO智能体用“选最好”策略时准确率15.85,反而低于单个IO的16.60,说明复制智能体本身不保证改善。
条件:本地全文 arXiv:2402.16823v3,Table 2;条件及比较对象见陈述
PDF p.8, Table 2 · PDF p.8
GPTSwarm: Language Agents as Optimizable Graphs Table 2. Ablations on the GAIA benchmark (Level 1 validation set) (Mialon et al., 2023). DA = DirectAnswer, GQ = GenerateQuery, WS = WebSearch, FA = FileAnalyzer, CA = CombinedAnswer. ‘!’ indicates the presence of a specific feature in the corresponding framework, ‘%’ its absence. Each type of experiment is run five times to record the mean, standard deviation, and best run (marked as Best). Self-Consistency describes prompt-based self-consistency (Wang et al., 2022); Choose “Best” refers to the LLM’s favorite answer among the different agents’ answers. All agents and swarms are implemented using our GPTSwarm framework. Agent or Swarm DA GQ WS FA CA Decision Strategy Accuracy Best Duration (s) (A) Agent: IO ! % % % % N/A 16.60±3.02 20.75% ∼13.37 (B) Agent: COTweb % ! ! % ! N/A 18.87±2.67 22.64% ∼60.90 (C) Agent: COTFA % ! % ! ! N/A 25.28±3.50 30.18% ∼56.42 (D) Agent: TOT % ! ! ! ! N/A 25.66±3.50 30.18% ∼71.31 (E) Swarm(3×IO) ! % % % % Choose “Best” 15.85±0.92 18.87% ∼45.65 (F) Swarm(3×COT) % ! ! % ! Choose “Best” 27.17±3.29 32.08% ∼152.89 (G) Swarm(3×TOT) % ! ! ! ! Choose “Best” 30.18±4.30 35.85% ∼198.50 (H) Swarm(3×IO) ! % % % % Self-Consistency 18.11±3.07 22.64% ∼45.70 (I) Swarm(3×COT) % ! ! % ! Self-Consistency 27.17±4.06 32.08% ∼150.26 (J) Swarm(3×TOT) % ! ! ! ! Self-Consistency 28.30±3.38 32.08% ∼181.15 (K) Swarm(5×TOT) % ! ! ! ! Self-Consistency 29.06±2.56 32.08% ∼291.07 (L) Swarm(7×TOT) % ! ! ! ! Self-Consistency 30.56±3.25 35.85% ∼414.89 (M) Human - - - - - - 94% - ∼422.26 notably improves the overall performance of the system. We Agents (Park et al., 2023), ChatDev (Qian et al., 2023), and also found that a greater variety of node operations leads to AutoGen (Wu et al., 2023) focus on role-based communi- better performance. As illustrated in Figure 6, web browsing cation, but struggle with hallucinations. MetaGPT (Hong is required for 43.9% of the tasks. Our current implemen- et al., 2023) introduces standard operating procedures for tation accesses the Internet by only downloading materials better role definition and communication, making the collab- directly from the URLs provided in the problem statement or oration between agents more effective. In contrast to these querying a Google search3 without further website naviga- frameworks, we automatically optimize nodes and edges in tion. Therefore, we believe that enhancing web capabilities a self-organizing society of agents. would further increase performance significantly. 4.2. Language Agents with Graphs 4. Related Work Besta et al. (2023) introduced LLM-based problem-solving 4.1. LLM-based Autonomous Agents with graphs; however, the approach only encompasses LLM prompting schemes without modeling other fundamental Current works on LLM-based autonomous agents or lan- capabilities of language agents, such as use of external tools. guage agents vary in focus. Methods such as Chain of LangGraph (langchain ai, 2024), on the other hand, is a Thought (Wei et al., 2022), ReAct (Yao et al., 2022), Re- concurrent open-source framework that focuses on building flexion (Shinn et al., 2023), Tree of Thought (ToT) im- multi-actor state LLM applications through possibly cycli- prove prompt strategies and structure to improve reason- cal operations. However, its practical applicability has not ing capabilities, while others such as exchange-of-thoughts yet been systematically studied. Unlike previous studies, (EOT) (Yin et al., 2023) focus on the benefits of various our approach emphasizes the development of hierarchical communication paradigms. Single LLM agent frameworks intelligence, as discussed by Minsky (1988) and Kennedy such as AutoGPT (Gravitas, 2023), LangChain (Chase, (2006), through the construction of agent graphs and the 2022), LlamaIndex (Liu, 2022), and XAgent (XAgent Team, composition of multiple graphs into swarms. Crucially, the 2023) showcase problem solving through various external graph representation facilitates automatic optimization on functions and tools. In the space of LLM-based multia- two levels. First, at the node level, since the majority of gent systems (Xie et al., 2023; Chen et al., 2023a;b), NL- nodes in the graph involve prompting an LLM, prompt op- SOMs (Zhuge et al., 2023) employ various social struc- timization methods can be employed. Second, at the edge tures for task-specific applications (inspired by SOMs (Min- level, we demonstrate the application of the REINFORCE sky, 1988)), without exploring optimization over the social algorithm (Williams, 1992) to optimize the potential con- structure of agents. CAMEL (Li et al., 2023), Generalist nections between nodes. 3 We use SearchApi (https://www.searchapi.io/) in the experi- ments 8
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:工具能力仍是瓶颈:该实现能够直接下载给定网址及做搜索,但没有完整网页导航能力。节点可组合、图可搜索,均不代表所有任务都能访问所需信息。复现应区分固定群体、节点优化和边优化三条实验路径;否则会把模型、工具与计算预算的收益都归因给拓扑学习。
条件:本地全文 arXiv:2402.16823v3,Analysis after Table 2;条件及比较对象见陈述
PDF p.8, Analysis after Table 2 · PDF p.8
GPTSwarm: Language Agents as Optimizable Graphs Table 2. Ablations on the GAIA benchmark (Level 1 validation set) (Mialon et al., 2023). DA = DirectAnswer, GQ = GenerateQuery, WS = WebSearch, FA = FileAnalyzer, CA = CombinedAnswer. ‘!’ indicates the presence of a specific feature in the corresponding framework, ‘%’ its absence. Each type of experiment is run five times to record the mean, standard deviation, and best run (marked as Best). Self-Consistency describes prompt-based self-consistency (Wang et al., 2022); Choose “Best” refers to the LLM’s favorite answer among the different agents’ answers. All agents and swarms are implemented using our GPTSwarm framework. Agent or Swarm DA GQ WS FA CA Decision Strategy Accuracy Best Duration (s) (A) Agent: IO ! % % % % N/A 16.60±3.02 20.75% ∼13.37 (B) Agent: COTweb % ! ! % ! N/A 18.87±2.67 22.64% ∼60.90 (C) Agent: COTFA % ! % ! ! N/A 25.28±3.50 30.18% ∼56.42 (D) Agent: TOT % ! ! ! ! N/A 25.66±3.50 30.18% ∼71.31 (E) Swarm(3×IO) ! % % % % Choose “Best” 15.85±0.92 18.87% ∼45.65 (F) Swarm(3×COT) % ! ! % ! Choose “Best” 27.17±3.29 32.08% ∼152.89 (G) Swarm(3×TOT) % ! ! ! ! Choose “Best” 30.18±4.30 35.85% ∼198.50 (H) Swarm(3×IO) ! % % % % Self-Consistency 18.11±3.07 22.64% ∼45.70 (I) Swarm(3×COT) % ! ! % ! Self-Consistency 27.17±4.06 32.08% ∼150.26 (J) Swarm(3×TOT) % ! ! ! ! Self-Consistency 28.30±3.38 32.08% ∼181.15 (K) Swarm(5×TOT) % ! ! ! ! Self-Consistency 29.06±2.56 32.08% ∼291.07 (L) Swarm(7×TOT) % ! ! ! ! Self-Consistency 30.56±3.25 35.85% ∼414.89 (M) Human - - - - - - 94% - ∼422.26 notably improves the overall performance of the system. We Agents (Park et al., 2023), ChatDev (Qian et al., 2023), and also found that a greater variety of node operations leads to AutoGen (Wu et al., 2023) focus on role-based communi- better performance. As illustrated in Figure 6, web browsing cation, but struggle with hallucinations. MetaGPT (Hong is required for 43.9% of the tasks. Our current implemen- et al., 2023) introduces standard operating procedures for tation accesses the Internet by only downloading materials better role definition and communication, making the collab- directly from the URLs provided in the problem statement or oration between agents more effective. In contrast to these querying a Google search3 without further website naviga- frameworks, we automatically optimize nodes and edges in tion. Therefore, we believe that enhancing web capabilities a self-organizing society of agents. would further increase performance significantly. 4.2. Language Agents with Graphs 4. Related Work Besta et al. (2023) introduced LLM-based problem-solving 4.1. LLM-based Autonomous Agents with graphs; however, the approach only encompasses LLM prompting schemes without modeling other fundamental Current works on LLM-based autonomous agents or lan- capabilities of language agents, such as use of external tools. guage agents vary in focus. Methods such as Chain of LangGraph (langchain ai, 2024), on the other hand, is a Thought (Wei et al., 2022), ReAct (Yao et al., 2022), Re- concurrent open-source framework that focuses on building flexion (Shinn et al., 2023), Tree of Thought (ToT) im- multi-actor state LLM applications through possibly cycli- prove prompt strategies and structure to improve reason- cal operations. However, its practical applicability has not ing capabilities, while others such as exchange-of-thoughts yet been systematically studied. Unlike previous studies, (EOT) (Yin et al., 2023) focus on the benefits of various our approach emphasizes the development of hierarchical communication paradigms. Single LLM agent frameworks intelligence, as discussed by Minsky (1988) and Kennedy such as AutoGPT (Gravitas, 2023), LangChain (Chase, (2006), through the construction of agent graphs and the 2022), LlamaIndex (Liu, 2022), and XAgent (XAgent Team, composition of multiple graphs into swarms. Crucially, the 2023) showcase problem solving through various external graph representation facilitates automatic optimization on functions and tools. In the space of LLM-based multia- two levels. First, at the node level, since the majority of gent systems (Xie et al., 2023; Chen et al., 2023a;b), NL- nodes in the graph involve prompting an LLM, prompt op- SOMs (Zhuge et al., 2023) employ various social struc- timization methods can be employed. Second, at the edge tures for task-specific applications (inspired by SOMs (Min- level, we demonstrate the application of the REINFORCE sky, 1988)), without exploring optimization over the social algorithm (Williams, 1992) to optimize the potential con- structure of agents. CAMEL (Li et al., 2023), Generalist nections between nodes. 3 We use SearchApi (https://www.searchapi.io/) in the experi- ments 8
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
论文为什么要做这件事
只把智能体描述成“程序员、审核员”容易隐藏实际计算过程。这里每个节点是一次模型或工具操作,每条边携带前驱输出,终点节点给出答案。单个智能体本身就是一张图,多个智能体可连接成更大的图。计算被限制为有向无环图,便于按依赖顺序执行,并非任意循环对话都原样支持。 (原文:PDF p.3, Section 2)
指标:只把智能体描述成“程序员、审核员”容易隐藏实际计算过程。这里每个节点是一次模型或工具操作,每条边携带前驱输出,终点节点给出答案。单个智能体本身就是一张图,多个智能体可连接成更大的图。计算被限制为有向无环图,便于按依赖顺序执行,并非任意循环对话都原样支持。
条件:本地全文 arXiv:2402.16823v3,Section 2;条件及比较对象见陈述
PDF p.3, Section 2 · PDF p.3
GPTSwarm: Language Agents as Optimizable Graphs to their topological order. Each node n ∈ N receives as 2.3. Edge Optimization input x and the output zn from its predecessor nodes. In Given a task τ and its associated utility function uτ that this work, inputs and outputs are strings in natural language, maps the candidate graphs to real numbers, we formulate but may take on other data types more generally. Node n an optimization problem about the choice of additional applies the computational routine fn (zn , x) and sends the edges. The goal is to identify the edges that connect var- output to its successor nodes. The graph output, denoted ious language agents in a swarm, maximizing the utility. ŷ = G(x), is the output fo (zo , x) from the output node o. This process involves determining the most effective pat- Note that in a DAG, some nodes will not have predecessors. terns of communication and information exchange among For such nodes, the context z will be empty. This graph agents for the task at hand. We consider a set of poten- execution procedure is summarized in Algorithm 1. tial edges {ei }di=1 = E, which leads to 2d possible edge configurations, symbolized as E ∈ {0, 1}d . We further re- Algorithm 1 Graph Execution strict the search space to only consider composite graphs Require: Computational graph G = (N, E, F, o), input x, that are DAGs. Formally, optimization of the composite empty context z for each node without predecessors. graph of language agents is achieved by solving the prob- for n in TopologicalSort(N ) do lem maxE uτ (GE ). zn ← {fv (zv , x) : v ∈ pre(n)} end for 2.3.1. P ROBLEM R EFORMULATION Ensure: fo (zo , x) DAG optimization through pruning of nodes and edges was already present in the first work on “deep learning” with deep feedforward networks (Ivakhnenko et al., 1965; In the context of language agents, for example, the input Ivakhnenko, 1968). Due to the combinatorial complexity x may correspond to a question in natural language. Each induced by DAGs, recent studies have increasingly focused node processes the input x and context information z from on the continuous optimization approach (Vowels et al., its predecessor nodes by applying a computational routine f . 2022). This is particularly relevant in scenarios where most Examples of routines include LLM queries with input data node executions require one or more queries to LLMs for from other agents, instructions to generate prompts for web moderate-scale applications. Moreover, the utility function searches that gather task-related information, or tool usage. is typically non-differentiable due to the tokenization of Although our formalization specifies that the input x is given LLMs, and this remains true even when a differentiable to each node, in practice, many routines might be designed DAG sampling technique is employed. Therefore, we refor- to ignore the input and operate solely in the context provided mulate our edge optimization as a continuous optimization by the predecessor nodes. Finally, the output provided by the problem. Instead of optimizing in a discrete space, our output node corresponds to the answer to the input question approach is to optimize over a continuum of probabilistic or, more generally, to the solution of the input task. distributions, each representing a distribution over the fea- sible DAGs. Formally, rather than solving the maximum Swarm of language agents as a composite graph. Given utility function arg maxE uτ (GE ), we propose solving a set of K language agents, each represented by a com- arg max EG′ ∼Dθ [uτ (G′ )], (1) putational graph {Gk = (Nk , Ek , Fk , ok )}K k=1 , one can θ∈Θ compose these agents to achieve high performance in spe- where Dθ is a parameterized distribution and Θ represents cific tasks. Let N ′ = ∪k Nk represent the union of the a feasible set of real-valued parameters. nodes of the agents, E ′ = ∪k Ek be the union of the edges of the agents, F ′ = ∪k Fk be the union of the computa- 2.3.2. S OLUTION PARAMETERIZATION tional routines of the agents, and o′ ∈ ∪k {ok } be the output node for the composite graph. Consider a selection of edges A straightforward way to define a parameterized probabilis- E ⊂ ∪i̸=j Ni ×Nj that describe a set of connections between tic distribution over DAGs with fixed nodes N and required nodes from different agents. We define the composite graph edges E is to assign a real-valued parameter θi ∈ R to each representing the swarm of agents as GE = (N ′ , EE , F ′ , o′ ), potential edge ei . Let θ = [θ1 ; θ2 ; . . . ; θd ] ∈ [0, 1]d . The where EE = E ′ ∪ E is the union of the edges of the agents probability of G′ = GE for G′ ∼ Dθ is and the new edges connecting them. Composite graphs are ( d restricted to DAGs. The composite graph GE can be exe- Y θi if (N, E ∪ ({ej }i−1 j=1 ∩ E) ∪ {ei }) is a DAG, cuted as described in Algorithm 1. In a swarm of language 0 otherwise. i=1 agents, the newly specified edges represent communication channels between agents. In the following sections, we A sampling method that realizes this distribution is first to explore how to optimize such a computational graph. initialize a graph G′ ← (N, E). Then, iteratively sample 3
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
核心方法到底怎么运转
连边优化给候选连接分配概率,采样一张可执行图,依据任务表现调整概率;造成环的边不会加入。节点优化则记录该节点的输入输出与反馈,用它改善节点提示。优化一个节点时把其他提示暂时视为固定。这里改变的是调用组织与提示,而不是反向传播修改大模型权重;效用函数和搜索样本本身仍需设计。 (原文:PDF p.4, Sections 2.3–2.4)
指标:连边优化给候选连接分配概率,采样一张可执行图,依据任务表现调整概率;造成环的边不会加入。节点优化则记录该节点的输入输出与反馈,用它改善节点提示。优化一个节点时把其他提示暂时视为固定。这里改变的是调用组织与提示,而不是反向传播修改大模型权重;效用函数和搜索样本本身仍需设计。
条件:本地全文 arXiv:2402.16823v3,Sections 2.3–2.4;条件及比较对象见陈述
PDF p.4, Sections 2.3–2.4 · PDF p.4
GPTSwarm: Language Agents as Optimizable Graphs whether to include edge ei in G′ for all i’s. If including ei also require a natural language description of the intended causes a cycle in current G′ , then the edge would not be function for each routine fnpn ∈ F denoted by dn . For ex- included. Otherwise, add the edge to G′ with probability θi . ample, a suitable description for a node designed to write Python programs would be “a Python code generator”. Here, 2.3.3. O PTIMIZATION A LGORITHM existing prompt optimization methods, such as OPRO (Yang To optimize the objective function (Equation (1)), we apply et al., 2023), can be described as a function I that iteratively the REINFORCE algorithm (Williams, 1992) by applying a maps a prompt, a function description, and a set of node gradient ascent variant (e.g., Adam (Kingma & Ba, 2014)) input-output pairs (which may include annotations such as with an unbiased gradient estimation: a quality measure for each pair) to an improved prompt. For example, I could take a prompt such as “generate Python M 1 X code”, a description “a Python code generator”, and an ∇θ EGE ∼Dθ [uτ (GE )] ≈ ûτ (Gi )∇θ log(pθ (Gi )), (2) M i=1 input-output pair “Input: evaluate two divided by one as an integer. Output: 2 / 1”, where the output yields 1.0 as the where G1 , G2 , . . . , GN ∼ Dθ are mutually independent result of execution. A prompt optimization method would and ûτ (Gi ) is an independent unbiased estimate of uτ (Gi ) return an improved prompt “generate Python code and pay for all i and some M ∈ N. Algorithm 2 describes the attention to data types”. optimization algorithm with vanilla gradient ascent. Formally, our method begins by initializing an empty his- Algorithm 2 Edge Optimization with REINFORCE tory set, denoted hn , one for each node n ∈ N . The process then proceeds iteratively: first, the graph GP (x) is executed Require: A parameterized probabilistic distribution over using a randomly sampled input x following Algorithm computation graphs Dθ , an unbiased utility estimator 1. Subsequently, for each node, a tuple consisting of the ûτ (·), and a learning rate α. input to the node (zn , x), where zn is the context vector Initialize θ ∈ Rd . that includes the outputs of the predecessor nodes, and the while terminate condition not met do node’s own output fnpn (zn , x), is added to the node’s his- Sample Gi ∼ Dθ forP i = 1, 2, . . . , M . α M tory hn . The final step involves updating the node prompts. Update θ ← θ + M i=1 ûτ (Gi )∇θ log(pθ (Gi )). This is done by applying I to the node’s updated history, end while its current prompt, and its function description, resulting in an improved prompt I(hn , pn , dn ). This iterative pro- 2.4. Node Optimization cess, described in Algorithm 3, continuously improves the operations of the nodes in the entire graph. In our framework, each node implements a fundamental operation, such as querying an LLM, using a tool, calling Algorithm 3 Node Optimization an API, etc. In a language agent, most of these operations Require: A parameterized graph GP = (N, E, F P , o), involve prompting an LLM once or several times. Optimiz- natural language function descriptions D = {dn }n∈N , ing the prompts of these nodes is crucial for improving the and a distribution of inputs DX . system’s overall performance. Initialize pn for all n ∈ N . Unlike many other works on prompt optimization, which Initialize hn ← ∅ for all n ∈ N . optimize a single global prompt (e.g., Yang et al., 2023; while terminate condition not met do Pryzant et al., 2023; Deng et al., 2022), our node optimiza- Sample input x ∼ DX . tion problem naturally involves several operations where y ← GP (x) following Algorithm 1. each of them consists of a node-level prompt. In our case, hn ← hn ∪ {((zn , x), fnpn (zn , x))} for all n ∈ N . the optimization problem is more complex due to prompts pn ← I(hn , pn , dn ), for all n ∈ N . affecting how other prompts operate on connected nodes. end while At the same time, our graph representation leads to a sepa- ration of concerns where each node has a specific purpose 2.5. General Applicability with its own associated prompt. Due to this separation of Frameworks such as AutoGPT (Torantulino et al., 2023) concerns, we hypothesize that, for every optimization step, and LangChain (Chase, 2022) have set a standard for flexi- it is sufficient to update each node-level prompt individually, bility and reusability in various language-based tasks. Our assuming that all other prompts are fixed. framework, GPTSwarm, introduces a graph-based design of Consider a parameterized computational graph GP = agents and swarms. This design further simplifies the reuse (N, E, F P , o), where F P = {fnpn } are computational rou- of modular components (nodes & agents) and the integra- tines, each parameterized by a prompt pn to be optimized tion of such modules. For instance, GPTSwarm supports for all n ∈ N . To enable effective node optimization, we 41 types of file analysis, web search (e.g., Google Search), 4
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
解释性例子:回答资料题时,把“搜网页→读文件→汇总答案”表示成节点,尝试让读文件结果再传给另一位解题者。测试新增连接是否值得,而不是仅给几个聊天机器人换职业名称。
解释性推断,不能当作论文直接支持的主张。
实验怎样检验这个方法
实验包含编程、推理和需要工具的GAIA任务。GAIA部分把多个同类树式推理智能体的答案进行汇总,比较不同工具与不同数量组合。作者明确说该组实验没有进行节点或连边优化;因此它检验框架的组合能力,而不是单独验证图优化算法的贡献。 (原文:PDF p.7, Section 3.4)
指标:实验包含编程、推理和需要工具的GAIA任务。GAIA部分把多个同类树式推理智能体的答案进行汇总,比较不同工具与不同数量组合。作者明确说该组实验没有进行节点或连边优化;因此它检验框架的组合能力,而不是单独验证图优化算法的贡献。
条件:本地全文 arXiv:2402.16823v3,Section 3.4;条件及比较对象见陈述
PDF p.7, Section 3.4 · PDF p.7
GPTSwarm: Language Agents as Optimizable Graphs Optimization Curve on HumanEval Dataset 0.88 0.86 0.84 Accuracy 0.82 0.80 0.78 0.76 1 2 3 4 5 6 7 8 Number of Iterations Figure 5. Optimization curve on HumanEval. Accuracy as a function of the number of iterations. We observe significant im- Figure 6. Solving a wide range of tasks requires many different provements during the first five iterations. The results, including tools. The GAIA benchmark (Mialon et al., 2023) tests for many the mean and standard errors, are based on three repeated experi- of these capabilities by including questions that require several of ments. these tools for successful completion. Table 1. Performance on the GAIA Benchmark (Mialon et al., ReAct-style (Yao et al., 2022) agent. The agent first gener- 2023). Using our framework, we demonstrate significant improve- ates a Python program in response to a given question. If ments across several levels of difficulty. The ‘GPT-4 with plugins’ the generated program passes all test cases included in the baseline is less significant since it involves the manual selection problem statement, then the program is returned. Otherwise, of the appropriate tools per question. We report the mean and the agent regenerates a program based on the execution standard deviation across 5 runs. feedback. We optimize the prompts by adding input-output Method Level 1 Level 2 Level 3 Avg. pairs selected by assessing their effectiveness as demonstra- GPT-3.5 7.55 4.65 0 4.85 tion examples, particularly in improving the node operation GPT-4 15.09 2.33 0 6.06 applied to the node’s ten most recent inputs. To evaluate a GPT-4-Turbo 20.75 5.81 0 9.70 node operation, we determine if the generated program suc- AutoGPT 13.21 0 3.85 4.85 GPTSwarm 30.56±3.25 20.93±1.27 3.85±2.43 18.45 cessfully solves the unit tests provided in the input problem Improvement 47.3%↑ 260.2%↑ 0.0% 90.2%↑ statement. For more details on the node optimizer, please GPT4 with Plugins* 30.30 9.70 0 14.6 refer to Appendix E.3.1. Figure 5 shows the optimization results of the first eight iterations. After each iteration, the optimized solution is et al., 2022). We also experimented with adding different evaluated on the entire dataset. The mean and standard er- types of agents to the swarm and using prompt-based best rors are presented for three repeated runs. We observe that answer selection. The results indicate that prompt-based the accuracy increases during the first five iterations. We self-consistency yields the best performance. Note that also test our method in an online learning setting, contin- these experiments are meant to demonstrate the generic ca- uously optimizing and evaluating without restarting. An pabilities of our modular framework and include neither improvement is observed from 0.76 (no optimization) to edge-based nor node-level optimization, which is left for 0.88(±0.007) (mean and standard error). future work. Analysis: Table 1 shows the results of our swarm with 3.4. GAIA seven TOT agents and the self-consistency strategy for Motivation: GAIA is a benchmark specifically designed the final decision. We compare the performance of the for testing the generality of AI assistants focusing on real- GPT-Series (Achiam et al., 2023) with plugins and Auto- world questions (Mialon et al., 2023). Abilities required to GPT (Torantulino et al., 2023) performance as reported by answer GAIA questions include reasoning, multi-modality Mialon et al. (2023). Our methods significantly outperform processing, web browsing, and other tool use. Although these baselines. conceptually straightforward for humans, these questions Table 2 presents a more comprehensive set of results. We ex- present significant challenges for current AI systems. periment with varying numbers of agents and different node Using this benchmark, we evaluate the general applicabil- operations, such as different tool uses. Our observations ity of our framework. We construct swarms with multiple indicate that the time requirement of a swarm grows ap- agents of the same type and employ self-consistency (a proximately linearly with the number of agents. Despite the prompt-based majority vote) for the final decision (Wang increased computational time, incorporating more agents 7
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
结果说明了什么
GAIA表中GPTSwarm平均分18.45,GPT-4-Turbo为9.70;但最高难度Level 3仅为3.85。该结果说明在这组基线与工具条件下群体有收益,远非通用任务已经解决。表内GPT-4加插件还涉及人工为问题选工具,比较条件并不完全同质。 (原文:PDF p.7, Table 1)
指标:GAIA表中GPTSwarm平均分18.45,GPT-4-Turbo为9.70;但最高难度Level 3仅为3.85。该结果说明在这组基线与工具条件下群体有收益,远非通用任务已经解决。表内GPT-4加插件还涉及人工为问题选工具,比较条件并不完全同质。
条件:本地全文 arXiv:2402.16823v3,Table 1;条件及比较对象见陈述
PDF p.7, Table 1 · PDF p.7
GPTSwarm: Language Agents as Optimizable Graphs Optimization Curve on HumanEval Dataset 0.88 0.86 0.84 Accuracy 0.82 0.80 0.78 0.76 1 2 3 4 5 6 7 8 Number of Iterations Figure 5. Optimization curve on HumanEval. Accuracy as a function of the number of iterations. We observe significant im- Figure 6. Solving a wide range of tasks requires many different provements during the first five iterations. The results, including tools. The GAIA benchmark (Mialon et al., 2023) tests for many the mean and standard errors, are based on three repeated experi- of these capabilities by including questions that require several of ments. these tools for successful completion. Table 1. Performance on the GAIA Benchmark (Mialon et al., ReAct-style (Yao et al., 2022) agent. The agent first gener- 2023). Using our framework, we demonstrate significant improve- ates a Python program in response to a given question. If ments across several levels of difficulty. The ‘GPT-4 with plugins’ the generated program passes all test cases included in the baseline is less significant since it involves the manual selection problem statement, then the program is returned. Otherwise, of the appropriate tools per question. We report the mean and the agent regenerates a program based on the execution standard deviation across 5 runs. feedback. We optimize the prompts by adding input-output Method Level 1 Level 2 Level 3 Avg. pairs selected by assessing their effectiveness as demonstra- GPT-3.5 7.55 4.65 0 4.85 tion examples, particularly in improving the node operation GPT-4 15.09 2.33 0 6.06 applied to the node’s ten most recent inputs. To evaluate a GPT-4-Turbo 20.75 5.81 0 9.70 node operation, we determine if the generated program suc- AutoGPT 13.21 0 3.85 4.85 GPTSwarm 30.56±3.25 20.93±1.27 3.85±2.43 18.45 cessfully solves the unit tests provided in the input problem Improvement 47.3%↑ 260.2%↑ 0.0% 90.2%↑ statement. For more details on the node optimizer, please GPT4 with Plugins* 30.30 9.70 0 14.6 refer to Appendix E.3.1. Figure 5 shows the optimization results of the first eight iterations. After each iteration, the optimized solution is et al., 2022). We also experimented with adding different evaluated on the entire dataset. The mean and standard er- types of agents to the swarm and using prompt-based best rors are presented for three repeated runs. We observe that answer selection. The results indicate that prompt-based the accuracy increases during the first five iterations. We self-consistency yields the best performance. Note that also test our method in an online learning setting, contin- these experiments are meant to demonstrate the generic ca- uously optimizing and evaluating without restarting. An pabilities of our modular framework and include neither improvement is observed from 0.76 (no optimization) to edge-based nor node-level optimization, which is left for 0.88(±0.007) (mean and standard error). future work. Analysis: Table 1 shows the results of our swarm with 3.4. GAIA seven TOT agents and the self-consistency strategy for Motivation: GAIA is a benchmark specifically designed the final decision. We compare the performance of the for testing the generality of AI assistants focusing on real- GPT-Series (Achiam et al., 2023) with plugins and Auto- world questions (Mialon et al., 2023). Abilities required to GPT (Torantulino et al., 2023) performance as reported by answer GAIA questions include reasoning, multi-modality Mialon et al. (2023). Our methods significantly outperform processing, web browsing, and other tool use. Although these baselines. conceptually straightforward for humans, these questions Table 2 presents a more comprehensive set of results. We ex- present significant challenges for current AI systems. periment with varying numbers of agents and different node Using this benchmark, we evaluate the general applicabil- operations, such as different tool uses. Our observations ity of our framework. We construct swarms with multiple indicate that the time requirement of a swarm grows ap- agents of the same type and employ self-consistency (a proximately linearly with the number of agents. Despite the prompt-based majority vote) for the final decision (Wang increased computational time, incorporating more agents 7
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
在GAIA较简单的子集,单个TOT准确率25.66、耗时约71.31秒,七个TOT汇总后30.56、耗时约414.89秒。增加群体大小不是免费提升:调用与运行时间同时增加。三个IO智能体用“选最好”策略时准确率15.85,反而低于单个IO的16.60,说明复制智能体本身不保证改善。 (原文:PDF p.8, Table 2)
指标:在GAIA较简单的子集,单个TOT准确率25.66、耗时约71.31秒,七个TOT汇总后30.56、耗时约414.89秒。增加群体大小不是免费提升:调用与运行时间同时增加。三个IO智能体用“选最好”策略时准确率15.85,反而低于单个IO的16.60,说明复制智能体本身不保证改善。
条件:本地全文 arXiv:2402.16823v3,Table 2;条件及比较对象见陈述
PDF p.8, Table 2 · PDF p.8
GPTSwarm: Language Agents as Optimizable Graphs Table 2. Ablations on the GAIA benchmark (Level 1 validation set) (Mialon et al., 2023). DA = DirectAnswer, GQ = GenerateQuery, WS = WebSearch, FA = FileAnalyzer, CA = CombinedAnswer. ‘!’ indicates the presence of a specific feature in the corresponding framework, ‘%’ its absence. Each type of experiment is run five times to record the mean, standard deviation, and best run (marked as Best). Self-Consistency describes prompt-based self-consistency (Wang et al., 2022); Choose “Best” refers to the LLM’s favorite answer among the different agents’ answers. All agents and swarms are implemented using our GPTSwarm framework. Agent or Swarm DA GQ WS FA CA Decision Strategy Accuracy Best Duration (s) (A) Agent: IO ! % % % % N/A 16.60±3.02 20.75% ∼13.37 (B) Agent: COTweb % ! ! % ! N/A 18.87±2.67 22.64% ∼60.90 (C) Agent: COTFA % ! % ! ! N/A 25.28±3.50 30.18% ∼56.42 (D) Agent: TOT % ! ! ! ! N/A 25.66±3.50 30.18% ∼71.31 (E) Swarm(3×IO) ! % % % % Choose “Best” 15.85±0.92 18.87% ∼45.65 (F) Swarm(3×COT) % ! ! % ! Choose “Best” 27.17±3.29 32.08% ∼152.89 (G) Swarm(3×TOT) % ! ! ! ! Choose “Best” 30.18±4.30 35.85% ∼198.50 (H) Swarm(3×IO) ! % % % % Self-Consistency 18.11±3.07 22.64% ∼45.70 (I) Swarm(3×COT) % ! ! % ! Self-Consistency 27.17±4.06 32.08% ∼150.26 (J) Swarm(3×TOT) % ! ! ! ! Self-Consistency 28.30±3.38 32.08% ∼181.15 (K) Swarm(5×TOT) % ! ! ! ! Self-Consistency 29.06±2.56 32.08% ∼291.07 (L) Swarm(7×TOT) % ! ! ! ! Self-Consistency 30.56±3.25 35.85% ∼414.89 (M) Human - - - - - - 94% - ∼422.26 notably improves the overall performance of the system. We Agents (Park et al., 2023), ChatDev (Qian et al., 2023), and also found that a greater variety of node operations leads to AutoGen (Wu et al., 2023) focus on role-based communi- better performance. As illustrated in Figure 6, web browsing cation, but struggle with hallucinations. MetaGPT (Hong is required for 43.9% of the tasks. Our current implemen- et al., 2023) introduces standard operating procedures for tation accesses the Internet by only downloading materials better role definition and communication, making the collab- directly from the URLs provided in the problem statement or oration between agents more effective. In contrast to these querying a Google search3 without further website naviga- frameworks, we automatically optimize nodes and edges in tion. Therefore, we believe that enhancing web capabilities a self-organizing society of agents. would further increase performance significantly. 4.2. Language Agents with Graphs 4. Related Work Besta et al. (2023) introduced LLM-based problem-solving 4.1. LLM-based Autonomous Agents with graphs; however, the approach only encompasses LLM prompting schemes without modeling other fundamental Current works on LLM-based autonomous agents or lan- capabilities of language agents, such as use of external tools. guage agents vary in focus. Methods such as Chain of LangGraph (langchain ai, 2024), on the other hand, is a Thought (Wei et al., 2022), ReAct (Yao et al., 2022), Re- concurrent open-source framework that focuses on building flexion (Shinn et al., 2023), Tree of Thought (ToT) im- multi-actor state LLM applications through possibly cycli- prove prompt strategies and structure to improve reason- cal operations. However, its practical applicability has not ing capabilities, while others such as exchange-of-thoughts yet been systematically studied. Unlike previous studies, (EOT) (Yin et al., 2023) focus on the benefits of various our approach emphasizes the development of hierarchical communication paradigms. Single LLM agent frameworks intelligence, as discussed by Minsky (1988) and Kennedy such as AutoGPT (Gravitas, 2023), LangChain (Chase, (2006), through the construction of agent graphs and the 2022), LlamaIndex (Liu, 2022), and XAgent (XAgent Team, composition of multiple graphs into swarms. Crucially, the 2023) showcase problem solving through various external graph representation facilitates automatic optimization on functions and tools. In the space of LLM-based multia- two levels. First, at the node level, since the majority of gent systems (Xie et al., 2023; Chen et al., 2023a;b), NL- nodes in the graph involve prompting an LLM, prompt op- SOMs (Zhuge et al., 2023) employ various social struc- timization methods can be employed. Second, at the edge tures for task-specific applications (inspired by SOMs (Min- level, we demonstrate the application of the REINFORCE sky, 1988)), without exploring optimization over the social algorithm (Williams, 1992) to optimize the potential con- structure of agents. CAMEL (Li et al., 2023), Generalist nections between nodes. 3 We use SearchApi (https://www.searchapi.io/) in the experi- ments 8
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
这篇论文哪里最强,哪里最危险
工具能力仍是瓶颈:该实现能够直接下载给定网址及做搜索,但没有完整网页导航能力。节点可组合、图可搜索,均不代表所有任务都能访问所需信息。复现应区分固定群体、节点优化和边优化三条实验路径;否则会把模型、工具与计算预算的收益都归因给拓扑学习。 (原文:PDF p.8, Analysis after Table 2)
指标:工具能力仍是瓶颈:该实现能够直接下载给定网址及做搜索,但没有完整网页导航能力。节点可组合、图可搜索,均不代表所有任务都能访问所需信息。复现应区分固定群体、节点优化和边优化三条实验路径;否则会把模型、工具与计算预算的收益都归因给拓扑学习。
条件:本地全文 arXiv:2402.16823v3,Analysis after Table 2;条件及比较对象见陈述
PDF p.8, Analysis after Table 2 · PDF p.8
GPTSwarm: Language Agents as Optimizable Graphs Table 2. Ablations on the GAIA benchmark (Level 1 validation set) (Mialon et al., 2023). DA = DirectAnswer, GQ = GenerateQuery, WS = WebSearch, FA = FileAnalyzer, CA = CombinedAnswer. ‘!’ indicates the presence of a specific feature in the corresponding framework, ‘%’ its absence. Each type of experiment is run five times to record the mean, standard deviation, and best run (marked as Best). Self-Consistency describes prompt-based self-consistency (Wang et al., 2022); Choose “Best” refers to the LLM’s favorite answer among the different agents’ answers. All agents and swarms are implemented using our GPTSwarm framework. Agent or Swarm DA GQ WS FA CA Decision Strategy Accuracy Best Duration (s) (A) Agent: IO ! % % % % N/A 16.60±3.02 20.75% ∼13.37 (B) Agent: COTweb % ! ! % ! N/A 18.87±2.67 22.64% ∼60.90 (C) Agent: COTFA % ! % ! ! N/A 25.28±3.50 30.18% ∼56.42 (D) Agent: TOT % ! ! ! ! N/A 25.66±3.50 30.18% ∼71.31 (E) Swarm(3×IO) ! % % % % Choose “Best” 15.85±0.92 18.87% ∼45.65 (F) Swarm(3×COT) % ! ! % ! Choose “Best” 27.17±3.29 32.08% ∼152.89 (G) Swarm(3×TOT) % ! ! ! ! Choose “Best” 30.18±4.30 35.85% ∼198.50 (H) Swarm(3×IO) ! % % % % Self-Consistency 18.11±3.07 22.64% ∼45.70 (I) Swarm(3×COT) % ! ! % ! Self-Consistency 27.17±4.06 32.08% ∼150.26 (J) Swarm(3×TOT) % ! ! ! ! Self-Consistency 28.30±3.38 32.08% ∼181.15 (K) Swarm(5×TOT) % ! ! ! ! Self-Consistency 29.06±2.56 32.08% ∼291.07 (L) Swarm(7×TOT) % ! ! ! ! Self-Consistency 30.56±3.25 35.85% ∼414.89 (M) Human - - - - - - 94% - ∼422.26 notably improves the overall performance of the system. We Agents (Park et al., 2023), ChatDev (Qian et al., 2023), and also found that a greater variety of node operations leads to AutoGen (Wu et al., 2023) focus on role-based communi- better performance. As illustrated in Figure 6, web browsing cation, but struggle with hallucinations. MetaGPT (Hong is required for 43.9% of the tasks. Our current implemen- et al., 2023) introduces standard operating procedures for tation accesses the Internet by only downloading materials better role definition and communication, making the collab- directly from the URLs provided in the problem statement or oration between agents more effective. In contrast to these querying a Google search3 without further website naviga- frameworks, we automatically optimize nodes and edges in tion. Therefore, we believe that enhancing web capabilities a self-organizing society of agents. would further increase performance significantly. 4.2. Language Agents with Graphs 4. Related Work Besta et al. (2023) introduced LLM-based problem-solving 4.1. LLM-based Autonomous Agents with graphs; however, the approach only encompasses LLM prompting schemes without modeling other fundamental Current works on LLM-based autonomous agents or lan- capabilities of language agents, such as use of external tools. guage agents vary in focus. Methods such as Chain of LangGraph (langchain ai, 2024), on the other hand, is a Thought (Wei et al., 2022), ReAct (Yao et al., 2022), Re- concurrent open-source framework that focuses on building flexion (Shinn et al., 2023), Tree of Thought (ToT) im- multi-actor state LLM applications through possibly cycli- prove prompt strategies and structure to improve reason- cal operations. However, its practical applicability has not ing capabilities, while others such as exchange-of-thoughts yet been systematically studied. Unlike previous studies, (EOT) (Yin et al., 2023) focus on the benefits of various our approach emphasizes the development of hierarchical communication paradigms. Single LLM agent frameworks intelligence, as discussed by Minsky (1988) and Kennedy such as AutoGPT (Gravitas, 2023), LangChain (Chase, (2006), through the construction of agent graphs and the 2022), LlamaIndex (Liu, 2022), and XAgent (XAgent Team, composition of multiple graphs into swarms. Crucially, the 2023) showcase problem solving through various external graph representation facilitates automatic optimization on functions and tools. In the space of LLM-based multia- two levels. First, at the node level, since the majority of gent systems (Xie et al., 2023; Chen et al., 2023a;b), NL- nodes in the graph involve prompting an LLM, prompt op- SOMs (Zhuge et al., 2023) employ various social struc- timization methods can be employed. Second, at the edge tures for task-specific applications (inspired by SOMs (Min- level, we demonstrate the application of the REINFORCE sky, 1988)), without exploring optimization over the social algorithm (Williams, 1992) to optimize the potential con- structure of agents. CAMEL (Li et al., 2023), Generalist nections between nodes. 3 We use SearchApi (https://www.searchapi.io/) in the experi- ments 8
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
代码从哪里读
已核验作者代码仓库可以访问。先从项目说明核对版本、运行环境与输入格式,再决定是否复现。本次未安装、运行作者代码,也没有验证复现成功。
读完后记住这三件事
把代理表示成操作图;分别优化提示与连接;不要把未优化的基准实验算成图搜索的收益。 (原文:PDF p.3, Section 2;PDF p.4, Sections 2.3–2.4;PDF p.7, Section 3.4;PDF p.7, Table 1;PDF p.8, Table 2;PDF p.8, Analysis after Table 2)
指标:只把智能体描述成“程序员、审核员”容易隐藏实际计算过程。这里每个节点是一次模型或工具操作,每条边携带前驱输出,终点节点给出答案。单个智能体本身就是一张图,多个智能体可连接成更大的图。计算被限制为有向无环图,便于按依赖顺序执行,并非任意循环对话都原样支持。
条件:本地全文 arXiv:2402.16823v3,Section 2;条件及比较对象见陈述
PDF p.3, Section 2 · PDF p.3
GPTSwarm: Language Agents as Optimizable Graphs to their topological order. Each node n ∈ N receives as 2.3. Edge Optimization input x and the output zn from its predecessor nodes. In Given a task τ and its associated utility function uτ that this work, inputs and outputs are strings in natural language, maps the candidate graphs to real numbers, we formulate but may take on other data types more generally. Node n an optimization problem about the choice of additional applies the computational routine fn (zn , x) and sends the edges. The goal is to identify the edges that connect var- output to its successor nodes. The graph output, denoted ious language agents in a swarm, maximizing the utility. ŷ = G(x), is the output fo (zo , x) from the output node o. This process involves determining the most effective pat- Note that in a DAG, some nodes will not have predecessors. terns of communication and information exchange among For such nodes, the context z will be empty. This graph agents for the task at hand. We consider a set of poten- execution procedure is summarized in Algorithm 1. tial edges {ei }di=1 = E, which leads to 2d possible edge configurations, symbolized as E ∈ {0, 1}d . We further re- Algorithm 1 Graph Execution strict the search space to only consider composite graphs Require: Computational graph G = (N, E, F, o), input x, that are DAGs. Formally, optimization of the composite empty context z for each node without predecessors. graph of language agents is achieved by solving the prob- for n in TopologicalSort(N ) do lem maxE uτ (GE ). zn ← {fv (zv , x) : v ∈ pre(n)} end for 2.3.1. P ROBLEM R EFORMULATION Ensure: fo (zo , x) DAG optimization through pruning of nodes and edges was already present in the first work on “deep learning” with deep feedforward networks (Ivakhnenko et al., 1965; In the context of language agents, for example, the input Ivakhnenko, 1968). Due to the combinatorial complexity x may correspond to a question in natural language. Each induced by DAGs, recent studies have increasingly focused node processes the input x and context information z from on the continuous optimization approach (Vowels et al., its predecessor nodes by applying a computational routine f . 2022). This is particularly relevant in scenarios where most Examples of routines include LLM queries with input data node executions require one or more queries to LLMs for from other agents, instructions to generate prompts for web moderate-scale applications. Moreover, the utility function searches that gather task-related information, or tool usage. is typically non-differentiable due to the tokenization of Although our formalization specifies that the input x is given LLMs, and this remains true even when a differentiable to each node, in practice, many routines might be designed DAG sampling technique is employed. Therefore, we refor- to ignore the input and operate solely in the context provided mulate our edge optimization as a continuous optimization by the predecessor nodes. Finally, the output provided by the problem. Instead of optimizing in a discrete space, our output node corresponds to the answer to the input question approach is to optimize over a continuum of probabilistic or, more generally, to the solution of the input task. distributions, each representing a distribution over the fea- sible DAGs. Formally, rather than solving the maximum Swarm of language agents as a composite graph. Given utility function arg maxE uτ (GE ), we propose solving a set of K language agents, each represented by a com- arg max EG′ ∼Dθ [uτ (G′ )], (1) putational graph {Gk = (Nk , Ek , Fk , ok )}K k=1 , one can θ∈Θ compose these agents to achieve high performance in spe- where Dθ is a parameterized distribution and Θ represents cific tasks. Let N ′ = ∪k Nk represent the union of the a feasible set of real-valued parameters. nodes of the agents, E ′ = ∪k Ek be the union of the edges of the agents, F ′ = ∪k Fk be the union of the computa- 2.3.2. S OLUTION PARAMETERIZATION tional routines of the agents, and o′ ∈ ∪k {ok } be the output node for the composite graph. Consider a selection of edges A straightforward way to define a parameterized probabilis- E ⊂ ∪i̸=j Ni ×Nj that describe a set of connections between tic distribution over DAGs with fixed nodes N and required nodes from different agents. We define the composite graph edges E is to assign a real-valued parameter θi ∈ R to each representing the swarm of agents as GE = (N ′ , EE , F ′ , o′ ), potential edge ei . Let θ = [θ1 ; θ2 ; . . . ; θd ] ∈ [0, 1]d . The where EE = E ′ ∪ E is the union of the edges of the agents probability of G′ = GE for G′ ∼ Dθ is and the new edges connecting them. Composite graphs are ( d restricted to DAGs. The composite graph GE can be exe- Y θi if (N, E ∪ ({ej }i−1 j=1 ∩ E) ∪ {ei }) is a DAG, cuted as described in Algorithm 1. In a swarm of language 0 otherwise. i=1 agents, the newly specified edges represent communication channels between agents. In the following sections, we A sampling method that realizes this distribution is first to explore how to optimize such a computational graph. initialize a graph G′ ← (N, E). Then, iteratively sample 3
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:连边优化给候选连接分配概率,采样一张可执行图,依据任务表现调整概率;造成环的边不会加入。节点优化则记录该节点的输入输出与反馈,用它改善节点提示。优化一个节点时把其他提示暂时视为固定。这里改变的是调用组织与提示,而不是反向传播修改大模型权重;效用函数和搜索样本本身仍需设计。
条件:本地全文 arXiv:2402.16823v3,Sections 2.3–2.4;条件及比较对象见陈述
PDF p.4, Sections 2.3–2.4 · PDF p.4
GPTSwarm: Language Agents as Optimizable Graphs whether to include edge ei in G′ for all i’s. If including ei also require a natural language description of the intended causes a cycle in current G′ , then the edge would not be function for each routine fnpn ∈ F denoted by dn . For ex- included. Otherwise, add the edge to G′ with probability θi . ample, a suitable description for a node designed to write Python programs would be “a Python code generator”. Here, 2.3.3. O PTIMIZATION A LGORITHM existing prompt optimization methods, such as OPRO (Yang To optimize the objective function (Equation (1)), we apply et al., 2023), can be described as a function I that iteratively the REINFORCE algorithm (Williams, 1992) by applying a maps a prompt, a function description, and a set of node gradient ascent variant (e.g., Adam (Kingma & Ba, 2014)) input-output pairs (which may include annotations such as with an unbiased gradient estimation: a quality measure for each pair) to an improved prompt. For example, I could take a prompt such as “generate Python M 1 X code”, a description “a Python code generator”, and an ∇θ EGE ∼Dθ [uτ (GE )] ≈ ûτ (Gi )∇θ log(pθ (Gi )), (2) M i=1 input-output pair “Input: evaluate two divided by one as an integer. Output: 2 / 1”, where the output yields 1.0 as the where G1 , G2 , . . . , GN ∼ Dθ are mutually independent result of execution. A prompt optimization method would and ûτ (Gi ) is an independent unbiased estimate of uτ (Gi ) return an improved prompt “generate Python code and pay for all i and some M ∈ N. Algorithm 2 describes the attention to data types”. optimization algorithm with vanilla gradient ascent. Formally, our method begins by initializing an empty his- Algorithm 2 Edge Optimization with REINFORCE tory set, denoted hn , one for each node n ∈ N . The process then proceeds iteratively: first, the graph GP (x) is executed Require: A parameterized probabilistic distribution over using a randomly sampled input x following Algorithm computation graphs Dθ , an unbiased utility estimator 1. Subsequently, for each node, a tuple consisting of the ûτ (·), and a learning rate α. input to the node (zn , x), where zn is the context vector Initialize θ ∈ Rd . that includes the outputs of the predecessor nodes, and the while terminate condition not met do node’s own output fnpn (zn , x), is added to the node’s his- Sample Gi ∼ Dθ forP i = 1, 2, . . . , M . α M tory hn . The final step involves updating the node prompts. Update θ ← θ + M i=1 ûτ (Gi )∇θ log(pθ (Gi )). This is done by applying I to the node’s updated history, end while its current prompt, and its function description, resulting in an improved prompt I(hn , pn , dn ). This iterative pro- 2.4. Node Optimization cess, described in Algorithm 3, continuously improves the operations of the nodes in the entire graph. In our framework, each node implements a fundamental operation, such as querying an LLM, using a tool, calling Algorithm 3 Node Optimization an API, etc. In a language agent, most of these operations Require: A parameterized graph GP = (N, E, F P , o), involve prompting an LLM once or several times. Optimiz- natural language function descriptions D = {dn }n∈N , ing the prompts of these nodes is crucial for improving the and a distribution of inputs DX . system’s overall performance. Initialize pn for all n ∈ N . Unlike many other works on prompt optimization, which Initialize hn ← ∅ for all n ∈ N . optimize a single global prompt (e.g., Yang et al., 2023; while terminate condition not met do Pryzant et al., 2023; Deng et al., 2022), our node optimiza- Sample input x ∼ DX . tion problem naturally involves several operations where y ← GP (x) following Algorithm 1. each of them consists of a node-level prompt. In our case, hn ← hn ∪ {((zn , x), fnpn (zn , x))} for all n ∈ N . the optimization problem is more complex due to prompts pn ← I(hn , pn , dn ), for all n ∈ N . affecting how other prompts operate on connected nodes. end while At the same time, our graph representation leads to a sepa- ration of concerns where each node has a specific purpose 2.5. General Applicability with its own associated prompt. Due to this separation of Frameworks such as AutoGPT (Torantulino et al., 2023) concerns, we hypothesize that, for every optimization step, and LangChain (Chase, 2022) have set a standard for flexi- it is sufficient to update each node-level prompt individually, bility and reusability in various language-based tasks. Our assuming that all other prompts are fixed. framework, GPTSwarm, introduces a graph-based design of Consider a parameterized computational graph GP = agents and swarms. This design further simplifies the reuse (N, E, F P , o), where F P = {fnpn } are computational rou- of modular components (nodes & agents) and the integra- tines, each parameterized by a prompt pn to be optimized tion of such modules. For instance, GPTSwarm supports for all n ∈ N . To enable effective node optimization, we 41 types of file analysis, web search (e.g., Google Search), 4
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:实验包含编程、推理和需要工具的GAIA任务。GAIA部分把多个同类树式推理智能体的答案进行汇总,比较不同工具与不同数量组合。作者明确说该组实验没有进行节点或连边优化;因此它检验框架的组合能力,而不是单独验证图优化算法的贡献。
条件:本地全文 arXiv:2402.16823v3,Section 3.4;条件及比较对象见陈述
PDF p.7, Section 3.4 · PDF p.7
GPTSwarm: Language Agents as Optimizable Graphs Optimization Curve on HumanEval Dataset 0.88 0.86 0.84 Accuracy 0.82 0.80 0.78 0.76 1 2 3 4 5 6 7 8 Number of Iterations Figure 5. Optimization curve on HumanEval. Accuracy as a function of the number of iterations. We observe significant im- Figure 6. Solving a wide range of tasks requires many different provements during the first five iterations. The results, including tools. The GAIA benchmark (Mialon et al., 2023) tests for many the mean and standard errors, are based on three repeated experi- of these capabilities by including questions that require several of ments. these tools for successful completion. Table 1. Performance on the GAIA Benchmark (Mialon et al., ReAct-style (Yao et al., 2022) agent. The agent first gener- 2023). Using our framework, we demonstrate significant improve- ates a Python program in response to a given question. If ments across several levels of difficulty. The ‘GPT-4 with plugins’ the generated program passes all test cases included in the baseline is less significant since it involves the manual selection problem statement, then the program is returned. Otherwise, of the appropriate tools per question. We report the mean and the agent regenerates a program based on the execution standard deviation across 5 runs. feedback. We optimize the prompts by adding input-output Method Level 1 Level 2 Level 3 Avg. pairs selected by assessing their effectiveness as demonstra- GPT-3.5 7.55 4.65 0 4.85 tion examples, particularly in improving the node operation GPT-4 15.09 2.33 0 6.06 applied to the node’s ten most recent inputs. To evaluate a GPT-4-Turbo 20.75 5.81 0 9.70 node operation, we determine if the generated program suc- AutoGPT 13.21 0 3.85 4.85 GPTSwarm 30.56±3.25 20.93±1.27 3.85±2.43 18.45 cessfully solves the unit tests provided in the input problem Improvement 47.3%↑ 260.2%↑ 0.0% 90.2%↑ statement. For more details on the node optimizer, please GPT4 with Plugins* 30.30 9.70 0 14.6 refer to Appendix E.3.1. Figure 5 shows the optimization results of the first eight iterations. After each iteration, the optimized solution is et al., 2022). We also experimented with adding different evaluated on the entire dataset. The mean and standard er- types of agents to the swarm and using prompt-based best rors are presented for three repeated runs. We observe that answer selection. The results indicate that prompt-based the accuracy increases during the first five iterations. We self-consistency yields the best performance. Note that also test our method in an online learning setting, contin- these experiments are meant to demonstrate the generic ca- uously optimizing and evaluating without restarting. An pabilities of our modular framework and include neither improvement is observed from 0.76 (no optimization) to edge-based nor node-level optimization, which is left for 0.88(±0.007) (mean and standard error). future work. Analysis: Table 1 shows the results of our swarm with 3.4. GAIA seven TOT agents and the self-consistency strategy for Motivation: GAIA is a benchmark specifically designed the final decision. We compare the performance of the for testing the generality of AI assistants focusing on real- GPT-Series (Achiam et al., 2023) with plugins and Auto- world questions (Mialon et al., 2023). Abilities required to GPT (Torantulino et al., 2023) performance as reported by answer GAIA questions include reasoning, multi-modality Mialon et al. (2023). Our methods significantly outperform processing, web browsing, and other tool use. Although these baselines. conceptually straightforward for humans, these questions Table 2 presents a more comprehensive set of results. We ex- present significant challenges for current AI systems. periment with varying numbers of agents and different node Using this benchmark, we evaluate the general applicabil- operations, such as different tool uses. Our observations ity of our framework. We construct swarms with multiple indicate that the time requirement of a swarm grows ap- agents of the same type and employ self-consistency (a proximately linearly with the number of agents. Despite the prompt-based majority vote) for the final decision (Wang increased computational time, incorporating more agents 7
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:GAIA表中GPTSwarm平均分18.45,GPT-4-Turbo为9.70;但最高难度Level 3仅为3.85。该结果说明在这组基线与工具条件下群体有收益,远非通用任务已经解决。表内GPT-4加插件还涉及人工为问题选工具,比较条件并不完全同质。
条件:本地全文 arXiv:2402.16823v3,Table 1;条件及比较对象见陈述
PDF p.7, Table 1 · PDF p.7
GPTSwarm: Language Agents as Optimizable Graphs Optimization Curve on HumanEval Dataset 0.88 0.86 0.84 Accuracy 0.82 0.80 0.78 0.76 1 2 3 4 5 6 7 8 Number of Iterations Figure 5. Optimization curve on HumanEval. Accuracy as a function of the number of iterations. We observe significant im- Figure 6. Solving a wide range of tasks requires many different provements during the first five iterations. The results, including tools. The GAIA benchmark (Mialon et al., 2023) tests for many the mean and standard errors, are based on three repeated experi- of these capabilities by including questions that require several of ments. these tools for successful completion. Table 1. Performance on the GAIA Benchmark (Mialon et al., ReAct-style (Yao et al., 2022) agent. The agent first gener- 2023). Using our framework, we demonstrate significant improve- ates a Python program in response to a given question. If ments across several levels of difficulty. The ‘GPT-4 with plugins’ the generated program passes all test cases included in the baseline is less significant since it involves the manual selection problem statement, then the program is returned. Otherwise, of the appropriate tools per question. We report the mean and the agent regenerates a program based on the execution standard deviation across 5 runs. feedback. We optimize the prompts by adding input-output Method Level 1 Level 2 Level 3 Avg. pairs selected by assessing their effectiveness as demonstra- GPT-3.5 7.55 4.65 0 4.85 tion examples, particularly in improving the node operation GPT-4 15.09 2.33 0 6.06 applied to the node’s ten most recent inputs. To evaluate a GPT-4-Turbo 20.75 5.81 0 9.70 node operation, we determine if the generated program suc- AutoGPT 13.21 0 3.85 4.85 GPTSwarm 30.56±3.25 20.93±1.27 3.85±2.43 18.45 cessfully solves the unit tests provided in the input problem Improvement 47.3%↑ 260.2%↑ 0.0% 90.2%↑ statement. For more details on the node optimizer, please GPT4 with Plugins* 30.30 9.70 0 14.6 refer to Appendix E.3.1. Figure 5 shows the optimization results of the first eight iterations. After each iteration, the optimized solution is et al., 2022). We also experimented with adding different evaluated on the entire dataset. The mean and standard er- types of agents to the swarm and using prompt-based best rors are presented for three repeated runs. We observe that answer selection. The results indicate that prompt-based the accuracy increases during the first five iterations. We self-consistency yields the best performance. Note that also test our method in an online learning setting, contin- these experiments are meant to demonstrate the generic ca- uously optimizing and evaluating without restarting. An pabilities of our modular framework and include neither improvement is observed from 0.76 (no optimization) to edge-based nor node-level optimization, which is left for 0.88(±0.007) (mean and standard error). future work. Analysis: Table 1 shows the results of our swarm with 3.4. GAIA seven TOT agents and the self-consistency strategy for Motivation: GAIA is a benchmark specifically designed the final decision. We compare the performance of the for testing the generality of AI assistants focusing on real- GPT-Series (Achiam et al., 2023) with plugins and Auto- world questions (Mialon et al., 2023). Abilities required to GPT (Torantulino et al., 2023) performance as reported by answer GAIA questions include reasoning, multi-modality Mialon et al. (2023). Our methods significantly outperform processing, web browsing, and other tool use. Although these baselines. conceptually straightforward for humans, these questions Table 2 presents a more comprehensive set of results. We ex- present significant challenges for current AI systems. periment with varying numbers of agents and different node Using this benchmark, we evaluate the general applicabil- operations, such as different tool uses. Our observations ity of our framework. We construct swarms with multiple indicate that the time requirement of a swarm grows ap- agents of the same type and employ self-consistency (a proximately linearly with the number of agents. Despite the prompt-based majority vote) for the final decision (Wang increased computational time, incorporating more agents 7
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:在GAIA较简单的子集,单个TOT准确率25.66、耗时约71.31秒,七个TOT汇总后30.56、耗时约414.89秒。增加群体大小不是免费提升:调用与运行时间同时增加。三个IO智能体用“选最好”策略时准确率15.85,反而低于单个IO的16.60,说明复制智能体本身不保证改善。
条件:本地全文 arXiv:2402.16823v3,Table 2;条件及比较对象见陈述
PDF p.8, Table 2 · PDF p.8
GPTSwarm: Language Agents as Optimizable Graphs Table 2. Ablations on the GAIA benchmark (Level 1 validation set) (Mialon et al., 2023). DA = DirectAnswer, GQ = GenerateQuery, WS = WebSearch, FA = FileAnalyzer, CA = CombinedAnswer. ‘!’ indicates the presence of a specific feature in the corresponding framework, ‘%’ its absence. Each type of experiment is run five times to record the mean, standard deviation, and best run (marked as Best). Self-Consistency describes prompt-based self-consistency (Wang et al., 2022); Choose “Best” refers to the LLM’s favorite answer among the different agents’ answers. All agents and swarms are implemented using our GPTSwarm framework. Agent or Swarm DA GQ WS FA CA Decision Strategy Accuracy Best Duration (s) (A) Agent: IO ! % % % % N/A 16.60±3.02 20.75% ∼13.37 (B) Agent: COTweb % ! ! % ! N/A 18.87±2.67 22.64% ∼60.90 (C) Agent: COTFA % ! % ! ! N/A 25.28±3.50 30.18% ∼56.42 (D) Agent: TOT % ! ! ! ! N/A 25.66±3.50 30.18% ∼71.31 (E) Swarm(3×IO) ! % % % % Choose “Best” 15.85±0.92 18.87% ∼45.65 (F) Swarm(3×COT) % ! ! % ! Choose “Best” 27.17±3.29 32.08% ∼152.89 (G) Swarm(3×TOT) % ! ! ! ! Choose “Best” 30.18±4.30 35.85% ∼198.50 (H) Swarm(3×IO) ! % % % % Self-Consistency 18.11±3.07 22.64% ∼45.70 (I) Swarm(3×COT) % ! ! % ! Self-Consistency 27.17±4.06 32.08% ∼150.26 (J) Swarm(3×TOT) % ! ! ! ! Self-Consistency 28.30±3.38 32.08% ∼181.15 (K) Swarm(5×TOT) % ! ! ! ! Self-Consistency 29.06±2.56 32.08% ∼291.07 (L) Swarm(7×TOT) % ! ! ! ! Self-Consistency 30.56±3.25 35.85% ∼414.89 (M) Human - - - - - - 94% - ∼422.26 notably improves the overall performance of the system. We Agents (Park et al., 2023), ChatDev (Qian et al., 2023), and also found that a greater variety of node operations leads to AutoGen (Wu et al., 2023) focus on role-based communi- better performance. As illustrated in Figure 6, web browsing cation, but struggle with hallucinations. MetaGPT (Hong is required for 43.9% of the tasks. Our current implemen- et al., 2023) introduces standard operating procedures for tation accesses the Internet by only downloading materials better role definition and communication, making the collab- directly from the URLs provided in the problem statement or oration between agents more effective. In contrast to these querying a Google search3 without further website naviga- frameworks, we automatically optimize nodes and edges in tion. Therefore, we believe that enhancing web capabilities a self-organizing society of agents. would further increase performance significantly. 4.2. Language Agents with Graphs 4. Related Work Besta et al. (2023) introduced LLM-based problem-solving 4.1. LLM-based Autonomous Agents with graphs; however, the approach only encompasses LLM prompting schemes without modeling other fundamental Current works on LLM-based autonomous agents or lan- capabilities of language agents, such as use of external tools. guage agents vary in focus. Methods such as Chain of LangGraph (langchain ai, 2024), on the other hand, is a Thought (Wei et al., 2022), ReAct (Yao et al., 2022), Re- concurrent open-source framework that focuses on building flexion (Shinn et al., 2023), Tree of Thought (ToT) im- multi-actor state LLM applications through possibly cycli- prove prompt strategies and structure to improve reason- cal operations. However, its practical applicability has not ing capabilities, while others such as exchange-of-thoughts yet been systematically studied. Unlike previous studies, (EOT) (Yin et al., 2023) focus on the benefits of various our approach emphasizes the development of hierarchical communication paradigms. Single LLM agent frameworks intelligence, as discussed by Minsky (1988) and Kennedy such as AutoGPT (Gravitas, 2023), LangChain (Chase, (2006), through the construction of agent graphs and the 2022), LlamaIndex (Liu, 2022), and XAgent (XAgent Team, composition of multiple graphs into swarms. Crucially, the 2023) showcase problem solving through various external graph representation facilitates automatic optimization on functions and tools. In the space of LLM-based multia- two levels. First, at the node level, since the majority of gent systems (Xie et al., 2023; Chen et al., 2023a;b), NL- nodes in the graph involve prompting an LLM, prompt op- SOMs (Zhuge et al., 2023) employ various social struc- timization methods can be employed. Second, at the edge tures for task-specific applications (inspired by SOMs (Min- level, we demonstrate the application of the REINFORCE sky, 1988)), without exploring optimization over the social algorithm (Williams, 1992) to optimize the potential con- structure of agents. CAMEL (Li et al., 2023), Generalist nections between nodes. 3 We use SearchApi (https://www.searchapi.io/) in the experi- ments 8
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。
指标:工具能力仍是瓶颈:该实现能够直接下载给定网址及做搜索,但没有完整网页导航能力。节点可组合、图可搜索,均不代表所有任务都能访问所需信息。复现应区分固定群体、节点优化和边优化三条实验路径;否则会把模型、工具与计算预算的收益都归因给拓扑学习。
条件:本地全文 arXiv:2402.16823v3,Analysis after Table 2;条件及比较对象见陈述
PDF p.8, Analysis after Table 2 · PDF p.8
GPTSwarm: Language Agents as Optimizable Graphs Table 2. Ablations on the GAIA benchmark (Level 1 validation set) (Mialon et al., 2023). DA = DirectAnswer, GQ = GenerateQuery, WS = WebSearch, FA = FileAnalyzer, CA = CombinedAnswer. ‘!’ indicates the presence of a specific feature in the corresponding framework, ‘%’ its absence. Each type of experiment is run five times to record the mean, standard deviation, and best run (marked as Best). Self-Consistency describes prompt-based self-consistency (Wang et al., 2022); Choose “Best” refers to the LLM’s favorite answer among the different agents’ answers. All agents and swarms are implemented using our GPTSwarm framework. Agent or Swarm DA GQ WS FA CA Decision Strategy Accuracy Best Duration (s) (A) Agent: IO ! % % % % N/A 16.60±3.02 20.75% ∼13.37 (B) Agent: COTweb % ! ! % ! N/A 18.87±2.67 22.64% ∼60.90 (C) Agent: COTFA % ! % ! ! N/A 25.28±3.50 30.18% ∼56.42 (D) Agent: TOT % ! ! ! ! N/A 25.66±3.50 30.18% ∼71.31 (E) Swarm(3×IO) ! % % % % Choose “Best” 15.85±0.92 18.87% ∼45.65 (F) Swarm(3×COT) % ! ! % ! Choose “Best” 27.17±3.29 32.08% ∼152.89 (G) Swarm(3×TOT) % ! ! ! ! Choose “Best” 30.18±4.30 35.85% ∼198.50 (H) Swarm(3×IO) ! % % % % Self-Consistency 18.11±3.07 22.64% ∼45.70 (I) Swarm(3×COT) % ! ! % ! Self-Consistency 27.17±4.06 32.08% ∼150.26 (J) Swarm(3×TOT) % ! ! ! ! Self-Consistency 28.30±3.38 32.08% ∼181.15 (K) Swarm(5×TOT) % ! ! ! ! Self-Consistency 29.06±2.56 32.08% ∼291.07 (L) Swarm(7×TOT) % ! ! ! ! Self-Consistency 30.56±3.25 35.85% ∼414.89 (M) Human - - - - - - 94% - ∼422.26 notably improves the overall performance of the system. We Agents (Park et al., 2023), ChatDev (Qian et al., 2023), and also found that a greater variety of node operations leads to AutoGen (Wu et al., 2023) focus on role-based communi- better performance. As illustrated in Figure 6, web browsing cation, but struggle with hallucinations. MetaGPT (Hong is required for 43.9% of the tasks. Our current implemen- et al., 2023) introduces standard operating procedures for tation accesses the Internet by only downloading materials better role definition and communication, making the collab- directly from the URLs provided in the problem statement or oration between agents more effective. In contrast to these querying a Google search3 without further website naviga- frameworks, we automatically optimize nodes and edges in tion. Therefore, we believe that enhancing web capabilities a self-organizing society of agents. would further increase performance significantly. 4.2. Language Agents with Graphs 4. Related Work Besta et al. (2023) introduced LLM-based problem-solving 4.1. LLM-based Autonomous Agents with graphs; however, the approach only encompasses LLM prompting schemes without modeling other fundamental Current works on LLM-based autonomous agents or lan- capabilities of language agents, such as use of external tools. guage agents vary in focus. Methods such as Chain of LangGraph (langchain ai, 2024), on the other hand, is a Thought (Wei et al., 2022), ReAct (Yao et al., 2022), Re- concurrent open-source framework that focuses on building flexion (Shinn et al., 2023), Tree of Thought (ToT) im- multi-actor state LLM applications through possibly cycli- prove prompt strategies and structure to improve reason- cal operations. However, its practical applicability has not ing capabilities, while others such as exchange-of-thoughts yet been systematically studied. Unlike previous studies, (EOT) (Yin et al., 2023) focus on the benefits of various our approach emphasizes the development of hierarchical communication paradigms. Single LLM agent frameworks intelligence, as discussed by Minsky (1988) and Kennedy such as AutoGPT (Gravitas, 2023), LangChain (Chase, (2006), through the construction of agent graphs and the 2022), LlamaIndex (Liu, 2022), and XAgent (XAgent Team, composition of multiple graphs into swarms. Crucially, the 2023) showcase problem solving through various external graph representation facilitates automatic optimization on functions and tools. In the space of LLM-based multia- two levels. First, at the node level, since the majority of gent systems (Xie et al., 2023; Chen et al., 2023a;b), NL- nodes in the graph involve prompting an LLM, prompt op- SOMs (Zhuge et al., 2023) employ various social struc- timization methods can be employed. Second, at the edge tures for task-specific applications (inspired by SOMs (Min- level, we demonstrate the application of the REINFORCE sky, 1988)), without exploring optimization over the social algorithm (Williams, 1992) to optimize the potential con- structure of agents. CAMEL (Li et al., 2023), Generalist nections between nodes. 3 We use SearchApi (https://www.searchapi.io/) in the experi- ments 8
解释边界:只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。