IntentCoding: Amplifying User Intent in Code Generation
Zheng Fang, Yihong Dong, Lili Mou, Dongming Jin, Zhi Jin, Ge Li

TL;DR
This paper introduces IntentCoding, a decoding method that amplifies user intent influence in code generation by masking and ensemble techniques, significantly improving constraint adherence and correctness without extra training.
Contribution
IntentCoding is a novel, model-agnostic decoding strategy that enhances user intent following in code generation without additional training or modifications.
Findings
Significantly improves constraint satisfaction in code generation.
Achieves up to 71% relative improvement on a new benchmark.
Enhances correctness on popular code datasets.
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Natural Language Processing Techniques · Software Engineering Research
