跳到正文
arXiv:cs.AI· Zheng Fang, Yihong Dong, Lili Mou, Dongming Jin, Zhi Jin, Ge Li·· 5 小时前AI 评分38

IntentCoding:在代码生成中放大用户意图

IntentCoding: Amplifying User Intent in Code Generation

AI 导读

研究者提出 IntentCoding,一种无需额外训练、与现有解码流程兼容的模型无关解码策略,通过遮蔽用户意图捕捉其影响并用多强度集成机制放大意图作用。在自建基准 CodeConstraints 上相对提升最高 71.0%,IFEvalCode 上最高 67.3%,HumanEval 与 LiveCodeBench 的 pass@1 最高提升 29.3%。

正文

View PDF HTML (experimental)

Abstract:Large Language Models (LLMs) have shown strong capabilities in code generation, but their adherence to fine-grained user intent with multiple constraints remains a significant challenge. Our empirical analysis reveals two key observations: 1) Model performance deteriorates quickly as the number of constraints in the user intent increases, and 2) While user intent does influence the model's logits, such an influence may not be strong enough to effectively steer the decoding process. To this end, we propose Intent-Amplified Code Generation (IntentCoding), a novel decoding strategy that enhances an LLM's ability to follow user intent. IntentCoding captures the influence of user intent by masking out the intent, and applies a multi-strength ensemble mechanism to amplify the effect of user intent during generation. IntentCoding is model-agnostic, requires no additional training, and integrates seamlessly with existing decoding procedures. To enable systematic evaluation, we also construct CodeConstraints, a benchmark dataset specifically designed to test user intent compliance under varying numbers of constraints. Experiments on our constructed Constraints, as well as popular IFEvalCode, HumanEval and LiveCodeBench datasets, show that our IntentCoding model significantly improves both constraint satisfaction and functional correctness compared to standard decoding approaches. IntentCoding achieves up to 71.0% relative improvement on CodeConstraints, achieves up to 67.3% relative improvement on IFEvalCode and achieves up to 29.3% relative improvement in pass@1 on HumanEval and LiveCodeBench compared with greedy decoding.
Subjects: Software Engineering (cs.SE); Artificial Intelligence (cs.AI); Computation and Language (cs.CL); Machine Learning (cs.LG)
Cite as: arXiv:2602.00066 [cs.SE]
  (or arXiv:2602.00066v1 [cs.SE] for this version)
  https://doi.org/10.48550/arXiv.2602.00066

arXiv-issued DOI via DataCite

Submission history

From: Zheng Fang [view email]
[v1] Tue, 20 Jan 2026 13:34:16 UTC (270 KB)

来源:arXiv:cs.AI · arxiv.org