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

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Gee, Leonidas, Gritta, Milan, Lampouras, Gerasimos, Iacobacci, Ignacio
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866909477904580608
author Gee, Leonidas
Gritta, Milan
Lampouras, Gerasimos
Iacobacci, Ignacio
author_facet Gee, Leonidas
Gritta, Milan
Lampouras, Gerasimos
Iacobacci, Ignacio
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2406_12502
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Code-Optimise: Self-Generated Preference Data for Correctness and Efficiency
Gee, Leonidas
Gritta, Milan
Lampouras, Gerasimos
Iacobacci, Ignacio
Computation and Language
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.
title Code-Optimise: Self-Generated Preference Data for Correctness and Efficiency
topic Computation and Language
url https://arxiv.org/abs/2406.12502