{"id":22814804,"url":"https://github.com/seonglae/emgsd-hermes","last_synced_at":"2026-02-19T14:32:24.500Z","repository":{"id":264397965,"uuid":"893017248","full_name":"seonglae/emgsd-hermes","owner":"seonglae","description":"Steering GPT2-EMGSD less biased \u0026 Generating stereotyped text with vanilla GPT2 without fine tuning or prompt engineering","archived":false,"fork":false,"pushed_at":"2025-03-17T15:37:16.000Z","size":517,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-14T17:28:49.671Z","etag":null,"topics":["bias-correction","bias-mitigation","emgsd","gpt2","sparse-autoencoder","steering-vector","stereotype"],"latest_commit_sha":null,"homepage":"https://www.canva.com/design/DAGXTdRh__E/MfKS_-4Px4iXNyCT89Sh5g/edit","language":"Jupyter Notebook","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/seonglae.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},"funding":{"github":["seonglae"],"custom":["https://paypal.me/seonglae","https://www.buymeacoffee.com/seongland"]}},"created_at":"2024-11-23T10:10:36.000Z","updated_at":"2025-03-17T15:37:20.000Z","dependencies_parsed_at":"2024-12-12T13:10:51.420Z","dependency_job_id":"12c0e23e-35f5-469b-a5db-779b86d837ec","html_url":"https://github.com/seonglae/emgsd-hermes","commit_stats":null,"previous_names":["seonglae/emgsd-hermes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/seonglae/emgsd-hermes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonglae%2Femgsd-hermes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonglae%2Femgsd-hermes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonglae%2Femgsd-hermes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonglae%2Femgsd-hermes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seonglae","download_url":"https://codeload.github.com/seonglae/emgsd-hermes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonglae%2Femgsd-hermes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29618330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bias-correction","bias-mitigation","emgsd","gpt2","sparse-autoencoder","steering-vector","stereotype"],"created_at":"2024-12-12T13:10:41.600Z","updated_at":"2026-02-19T14:32:24.482Z","avatar_url":"https://github.com/seonglae.png","language":"Jupyter Notebook","funding_links":["https://github.com/sponsors/seonglae","https://paypal.me/seonglae","https://www.buymeacoffee.com/seongland"],"categories":[],"sub_categories":[],"readme":"# EMGSD Hermes\nThis project explores bias mitigation in GPT2-EMGSD, leveraging correlation analysis for stereotype deduction and activation manipulation, highlighting the potential of an alternative to traditional fine-tuning. Additionally, it demonstrates the feasibility of inducing bias in vanilla GPT2 through activation engineering.\n\n\u003cimg width=\"750\" alt=\"image\" src=\"image/emgsd.png\"\u003e\n\n## Fast Demo\n```bash\n# Install python 3.10 which is required by SAE-Lens\n⁠⁠⁠git clone ⁠ https://github.com/seonglae/emgsd-hermes \u0026\u0026 cd emgsd-hermes\np⁠ip install torch colorama sae-lens transformers\npython compare.py\n```\n\n## Main Pipeline\nTBA\n### 1. Fine-tuning SAE with EMGSD dataset \n```bash\npython empsd.py\n```\n### 2. Extract features using correlation\n```bash\npython search_category.py\npython search_stereo.py\n# replace emgsd/*.json files\npython draw_corr.py\n```\n\u003cimg width=\"750\" alt=\"image\" src=\"image/stereotype_corr.png\"\u003e\n\nor if you want to calculate mutual information\n```\npython mi_stereo.py\n```\n\n### 3. Compute ratio of stereotyped text in generation\n```bash\npython compare_all.py\n```\n\n\n\u003cimg width=\"750\" alt=\"image\" src=\"image/stereotype_ratios_per_stereotype.png\"\u003e\n\u003cimg width=\"500\" alt=\"image\" src=\"image/overall_stereotype_ratios_table.png\"\u003e\n\n\n\n## Loss Graph of fine-tuning SAE\n\u003cimg width=\"1000\" alt=\"image\" src=\"https://github.com/user-attachments/assets/20ba51ae-7f58-4f11-af5c-5a9eaa2cd0da\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseonglae%2Femgsd-hermes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseonglae%2Femgsd-hermes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseonglae%2Femgsd-hermes/lists"}