{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/not-all-language-model-features-are-linear","title":"Not All Language Model Features Are Linear","arxiv_id":"2405.14860","date":"2024-05-23","proceeding":null,"authors":["Joshua Engels","Eric J. Michaud","Isaac Liao","Wes Gurnee","Max Tegmark"],"abstract":"Recent work has proposed that language models perform computation by manipulating one-dimensional representations of concepts (\"features\") in activation space. In contrast, we explore whether some language model representations may be inherently multi-dimensional. We begin by developing a rigorous definition of irreducible multi-dimensional features based on whether they can be decomposed into either independent or non-co-occurring lower-dimensional features. Motivated by these definitions, we design a scalable method that uses sparse autoencoders to automatically find multi-dimensional features in GPT-2 and Mistral 7B. These auto-discovered features include strikingly interpretable examples, e.g. circular features representing days of the week and months of the year. We identify tasks where these exact circles are used to solve computational problems involving modular arithmetic in days of the week and months of the year. Next, we provide evidence that these circular features are indeed the fundamental unit of computation in these tasks with intervention experiments on Mistral 7B and Llama 3 8B. Finally, we find further circular representations by breaking down the hidden states for these tasks into interpretable components, and we examine the continuity of the days of the week feature in Mistral 7B.","url_abs":"https://arxiv.org/abs/2405.14860v2","url_pdf":"https://arxiv.org/pdf/2405.14860v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"not-all-language-model-features-are-linear","repo_url":"https://github.com/joshengels/multidimensionalfeatures","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"all","task_name":"All"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"model","task_name":"model"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"discriminative-fine-tuning","method_name":"Discriminative Fine-Tuning"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt-2","method_name":"GPT-2"},{"method_slug":"llama","method_name":"LLaMA"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-cosine-annealing","method_name":"Linear Warmup With Cosine Annealing"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.14860","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.14860"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/joshengels/multidimensionalfeatures","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":6,"unverified":4},"by_repo_kind":{"official":{"samples":10,"ran":6,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"e5bbb58953bc029e","entry":"expand_descriptions","repo":"joshengels/multidimensionalfeatures","repo_kind":"official","path":"intervention/utils.py","file_url":"https://github.com/joshengels/multidimensionalfeatures/blob/HEAD/intervention/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e5bbb58953bc029e"}},{"code_sha256_prefix":"35bb96ea1f68e1fc","entry":"f","repo":"joshengels/multidimensionalfeatures","repo_kind":"official","path":"feature_deconstruction/simple_example.py","file_url":"https://github.com/joshengels/multidimensionalfeatures/blob/HEAD/feature_deconstruction/simple_example.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"35bb96ea1f68e1fc"}},{"code_sha256_prefix":"61e1dc25eff28dd1","entry":"get_all_acts","repo":"joshengels/multidimensionalfeatures","repo_kind":"official","path":"intervention/task.py","file_url":"https://github.com/joshengels/multidimensionalfeatures/blob/HEAD/intervention/task.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"61e1dc25eff28dd1"}},{"code_sha256_prefix":"0400998cc6c8e217","entry":"get_lambdas_and_descriptions","repo":"joshengels/multidimensionalfeatures","repo_kind":"official","path":"intervention/utils.py","file_url":"https://github.com/joshengels/multidimensionalfeatures/blob/HEAD/intervention/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0400998cc6c8e217"}},{"code_sha256_prefix":"dc43373d010228a4","entry":"get_points","repo":"joshengels/multidimensionalfeatures","repo_kind":"official","path":"intervention/intervene_in_middle_of_circle.py","file_url":"https://github.com/joshengels/multidimensionalfeatures/blob/HEAD/intervention/intervene_in_middle_of_circle.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dc43373d010228a4"}},{"code_sha256_prefix":"6661fded31c6734f","entry":"mean_confidence_interval","repo":"joshengels/multidimensionalfeatures","repo_kind":"official","path":"intervention/compare_circle_intervention_types.py","file_url":"https://github.com/joshengels/multidimensionalfeatures/blob/HEAD/intervention/compare_circle_intervention_types.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6661fded31c6734f"}},{"code_sha256_prefix":"6d8c73b8de5b9b2c","entry":"do_regression","repo":"joshengels/multidimensionalfeatures","repo_kind":"official","path":"intervention/circle_finding_utils.py","file_url":"https://github.com/joshengels/multidimensionalfeatures/blob/HEAD/intervention/circle_finding_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6d8c73b8de5b9b2c"}},{"code_sha256_prefix":"fb6d83ae4739bc75","entry":"find_c_circle","repo":"joshengels/multidimensionalfeatures","repo_kind":"official","path":"intervention/circle_finding_utils.py","file_url":"https://github.com/joshengels/multidimensionalfeatures/blob/HEAD/intervention/circle_finding_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fb6d83ae4739bc75"}},{"code_sha256_prefix":"5daefa372b9d0d79","entry":"get_acts","repo":"joshengels/multidimensionalfeatures","repo_kind":"official","path":"intervention/task.py","file_url":"https://github.com/joshengels/multidimensionalfeatures/blob/HEAD/intervention/task.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5daefa372b9d0d79"}},{"code_sha256_prefix":"08d36115ab4d9a96","entry":"get_acts_pca","repo":"joshengels/multidimensionalfeatures","repo_kind":"official","path":"intervention/task.py","file_url":"https://github.com/joshengels/multidimensionalfeatures/blob/HEAD/intervention/task.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"08d36115ab4d9a96"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}