TACO: Topics in Algorithmic COde generation dataset

Rongao Li, Jie Fu, Bo-Wen Zhang, Tao Huang, Zhihong Sun, Chen Lyu, Guang Liu, Zhi Jin, Ge LiarXiv 2023 · DOI

Abstract

Large Language Models (LLMs) have demonstrated remarkable proficiency in basic code generation, yet they frequently falter when confronted with complex algorithmic reasoning. We introduce TACO (Topics in Algorithmic COde generation), a comprehensive open-source dataset featuring over 26,000 programming problems. By implementing a multi-stage pipeline for data harvesting, rigorous cleaning, and test case augmentation, TACO provides a high-quality benchmark that moves beyond simple syntax completion. With fine-grained labels across 36 algorithmic topics and a focus on reducing false positives through extensive test suites, TACO offers a more accurate measure of an LLM's true competitive programming capabilities.

Introduction: The Algorithmic Reasoning Gap

While current LLMs achieve high scores on benchmarks like HumanEval and MBPP, these metrics often focus on basic function completion tasks that are largely considered "solved." In contrast, real-world competitive programming—such as "Hard" problems on platforms like LeetCode—remains a significant challenge, with even state-of-the-art models like GPT-4 seeing performance drops to approximately 7%.

Existing datasets like APPS and CodeContests were designed to address this gap but suffer from "quality debt," including duplicate problems, missing manual solutions, and insufficient test cases. A lack of robust testing leads to "false positives," where incorrect code passes a limited set of tests by chance, artificially inflating model performance metrics. TACO aims to rectify these issues by providing a larger, cleaner, and more rigorously verified dataset.

Methodology: Scale, Diversity, and Verification

The construction of TACO involved a four-stage pipeline designed to ensure the dataset's utility for training and evaluation:

  1. Data Harvesting: Problems were aggregated from major competitive platforms, including CodeChef, CodeForces, HackerRank, and GeeksforGeeks, with a specific focus on Python 3 solutions.
  2. Rigorous Cleaning: To eliminate redundancy, the authors employed the MinHash algorithm and Jaccard similarity to merge near-duplicate problems. Abstract Syntax Tree (AST) parsing was used to strip comments and whitespace, ensuring high-quality training data.
  3. Test Case Augmentation: To combat the false positive trap, GPT-4 was utilized to generate new test inputs, which were then validated against verified solutions. Every problem in the test set now includes at least 200 unit tests, reducing the false positive rate from an estimated 60% in older datasets to roughly 4%.
  4. Fine-Grained Taxonomy: The authors mapped 968 raw tags into a clean hierarchy of 36 algorithmic categories (e.g., Dynamic Programming, Graph Theory) and 8 foundational skills.

Dataset Composition and Taxonomy

TACO consists of 25,433 training problems and 1,000 test problems, supported by 1.55 million diverse solutions. This makes it significantly larger than legacy datasets like APPS (10,000 problems).

Figure 5: Dataset composition of TACO, showing the integration of new crawled data with existing benchmarks.

As shown in the composition analysis, TACO is not merely a collection of existing data; nearly 30% of the dataset consists of newly crawled problems, while the remainder from APPS and CodeContests has been re-processed and re-labeled to meet higher quality standards.

Figure 6: Distribution of algorithmic tags across the TACO dataset, highlighting the focus on Mathematics and Data Structures.

The distribution of tags within TACO reveals a heavy emphasis on Mathematics, Data Structures, and Implementation. This diversity allows researchers to pinpoint exactly where a model's reasoning fails, treating algorithms as the "basic alphabet" of programming.

Key Insights and Results

Evaluation on TACO reveals a sobering "difficulty gap" for current AI models:

  • The False Positive Trap: By increasing the number of test cases to over 200 per problem, TACO provides a much more "honest" benchmark. Models that appeared successful on older, sparsely-tested datasets often fail when subjected to TACO's rigorous verification.
  • Model Performance: GPT-4 remains the leader but struggles significantly as difficulty increases, dropping from a 31.5% pass@1 on "Easy" tasks to a mere 2.0% on "Very Hard" tasks. Open-source models like CodeLlama-7b and StarCoder-15b generally stay below 12% even on the simplest problems.
  • Specialization via LoRA: Research using TACO found that fine-tuning models on specific skills (e.g., Sorting) using Low-Rank Adaptation (LoRA) often yielded better results for those tasks than general fine-tuning. This suggests that developing "algorithmic experts" may be a more viable path toward complex code generation than relying solely on generalist models.

Conclusion and Future Work

TACO represents a significant step forward in the evaluation of algorithmic code generation. By providing a clean, large-scale dataset with rigorous testing and fine-grained labels, it enables a deeper understanding of LLM reasoning capabilities. Future work will look toward expanding TACO to include languages like C++ and Rust, as well as utilizing its detailed taxonomy to provide targeted guidance during the model training process.

Summary updated

BibTeX
@misc{li2023taco,
  author = {Rongao Li and Jie Fu and Bo-Wen Zhang and Tao Huang and Zhihong Sun and Chen Lyu and Guang Liu and Zhi Jin and Ge Li},
  title = {{TACO: Topics in Algorithmic COde generation dataset}},
  year = {2023},
  eprint = {2312.14852},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.14852},
}
Figure