On Sample-Efficient Code Generation

Hojae Han, Yu Jin Kim, Byoungjip Kim, Youngwon Lee, Kyungjae Lee, Kyungmin Lee, Moontae Lee, Kyunghoon Bae, Seung-won Hwang


Abstract
Large language models often struggle to predict runtime behavior in code generation tasks, leading to a reliance on rejection sampling (best-of-n) to generate multiple code snippets then select the best. Our distinction is reducing sampling costs, without compromising generation quality. We introduce EFFICODE, a novel framework that prioritizes sampling on test problems that models can solve. We show how EFFICODE estimates solvability to optimize computational costs during multiple sampling. Based on empirical evidence, EFFICODE consistently demonstrates reduced sampling budgets while maintaining comparable code generation performance, especially when problems are challenging. In addition, utilizing EFFICODE to rank sampled code snippets also shows its effectiveness in answer code selection for reducing temporal costs, by not requiring any execution or test case generation.
Anthology ID:
2023.emnlp-industry.73
Volume:
Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing: Industry Track
Month:
December
Year:
2023
Address:
Singapore
Editors:
Mingxuan Wang, Imed Zitouni
Venue:
EMNLP
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
783–791
Language:
URL:
https://aclanthology.org/2023.emnlp-industry.73
DOI:
10.18653/v1/2023.emnlp-industry.73
Bibkey:
Cite (ACL):
Hojae Han, Yu Jin Kim, Byoungjip Kim, Youngwon Lee, Kyungjae Lee, Kyungmin Lee, Moontae Lee, Kyunghoon Bae, and Seung-won Hwang. 2023. On Sample-Efficient Code Generation. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing: Industry Track, pages 783–791, Singapore. Association for Computational Linguistics.
Cite (Informal):
On Sample-Efficient Code Generation (Han et al., EMNLP 2023)
Copy Citation:
PDF:
https://aclanthology.org/2023.emnlp-industry.73.pdf
Video:
 https://aclanthology.org/2023.emnlp-industry.73.mp4