{"id":28653909,"url":"https://github.com/tiger-ai-lab/critiquefinetuning","last_synced_at":"2025-06-13T07:08:09.234Z","repository":{"id":274826160,"uuid":"924150022","full_name":"TIGER-AI-Lab/CritiqueFineTuning","owner":"TIGER-AI-Lab","description":"Code for \"Critique Fine-Tuning: Learning to Critique is More Effective than Learning to Imitate\"","archived":false,"fork":false,"pushed_at":"2025-06-04T22:38:01.000Z","size":39500,"stargazers_count":151,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-05T03:30:02.683Z","etag":null,"topics":["fine-tuning","languagemodel"],"latest_commit_sha":null,"homepage":"https://tiger-ai-lab.github.io/CritiqueFineTuning/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TIGER-AI-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-01-29T14:03:53.000Z","updated_at":"2025-06-04T22:38:04.000Z","dependencies_parsed_at":"2025-04-20T17:32:35.765Z","dependency_job_id":null,"html_url":"https://github.com/TIGER-AI-Lab/CritiqueFineTuning","commit_stats":null,"previous_names":["tiger-ai-lab/critiquefinetuning"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TIGER-AI-Lab/CritiqueFineTuning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FCritiqueFineTuning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FCritiqueFineTuning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FCritiqueFineTuning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FCritiqueFineTuning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TIGER-AI-Lab","download_url":"https://codeload.github.com/TIGER-AI-Lab/CritiqueFineTuning/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FCritiqueFineTuning/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259599330,"owners_count":22882357,"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","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":["fine-tuning","languagemodel"],"created_at":"2025-06-13T07:08:05.957Z","updated_at":"2025-06-13T07:08:09.218Z","avatar_url":"https://github.com/TIGER-AI-Lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CritiqueFineTuning\n\nThis repo contains the code for [Critique Fine-Tuning: Learning to Critique is More Effective than Learning to Imitate](https://arxiv.org/abs/2501.17703). In this paper, we introduce Critique Fine-Tuning (CFT) - a paradigm shift in LLM training where models learn to critique rather than imitate!  \n\n\u003ca target=\"_blank\" href=\"https://github.com/TIGER-AI-Lab/CritiqueFineTuning\"\u003e\n\u003cimg style=\"height:22pt\" src=\"https://img.shields.io/badge/-Code-black?style=flat\u0026logo=github\"\u003e\u003c/a\u003e\n\u003ca target=\"_blank\" href=\"https://arxiv.org/abs/2501.17703\"\u003e\n\u003cimg style=\"height:22pt\" src=\"https://img.shields.io/badge/-Paper-green?style=flat\u0026logo=arxiv\"\u003e\u003c/a\u003e\n\u003ca target=\"_blank\" href=\"https://tiger-ai-lab.github.io/CritiqueFineTuning\"\u003e\n\u003cimg style=\"height:22pt\" src=\"https://img.shields.io/badge/-🌐%20Website-red?style=flat\"\u003e\u003c/a\u003e\n\u003ca target=\"_blank\" href=\"https://huggingface.co/datasets/TIGER-Lab/WebInstruct-CFT\"\u003e\n\u003cimg style=\"height:22pt\" src=\"https://img.shields.io/badge/-🤗%20Dataset-red?style=flat\"\u003e\u003c/a\u003e\n\u003ca target=\"_blank\" href=\"https://huggingface.co/collections/TIGER-Lab/critiquefinetuning-679b25e1528e75180f55e5c4\"\u003e\n\u003cimg style=\"height:22pt\" src=\"https://img.shields.io/badge/-🤗%20Models-red?style=flat\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n\n## Highlights\nOur fine-tuning method can achieve on par results with RL training!\n\n\u003cimg width=\"1432\" alt=\"abs\" src=\"https://tiger-ai-lab.github.io/CritiqueFineTuning/static/images/teaser.png\"\u003e\n\n\n## News\n- **[2025/01/30]** ⚡️ The paper, code, data, and model for CritiqueFineTuning are all available online.\n\n## Getting Started\n\n### Installation\n\n1. First install LLaMA-Factory:\n```bash\ngit clone --depth 1 https://github.com/hiyouga/LLaMA-Factory.git\ncd LLaMA-Factory\npip install -e \".[torch,metrics]\"\n```\n\n2. Install additional requirements:\npip install -r requirements.txt\n\n### Training Steps\n\n1. First, clone the repository and download the dataset:\n```bash\ngit clone https://github.com/TIGER-AI-Lab/CritiqueFineTuning.git\ncd tools/scripts\nbash download_data.sh\n```\n\n2. Configure model paths in train/scripts/train_qwen2_5-math-7b-cft/qwen2.5-math-7b-cft-webinstruct-50k.yaml\n\n3. Start training:\n```bash\ncd ../../train/scripts/train_qwen2_5-math-7b-cft\nbash train.sh\n```\n\nFor training the 32B model, follow a similar process but refer to the configuration in train/scripts/train_qwen2_5-32b-instruct-cft/qwen2.5-32b-cft-webinstruct-4k.yaml.\n\nNote: In our paper experiments, we used MATH-500 as the validation set to select the final checkpoint. After training is complete, run the following commands to generate validation scores:\n```bash\ncd train/Validation\nbash start_validate.sh\n```\nThis will create a validation_summary.txt file containing MATH-500 scores for each checkpoint. Select the checkpoint with the highest score as your final model.\n\n## Evaluation\n\nFill in the model path and evaluation result save path in tools/scripts/evaluate.sh, then run:\n```bash\ncd tools/scripts\nbash evaluate.sh\n```\nHardware may have a slight impact on evaluation results based on our testing. To fully reproduce our results, we recommend testing on A6000 GPU with CUDA 12.4 and vllm==0.6.6. For more environment details, please refer to requirements.txt\n\n\nNote: Our evaluation code is modified from [Qwen2.5-Math](https://github.com/QwenLM/Qwen2.5-Math) and [MAmmoTH](https://github.com/TIGER-AI-Lab/MAmmoTH).\n\n## Construct Critique Data\n\nTo create your own critique data, you can use our data generation script:\n\n```bash\ncd tools/self_construct_critique_data\nbash run.sh\n```\nSimply modify the model_name parameter in run.sh to specify which model you want to use as the critique teacher. The script will generate critique data following our paper's approach.\n\n\n## Citation\n\nCite our paper as\n```\n@article{wang2025critique,\n  title={Critique fine-tuning: Learning to critique is more effective than learning to imitate},\n  author={Wang, Yubo and Yue, Xiang and Chen, Wenhu},\n  journal={arXiv preprint arXiv:2501.17703},\n  year={2025}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiger-ai-lab%2Fcritiquefinetuning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiger-ai-lab%2Fcritiquefinetuning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiger-ai-lab%2Fcritiquefinetuning/lists"}