{"type":"ScholarlyArticle","title":"SRA-MCTS: Self-driven Reasoning Augmentation with Monte Carlo Tree Search for Code Generation","authors":[{"name":"Bin Xu","slug":"bin-xu","given":"Bin","family":"Xu","affiliation":""},{"name":"Yiguan Lin","slug":"yiguan-lin","given":"Yiguan","family":"Lin","affiliation":""},{"name":"Yinghao Li","slug":"yinghao-li","given":"Yinghao","family":"Li","affiliation":""},{"name":"Yang Gao","slug":"yang-gao","given":"Yang","family":"Gao","affiliation":""}],"abstract":"Large language models exhibit remarkable performance in simple code generation tasks. However, they encounter significant challenges when addressing complex problems that require reasoning and question decomposition. To tackle this, we propose a self-driven reasoning augmentation process, SRA-MCTS, which incorporates Monte Carlo Tree Search (MCTS) for reasoning data generation. \r\nSRA-MCTS enables LLMs to self-generate intermediate reasoning steps and perform iterative self-evaluation, facilitating self-improvement. Specifically, it utilizes MCTS to produce diverse intermediate reasoning steps. During each iteration, MCTS generates a step and employs self-evaluation to guide the selection of subsequent branches, ultimately forming a sufficiently diverse reasoning path referred to as “thinking”. This thinking guides the model in generating corresponding code, and both are combined as training data for supervised fine-tuning. \r\nExperimental results demonstrate that SRA-MCTS achieves consistent performance improvements across three model scales without additional supervisory assistance. Applied to the Meta-Llama-3.1-8B-Instruct model, it delivers an 11-point improvement on the MBPP-Complex dataset, underscoring the significant potential for model self-improvement. The code and data are available at https://github.com/DIRECT-BIT/SRA-MCTS.","doi":"10.24963/ijcai.2025/965","url":"https://ijcai.org/proceedings/2025/965","pdf":"https://ijcai.org/proceedings/2025/0965.pdf","markdown":"https://ijcai.org/proceedings/2025/965.md","bibtex":"https://ijcai.org/proceedings/2025/bibtex/965","volume":{"slug":"2025","title":"Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence","short_title":"IJCAI 2025","url":"https://ijcai.org/proceedings/2025/","year":2025,"location":"Montreal, Canada","dates":"16-22 August 2025","editors":"James Kwok","isbn":"978-1-956792-06-5","publisher":"International Joint Conferences on Artificial Intelligence Organization","doi_prefix":"10.24963/ijcai.2025"},"section":"Planning and Scheduling","track":"Main Track","number":965,"pages":{"first":8678,"last":8686},"keywords":["Planning and Scheduling: PS: Model-based reasoning","Natural Language Processing: NLP: Language generation"],"videos":[],"references":[],"license_note":"Copyright International Joint Conferences on Artificial Intelligence."}