{"id":30743722,"url":"https://github.com/open-compass/saga","last_synced_at":"2026-02-12T00:34:53.603Z","repository":{"id":303899760,"uuid":"1013634038","full_name":"open-compass/SAGA","owner":"open-compass","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-10T02:03:44.000Z","size":3349,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-10T11:17:30.905Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-compass.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-04T08:07:46.000Z","updated_at":"2025-07-10T07:41:32.000Z","dependencies_parsed_at":"2025-07-10T11:17:33.377Z","dependency_job_id":"364980ac-80e5-49e9-9ab5-a594eafd553d","html_url":"https://github.com/open-compass/SAGA","commit_stats":null,"previous_names":["open-compass/saga"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/open-compass/SAGA","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-compass%2FSAGA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-compass%2FSAGA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-compass%2FSAGA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-compass%2FSAGA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-compass","download_url":"https://codeload.github.com/open-compass/SAGA/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-compass%2FSAGA/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273543836,"owners_count":25124340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-04T02:48:39.699Z","updated_at":"2026-02-12T00:34:53.590Z","avatar_url":"https://github.com/open-compass.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# SAGA: Strategic Adversarial \u0026 Constraint-differential Generative workflow for Test Case Generation\n\n[![arXiv](https://img.shields.io/badge/arXiv-2507.06920-b31b1b.svg)](https://arxiv.org/abs/2507.06920)\n[![Hugging Face - CodeCompass](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-opencompass/CodeCompass-blue)](https://huggingface.co/datasets/opencompass/CodeCompass)\n[![Hugging Face - CodeForce_SAGA](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-opencompass/CodeForce_SAGA-orange)](https://huggingface.co/datasets/opencompass/CodeForce_SAGA)\n\nThis repository is the official implementation and supplementary material for the research paper, **\"Rethinking Verification for LLM Code Generation: From Generation to Testing.\"** This work is a proud contribution from the [OpenCompass](https://github.com/open-compass/opencompass) team to advance the robust evaluation of large language models.\n\n## 🚀 Introduction to SAGA\n\nCurrent benchmarks for evaluating Large Language Model code generation often rely on a limited or homogeneous set of test cases. This can lead to inflated performance metrics and hinder the development of truly robust and reliable models.\n\nTo address these critical shortcomings, we introduce **SAGA (Strategic Adversarial \u0026 Constraint-differential Generative workflow)**, a novel human-LLM collaborative framework for advanced Test Case Generation (TCG). SAGA systematically integrates deep human programming expertise with the reasoning capabilities of LLMs to produce high-quality, diverse, and discriminative test suites. It achieves this through a dual-pronged analytical approach:\n\n*   **Multidimensional Analysis:** Leveraging profound insights from correct human solutions to engineer challenging test scenarios.\n*   **Differential Analysis:** Identifying subtle error patterns by analyzing incorrect human submissions against their corrected versions.\n\nThe core mission of SAGA is to significantly enhance the verification of LLM-generated code by maximizing both individual test case potency and overall test suite diversity.\n\n## 🌟 Key Assets\n\nThis project provides several key assets to support full reproducibility and further research.\n\n### 📦 Datasets on Hugging Face\n\nWe release two major datasets built with the SAGA framework:\n\n#### 🔹 CodeCompass Benchmark\n- **URL:** [https://huggingface.co/datasets/opencompass/CodeCompass](https://huggingface.co/datasets/opencompass/CodeCompass)\n- A high-quality **evaluation benchmark** containing rigorous and diverse verifiers for all problems in TCGBench-Lite, designed for evaluating LLM code generation systems.\n\n#### 🔸 CodeForce_SAGA Training Set\n- **URL:** [https://huggingface.co/datasets/opencompass/CodeForce_SAGA](https://huggingface.co/datasets/opencompass/CodeForce_SAGA)\n- A large-scale **training dataset** constructed using the SAGA framework. It is built from competitive programming problems and enriched via SAGA to produce fine-grained test cases for training code intelligence models.\n\n### 📁 Local Assets in this Repository\n\n*   **TCGBench-Lite Problem Set:**\n    - Problem descriptions for the 270 problems used in our experiments.\n    - Located at: `data/tcgbenc_lite_problems.jsonl` (demo included)\n\n*   **SAGA Prompt Templates:**\n    - Prompt templates for both Multidimensional and Differential Analysis.\n    - Located at: `prompts/`\n\n*   **SAGA-Generated Test Case Demo:**\n    - A demo Python script showcasing a generated test case.\n    - Located at: `demos/parse.py`\n\n## 🛠️ Integration with OpenCompass (Coming Soon)\n\nThe **CodeCompass Benchmark** will soon be integrated into the [**OpenCompass**](https://github.com/open-compass/opencompass) evaluation ecosystem, enabling plug-and-play benchmarking of LLMs in code generation tasks.\n\n## 📚 Citation\n\nIf you find our work useful, please consider citing:\n\n```bibtex\n@inproceedings{\nma2025rethinking,\ntitle={Rethinking Verification for {LLM} Code Generation: From Generation to Testing},\nauthor={Zihan Ma and Taolin Zhang and Maosongcao and Junnan Liu and Wenwei Zhang and Minnan Luo and Songyang Zhang and Kai Chen},\nbooktitle={The Thirty-ninth Annual Conference on Neural Information Processing Systems},\nyear={2025},\nurl={https://openreview.net/forum?id=Gp2vgxWROE}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-compass%2Fsaga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-compass%2Fsaga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-compass%2Fsaga/lists"}