논문 정리) DeepAgent, A General Reasoning Agent with Scalable Toolsets(읽는 중)
1. 원문 링크
2. 논문 리뷰
Abstract
- 장기적인 상호작용을 관리하기 위해, 우리는 과거의 상호작용을 구조화된 일화적(episodic) 기억, 작업(working) 기억, 도구(tool) 기억으로 압축하는 자율적 기억 폴딩(memory folding) 메커니즘을 도입하여, 중요한 정보는 보존하면서 오류 누적을 줄입니다.
- 원문 : To manage long-horizon interactions, we introduce an autonomous memory folding mechanism that compresses past interactions into structured episodic, working, and tool memories, reducing error ac cumulation while preserving critical information.
1 Introduction
- 이러한 접근 방식들은 비교적 단순한 작업에서는 효과적이지만, 다음과 같은 몇 가지 치명적인 한계를 가집니다. (1) 실행 단계 및 전반적인 절차에서의 자율성 부족, (2) 작업 수행 중 동적으로 도구를 발견하는 능력의 부재, (3) 상호작용 기억(interactive memory)을 완전 자율적으로 관리하는 기능의 결핍, 그리고 (4) 전체 작업에 대한 추론의 깊이와 일관성 부족입니다. 이러한 한계로 인해 에이전트는 현실 세계의 문제를 해결하는 데 어려움을 겪으며, 특히 범용적이고 다양한 도구 사용을 요구하는 복잡한 작업에서 더욱 한계를 드러냅니다.
- 원문 : Although effective in simpler tasks, these approaches suffer from several critical limitations: (1) lack of autonomy in ex ecution steps and overall procedure; (2) inability to dynamically discover tools during task execution; (3) deficiency in fully au tonomous management of interactive memory; and (4) insufficient depth and coherence in reasoning about the entire task. These lim itations hinder agents from real-world problems, particularly for complex tasks that demand general and multiple tool-use.
- 장기적인(long-horizon) 환경에서 안정적인 탐색을 용이하게 하기 위해, 우리는 DeepAgent에 자율 기억 폴딩(Autonomous Memory Folding) 기능을 탑재했습니다. 이 전략을 통해 에이전트는 자신의 추론 과정과 상호작용 기록을 구조화된 기억 스키마(memory schema)로 동적으로 통합할 수 있습니다. 이 메커니즘은 토큰 오버헤드(비용 및 용량)를 줄여줄 뿐만 아니라, 에이전트가 숨을 고르며(take a breath)’ 잠시 멈추어 전략을 재고하고 잘못된 경로를 피할 수 있도록 해줍니다. 통합 과정에서의 정보 손실을 최소화하기 위해, 우리는 일화(episodic) 기억, 작업(working) 기억, 도구(tool) 기억으로 구성된 뇌과학 기반의 기억 아키텍처를 도입했습니다. 이 기억들은 모두 에이전트가 사용할 수 있는 데이터 스키마로 구조화되어 있어, 폴딩된 기억의 안정성과 유용성을 보장합니다. 나아가 DeepAgent가 이러한 메커니즘을 숙달하는 능력을 향상시키기 위해, 우리는 범용 도구 사용에 맞춤화된 엔드투엔드(end-to-end) 강화학습(RL) 훈련 방법론인 ToolPO를 제안합니다.
- 원문 : To facilitate robust exploration in long-horizon environments, we equip DeepAgent with Autonomous Memory Folding. This strategy allows the agent to dynamically consolidate its reasoning process and interaction history into a structured memory schema. Beyond reducing token overhead, this mechanism enables the agent to “take a breath”—pausing to reconsider strategies and avoid erro neous paths. To minimize information loss during consolidation, we introduce a brain-inspired memory architecture comprising episodic, working, and tool memory, all structured with an agent-usable data schema to ensure the stability and utility of the folded memory. To enhance DeepAgent’s proficiency in mastering these mecha nisms, we propose ToolPO, an end-to-end reinforcement learning (RL) training method tailored for general tool use.
- 우리의 주요 기여(Contributions)는 다음과 같이 요약됩니다: (1) 우리는 추론 모델이 하나의 통합된 추론 과정 안에서 자율적으로 사고하고, 도구를 발견하며, 행동을 실행할 수 있도록 하는 최초의 에이전트 프레임워크인 DeepAgent를 제안합니다. 이를 통해 대형 추론 모델(LRMs)이 임의의 규모의 도구 모음(toolsets)을 자유롭게 활용하고 복잡한 현실 세계의 과제까지 일반화(generalize)할 수 있도록 지원합니다. (2) 우리는 뇌과학에서 영감을 받은 기억 설계로 보완된 자율 기억 폴딩(memory folding) 메커니즘을 도입합니다. 이는 에이전트에게 시도가 실패했을 때 “한숨 돌리며(take a breath)” 자신의 탐색 전략을 재고할 수 있는 능력을 부여합니다. (3) 우리는 범용 도구 사용을 위한 엔드투엔드(end-to-end) 강화학습 훈련 방법론을 제안합니다. 이를 통해 훈련 과정 중 대규모 도구 실행의 안정성과 효율성을 보장할 뿐만 아니라, 추론 과정에서 도구 호출(invocation)의 정확성을 확보합니다. (4) 우리는 8개의 벤치마크에 걸쳐 광범위한 실험을 수행하였으며, 이를 통해 DeepAgent의 탁월한 도구 활용 능력과 현실 세계 과제에 대한 높은 적응력을 입증했습니다.
- 원문 : Our main contributions are summarized as follows: (1) We propose DeepAgent, the first agentic framework that enables reasoning models to autonomously think, discover tools, and execute actions within a unified reasoning process, empowering LRMs to harness toolsets of arbitrary scale and generalize to complex real-world tasks. (2) We introduce an autonomous memory folding mechanism, com plemented by a brain-inspired memory design. This endows the agent with the ability to “take a breath” and reconsider its explo ration strategies following unsuccessful attempts. (3) Weproposeanend-to-endreinforcementlearningtrainingmethod ology for general-purpose tool use, ensuring stability and effi ciency in large-scale tool execution during training, as well as accuracy in tool invocation during reasoning. (4) We conduct extensive experiments across eight benchmarks, demonstrating DeepAgent’s superior tool-use capabilities and high adaptability to real-world tasks
2 Related Work
2.1 Large Reasoning Models
- 대형 추론 모델(LRMs)은 최종 답변을 생성하기 전에 단계별로 심층적으로 사고하는 과정(slow thinking processes)을 채택함으로써 수학, 과학, 코딩 작업에서 상당한 성능 향상을 증명해 왔습니다.
- 원문 : Large Reasoning Models (LRMs) [4, 16] have demonstrated significant performance improvements in mathematical, scientific, and coding tasks by employing step-by-step slow thinking processes before generating final responses.
- 그러나 자체 매개변수 지식(모델 내부에 내재된 지식)에만 의존하는 모델들은 태생적인 한계를 가지며, 현실 세계와 상호작용할 수 없습니다.
- 원문 : However, models relying solely on parametric knowledge face inherent limitations and cannot interact with the real world.
- 하지만 이러한 (기존의 도구 확장형) 방법들은 대개 웹 검색, 페이지 브라우징, 코드 실행과 같은 제한된 연구 목적의 도구 세트만을 지원하기 때문에, 더 다양한 도구에 대한 접근을 요구하는 현실 세계의 시나리오에 적용하기에는 한계가 있습니다.
- 원문 : However, these methods typically support only a limited set of research-oriented tools, such as web search, page browsing, and code execution, which constrains their applicability to real-world scenarios that demand access to more diverse tools.
2.2 Autonomous Agents
- 따라서, 우리는 더욱 일반화된 현실 세계의 과제를 해결하기 위해 확장 가능한 도구 모음(toolsets)으로부터 유용한 도구를 동적으로 발견하고 호출할 수 있는 심층 추론 에이전트를 개발하고자 합니다.
- 원문 : Therefore, we aim to develop a deep reasoning agent capable of dynamically discovering and invoking helpful tools from scalable toolsets to address more generalized real-world tasks.
3 Methodology
3.1 Problem Formulation
- $\theta$로 매개변수화된 정책 $\pi$에 의해 구동되는 에이전트는 현재 상태, 사용자의 질문, 그리고 지시사항을 기반으로 다음과 같이 행동 $a_t$를 선택합니다:
$a_t$ : $t$ 시점에서의 에이전트의 행동(Action) (내부 사고, 도구 검색, 도구 호출, 기억 폴딩 중 하나)
$\pi_\theta$: $\theta$라는 파라미터(매개변수)로 이루어진 에이전트의 정책(Policy) 또는 모델
$s_t$: $t$ 시점에서의 에이전트의 상태(State) (이전까지의 행동과 관찰 기록의 누적 데이터)
$Q$: 사용자가 입력한 질문(Question)
$I$: 사용자가 제공한 지시사항(Instruction)
- 이때 행동 a_t는 다음 네 가지 유형 중 하나가 될 수 있습니다: 내부 사고($a_t^{\text{think}}$), 도구 검색($a_t^{\text{search}}$), 도구 호출($a_t^{\text{call}}$), 기억 폴딩($a_t^{\text{fold}}$).
- 원문 : The agent, driven by a policy $\pi$ parameterized by $\theta$, selects an action a_t based on the current state, the user question, and the instruction, An action a_t can be one of four types: Internal Thought ($a_t^{\text{think}}$), Tool Search ($a_t^{\text{search}}$), Tool Call ($a_t^{\text{call}}$), Memory Fold ($a_t^{\text{fold}}$).
- R($\tau$)를 전체 궤적(trajectory) $\tau$의 성공 여부를 평가하는 보상 함수라고 가정할 때, 우리의 목표는 주어진 작업에 대해 예상 누적 보상을 최대화하는 최적의 정책 $\pi_\theta^*$를 학습하는 것입니다:
- 원문 : Suppose R($\tau$) is a reward function that evaluates the overall success of the trajectory $\tau$, the objective is to learn an optimal policy $\pi_\theta^*$ that maximizes the expected cumulative reward for a given task:
$\pi_\theta^*$: 에이전트가 학습하고자 하는 최적의 정책(Optimal Policy)
$\tau$: 에이전트가 처음부터 끝까지 수행한 상태, 행동, 관찰의 연속적인 흐름인 궤적(Trajectory)
$R(\tau)$: 해당 궤적 $\tau$ 전체의 성공 여부를 평가하여 부여하는 보상 함수(Reward Function)
$\mathbb{E}$: 정책 $\pi_\theta$를 따랐을 때 얻게 되는 보상의 기댓값(Expected Value)
$\arg\max_{\pi_\theta}$ : 보상의 기댓값을 가장 크게 만드는 정책 $\pi_\theta$를 구하라는 의미
3.2 Overview of the DeepAgent Framework
- Main Reasoning Process : 단일한 사고의 흐름 안에서, LRM은 자율적으로 작업을 추론하고, 필요한 도구를 동적으로 발견하며, 행동을 실행하고, 자체 기억을 관리합니다.
- Main Reasoning Process : In a single stream of thought, the LRM autonomously reasons about the task, dynamically discovers necessary tools, executes actions, and manages its own memory.
- Auxiliary Mechanisms : 이러한 분업을 통해 메인 LRM은 고차원적인 전략적 추론에만 집중할 수 있게 됩니다.
- Auxiliary Mechanisms : This division of labor allows the main LRM to concentrate on high-level strategic reasoning.
3.3 Autonomous Tool Search and Calling
$\mathcal{T}_{\text{retrieved}}$: 검색을 통해 찾아온 도구들의 집합
$\mathcal{T}$: 시스템이 접근할 수 있는 전체 도구 모음(전체 집합)
$q_s$: 에이전트가 생성한 도구 검색 쿼리(질의어)
$d_i$: 각 도구 \tau_i의 설명 문서(Documentation)
$E$: 텍스트를 벡터로 변환하는 임베딩 모델
$\text{sim}(\cdot, \cdot)$: 두 임베딩 벡터 간의 코사인 유사도(Cosine Similarity)
$\text{top-k}$: 유사도 점수가 가장 높은 상위 k개의 도구를 선택하라는 의미
- 추론 과정에서 쿼리 $q_s$가 주어지면, 시스템은 코사인 유사도 $\text{sim}(\cdot, \cdot)$를 기반으로 순위를 매겨 상위 k개의 도구를 검색합니다.
- 원문 : - During inference, given the query $q_s$, the system retrieves the top-$k$ tools by ranking them based on the cosine similarity $sim(\cdot, \cdot)$:
- 태그 정리
-
q_s - 에이전트가 도구가 필요하다고 판단할 때, 특수 토큰(태그)으로 감싸진 도구 검색 쿼리 q_s를 생성합니다.
-
relevant tools - 검색된 도구 문서 파일들을 보조 LLM이 처리(너무 길면 요약, 그렇지 않으면 그대로 제공)한 후, 메인 LRM의 컨텍스트로 반환되는 결과 태그입니다.
-
{"name": "tool_name", "arguments": ...} - 도구를 실행하기 위해 에이전트는 도구의 이름과 인자(arguments)를 포함한 구조화된 호출을 생성합니다. 프레임워크는 이 호출을 파싱하여 도구를 실행하고 출력을 캡처합니다.
-
helpful information - 도구 실행 결과 데이터에 노이즈가 많거나 너무 길 경우 보조 LLM이 이를 요약하여 간결하고 유용한 정보로 만든 뒤, 다시 추론 컨텍스트로 전달하는 결과 태그입니다.
-
3.4 Autonomous Memory Folding and Brain-Inspired Memory Schema
$M_E$: 일화적 기억 (Episodic Memory)
$M_W$: 작업 기억 (Working Memory)
$M_T$: 도구 기억 (Tool Memory)
$f_{\text{compress}}$: 보조 LLM이 수행하는 기억 압축 함수
$s_t$: 현재 시점 $t$까지의 전체 상호작용 이력 (Interaction History)
$\theta_{\text{aux}}$: 보조 LLM (Auxiliary LLM)의 파라미터
- $\theta_{\text{aux}}$로 매개변수화된 보조 LLM은 이전의 전체 상호작용 이력 $s_t$를 처리하고, 세 가지 구조화된 기억 구성 요소를 병렬로 생성합니다.
- 원문 : The auxiliary LLM (parameterized by $\theta_{\text{aux}}$) processes the entire preceding interaction history $s_t$ and generates three structured memory components in parallel:
- 이렇게 압축된 일화적($M_E$), 작업($M_W$), 도구($M_T$) 기억은 가공되지 않은 기존의 상호작용 이력을 대체하며, 이를 통해 에이전트는 잘못된 탐색 경로에 갇히는 것을 피하는 동시에 지금까지의 진행 상황을 새롭고 요약된 관점으로 바라보며 나아갈 수 있습니다.
- 원문 : These compressed episodic ($M_E$), working ($M_W$), and tool ($M_T$) memories then replace the raw interaction history, enabling the agent to proceed with a refreshed and condensed view of its progress while avoiding entrapment in incorrect exploration paths.
- Episodic Memory ($M_E$) : 이 구성 요소는 작업의 고차원적인 로그 역할을 하며 핵심 이벤트, 주요 의사결정 지점, 하위 작업 완료 상황을 기록합니다. 이는 에이전트에게 전체적인 작업 구조 및 궁극적인 목표와 관련된 장기적인 컨텍스트를 제공합니다.
- 원문 : Episodic Memory ($M_E$) : This component serves as a high-level log of the task, recording key events, major decision points, and sub-task completions. It provides the agent with long-term context regarding the overall task structure and its overarching goals.
- Working Memory ($M_W$) : 여기에는 현재의 하위 목표, 직면한 장애물, 단기 계획과 같은 가장 최신의 정보가 포함됩니다. 이는 기억 폴딩(합치기) 과정 전반에서 에이전트 추론의 연속성을 보장하는 핵심 구성 요소입니다.
- 원문 : Working Memory ($M_W$) : This contains the most recent information, such as the current sub-goal, obstacles encountered, and near-term plans. It is the core component that ensures the continuity of the agent’s reasoning across the memory fold.
- Tool Memory ($M_T$) : 어떤 도구가 사용되었는지, 어떻게 호출되었는지, 그리고 그 효과는 어땠는지를 포함하여 모든 도구 관련 상호작용을 통합합니다. 이를 통해 에이전트는 경험으로부터 학습하여 도구 선택 및 사용 전략을 개선할 수 있습니다.
- 원문 : Tool Memory ($M_T$) : This consolidates all tool-related interactions, including which tools have been used, how they were invoked, and their effectiveness. It allows the agent to learn from its experiences, refining its tool selection and usage strategies.
- 압축된 기억의 안정성을 보장하고 에이전트가 이를 쉽게 파싱(해석)할 수 있도록, 우리는 구조화되지 않은 자연어 대신 JSON 형식의 에이전트 사용 가능 데이터 스키마(agent-usable data schema)를 채택했습니다.
- 원문 : To ensure that the compressed memory is stable and easily parsed by the agent, we employ an agent-usable data schema in JSON format instead of unstructured natural language.
3.5 End-to-end RL Training with ToolPO
- 우리는 일반적인 도구 사용 에이전트를 위해 설계된 강화학습(RL) 접근 방식인 도구 정책 최적화(ToolPO, Tool Policy Optimization)를 통해 DeepAgent를 엔드투엔드(end-to-end, 전과정 통합)로 학습시킵니다.
- 원문 : We train DeepAgent end-to-end with Tool Policy Optimization (ToolPO), an RL approach designed for general tool-using agents.
- 주요 내용 번역
- 훈련 데이터 수집을 위해 총 4가지 카테고리에 걸쳐 다음과 같은 다양한 벤치마크 및 데이터셋을 활용했습니다.
- 범용 도구 사용 역량 (General Tool-Use): ToolBench
- 현실 세계 상호작용 (Real-world Interaction): ALFWorld, WebShop
- 심층 연구 기술 (Deep Research Skills): WebDancer, WebShaperQA
- 코드를 활용한 수학적 추론 (Mathematical Reasoning with Code): DeepMath
- Tool Simulator(도구 시뮬레이터)는 수천 개의 실제 현실 세계 API와 직접 연동하여 에이전트를 훈련할 때 발생하는 불안정성, 지연 시간(레이턴시), 그리고 높은 비용 문제를 해결하기 위해 개발한 LLM 기반의 가상 환경 환경입니다.
- 훈련 데이터 수집을 위해 총 4가지 카테고리에 걸쳐 다음과 같은 다양한 벤치마크 및 데이터셋을 활용했습니다.
$\tau_k$: 샘플링된 $K$개의 궤적 중 현재 계산하고자 하는 $k$번째 궤적(Trajectory)
$R_{\text{succ}}(\tau_k)$: 최종 작업의 성공 여부(정답 여부 등)를 평가하는 전역 보상(Global Reward)
$R_{\text{action}}(\tau_k)$: 중간 행동들(올바른 도구 호출, 효율적인 기억 폴딩 등)의 품질을 평가하는 행동 보상(Action-level Reward)
$K$: 하나의 프롬프트에서 샘플링한 총 궤적의 개수 (그룹의 크기)
$\frac{1}{K} \sum_{j=1}^{K} R(\tau_j)$: 동일한 조건에서 수행된 모든 궤적들의 보상 평균값(Baseline)
$A_{\text{succ}}(\tau_k)$ / $A_{\text{action}}(\tau_k)$: 평균보다 얼마나 더 잘했는지를 나타내는 그룹 상대적 어드밴티지(Group-relative Advantage)
- 이러한 보상을 바탕으로, 우리는 그룹 상대적인 두 가지 별도의 어드밴티지(Advantage)를 계산합니다.
- 원문 : Based on these rewards, we compute two separate group-relative advantages.
$y_i$: 궤적 $\tau_k$를 구성하는 개별 토큰(Token)
$A(y_i)$: 해당 토큰 $y_i$가 최종적으로 부여받는 최종 총 어드밴티지
$M(y_i)$: 특정 토큰에만 행동 보상을 부여하기 위한 마스크(Mask) 함수
- 궤적 $\tau_k$ 내의 주어진 토큰 $y_i$에 대한 총 어드밴티지는 전역(global) 어드밴티지와 지역(local) 어드밴티지의 합입니다.
- 원문 : The total advantage for a given token $y_i$ in trajectory $\tau_k$ is the sum of the global and local advantages:
$\mathcal{L}$: ToolPO 알고리즘의 최종 손실 함수(Loss Function / Objective)
$\theta$: 업데이트할 모델(정책)의 파라미터(가중치)
$|\tau_k|$: 궤적 $\tau_k$에 포함된 전체 토큰의 개수
$\rho_i(\theta)$: 현재 모델과 이전 모델의 확률 비율을 나타내는 중요도 샘플링 비율(Probability Ratio)
$\text{clip}(\cdot, 1-\epsilon, 1+\epsilon)$: 모델이 한 번에 너무 급격하게 변하지 않도록 $\epsilon$(하이퍼파라미터, 보통 0.1~0.2) 범위 내로 제한하는 클리핑(Clipping) 연산
$\min(\cdot, \cdot)$: 클리핑된 값과 클리핑되지 않은 값 중 작은 값을 취하여 안정적인 보수적 업데이트를 유도하는 PPO 알고리즘의 핵심 연산
$y_i$: 현재 시점에서 모델이 생성하고 있는 $i$번째 단어 혹은 토큰
$y_{<i}$: $i$번째 토큰을 생성하기 전까지 과거에 생성된 모든 토큰들의 시퀀스(맥락/컨텍스트)를 의미
- 그런 다음 ToolPO는 클리핑된 대리 목적 함수(clipped surrogate objective function)를 사용하여 정책을 최적화합니다.
- 원문 : ToolPO then optimizes the policy using a clipped surrogate objective function:
😭😭😭😭😭😭😭 할게 많아 내 주말 돌려줘
댓글남기기