pith. sign in

arxiv: 2406.12502 · v2 · pith:AENOPH4Knew · submitted 2024-06-18 · 💻 cs.CL

Code-Optimise: Self-Generated Preference Data for Correctness and Efficiency

classification 💻 cs.CL
keywords datacode-optimisecorrectnesssolutionscodeframeworkgeneratedlearning
0
0 comments X
read the original abstract

Code Language Models have been trained to generate accurate solutions, typically with no regard for runtime. On the other hand, previous works that explored execution optimisation have observed corresponding drops in functional correctness. To that end, we introduce Code-Optimise, a framework that incorporates both correctness (passed, failed) and runtime (quick, slow) as learning signals via self-generated preference data. Our framework is both lightweight and robust as it dynamically selects solutions to reduce overfitting while avoiding a reliance on larger models for learning signals. Code-Optimise achieves significant improvements in pass@k while decreasing the competitive baseline runtimes by an additional 6% for in-domain data and up to 3% for out-of-domain data. As a by-product, the average length of the generated solutions is reduced by up to 48% on MBPP and 23% on HumanEval, resulting in faster and cheaper inference. The generated data and codebase is open-sourced at https://github.com/huawei-noah/HEBO/tree/Code_Optimise.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 4 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. Bridging Functional Correctness and Runtime Efficiency Gaps in LLM-Based Code Translation

    cs.CL 2026-06 unverdicted novelty 7.0

    SwiftTrans improves both functional correctness and runtime efficiency of LLM code translations via multi-perspective exploration with hierarchical guidance and difference-aware selection with ordinal guidance on exte...

  2. SkelDPO: A Skeleton-Guided Direct Preference Optimization Framework for Efficient Code Generation

    cs.SE 2026-06 unverdicted novelty 7.0

    SkelDPO improves code generation efficiency by 2-7% over prior DPO methods via joint preference losses on full code and efficiency-critical skeletons.

  3. In Line with Context: Repository-Level Code Generation via Context Inlining

    cs.SE 2026-01 unverdicted novelty 7.0

    InlineCoder reframes repository-level code generation as function-level coding by using a draft anchor to inline the target function into its call graph for upstream usage and downstream dependency context.

  4. CROP: Expert-Aligned Image Cropping via Compositional Reasoning and Optimizing Preference

    cs.CV 2026-05 unverdicted novelty 6.0

    CROP uses compositional reasoning and expert preference alignment in VLMs to produce aesthetic crops that match human experts more closely than previous methods.