{"id":18852795,"url":"https://github.com/tech-srl/layer_norm_expressivity_role","last_synced_at":"2025-04-14T10:22:56.653Z","repository":{"id":161422720,"uuid":"635751847","full_name":"tech-srl/layer_norm_expressivity_role","owner":"tech-srl","description":"Code for the paper \"On the Expressivity Role of LayerNorm in Transformers' Attention\" (Findings of ACL'2023)","archived":false,"fork":false,"pushed_at":"2024-09-27T12:14:53.000Z","size":766,"stargazers_count":46,"open_issues_count":1,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-11T23:47:51.987Z","etag":null,"topics":["attention","layer-normalization","layernorm","transformers"],"latest_commit_sha":null,"homepage":"","language":"Python","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/tech-srl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-03T11:37:03.000Z","updated_at":"2025-03-19T05:02:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"10eabb00-6195-4444-b6c3-dec94fff95a1","html_url":"https://github.com/tech-srl/layer_norm_expressivity_role","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/tech-srl%2Flayer_norm_expressivity_role","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tech-srl%2Flayer_norm_expressivity_role/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tech-srl%2Flayer_norm_expressivity_role/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tech-srl%2Flayer_norm_expressivity_role/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tech-srl","download_url":"https://codeload.github.com/tech-srl/layer_norm_expressivity_role/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860296,"owners_count":21173398,"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":["attention","layer-normalization","layernorm","transformers"],"created_at":"2024-11-08T03:41:34.553Z","updated_at":"2025-04-14T10:22:56.643Z","avatar_url":"https://github.com/tech-srl.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# On the Expressivity Role of LayerNorm in Transformers' Attention\n\nThis repository contains the code for reproduce the results from \"On the Expressivity Role of LayerNorm in Transformers' Attention\" (Findings of ACL'2023) [[PDF]](https://arxiv.org/pdf/2305.02582.pdf).\n\n![alt text](images/figure1.png \"Figure 1 from the paper\")\n\n## Setup\n\nMake sure you have [wandb.ai](wandb.ai) user and that you are [logged](https://docs.wandb.ai/ref/cli/wandb-login) into your machine.\n\nInstall the required python packages:\n```\npip install -r requirements.txt \n```\n\nGurobi is needed to find unselectable keys, and requires a license. See in [here](https://www.gurobi.com/academia/academic-program-and-licenses/).\n\n## Hardware\nIn general, all experiments can run on either GPU or CPU. \n\n## Code Structure\n\n1. The `majority` subdirectory contains the files needed to reproduce the results of the Majority task (Figure 1a, 1b, 2, 3).\n2. The `unselectable` subdirectory contains the files needed to reproduce the results of the unselectable experiments (Figure 1c, 1d, 4, Table 1, 2).\n\n## Citation\n[On the Expressivity Role of LayerNorm in Transformers' Attention](https://arxiv.org/pdf/2305.02582.pdf)\n```\n@article{brody2023expressivity,\n  title={On the Expressivity Role of LayerNorm in Transformers' Attention},\n  author={Brody, Shaked and Alon, Uri and Yahav, Eran},\n  journal={arXiv preprint arXiv:2305.02582},\n  year={2023}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftech-srl%2Flayer_norm_expressivity_role","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftech-srl%2Flayer_norm_expressivity_role","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftech-srl%2Flayer_norm_expressivity_role/lists"}