{"id":20216284,"url":"https://github.com/thudm/efficient-head-finetuning","last_synced_at":"2025-10-28T08:03:43.567Z","repository":{"id":62815638,"uuid":"555369503","full_name":"THUDM/Efficient-Head-Finetuning","owner":"THUDM","description":"Source code for EMNLP2022 long paper: Parameter-Efficient Tuning Makes a Good Classification Head","archived":false,"fork":false,"pushed_at":"2022-11-07T05:54:42.000Z","size":2198,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-24T13:11:16.240Z","etag":null,"topics":["finetuning","language-model"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/THUDM.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}},"created_at":"2022-10-21T12:52:24.000Z","updated_at":"2024-12-14T11:33:05.000Z","dependencies_parsed_at":"2022-11-07T06:45:30.037Z","dependency_job_id":null,"html_url":"https://github.com/THUDM/Efficient-Head-Finetuning","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUDM%2FEfficient-Head-Finetuning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUDM%2FEfficient-Head-Finetuning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUDM%2FEfficient-Head-Finetuning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUDM%2FEfficient-Head-Finetuning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/THUDM","download_url":"https://codeload.github.com/THUDM/Efficient-Head-Finetuning/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248243206,"owners_count":21071054,"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":["finetuning","language-model"],"created_at":"2024-11-14T06:27:14.656Z","updated_at":"2025-10-28T08:03:43.492Z","avatar_url":"https://github.com/THUDM.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Parameter-Efficient-Tuning-Makes-a-Good-Classification-Head\n\nSource code for EMNLP2022 long paper: Parameter-Efficient Tuning Makes a Good Classification Head\n\n[arxiv](https://arxiv.org/abs/2210.16771)\n\nWe found that \n\u003e 1. Finetune the pretrained LM with a parameter-efficient algorithm.\n\u003e 2. Finetune the pretrained LM with initializing the classification head as the weight from 1.\n\nusually better than direct finetuning.\n\n**We implement our methods base on a open source libary [SwissArmyTransformers](https://github.com/THUDM/SwissArmyTransformer).**\n\n**Step 1.** \n\nDownload checkpoint of [RoBERTa-Large](https://cloud.tsinghua.edu.cn/f/66c42c24ca304cecaf7e/?dl=1) or [BERT-Large](https://cloud.tsinghua.edu.cn/f/6d4f38c96e8c4c16917e/?dl=1) (Provided by SwissArmyTransformer) and decompress.\n\n**Step 2.**\n\n\nAdd checkpoint dir path to line 5 in EH-FT/roberta/scripts/finetune.sh\n\n **Step3.**\n```\ncd EH-FT/roberta\npython scripts/run_multiseed.py --number-gpu 1 --gpu-s 0 --seed-per-gpu 1 --dataset rte --finetune-type 2step+bitfit\n```\n\n **Step4.**\n```\ncd EH-FT/roberta\npython scripts/run_multiseed.py --number-gpu 1 --gpu-s 0 --seed-per-gpu 1 --dataset rte --finetune-type 2step+bitfit\n```\nThe script will launch [number-gpu] processes with gpu [gpu-s], gpu [gpu-s+1], ..., gpu [gpu-s + number-gpu - 1]. Each process has a different random seed. \n\n**You can change dataset and finetune-type.**\n\n\nDataset: rte, mrpc, boolq, wic, cb, copa, wsc, qnli, stsb\n\n| Finetune-type | name in paper             |\n| ------------- | ------------------------- |\n| all           | traditional finetuning    |\n| 2step+head    | LP-FT                     |\n| 2step+bitfit  | EH-FT(BitFit)             |\n| 2step+lora    | EH-FT(LoRA)               |\n| 2step+pt      | EH-FT(PT)                 |\n| bitft/lora/pt | BitFit/LoRA/Prefix tuning |\n| head          | Linear Probing            |\n| child         | child-tuning              |\n| mixout        | Mixout                    |\n\n**Step4.**\n\nSee results in runs/ using tensorboard.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthudm%2Fefficient-head-finetuning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthudm%2Fefficient-head-finetuning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthudm%2Fefficient-head-finetuning/lists"}