AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Oct 29, 2026, 01:00 JST

Directed-graph agent cuts tokens 74% with 7回 ➔ 3回 turns

Send on LINE
Directed-graph agent cuts tokens 74% with 7回 ➔ 3回 turns

3 Key Points

  1. What happened

    AI Labo ran the same model and the same six-bug, three-module task two ways; the Directed Graph version kept 20 / 20 test passes but used 7回 ➔ 3回 turns and 23,322 ➔ 5,966 input tokens.

  2. Why it matters

    The quality did not drop even as input tokens fell 74.4%, suggesting teams can shrink their AI coding bills by fixing the workflow order in code instead of letting the model decide it.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

Context & Analysis

The experiment is a direct test of a design argument by @hanakoxbt: that an agent's inner work should be a small loop of generate-and-verify, while the outer order of stages should be pinned down in ordinary code rather than left to the model. AI Labo built a fully offline sandbox VM in which the AI user and the grading user are separated by Linux UID and systemd namespaces, so the model could not read the hidden test file evaluation/judges.py. On that setup, the single-loop mode spent four of its seven turns on orchestration — inspecting files, running an initial test, re-running tests, and submitting — and its context grew from 1,652 input tokens at the first call to 4,318 by the submit step. The directed-graph mode instead reset context at each node and let a stage-specific verifier advance the workflow automatically, holding input near 2,000 tokens per call. The body frames the takeaway as a separation of reasoning (what to do) from control (how to proceed), and notes that developers could then approve only the final gate once every stage verifier has passed.

FAQ
How much faster was the directed-graph version?
AI Labo measured 36.69 seconds for the single loop versus 19.07 seconds for the directed graph, a 48.0% reduction or about 1.92x speedup.
What task did the two agent modes solve?
Both modes fixed the same six bugs spread across three modules — a parser, a pricing calculator, and a report formatter — in an order-processing pipeline.
Did the cheaper mode sacrifice code quality?
No. Both modes passed all 20 cases in an independent grading suite that the AI process could not read, and output tokens were nearly identical at 1,188 versus 1,189.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleAI agent pricing as of 2026年10月: from a few thousand yen to millions