Salvato in:
Dettagli Bibliografici
Autori principali: Tang, Xunzhu, Olatunji, Iyiola Emmanuel, Sun, Tiezhu, Klein, Jacques, Bissyande, Tegawende F.
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:https://arxiv.org/abs/2509.25243
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866908566775922688
author Tang, Xunzhu
Olatunji, Iyiola Emmanuel
Sun, Tiezhu
Klein, Jacques
Bissyande, Tegawende F.
author_facet Tang, Xunzhu
Olatunji, Iyiola Emmanuel
Sun, Tiezhu
Klein, Jacques
Bissyande, Tegawende F.
contents LLMs demonstrate surface-level fluency in code generation but struggle with structured reasoning tasks requiring correctness and semantic alignment. While Chain-of-Thought (CoT) prompting enhances reasoning through intermediate steps, it suffers from verbosity and inefficiency. Chain-of-Draft (CoD) prompting offers more concise reasoning, but the stochastic nature of LLMs produces varying solution quality, making optimal selection challenging. We propose \multicod, a reinforcement learning framework that learns to select the most promising candidate from CoD-generated solutions. Our approach uses strategy-guided prompting to encourage diverse reasoning styles and models solution selection as a contextual bandit problem. The framework optimizes interpretable features including code complexity, reasoning structure, and strategic metadata through a reward function balancing correctness, efficiency, and clarity. Experiments on MBPP, BigCodeBench, SWE-bench Verified, and Defects4J show \multicod~outperforms and in some cases, on par with standard prompting, CoT, and CoD baselines while achieving cost and token efficiency from the user's perspective through a multi-candidate design that charges only for the selected output, reducing user billing by over 50\% and improving LLM response quality, making \multicod~more sustainable and scalable for real-world deployment. Our code is available: https://anonymous.4open.science/r/MultiCoD.
format Preprint
id arxiv_https___arxiv_org_abs_2509_25243
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Reinforcement Learning-Guided Chain-of-Draft for Token-Efficient Code Generation
Tang, Xunzhu
Olatunji, Iyiola Emmanuel
Sun, Tiezhu
Klein, Jacques
Bissyande, Tegawende F.
Software Engineering
Artificial Intelligence
LLMs demonstrate surface-level fluency in code generation but struggle with structured reasoning tasks requiring correctness and semantic alignment. While Chain-of-Thought (CoT) prompting enhances reasoning through intermediate steps, it suffers from verbosity and inefficiency. Chain-of-Draft (CoD) prompting offers more concise reasoning, but the stochastic nature of LLMs produces varying solution quality, making optimal selection challenging. We propose \multicod, a reinforcement learning framework that learns to select the most promising candidate from CoD-generated solutions. Our approach uses strategy-guided prompting to encourage diverse reasoning styles and models solution selection as a contextual bandit problem. The framework optimizes interpretable features including code complexity, reasoning structure, and strategic metadata through a reward function balancing correctness, efficiency, and clarity. Experiments on MBPP, BigCodeBench, SWE-bench Verified, and Defects4J show \multicod~outperforms and in some cases, on par with standard prompting, CoT, and CoD baselines while achieving cost and token efficiency from the user's perspective through a multi-candidate design that charges only for the selected output, reducing user billing by over 50\% and improving LLM response quality, making \multicod~more sustainable and scalable for real-world deployment. Our code is available: https://anonymous.4open.science/r/MultiCoD.
title Reinforcement Learning-Guided Chain-of-Draft for Token-Efficient Code Generation
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2509.25243