arXiv:2602.14054cs.CL2026-02

通过词元偏好解码,高效生成高质量代码推理路径。

LogitsCoder: Towards Efficient Chain-of-Thought Path Search via Logits Preference Decoding for Code Generation

  • 用词元偏好控制生成方向,避免浅层思考。
  • 结合路径选择与思想聚合,提升推理深度与效率。
  • 适合需要精准推理的代码生成任务。

代码生成仍是一项需精确结构化推理的挑战性任务。现有测试时扩展(TTS)方法虽在探索推理路径上取得进展,但仍面临两大问题:(1) 低思考(underthinking),即推理链过浅,难以捕捉问题全貌;(2) 过思考(overthinking),即推理冗长,导致效率低下与计算成本上升。为此,我们提出 LogitsCoder,一种通过轻量级词元层级控制机制增强思维链推理的框架。LogitsCoder 通过迭代生成与优化推理步骤:首先利用词元偏好解码引导词元选择向统计上更优的模式靠拢;随后采用基于词元排序的路径选择与思想聚合策略,筛选并整合多样化的推理路径。该方法生成连贯且高效的推理链,在深度与效率间取得平衡。大量实验表明,LogitsCoder 能生成更高效、更高质量的推理链,显著优于基线方法,实现更优的代码生成性能。

原文摘要 · Abstract (English)

Code generation remains a challenging task that requires precise and structured reasoning. Existing Test Time Scaling (TTS) methods, including structured tree search, have made progress in exploring reasoning paths but still face two major challenges: (1) underthinking, where reasoning chains tend to be shallow and fail to capture the full complexity of problems; and (2) overthinking, where overly verbose reasoning leads to inefficiency and increased computational costs. To address these issues, we propose LogitsCoder, a novel framework that enhances chain-of-thought reasoning through lightweight, logit-level control mechanisms for code generation. LogitsCoder iteratively generates and refines reasoning steps by first steering token selection toward statistically preferred patterns via Logits Preference Decoding, then selecting and aggregating diverse reasoning paths using Logits Rank Based Path Selection and Thoughts Aggregation. This results in coherent and effective reasoning chains that balance depth and efficiency. Extensive experiments demonstrate that LogitsCoder produces more efficient and higher-quality reasoning chains, leading to superior code generation performance compared to baseline methods.

代码生成推理链词元控制

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。