{"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/diffusion-model-is-an-effective-planner-and-1","title":"Diffusion Model is an Effective Planner and Data Synthesizer for Multi-Task Reinforcement Learning","arxiv_id":"2305.18459","date":"2023-05-29","proceeding":"NeurIPS 2023 11","authors":["Haoran He","Chenjia Bai","Kang Xu","Zhuoran Yang","Weinan Zhang","Dong Wang","Bin Zhao","Xuelong Li"],"abstract":"Diffusion models have demonstrated highly-expressive generative capabilities in vision and NLP. Recent studies in reinforcement learning (RL) have shown that diffusion models are also powerful in modeling complex policies or trajectories in offline datasets. However, these works have been limited to single-task settings where a generalist agent capable of addressing multi-task predicaments is absent. In this paper, we aim to investigate the effectiveness of a single diffusion model in modeling large-scale multi-task offline data, which can be challenging due to diverse and multimodal data distribution. Specifically, we propose Multi-Task Diffusion Model (\\textsc{MTDiff}), a diffusion-based method that incorporates Transformer backbones and prompt learning for generative planning and data synthesis in multi-task offline settings. \\textsc{MTDiff} leverages vast amounts of knowledge available in multi-task data and performs implicit knowledge sharing among tasks. For generative planning, we find \\textsc{MTDiff} outperforms state-of-the-art algorithms across 50 tasks on Meta-World and 8 maps on Maze2D. For data synthesis, \\textsc{MTDiff} generates high-quality data for testing tasks given a single demonstration as a prompt, which enhances the low-quality datasets for even unseen tasks.","url_abs":"https://arxiv.org/abs/2305.18459v2","url_pdf":"https://arxiv.org/pdf/2305.18459v2.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":"diffusion-model-is-an-effective-planner-and-1","repo_url":"https://github.com/tinnerhrhe/MTDiff","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"prompt-learning","task_name":"Prompt Learning"},{"task_slug":"reinforcement-learning-1","task_name":"Reinforcement Learning (RL)"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2305.18459","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.18459"}},"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/tinkoff-ai/CORL","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/kzl/decision-transformer","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/mxu34/prompt-dt","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/jannerm/diffuser","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/Farama-Foundation/D4RL","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tinnerhrhe/MTDiff","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":5,"ran_honours":5,"ran_draft_wrong":1,"unverified":19},"by_repo_kind":{"official":{"samples":22,"ran":7,"repositories":1},"found_in_text":{"samples":8,"ran":4,"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":"bb0b654d7e2f043a","entry":"WeightedL1","repo":"jannerm/diffuser","repo_kind":"found_in_text","path":"diffuser/models/diffusion.py","file_url":"https://github.com/jannerm/diffuser/blob/HEAD/diffuser/models/diffusion.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":"bb0b654d7e2f043a"}},{"code_sha256_prefix":"63bb8b129db38dfb","entry":"WeightedL2","repo":"jannerm/diffuser","repo_kind":"found_in_text","path":"diffuser/models/diffusion.py","file_url":"https://github.com/jannerm/diffuser/blob/HEAD/diffuser/models/diffusion.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":"63bb8b129db38dfb"}},{"code_sha256_prefix":"31a6a65466c90f16","entry":"WeightedLoss","repo":"jannerm/diffuser","repo_kind":"found_in_text","path":"diffuser/models/diffusion.py","file_url":"https://github.com/jannerm/diffuser/blob/HEAD/diffuser/models/diffusion.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":"31a6a65466c90f16"}},{"code_sha256_prefix":"b6113e0f43155a33","entry":"cosine_beta_schedule","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/models/helpers.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/models/helpers.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b6113e0f43155a33"}},{"code_sha256_prefix":"8d04d499d75080d0","entry":"default_sample_fn","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/models/diffusion.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/models/diffusion.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8d04d499d75080d0"}},{"code_sha256_prefix":"69e493e37778664c","entry":"load_environment","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/datasets/d4rl.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/datasets/d4rl.py","link_basis":"plan_row","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":"69e493e37778664c"}},{"code_sha256_prefix":"51db163798eb0f5e","entry":"make_timesteps","repo":"jannerm/diffuser","repo_kind":"found_in_text","path":"diffuser/models/diffusion.py","file_url":"https://github.com/jannerm/diffuser/blob/HEAD/diffuser/models/diffusion.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"51db163798eb0f5e"}},{"code_sha256_prefix":"c409be426eec3eec","entry":"sort_by_values","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/models/diffusion.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/models/diffusion.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c409be426eec3eec"}},{"code_sha256_prefix":"0e8d8251e66ab160","entry":"to_np","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/utils/arrays.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/utils/arrays.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0e8d8251e66ab160"}},{"code_sha256_prefix":"134173215340e0d1","entry":"to_torch","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/utils/arrays.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/utils/arrays.py","link_basis":"plan_row","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":"134173215340e0d1"}},{"code_sha256_prefix":"47c7ce0ace6e7c47","entry":"vp_beta_schedule","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/models/helpers.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/models/helpers.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"47c7ce0ace6e7c47"}},{"code_sha256_prefix":"b647fa958c28b7a0","entry":"GaussianDiffusion","repo":"jannerm/diffuser","repo_kind":"found_in_text","path":"diffuser/models/diffusion.py","file_url":"https://github.com/jannerm/diffuser/blob/HEAD/diffuser/models/diffusion.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":"b647fa958c28b7a0"}},{"code_sha256_prefix":"15f5f25cbe9d72e0","entry":"ValueL1","repo":"jannerm/diffuser","repo_kind":"found_in_text","path":"diffuser/models/diffusion.py","file_url":"https://github.com/jannerm/diffuser/blob/HEAD/diffuser/models/diffusion.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":"15f5f25cbe9d72e0"}},{"code_sha256_prefix":"4b9ad2741a65b9b0","entry":"ValueL2","repo":"jannerm/diffuser","repo_kind":"found_in_text","path":"diffuser/models/diffusion.py","file_url":"https://github.com/jannerm/diffuser/blob/HEAD/diffuser/models/diffusion.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":"4b9ad2741a65b9b0"}},{"code_sha256_prefix":"2033d022f4c21dd8","entry":"ValueLoss","repo":"jannerm/diffuser","repo_kind":"found_in_text","path":"diffuser/models/diffusion.py","file_url":"https://github.com/jannerm/diffuser/blob/HEAD/diffuser/models/diffusion.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":"2033d022f4c21dd8"}},{"code_sha256_prefix":"5347209028588046","entry":"add_deltas","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/datasets/preprocessing.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/datasets/preprocessing.py","link_basis":"plan_row","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":"5347209028588046"}},{"code_sha256_prefix":"785632d29b87adad","entry":"atleast_2d","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/datasets/buffer.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/datasets/buffer.py","link_basis":"plan_row","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":"785632d29b87adad"}},{"code_sha256_prefix":"3ca83b3e96824f00","entry":"atleast_2d","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/datasets/normalization.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/datasets/normalization.py","link_basis":"plan_row","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":"3ca83b3e96824f00"}},{"code_sha256_prefix":"2fd70118265255f8","entry":"empirical_cdf","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/datasets/normalization.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/datasets/normalization.py","link_basis":"plan_row","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":"2fd70118265255f8"}},{"code_sha256_prefix":"09c8479d9a5b3e06","entry":"extract","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/models/helpers.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/models/helpers.py","link_basis":"harvester_set","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":"09c8479d9a5b3e06"}},{"code_sha256_prefix":"505d6b06c543b4fb","entry":"flatten","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/datasets/normalization.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/datasets/normalization.py","link_basis":"plan_row","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":"505d6b06c543b4fb"}},{"code_sha256_prefix":"6b688f0cd038f65e","entry":"get_dataset","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/datasets/d4rl.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/datasets/d4rl.py","link_basis":"plan_row","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":"6b688f0cd038f65e"}},{"code_sha256_prefix":"65e5c27060559602","entry":"get_policy_preprocess_fn","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/datasets/preprocessing.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/datasets/preprocessing.py","link_basis":"plan_row","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":"65e5c27060559602"}},{"code_sha256_prefix":"54442074c20e0e8f","entry":"get_preprocess_fn","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/datasets/preprocessing.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/datasets/preprocessing.py","link_basis":"plan_row","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":"54442074c20e0e8f"}},{"code_sha256_prefix":"5321d9d86ff019c1","entry":"get_prompt","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/models/temporal.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/models/temporal.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":"5321d9d86ff019c1"}},{"code_sha256_prefix":"27c640b42f4e6a73","entry":"get_prompt_batch","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/models/temporal.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/models/temporal.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":"27c640b42f4e6a73"}},{"code_sha256_prefix":"6c4cc9bc7e5e5859","entry":"get_prompt_batchs","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/models/temporal.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/models/temporal.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":"6c4cc9bc7e5e5859"}},{"code_sha256_prefix":"bb6694e97ebbdbb5","entry":"load_episode","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/datasets/d4rl.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/datasets/d4rl.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":"bb6694e97ebbdbb5"}},{"code_sha256_prefix":"00a33466c69c5705","entry":"load_tf_weights_in_gpt2","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/models/GPT2.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/models/GPT2.py","link_basis":"harvester_set","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":"00a33466c69c5705"}},{"code_sha256_prefix":"80cbf0ec77b1d134","entry":"parse_maze","repo":"tinnerhrhe/MTDiff","repo_kind":"official","path":"diffuser/utils/arrays.py","file_url":"https://github.com/tinnerhrhe/MTDiff/blob/HEAD/diffuser/utils/arrays.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":"80cbf0ec77b1d134"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}