Case2Code: Scalable Synthetic Data for Code Generation

Yunfan Shao, Linyang Li, Yichuan Ma, Peiji Li, Demin Song +9 more
7/17/2024
cs.CL

No official code found. Best implementation: choosewhatulike/case2code (17 stars, Apache-2.0, last commit 2025-04-07).

Abstract

Large Language Models (LLMs) have shown outstanding breakthroughs in code generation. Recent work improves code LLMs by training on synthetic data generated by some powerful LLMs, which can be challenging to scale due to the dependence on a teacher model and high generation costs. In this paper, we focus on synthesizing code data at scale and propose a \textbf{Case2Code} task by exploiting the expressiveness and correctness of programs. \textbf{Case2Code} is an inductive inference task that aims to infer underlying code implementations by observing input-output examples or program behaviors, By incorporating LLMs to generate program inputs, and executing the program with these inputs to obtain the program outputs, we can synthesize diverse and high-quality \textbf{Case2Code} data at scale for training and evaluating code LLMs. Experimental results show that case-to-code induction is challenging for current representative LLMs if they are untrained. Models trained with \textbf{Case2Code} improve performance not only on distribution case-to-code induction but also on various coding-generation tasks, demonstrating the great potential of large-scale synthetic data and inductive learning.

View on arXivView PDF

Code Implementations(1)

Apache-2.0
171PythonJul 16, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{shao2024casecode,
  title  = {Case2Code: Scalable Synthetic Data for Code Generation},
  author = {Yunfan Shao and Linyang Li and Yichuan Ma and Peiji Li and Demin Song and Qinyuan Cheng and Shimin Li and Xiaonan Li and Pengyu Wang and Qipeng Guo and Hang Yan and Xipeng Qiu and Xuanjing Huang and Dahua Lin},
  year   = {2024},
  eprint = {2407.12504},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.12504v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.12504.svg)](https://codeofpaper.com/paper/2407.12504)

Discussion