IterPref: Focal Preference Learning for Code Generation via Iterative
  Debugging
Preference learning enhances Code LLMs beyond supervised fine-tuning by
leveraging relative quality comparisons. Existing methods construct preference
pairs from
  candidates based on test case success, treating the higher pass rate sample
as positive and the lower as negative. However, this approach does not pinpoint
specific errors in the code, which prevents the model from learning more
informative error correction patterns, as aligning failing code as a whole
lacks the granularity needed to capture meaningful error-resolution
relationships. To address these issues, we propose IterPref, a new preference
alignment framework that mimics human iterative debugging to refine Code LLMs.
IterPref explicitly locates error regions and aligns the corresponding tokens
via a tailored DPO algorithm. To generate informative pairs, we introduce the
CodeFlow dataset, where samples are iteratively refined until passing tests,
with modifications capturing error corrections. Extensive experiments show that
a diverse suite of Code LLMs equipped with IterPref achieves significant
performance gains in code generation and improves on challenging tasks like
BigCodeBench. In-depth analysis reveals that IterPref yields fewer errors. Our
code and data will be made publicaly available.
67c82d2202935d02b0ce0df1
Jie Wu
67c82d2202935d02b0ce0df2
Haoling Li
claimed_verified
2025-03-05T10:59:05.817Z
650be23ec4e52db6a4db63ef
/avatars/03af548029b38bee49ec295fefe74f9a.svg
Haoling Li
user
Ringo1110
67c82d2202935d02b0ce0df3
Xin Zhang
extracted_pending
2025-03-05T10:53:22.999Z
641a9a4b05290a135041a3ed
/avatars/95d66ac607973abe95bd3558c6c93739.svg
Pluto
user
CharonBony
67c82d2202935d02b0ce0df4
Jianwen Luo
admin_assigned
2025-03-05T11:37:40.552Z
66adf5cc0c6056d9f4dc308f
/avatars/7689ba5538f6bbf235084d418b3065c1.svg
Jianwen Luo
user
Jianwen2003
67c82d2202935d02b0ce0df5
Yangyu Huang
admin_assigned
2025-03-05T11:37:46.285Z
64c66647725ffa04b2fd6c94
/avatars/620f63f27fa1e90423b0dc22aa8e5809.svg
yangyu huang
user
yangyu90
67c82d2202935d02b0ce0df6
Ruihang Chu
admin_assigned
2025-03-05T11:37:51.435Z
642e3bcb958faf258a40e89c
/avatars/213501def37dc53032cee17e37fcc4c1.svg
Ruihang Chu
user
Ruihang
67c82d2202935d02b0ce0df7
Yujiu Yang
admin_assigned
2025-03-05T11:37:57.005Z
64ca1fe838837b12d5e529b7
/avatars/44a3ad9e59318784ac531993b5f69f6b.svg
Yujiu Yang
user
Thu-redrobot
67c82d2202935d02b0ce0df8
Scarlett Li
admin_assigned
2025-03-05T11:38:04.131Z
67366efb049bfa3a9084e8d1
https://cdn-avatars.huggingface.co/v1/production/uploads/noauth/Bny5bUc6qFQ_RWpEKpRAW.jpeg
Scarlett Li
user
lisijia0504
IterPref: Focal Preference Learning for Code Generation via Iterative
  Debugging
Preference learning enhances Code LLMs beyond supervised fine-tuning by
leveraging relative quality comparisons. Existing methods construct preference
pairs from
  candidates based on test case success, treating the higher pass rate sample
as positive and the lower as negative. However, this approach does not pinpoint
specific errors in the code, which prevents the model from learning more
informative error correction patterns, as aligning failing code as a whole
lacks the granularity needed to capture meaningful error-resolution
relationships. To address these issues, we propose IterPref, a new preference
alignment framework that mimics human iterative debugging to refine Code LLMs.
IterPref explicitly locates error regions and aligns the corresponding tokens
via a tailored DPO algorithm. To generate informative pairs, we introduce the
CodeFlow dataset, where samples are iteratively refined until passing tests,
with modifications capturing error corrections. Extensive experiments show that
a diverse suite of Code LLMs equipped with IterPref achieves significant
performance gains in code generation and improves on challenging tasks like
BigCodeBench. In-depth analysis reveals that IterPref yields fewer errors. Our
code and data will be made publicaly available.
IterPref refines Code LLMs by aligning error regions through iterative debugging, improving performance and error reduction using the CodeFlow dataset.
preference learning Code LLMs supervised fine-tuning preference pairs error correction patterns iterative debugging error regions tokens DPO algorithm CodeFlow dataset code generation BigCodeBench