CoCoDA: Co-evolving Compositional DAG for Tool-Augmented Agents

Ziyang Yu, Qiyue Li, Liang Zhao

arXiv:2605.08399 · 2026-05-12 공개 · arXiv · PDF

code-generation mathematical-reasoning gsm8k tool-augmented-agents skill-library dag-reward compositional-dag typed-retrieval

Abstract

Tool-augmented language models can extend small language models with external executable skills, but scaling the tool library creates a coupled challenge: the library must evolve with the planner as new reusable subroutines emerge, while retrieval from the growing library must remain within a fixed context budget. Existing tool-use and skill-library methods typically treat tools as flat or text-indexed memories, causing prompt cost to grow with library size and obscuring the typed, compositional structure of executable code. We propose CoCoDA, a framework that co-evolves the planner and tool library through a single code-native structure: a compositional code DAG. Nodes are primitive or composite tools, edges encode invocation dependencies, and each node stores a typed signature, description, pre/post-condition specification, and worked examples. At inference time, Typed DAG Retrieval prunes candidates by symbolic signature unification, ranks survivors by descriptions, filters them by behavioral specifications, and disambiguates with examples, keeping expensive context materialization on progressively smaller candidate sets. At training time, successful trajectories are folded into validated composite tools, while the planner is updated with a DAG-induced reward that credits composites by their primitive expansion size. We provide theoretical results showing retrieval cost reduction, sublinear retrieval time, compositional advantage under the shaped reward, monotone co-evolution under conservative updates, and DAG well-formedness. Across mathematical reasoning, tabular analysis, and code task benchmarks, CoCoDA enables an 8B student to match or exceed a 32B teacher on GSM8K and MATH and consistently improves over strong tool-use and library-learning baselines.

한국어 요약

📋 한 줄 요약

**[LLM Agents / Tool Use]** 도구 사용 에이전트의 계획자와 도구 라이브러리를 단일 코드 네이티브 컴포지셔널 DAG로 공진화시키는 CoCoDA 프레임워크를 제안한다.

🎯 핵심 기여도

💡 핵심 아이디어

도구를 평탄한 텍스트 메모리가 아니라 타입 있는 컴포지셔널 DAG로 표현하면, 검색 비용을 줄이면서 코드의 컴포지셔널 구조를 보존하고 계획자와 함께 공진화시킬 수 있다.

🔬 기술적 접근법

📊 주요 결과

💭 의의 및 한계

**의의**: 도구 라이브러리의 확장성과 계획자 효율을 동시에 개선하는 통합 프레임워크로, 코드 네이티브 에이전트 설계의 새로운 표준을 제시할 수 있다. **한계**: 평가가 수학·표·코드 벤치마크에 집중되어 있고, 도구 사양의 자동 생성 품질에 의존한다.

🚀 실용적 활용