← Latest papers
🤖 AI

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

CoCoDA is a framework that enables small language models to match or exceed larger teachers by co-evolving a planner and a growing tool library within a single compositional code DAG, which optimizes retrieval efficiency through symbolic unification and accelerates learning via a structure-aware reward mechanism.

Original authors: Ziyang Yu, Qiyue Li, Liang Zhao

Published 2026-05-12
📖 5 min read🧠 Deep dive

Original authors: Ziyang Yu, Qiyue Li, Liang Zhao

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a very smart but small robot assistant (the "planner") that needs to solve complex problems, like doing advanced math or writing code. This robot has a limited amount of "brain space" (context window) to hold information at once. To help it, we give it a toolbox of skills (tools) it can use.

The problem with existing methods is like trying to carry a massive library of books in your pocket. As you add more useful books (tools) to help the robot, the pocket gets too heavy, and the robot can't fit enough of them in its brain to solve the problem. Also, the robot doesn't know how to organize these books; it just sees a messy pile of text, making it hard to find the right one quickly.

CoCoDA is a new system that solves this by changing how the toolbox is built and how the robot learns to use it. Here is how it works, using simple analogies:

1. The "Living Blueprint" (The Compositional DAG)

Instead of a messy pile of books, CoCoDA builds a living blueprint (a Directed Acyclic Graph, or DAG).

  • The Nodes: Think of these as individual tools. Some are basic tools (like a hammer or a screwdriver), and others are "super-tools" (like a pre-assembled drill press) that are made by combining the basic ones.
  • The Connections: The blueprint shows exactly how the super-tools are built from the basic ones. It's like a recipe book where the "Cake" recipe points to the "Mix Batter" and "Bake" steps.
  • The Benefit: Because the blueprint knows the structure, the robot doesn't need to read every single page of every book. It can look at the "Table of Contents" (signatures) and the "Recipe Steps" (dependencies) to instantly know which tools fit together.

2. The "Smart Filter" (Typed DAG Retrieval)

When the robot faces a new problem, it needs to pick the right tools. Old methods would read the description of every tool in the library, which is slow and uses up too much brain space.

CoCoDA uses a four-stage filter to narrow down the choices, like a security checkpoint:

  1. Stage 1 (The ID Check): It checks the tool's "ID card" (its type signature). If the tool doesn't match the job (e.g., trying to use a hammer to cut paper), it's instantly rejected. This costs almost no brain power.
  2. Stage 2 (The Description Scan): For the tools that passed the ID check, it reads their short descriptions to see if they sound relevant.
  3. Stage 3 (The Rule Check): It checks the "rules" (pre-conditions and post-conditions). Does this tool require inputs it doesn't have? Will it produce the right output? If not, it's tossed out.
  4. Stage 4 (The Example Match): Finally, it looks at real-world examples of the tool in action to pick the absolute best match.

The Magic: Because it filters out bad tools at the cheap, fast stages (1 and 2), it only spends expensive "brain power" reading the full details of the few tools that actually survived the cut. This keeps the robot's "pocket" from getting too heavy, even as the library grows huge.

3. The "Co-Evolution" (Learning Together)

This is the most unique part. Usually, the robot learns to use tools, but the tools stay the same. In CoCoDA, the robot and the toolbox grow up together.

  • Discovery: When the robot successfully solves a hard problem by chaining together several basic steps (like "add," "multiply," then "divide"), a "Teacher" (a larger, smarter AI) looks at that success.
  • Invention: The Teacher says, "Hey, that sequence of steps is useful! Let's bundle them into a new 'Super-Tool' and add it to the blueprint."
  • Reward: The robot gets a bonus score (reward) for using these new Super-Tools because they save it from having to do the basic steps over and over again.
  • The Loop: As the robot gets better, it finds more patterns to bundle. As the toolbox gets smarter, the robot can solve harder problems. They evolve in sync.

The Results

The paper tested this system on math problems, table analysis, and coding tasks.

  • The "Small vs. Big" Test: They used a small robot (8 billion "brain units") and compared it to a giant robot (32 billion units).
  • The Outcome: With CoCoDA, the small robot was able to match or even beat the giant robot on difficult math and logic puzzles.
  • Efficiency: The small robot didn't just get lucky; it learned to organize its knowledge so efficiently that it didn't need the giant brain size to do the heavy lifting.

In short, CoCoDA teaches a small AI to build its own organized, hierarchical library of skills, allowing it to punch way above its weight class by knowing exactly which tools to grab and how to combine them without getting overwhelmed.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →