Tree-of-Code: A Self-Growing Tree Framework for End-to-End Code Generation and Execution in Complex Tasks

Solving complex reasoning tasks is a key realworld application of agents.Thanks to the pretraining of Large Language Models (LLMs) on code data, recent approaches like CodeAct successfully use code as LLM agents' action, achieving good results.However, CodeAct greedily generates the next action's code block by relying on fragmented thoughts, resulting in inconsistency and accumulative hallucination.Moreover, CodeAct lacks action-related ground-truth (GT), making its supervision signals and termination conditions questionable in multi-turn interactions.To address these issues, we propose Tree-of-Code (ToC), a self-growing framework that generates nodes through selfsupervision, incorporating prompt and model exploration in a GT-free setting.Each node employs CodeProgram, an end-to-end code generation paradigm that aligns executable code logic with global reasoning.This approach uses task-level execution success as both node validity and stop-growing flags, bypassing process supervision to enable online applications.Experiments on two datasets with ten popular zero-shot LLMs show that ToC boosts accuracy by nearly 20% over CodeAct with fewer than 1/4 turns.To further investigate the trade-off between efficacy and efficiency, ablation studies on different ToC tree sizes and exploration mechanisms validate ToC's superiority.

Authors

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.findings-acl.509
Citations
1
Primary Topic
Real-Time Systems Scheduling
Type
article
Field-Weighted Citation Impact
2.27

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Tree-of-Code: A Self-Growing Tree Framework for End-to-End Code Generation and Execution in Complex Tasks

Daxiang Dong, Ziyi Ni, Yixuan Li, Dou Shen et al.
1 citations
Real-Time Systems Scheduling
2.27
article

Tree-of-Code: A Self-Growing Tree Framework for End-to-End Code Generation and Execution in Complex Tasks

Daxiang Dong, Ziyi Ni, Yixuan Li, Dou Shen, Ning Yang, Pin Lyu
article en
1 citations

Abstract

Solving complex reasoning tasks is a key realworld application of agents.Thanks to the pretraining of Large Language Models (LLMs) on code data, recent approaches like CodeAct successfully use code as LLM agents' action, achieving good results.However, CodeAct greedily generates the next action's code block by relying on fragmented thoughts, resulting in inconsistency and accumulative hallucination.Moreover, CodeAct lacks action-related ground-truth (GT), making its supervision signals and termination conditions questionable in multi-turn interactions.To address these issues, we propose Tree-of-Code (ToC), a self-growing framework that generates nodes through selfsupervision, incorporating prompt and model exploration in a GT-free setting.Each node employs CodeProgram, an end-to-end code generation paradigm that aligns executable code logic with global reasoning.This approach uses task-level execution success as both node validity and stop-growing flags, bypassing process supervision to enable online applications.Experiments on two datasets with ten popular zero-shot LLMs show that ToC boosts accuracy by nearly 20% over CodeAct with fewer than 1/4 turns.To further investigate the trade-off between efficacy and efficiency, ablation studies on different ToC tree sizes and exploration mechanisms validate ToC's superiority.

National Natural Science Foundation of China, National Science and Technology Major Project
Openalex Percentile: Top 13%
Real-Time Systems Scheduling
2.27
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Tree-of-Code: A Self-Growing Tree Framework for End-to-End Code Generation and Execution in Complex Tasks — Daxiang Dong, Ziyi Ni, et al. · (2025) | TGRS Research Map | TGRS