title: IterPref: Focal Preference Learning for Code Generation via Iterative
    Debugging
summary: 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.
paper_authors._id: 67c82d2202935d02b0ce0df1
paper_authors.name: Jie Wu
paper_authors._id: 67c82d2202935d02b0ce0df2
paper_authors.name: Haoling Li
paper_authors.status: claimed_verified
paper_authors.statusLastChangedAt: 2025-03-05T10:59:05.817Z
paper_authors._id: 650be23ec4e52db6a4db63ef
paper_authors.avatarUrl: /avatars/03af548029b38bee49ec295fefe74f9a.svg
paper_authors.fullname: Haoling Li
paper_authors.type: user
paper_authors.user: Ringo1110
paper_authors._id: 67c82d2202935d02b0ce0df3
paper_authors.name: Xin Zhang
paper_authors.status: extracted_pending
paper_authors.statusLastChangedAt: 2025-03-05T10:53:22.999Z
paper_authors._id: 641a9a4b05290a135041a3ed
paper_authors.avatarUrl: /avatars/95d66ac607973abe95bd3558c6c93739.svg
paper_authors.fullname: Pluto
paper_authors.type: user
paper_authors.user: CharonBony
paper_authors._id: 67c82d2202935d02b0ce0df4
paper_authors.name: Jianwen Luo
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2025-03-05T11:37:40.552Z
paper_authors._id: 66adf5cc0c6056d9f4dc308f
paper_authors.avatarUrl: /avatars/7689ba5538f6bbf235084d418b3065c1.svg
paper_authors.fullname: Jianwen Luo
paper_authors.type: user
paper_authors.user: Jianwen2003
paper_authors._id: 67c82d2202935d02b0ce0df5
paper_authors.name: Yangyu Huang
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2025-03-05T11:37:46.285Z
paper_authors._id: 64c66647725ffa04b2fd6c94
paper_authors.avatarUrl: /avatars/620f63f27fa1e90423b0dc22aa8e5809.svg
paper_authors.fullname: yangyu huang
paper_authors.type: user
paper_authors.user: yangyu90
paper_authors._id: 67c82d2202935d02b0ce0df6
paper_authors.name: Ruihang Chu
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2025-03-05T11:37:51.435Z
paper_authors._id: 642e3bcb958faf258a40e89c
paper_authors.avatarUrl: /avatars/213501def37dc53032cee17e37fcc4c1.svg
paper_authors.fullname: Ruihang Chu
paper_authors.type: user
paper_authors.user: Ruihang
paper_authors._id: 67c82d2202935d02b0ce0df7
paper_authors.name: Yujiu Yang
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2025-03-05T11:37:57.005Z
paper_authors._id: 64ca1fe838837b12d5e529b7
paper_authors.avatarUrl: /avatars/44a3ad9e59318784ac531993b5f69f6b.svg
paper_authors.fullname: Yujiu Yang
paper_authors.type: user
paper_authors.user: Thu-redrobot
paper_authors._id: 67c82d2202935d02b0ce0df8
paper_authors.name: Scarlett Li
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2025-03-05T11:38:04.131Z
paper_authors._id: 67366efb049bfa3a9084e8d1
paper_authors.avatarUrl: https://cdn-avatars.huggingface.co/v1/production/uploads/noauth/Bny5bUc6qFQ_RWpEKpRAW.jpeg
paper_authors.fullname: Scarlett Li
paper_authors.type: user
paper_authors.user: lisijia0504
paper_title: IterPref: Focal Preference Learning for Code Generation via Iterative
    Debugging
paper_summary: 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.
paper_ai_keywords: preference learning Code LLMs supervised fine-tuning preference pairs test case success pass rate error regions tokens DPO algorithm CodeFlow dataset iterative debugging code generation BigCodeBench