New Tool Generates Contamination-Resistant, Labeled Code Datasets for LLMs

Yuxiang Ji· July 22, 2026 View original

Summary

Spaghetti Architect is a new open-source tool that generates controlled, multi-language code datasets, addressing issues of contamination and lack of semantic control in existing code corpora. It creates correct-by-construction programs with adjustable "messiness" and difficulty labels, making it ideal for training and evaluating code-generating LLMs.

Researchers have developed "Spaghetti Architect," an open-source tool designed to create high-quality, controlled code datasets for training and evaluating large language models. Unlike existing code corpora, which often suffer from contamination (data already seen by models) and a lack of precise semantic or difficulty labels, Spaghetti Architect generates programs from a clean, language-agnostic intermediate representation. The tool transpiles this representation into deliberately redundant and "messy" code in five different programming languages, ensuring each generated program is correct by construction through compilation and oracle checks. It also provides fine-grained control over code complexity and readability, labeling instances along intrinsic and incidental difficulty axes. This controlled generation process helps resist data contamination and provides a reliable benchmark for assessing model performance.

Why it matters

This tool provides a critical resource for AI researchers and engineers to develop and rigorously test code-generating LLMs with clean, controlled, and diverse datasets, overcoming limitations of existing public corpora.

How to implement this in your domain

  1. 1Download and experiment with Spaghetti Architect to generate custom code datasets for specific LLM training needs.
  2. 2Integrate generated datasets into existing LLM evaluation pipelines to benchmark model performance on controlled tasks.
  3. 3Utilize the tool's "messiness" and difficulty controls to create targeted challenges for code generation and refactoring models.
  4. 4Contribute to the open-source project to expand language support or add new anti-pattern profiles.

Who benefits

Software DevelopmentAI ResearchEdTechCybersecurityAutomotive

Key takeaways

  • Spaghetti Architect generates controlled, multi-language code datasets for LLM training and evaluation.
  • It addresses data contamination and provides precise semantic and difficulty labels.
  • The tool creates correct-by-construction programs with adjustable "messiness" and complexity.
  • It is an open-source, dependency-free resource for improving code-generating AI.

Original post by Yuxiang Ji

"arXiv:2607.18642v1 Announce Type: new Abstract: Mined code corpora are abundant but uncontrolled: a snippet's semantics, surface "messiness," and difficulty are whatever the wild contained; there is no known-optimal reference to grade against; and any public sample may already si…"

View on X

Originally posted by Yuxiang Ji on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses