[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-112519":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":14,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":26,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":30,"discoverSource":31},112519,"deleting-weights","agentic-learning-ai-lab\u002Fdeleting-weights","agentic-learning-ai-lab","Public code release for the paper \"The Surprising Effectiveness of Deleting Weights in LLM Post-Training\"","https:\u002F\u002Fagenticlearning.ai\u002Fdeleting-weights\u002F",null,"Python",134,12,1,2,0,22,72,10,63.54,"MIT License",false,"main",true,[],"2026-11-10 16:19:13","2026-11-23 16:51:36","\u003Ch1 align=\"center\">The Surprising Effectiveness of Deleting Weights in LLM Post-Training\u003C\u002Fh1>\n\n\u003Ch3 align=\"center\">NeurIPS 2026\u003C\u002Fh3>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fjacklu-me.com\u002F\">Jack Lu\u003C\u002Fa>\u003Csup>1*\u003C\u002Fsup>,\n  \u003Ca href=\"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fzhenbang-yang-625b6a2a4\u002F\">Zhenbang Yang\u003C\u002Fa>\u003Csup>1*\u003C\u002Fsup>,\n  \u003Ca href=\"https:\u002F\u002Fscholar.google.com\u002Fcitations?user=4odTWZMAAAAJ\">Mike Lasby\u003C\u002Fa>\u003Csup>2\u003C\u002Fsup>,\n  \u003Ca href=\"https:\u002F\u002Ftejaspote.github.io\u002F\">Tejas Pote\u003C\u002Fa>\u003Csup>2\u003C\u002Fsup>,\n  \u003Ca href=\"https:\u002F\u002Fyani.ai\u002F\">Yani Ioannou\u003C\u002Fa>\u003Csup>2\u003C\u002Fsup>,\n  \u003Ca href=\"https:\u002F\u002Fmengyeren.com\u002F\">Mengye Ren\u003C\u002Fa>\u003Csup>1\u003C\u002Fsup>\u003Cbr>\n  \u003Csup>1\u003C\u002Fsup>New York University, \u003Csup>2\u003C\u002Fsup>University of Calgary, \u003Csup>*\u003C\u002Fsup>Equal contribution\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.10866\">\u003Cimg alt=\"arXiv\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-2611.10866-b31b1b?logo=arxiv\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fagenticlearning.ai\u002Fdeleting-weights\u002F\">\u003Cimg alt=\"Project Page\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FProject-Page-blue\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fcdn.agenticlearning.ai\u002Fdfb9bf24cee86b6d\u002Fneurips2026-poster-deleting-weights.pdf\">\u003Cimg alt=\"Poster\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPoster-PDF-orange\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002FJacklu0831\u002Fdeletion-tuning-masks\">\u003Cimg alt=\"Masks\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FHF-Masks-yellow?logo=huggingface\">\u003C\u002Fa>\n  \u003Ca href=\"LICENSE\">\u003Cimg alt=\"License\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green\">\u003C\u002Fa>\n\u003C\u002Fp>\n\nOfficial code for Deletion Tuning, a post-training method that learns which pretrained weights of an LLM to delete.\n\n![Deletion Tuning](assets\u002Fmethod.gif)\n\n---\n\n## Overview\n\nHow little of a pretrained large language model (LLM) has to change for it to acquire new capabilities? We find that zeroing fewer than 0.05% of its weights, with no other modification, matches full fine-tuning (FFT) at scale across three LLM post-training regimes: reinforcement learning with verifiable rewards, supervised fine-tuning, and on-policy distillation. Our method, Deletion Tuning, learns a binary mask over the gate projection of transformer blocks. Two practical advantages follow: the trained mask is hundreds to thousands of times smaller than the corresponding FFT checkpoint, and Deletion Tuning forgets far less, which addresses a central challenge in continual learning. Under reinforcement learning, its prior-task accuracy stays near the base level while FFT, LoRA, and random sparse fine-tuning lose up to 5.4 points. To understand why masking alone suffices, we analyze the geometry of the learned weight changes under reinforcement learning using stable rank, spectrum drift, and principal-weight overlap. Compared with LoRA and random sparse fine-tuning, Deletion Tuning is closest to FFT across the three measures.\n\nThis repository trains Deletion Tuning with GRPO, SFT, and on-policy self-distillation (SDFT), saves each mask as a compressed bitmap, applies masks to base models, and evaluates them on the paper's benchmarks.\n\n## Setup\n\nThe three training regimes use separate environments, each created with [uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F); activate the matching one before each section's commands.\n\n**GRPO**:\n\n```bash\nuv venv envs\u002Fgrpo --python 3.10 && source envs\u002Fgrpo\u002Fbin\u002Factivate\nuv pip install torch==2.8.0 torchvision==0.23.0 torchaudio==2.8.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu126\nuv pip install https:\u002F\u002Fgithub.com\u002FDao-AILab\u002Fflash-attention\u002Freleases\u002Fdownload\u002Fv2.8.3\u002Fflash_attn-2.8.3+cu12torch2.8cxx11abiTRUE-cp310-cp310-linux_x86_64.whl\nuv pip install vllm==0.11.0\nuv pip install -r requirements_grpo.txt\nuv pip install -e \".\u002Fverl[gpu,vllm,math]\"\n```\n\n**SFT**:\n\n```bash\nuv venv envs\u002Fsft --python 3.10 && source envs\u002Fsft\u002Fbin\u002Factivate\nuv pip install torch==2.7.1 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu126\nuv pip install -r requirements_sft.txt\n```\n\n**SDFT**:\n\n```bash\nuv venv envs\u002Fsdft --python 3.12 && source envs\u002Fsdft\u002Fbin\u002Factivate\nuv pip install -r requirements_sdft.txt\nbash sdft\u002Fsetup.sh\n```\n\n## GRPO\n\nBuild the GSM8K and SimpleRL-Zoo parquets under `data\u002F`:\n\n```bash\nbash scripts\u002Fprepare_grpo_data.sh\n```\n\nTrain one model with the paper's settings (`scripts\u002Ftrain_grpo.sh \u003Cmodel> \u003Coutput_dir>`):\n\n```bash\nbash scripts\u002Ftrain_grpo.sh llama1b outputs\u002Fgrpo\u002Fllama1b\n```\n\n| Model | Dataset |\n| --- | --- |\n| `llama1b` (Llama-3.2-1B-Instruct) | GSM8K |\n| `llama3b` (Llama-3.2-3B-Instruct) | GSM8K |\n| `llama8b` (Meta-Llama-3-8B-Instruct) | GSM8K |\n| `qwen0.5b` (Qwen2.5-0.5B) | SimpleRL-Zoo |\n| `qwen3b` (Qwen2.5-3B) | SimpleRL-Zoo |\n| `qwen7b` (Qwen2.5-7B) | SimpleRL-Zoo |\n| `qwen14b` (Qwen2.5-14B) | SimpleRL-Zoo |\n| `qwen30b_a3b` (Qwen3-30B-A3B-Base, MoE) | SimpleRL-Zoo |\n\nThe shared settings are in `verl\u002Fverl\u002Ftrainer\u002Fconfig\u002Fgsm8k.yaml` and `simplerl_zoo.yaml`, and the per-model ones in `scripts\u002Ftrain_grpo.sh`. To change one, add it after the output directory, for example `actor_rollout_ref.actor.optim.lr=1e-4`.\n\nMasks are saved under `\u003Coutput_dir>\u002Fglobal_step_\u003CN>\u002Fmask\u002F`, and metrics are logged to `\u003Coutput_dir>\u002Fmetrics.jsonl` and Weights & Biases (run `wandb login` first, or `export WANDB_MODE=offline`). For convenience, this utility prints a run's best validation result (GSM8K accuracy for Llama, the mean over the six SimpleRL-Zoo benchmarks for Qwen):\n\n```bash\npython src\u002Fsummarize_grpo.py outputs\u002Fgrpo\u002Fllama1b\n```\n\nEvaluate a mask on the same benchmarks with vLLM (`base` instead of a mask directory evaluates the base model):\n\n```bash\nbash scripts\u002Fevaluate_grpo.sh llama1b outputs\u002Fgrpo\u002Fllama1b\u002Fglobal_step_125\u002Fmask outputs\u002Feval\u002Fllama1b\n```\n\n## SFT\n\nDeletion Tuning with supervised fine-tuning learns one mask per task on MMLU-Pro (14 categories, loaded from `TIGER-Lab\u002FMMLU-Pro`) and BBEH (23 tasks). Get BBEH first:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Fbbeh data\u002Fbbeh\ngit -C data\u002Fbbeh checkout 80d12ca916b7158f22293fcf3144f4d3d854d4be\n```\n\nThen train one mask per task (`scripts\u002Ftrain_sft.sh \u003Cmmlu_pro|bbeh> \u003Cllama1b|llama3b> \u003Coutput_dir>`); the masks are saved to `\u003Coutput_dir>\u002Fmasks\u002F\u003Ctask>\u002F`:\n\n```bash\nbash scripts\u002Ftrain_sft.sh mmlu_pro llama1b outputs\u002Fsft\u002Fmmlu_pro_llama1b\n```\n\nEvaluate them on each task's test split:\n\n```bash\nbash scripts\u002Fevaluate_sft.sh mmlu_pro llama1b outputs\u002Fsft\u002Fmmlu_pro_llama1b\u002Fmasks outputs\u002Feval\u002Fmmlu_pro_llama1b\n```\n\n## SDFT\n\nDeletion Tuning also trains with on-policy self-distillation ([SDFT](https:\u002F\u002Farxiv.org\u002Fabs\u002F2601.19897)) of Qwen2.5-7B-Instruct on ToolAlpaca (`tooluse`) and Science (`science`). Masks are saved under `\u003Coutput_dir>\u002Fmask_step_\u003CN>\u002F` and, at the end, `\u003Coutput_dir>\u002Fmask\u002F`:\n\n```bash\nbash scripts\u002Ftrain_sdft.sh tooluse outputs\u002Fsdft\u002Ftooluse\nbash scripts\u002Ftrain_sdft.sh science outputs\u002Fsdft\u002Fscience\n```\n\nEach evaluation command prints the test accuracy of a saved mask, and `base` evaluates Qwen2.5-7B-Instruct itself:\n\n```bash\nbash scripts\u002Fevaluate_sdft.sh tooluse outputs\u002Fsdft\u002Ftooluse\u002Fmask_step_200 outputs\u002Feval\u002Fsdft_tooluse\nbash scripts\u002Fevaluate_sdft.sh science outputs\u002Fsdft\u002Fscience\u002Fmask outputs\u002Feval\u002Fsdft_science\nbash scripts\u002Fevaluate_sdft.sh tooluse base outputs\u002Feval\u002Fsdft_tooluse_base\n```\n\n## Full Fine-Tuning Baseline\n\nWith `METHOD=fft`, each training command trains the full fine-tuning baseline instead, and the matching evaluation command takes its saved models in place of masks:\n\n```bash\nMETHOD=fft bash scripts\u002Ftrain_grpo.sh llama1b outputs\u002Fgrpo\u002Fllama1b_fft\nbash scripts\u002Fevaluate_grpo.sh llama1b outputs\u002Fgrpo\u002Fllama1b_fft\u002Fglobal_step_125\u002Factor\u002Fhuggingface outputs\u002Feval\u002Fllama1b_fft\n```\n\n## Forgetting\n\nThis measures how much a Llama GSM8K Deletion Tuning run forgets over training: forward KL from the base model, and mean accuracy on six prior-task benchmarks (HellaSwag, TruthfulQA, MMLU, IFEval, WinoGrande, HumanEval) for the base model and the run's masks, in the GRPO environment:\n\n```bash\nbash scripts\u002Fretention.sh llama1b outputs\u002Fgrpo\u002Fllama1b outputs\u002Fretention\u002Fllama1b\n```\n\n## Released Masks\n\nWe release our trained masks for the paper's main results on [Hugging Face](https:\u002F\u002Fhuggingface.co\u002FJacklu0831\u002Fdeletion-tuning-masks), one folder per experiment (for example `grpo\u002Fqwen2.5-7b-simplerl-zoo`, `sft\u002Fllama-3.2-1b-instruct-mmlu-pro` with one mask per category, and `sdft\u002Fqwen2.5-7b-instruct-toolalpaca`). Download one and evaluate it like a mask you trained:\n\n```bash\nhf download Jacklu0831\u002Fdeletion-tuning-masks --include \"grpo\u002Fqwen2.5-7b-simplerl-zoo\u002F*\" --local-dir masks\nbash scripts\u002Fevaluate_grpo.sh qwen7b masks\u002Fgrpo\u002Fqwen2.5-7b-simplerl-zoo outputs\u002Feval\u002Fqwen7b\n```\n\nApplying a mask to its base model sets the deleted weights to zero and saves a standard model that loads in Transformers or vLLM:\n\n```bash\npython src\u002Fapply_mask.py --base_model Qwen\u002FQwen2.5-7B --mask_dir masks\u002Fgrpo\u002Fqwen2.5-7b-simplerl-zoo \\\n    --output_dir outputs\u002Fmasked\u002Fqwen7b\n```\n\n## Repository Layout\n\n| Path | Contents |\n| --- | --- |\n| `scripts\u002F` | Commands with the paper's settings: prepare, train, evaluate, retention |\n| `src\u002Fverl_adapters.py` | Deletion Tuning inside verl: mask setup, regularizer, rollout weights, mask saving |\n| `src\u002Flearnable_sparsity\u002F` | Masked linear layer and its learnable mask |\n| `src\u002Fwanda_calibration.py` | Wanda scores and the mask initialization |\n| `src\u002Fapply_mask.py` | Load a saved mask and apply it to a base model |\n| `src\u002Ftrain_sft.py`, `src\u002Fsft_data.py`, `src\u002Fbbeh_*.py` | SFT training, data, and BBEH scoring |\n| `src\u002Fevaluate_*.py`, `src\u002Feval_grpo_common.py` | Evaluation of GRPO and SFT masks and models |\n| `src\u002Fretention_*.py` | Prior-task accuracy and forward KL |\n| `src\u002Fprepare_*.py`, `src\u002Fsummarize_grpo.py` | GRPO data preparation and run summary |\n| `sdft\u002F` | SDFT training and evaluation, on top of [Self-Distillation](https:\u002F\u002Fgithub.com\u002Fidanshen\u002FSelf-Distillation) |\n| `verl\u002F` | [verl](https:\u002F\u002Fgithub.com\u002Fverl-project\u002Fverl) at commit `d4880cf`, with Deletion Tuning added |\n\n## Roadmap\n\n- [x] GRPO training and evaluation (verl; Llama 3.x on GSM8K, Qwen2.5 on SimpleRL-Zoo)\n- [x] MoE (Qwen3-30B-A3B)\n- [x] FFT baselines\n- [x] SFT training and evaluation (MMLU-Pro, BBEH)\n- [x] SDFT training and evaluation (ToolAlpaca, Science)\n- [x] Trained masks uploaded to Hugging Face\n- [x] Forgetting analysis\n- [ ] LoRA and MTH baselines\n- [ ] Geometric analysis\n\n## Citation\n\nIf you have any questions or find any bugs, please feel free to contact Jack Lu (yl11330@nyu.edu). If you found our work helpful, please consider giving us a ⭐ and citing us!\n\n```bibtex\n@inproceedings{lu2026deleting,\n  title     = {The Surprising Effectiveness of Deleting Weights in {LLM} Post-Training},\n  author    = {Lu, Jack and Yang, Zhenbang and Lasby, Mike and Pote, Tejas and Ioannou, Yani and Ren, Mengye},\n  booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},\n  year      = {2026}\n}\n```\n","这是一个实现论文《The Surprising Effectiveness of Deleting Weights in LLM Post-Training》中提出的Deletion Tuning方法的开源项目，旨在通过学习二值化掩码、仅删除（置零）极少量预训练权重（\u003C0.05%）来完成大语言模型后训练。核心特点是：仅优化gate投影层的稀疏二值掩码，不引入新增参数；生成的掩码体积比全量微调检查点小数百至数千倍；在强化学习、监督微调和自蒸馏三种范式下均能媲美全量微调效果，且显著缓解灾难性遗忘。适用于资源受限场景下的高效模型适配、持续学习与轻量级模型定制。","2026-11-24 04:43:41","CREATED_QUERY"]