←新闻详情

智源 FlagOpen:原创开源项目更新于 10月14日 12:13

智源 FlagOpen 开源 TACO 算法代码生成数据集

GitHub - FlagOpen/TACO · GitHub

AI 导读

智源 FlagOpen 开源 TACO 算法代码生成数据集,含 25,443 道训练题和 1,000 道测试题,是目前规模最大的代码生成数据集,每题配有最多 1.55M 的多样解答及任务主题、算法、技能、难度等细粒度标签。评测显示 TACO 测试集难度极高,GPT-4 在 easy 级别 pass@1 仅 31.5,其他代码模型五个难度级别的 pass@1 普遍低于 10。

正文

当前显示原文,中文全文译文尚未就绪。

FlagOpen; TACO

Repository navigation

NotificationsYou must be signed in to change notification settings; Fork15 (15); Star240 (240)You must be signed in to star a repository

Repository files navigation

README; Apache-2.0 license

🤗 Hugging Face | BAAI DataHub | Paper

TACO (Topics in Algorithmic COde generation dataset) is a dataset focused on algorithmic code generation, designed to provide a more challenging training dataset and evaluation benchmark for the code generation model field. The dataset consists of programming competition problems that are more difficult and closer to real programming scenarios. It emphasizes improving or evaluating the model's understanding and reasoning abilities in practical application scenarios, rather than just implementing predefined function functionalities.

Larger scale: TACO includes a training set (25,443 problems) and a test set (1,000 problems), making it the largest code generation dataset currently available; Higher quality: Each problem in the TACO dataset is designed to match a diverse set of solution answers, with answer sizes of up to 1.55M. This ensures that the model is not prone to overfitting during training and validates the effectiveness of evaluation results; Fine-grained labels: Each problem in the TACO dataset includes fine-grained labels such as task topics, algorithms, skills, and difficulty levels. These labels provide more accurate references for the training and evaluation of code generation models

News and Updates

Check it out here.

🧩🧩🧩[2025/12/03] Released Special Judge Problem List for TACO Test Set! We've added a supplementary file listing all test problems requiring Special Judge, manually verified by 5 ACM competitive programmers and further validated by GPT-4-Turbo. It covers 3 common SPJ scenarios:

Non-deterministic outputs; Case-insensitive string comparisons; Floating-point precision with epsilon tolerance; 🚀🚀🚀[2024/06/19] Announcing Testing Framework Update: Bug Fixes and Enhanced Functionality! We're excited to announce the release of our first version after extensive manual validation and debugging efforts. In this update, we've addressed several bugs in our testing framework for the quoted APPS benchmark. We double-checked the test cases and updated TACO test set to a new version. Details on the fixes can be found here; 🔥🔥🔥[2024/04/11] Announcing the Release of Part of TACO (Topics in Algorithm for Code) Project Models on Hugging Face! We've full fine-tuned top-tier code models like CodeLlama and Starcoder, ranging from 1B to 15B parameters, specifically tailored for competitive algorithmic challenges. Check out our models under FlagOpen on Hugging Face. Join us in advancing the Code & LLMs community! 🏋️‍♂️👩‍💻

Download and Use

🤗 Hugging Face

First, install the datasets package.

Then, load the dataset with the following program.

You can also specify the split ("train" or "test") through; You can also specify the difficulties (a list choosing from ["EASY", "MEDIUM", "MEDIUM_HARD", "HARD", "VERY_HARD"] or ["ALL"] as default) or skills (a list choosing from ["Data structures", "Sorting", "Range queries", "Complete search", "Amortized analysis", "Dynamic programming", "Bit manipulation", "Greedy algorithms"] or ["ALL"] as default) by passing the list of difficulties or skills as a list

BAAI DataHub First, download the dataset and unzip it into a folder named "BAAI-TACO." Then, load the dataset with the following program.

You can also specify the split ("train" or "test") through; You can also specify the difficulties (a list choosing from ["EASY", "MEDIUM", "MEDIUM_HARD", "HARD", "VERY_HARD"] or ["ALL"] as default) or skills (a list choosing from ["Data structures", "Sorting", "Range queries", "Complete search", "Amortized analysis", "Dynamic programming", "Bit manipulation", "Greedy algorithms"] or ["ALL"] as default) by passing the list of difficulties or skills as a list

Statistics of TACO

The Distribution of Algorithm Tags in TACO is

The Distribution of Programming Skills in TACO is

Evaluation with TACO

First, you should initialize model, tokenizer as well as the difficulties or skills to use TACO.

Then, run generations with code models.

generation.py gives a complete example of generate TACO result samples with CodeLlama, which outputs a JSON format file generation.json.

Finally, execute the generated codes and compute metrics. compute_metric.py gives a complete example of code execution and pass@k computation with generation.json from last step.

The result file taco_metrics.json is like

Finetuning with TACO

First, you should tokenize the training set of TACO. We provide a python script pretokenizing.py and an example shell script pretokenize.sh to help you. This step would output a pretokenized training data in cache_dir with the name of dataset_name. Below is an example to tokenize with CodeLlama-7b.

Then, finetune with the pretokenized training data. We provide a python script train.py and an example shell script finetune.sh to help you. This step would output the checkpoints in output_dir. Below is an example to finetuning CodeLlama-7b.

Evaluation Results

We conducted experiments using the TACO test set and training set on GPT-4 and a code generation model trained on a large amount of code data. The results show:

The TACO test set is highly challenging, with GPT-4 achieving a pass@1 score of only 31.5 at the easy level. Except for GPT-4, the pass@1 scores of various code models across five difficulty levels are generally below 10. Even the pass@100 scores are not as high as GPT-4's pass@1; Utilizing the TACO training set with fine-grained labels can selectively enhance the performance of code generation models. For instance, after fine-tuning starcoder-1b on specific skills using the TACO training set, there is a noticeable improvement in performance

Citation

If you use the models, data, or code from this project, please cite the original paper:

License

The TACO dataset that is authored by BAAI, Shandong Normal University and Peking University is released under an Apache 2.0 License. However, the data also includes content licensed under other permissive licenses such as MIT License, or web-crawled data which is used under the terms of the CC BY 4.0 license(Creative Commons Attribution 4.0 International license).

We gratefully acknowledge the contributions of the following:

来源

智源 FlagOpen:原创开源项目