{"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/think-before-you-act-decision-transformers","title":"Think Before You Act: Decision Transformers with Working Memory","arxiv_id":"2305.16338","date":"2023-05-24","proceeding":null,"authors":["Jikun Kang","Romain Laroche","Xingdi Yuan","Adam Trischler","Xue Liu","Jie Fu"],"abstract":"Decision Transformer-based decision-making agents have shown the ability to generalize across multiple tasks. However, their performance relies on massive data and computation. We argue that this inefficiency stems from the forgetting phenomenon, in which a model memorizes its behaviors in parameters throughout training. As a result, training on a new task may deteriorate the model's performance on previous tasks. In contrast to LLMs' implicit memory mechanism, the human brain utilizes distributed memory storage, which helps manage and organize multiple skills efficiently, mitigating the forgetting phenomenon. Inspired by this, we propose a working memory module to store, blend, and retrieve information for different downstream tasks. Evaluation results show that the proposed method improves training efficiency and generalization in Atari games and Meta-World object manipulation tasks. Moreover, we demonstrate that memory fine-tuning further enhances the adaptability of the proposed architecture.","url_abs":"https://arxiv.org/abs/2305.16338v3","url_pdf":"https://arxiv.org/pdf/2305.16338v3.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":"think-before-you-act-decision-transformers","repo_url":"https://github.com/luciferkonn/dt_mem","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":null}],"tasks":[{"task_slug":"atari-games","task_name":"Atari Games"},{"task_slug":"decision-making","task_name":"Decision Making"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2305.16338","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.16338"}},"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/luciferkonn/dt_mem","reach":null}],"summary":{"ran":3,"ran_honours":2,"ran_fixture":1,"ran_draft_wrong":1,"unverified":5},"by_repo_kind":{"official":{"samples":12,"ran":7,"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":"161899026ce0eb8d","entry":"GroupLinearLayer","repo":"luciferkonn/dt_mem","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/luciferkonn/dt_mem/blob/HEAD/src/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"161899026ce0eb8d"}},{"code_sha256_prefix":"83fc917b52b947b3","entry":"RelationalMemory","repo":"luciferkonn/dt_mem","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/luciferkonn/dt_mem/blob/HEAD/src/model.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":"83fc917b52b947b3"}},{"code_sha256_prefix":"a0c499b6fb911e20","entry":"RepeatLinear","repo":"luciferkonn/dt_mem","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/luciferkonn/dt_mem/blob/HEAD/src/model.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":"a0c499b6fb911e20"}},{"code_sha256_prefix":"85999f9cb6163ec0","entry":"accuracy","repo":"luciferkonn/dt_mem","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/luciferkonn/dt_mem/blob/HEAD/src/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"85999f9cb6163ec0"}},{"code_sha256_prefix":"7a16e89219207505","entry":"cross_entropy","repo":"luciferkonn/dt_mem","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/luciferkonn/dt_mem/blob/HEAD/src/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7a16e89219207505"}},{"code_sha256_prefix":"c77c68839b869e29","entry":"encode_return","repo":"luciferkonn/dt_mem","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/luciferkonn/dt_mem/blob/HEAD/src/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c77c68839b869e29"}},{"code_sha256_prefix":"dd64b6c6ba18470c","entry":"encode_reward","repo":"luciferkonn/dt_mem","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/luciferkonn/dt_mem/blob/HEAD/src/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dd64b6c6ba18470c"}},{"code_sha256_prefix":"c59ed427653b94b7","entry":"CausalSelfAttention","repo":"luciferkonn/dt_mem","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/luciferkonn/dt_mem/blob/HEAD/src/model.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":"c59ed427653b94b7"}},{"code_sha256_prefix":"23804b0d6173123a","entry":"DecisionTransformer","repo":"luciferkonn/dt_mem","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/luciferkonn/dt_mem/blob/HEAD/src/model.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":"23804b0d6173123a"}},{"code_sha256_prefix":"88fdc33643df68a8","entry":"DenseBlock","repo":"luciferkonn/dt_mem","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/luciferkonn/dt_mem/blob/HEAD/src/model.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":"88fdc33643df68a8"}},{"code_sha256_prefix":"331bf757c4894bec","entry":"GPT2","repo":"luciferkonn/dt_mem","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/luciferkonn/dt_mem/blob/HEAD/src/model.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":"331bf757c4894bec"}},{"code_sha256_prefix":"75bf37896d765771","entry":"count_parameters","repo":"luciferkonn/dt_mem","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/luciferkonn/dt_mem/blob/HEAD/src/model.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":"75bf37896d765771"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}