{"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/drama-mamba-enabled-model-based-reinforcement","title":"Drama: Mamba-Enabled Model-Based Reinforcement Learning Is Sample and Parameter Efficient","arxiv_id":"2410.08893","date":"2024-10-11","proceeding":null,"authors":["Wenlong Wang","Ivana Dusparic","Yucheng Shi","Ke Zhang","Vinny Cahill"],"abstract":"Model-based reinforcement learning (RL) offers a solution to the data inefficiency that plagues most model-free RL algorithms. However, learning a robust world model often requires complex and deep architectures, which are computationally expensive and challenging to train. Within the world model, sequence models play a critical role in accurate predictions, and various architectures have been explored, each with its own challenges. Currently, recurrent neural network (RNN)-based world models struggle with vanishing gradients and capturing long-term dependencies. Transformers, on the other hand, suffer from the quadratic memory and computational complexity of self-attention mechanisms, scaling as $O(n^2)$, where $n$ is the sequence length. To address these challenges, we propose a state space model (SSM)-based world model, Drama, specifically leveraging Mamba, that achieves $O(n)$ memory and computational complexity while effectively capturing long-term dependencies and enabling efficient training with longer sequences. We also introduce a novel sampling method to mitigate the suboptimality caused by an incorrect world model in the early training stages. Combining these techniques, Drama achieves a normalised score on the Atari100k benchmark that is competitive with other state-of-the-art (SOTA) model-based RL algorithms, using only a 7 million-parameter world model. Drama is accessible and trainable on off-the-shelf hardware, such as a standard laptop. Our code is available at https://github.com/realwenlongwang/Drama.git.","url_abs":"https://arxiv.org/abs/2410.08893v4","url_pdf":"https://arxiv.org/pdf/2410.08893v4.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":"drama-mamba-enabled-model-based-reinforcement","repo_url":"https://github.com/realwenlongwang/drama","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"mamba","task_name":"Mamba"},{"task_slug":"model-based-reinforcement-learning","task_name":"Model-based Reinforcement Learning"},{"task_slug":"reinforcement-learning-1","task_name":"Reinforcement Learning (RL)"}],"methods":[{"method_slug":"mamba","method_name":"Mamba"},{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.08893","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.08893"}},"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":"deterministic:regex_extraction","url":"https://github.com/realwenlongwang/Drama","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/realwenlongwang/drama","reach":{"status":"ok"}}],"summary":{"ran":7,"unverified":2},"by_repo_kind":{"official":{"samples":9,"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":9,"samples":[{"code_sha256_prefix":"6ae6a81b313635f6","entry":"get_subsequent_mask","repo":"realwenlongwang/Drama","repo_kind":"official","path":"sub_models/attention_blocks.py","file_url":"https://github.com/realwenlongwang/Drama/blob/HEAD/sub_models/attention_blocks.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":"6ae6a81b313635f6"}},{"code_sha256_prefix":"e38bff42d47263cd","entry":"get_subsequent_mask_with_batch_length","repo":"realwenlongwang/Drama","repo_kind":"official","path":"sub_models/attention_blocks.py","file_url":"https://github.com/realwenlongwang/Drama/blob/HEAD/sub_models/attention_blocks.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":"e38bff42d47263cd"}},{"code_sha256_prefix":"3c26bddfecd514dd","entry":"get_vector_mask","repo":"realwenlongwang/Drama","repo_kind":"official","path":"sub_models/attention_blocks.py","file_url":"https://github.com/realwenlongwang/Drama/blob/HEAD/sub_models/attention_blocks.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":"3c26bddfecd514dd"}},{"code_sha256_prefix":"3efc0819c7bc75e2","entry":"layer_init","repo":"realwenlongwang/Drama","repo_kind":"official","path":"tools.py","file_url":"https://github.com/realwenlongwang/Drama/blob/HEAD/tools.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":"3efc0819c7bc75e2"}},{"code_sha256_prefix":"adce9ddcc08da8dc","entry":"percentile","repo":"realwenlongwang/Drama","repo_kind":"official","path":"agents.py","file_url":"https://github.com/realwenlongwang/Drama/blob/HEAD/agents.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"adce9ddcc08da8dc"}},{"code_sha256_prefix":"67b3a332ec394684","entry":"symexp","repo":"realwenlongwang/Drama","repo_kind":"official","path":"sub_models/functions_losses.py","file_url":"https://github.com/realwenlongwang/Drama/blob/HEAD/sub_models/functions_losses.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"67b3a332ec394684"}},{"code_sha256_prefix":"c5f6f10f82106e10","entry":"symlog","repo":"realwenlongwang/Drama","repo_kind":"official","path":"sub_models/functions_losses.py","file_url":"https://github.com/realwenlongwang/Drama/blob/HEAD/sub_models/functions_losses.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c5f6f10f82106e10"}},{"code_sha256_prefix":"b81345145f0ea196","entry":"build_single_env","repo":"realwenlongwang/Drama","repo_kind":"official","path":"env_wrapper.py","file_url":"https://github.com/realwenlongwang/Drama/blob/HEAD/env_wrapper.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b81345145f0ea196"}},{"code_sha256_prefix":"dbdef7d52f9792a4","entry":"build_vec_env","repo":"realwenlongwang/Drama","repo_kind":"official","path":"env_wrapper.py","file_url":"https://github.com/realwenlongwang/Drama/blob/HEAD/env_wrapper.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dbdef7d52f9792a4"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}