{"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/recurrent-neural-networks-learn-to-store-and","title":"Recurrent Neural Networks Learn to Store and Generate Sequences using Non-Linear Representations","arxiv_id":"2408.10920","date":"2024-08-20","proceeding":null,"authors":["Róbert Csordás","Christopher Potts","Christopher D. Manning","Atticus Geiger"],"abstract":"The Linear Representation Hypothesis (LRH) states that neural networks learn to encode concepts as directions in activation space, and a strong version of the LRH states that models learn only such encodings. In this paper, we present a counterexample to this strong LRH: when trained to repeat an input token sequence, gated recurrent neural networks (RNNs) learn to represent the token at each position with a particular order of magnitude, rather than a direction. These representations have layered features that are impossible to locate in distinct linear subspaces. To show this, we train interventions to predict and manipulate tokens by learning the scaling factor corresponding to each sequence position. These interventions indicate that the smallest RNNs find only this magnitude-based solution, while larger RNNs have linear representations. These findings strongly indicate that interpretability research should not be confined by the LRH.","url_abs":"https://arxiv.org/abs/2408.10920v1","url_pdf":"https://arxiv.org/pdf/2408.10920v1.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":"recurrent-neural-networks-learn-to-store-and","repo_url":"https://github.com/robertcsordas/onion_representations","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":null,"task_name":"Position"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2408.10920","atlas_url":"https://app.syntology.ai/?focus=2408.10920","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.10920"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/robertcsordas/onion_representations","reach":{"status":"ok"}}],"summary":{"ran":5,"ran_honours":1},"by_repo_kind":{"official":{"samples":6,"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":6,"samples":[{"code_sha256_prefix":"8d74527db3b7eebc","entry":"construct_name","repo":"robertcsordas/onion_representations","repo_kind":"official","path":"paper/lib/common.py","file_url":"https://github.com/robertcsordas/onion_representations/blob/HEAD/paper/lib/common.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8d74527db3b7eebc"}},{"code_sha256_prefix":"9d5bf0b8a99793b6","entry":"get_logs","repo":"robertcsordas/onion_representations","repo_kind":"official","path":"framework/layers/logging_layer.py","file_url":"https://github.com/robertcsordas/onion_representations/blob/HEAD/framework/layers/logging_layer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9d5bf0b8a99793b6"}},{"code_sha256_prefix":"be4657e3537b2b6b","entry":"group","repo":"robertcsordas/onion_representations","repo_kind":"official","path":"paper/lib/common.py","file_url":"https://github.com/robertcsordas/onion_representations/blob/HEAD/paper/lib/common.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"be4657e3537b2b6b"}},{"code_sha256_prefix":"6ffc97f245b45f9a","entry":"gumbel_noise_like","repo":"robertcsordas/onion_representations","repo_kind":"official","path":"framework/layers/gumbel_softmax.py","file_url":"https://github.com/robertcsordas/onion_representations/blob/HEAD/framework/layers/gumbel_softmax.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6ffc97f245b45f9a"}},{"code_sha256_prefix":"70ab3336f5bc37ef","entry":"gumbel_softmax","repo":"robertcsordas/onion_representations","repo_kind":"official","path":"framework/layers/gumbel_softmax.py","file_url":"https://github.com/robertcsordas/onion_representations/blob/HEAD/framework/layers/gumbel_softmax.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"70ab3336f5bc37ef"}},{"code_sha256_prefix":"d66ffb4b6ae08ca3","entry":"sinusoidal_pos_embedding","repo":"robertcsordas/onion_representations","repo_kind":"official","path":"framework/layers/positional_encoding.py","file_url":"https://github.com/robertcsordas/onion_representations/blob/HEAD/framework/layers/positional_encoding.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d66ffb4b6ae08ca3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}