{"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/odice-revealing-the-mystery-of-distribution","title":"ODICE: Revealing the Mystery of Distribution Correction Estimation via Orthogonal-gradient Update","arxiv_id":"2402.00348","date":"2024-02-01","proceeding":null,"authors":["Liyuan Mao","Haoran Xu","Weinan Zhang","Xianyuan Zhan"],"abstract":"In this study, we investigate the DIstribution Correction Estimation (DICE) methods, an important line of work in offline reinforcement learning (RL) and imitation learning (IL). DICE-based methods impose state-action-level behavior constraint, which is an ideal choice for offline learning. However, they typically perform much worse than current state-of-the-art (SOTA) methods that solely use action-level behavior constraint. After revisiting DICE-based methods, we find there exist two gradient terms when learning the value function using true-gradient update: forward gradient (taken on the current state) and backward gradient (taken on the next state). Using forward gradient bears a large similarity to many offline RL methods, and thus can be regarded as applying action-level constraint. However, directly adding the backward gradient may degenerate or cancel out its effect if these two gradients have conflicting directions. To resolve this issue, we propose a simple yet effective modification that projects the backward gradient onto the normal plane of the forward gradient, resulting in an orthogonal-gradient update, a new learning rule for DICE-based methods. We conduct thorough theoretical analyses and find that the projected backward gradient brings state-level behavior regularization, which reveals the mystery of DICE-based methods: the value learning objective does try to impose state-action-level constraint, but needs to be used in a corrected way. Through toy examples and extensive experiments on complex offline RL and IL tasks, we demonstrate that DICE-based methods using orthogonal-gradient updates (O-DICE) achieve SOTA performance and great robustness.","url_abs":"https://arxiv.org/abs/2402.00348v1","url_pdf":"https://arxiv.org/pdf/2402.00348v1.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":"odice-revealing-the-mystery-of-distribution","repo_url":"https://github.com/maoliyuan/odice-pytorch","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"imitation-learning","task_name":"Imitation Learning"},{"task_slug":"offline-rl","task_name":"Offline RL"},{"task_slug":"reinforcement-learning-1","task_name":"Reinforcement Learning (RL)"}],"methods":[{"method_slug":"forward-gradient","method_name":"Forward gradient"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2402.00348","atlas_url":"https://app.syntology.ai/?focus=2402.00348","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.00348"}},"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":"deterministic:regex_extraction","url":"https://github.com/maoliyuan/ODICE-Pytorch","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/maoliyuan/odice-pytorch","reach":{"status":"ok"}}],"summary":{"ran":5,"ran_draft_wrong":1,"ran_fixture":2},"by_repo_kind":{"official":{"samples":8,"ran":8,"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":8,"samples":[{"code_sha256_prefix":"95b3a586ef83458c","entry":"ODICE","repo":"maoliyuan/odice-pytorch","repo_kind":"official","path":"odice.py","file_url":"https://github.com/maoliyuan/odice-pytorch/blob/HEAD/odice.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":"95b3a586ef83458c"}},{"code_sha256_prefix":"dc565cac5846a7ee","entry":"compute_batched","repo":"maoliyuan/ODICE-Pytorch","repo_kind":"official","path":"util.py","file_url":"https://github.com/maoliyuan/ODICE-Pytorch/blob/HEAD/util.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":"dc565cac5846a7ee"}},{"code_sha256_prefix":"7bdec41dd9ec4e11","entry":"dataset_T_trajs","repo":"maoliyuan/odice-pytorch","repo_kind":"official","path":"main_odice_il.py","file_url":"https://github.com/maoliyuan/odice-pytorch/blob/HEAD/main_odice_il.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7bdec41dd9ec4e11"}},{"code_sha256_prefix":"5a868e3c277da7bb","entry":"f_prime_inverse","repo":"maoliyuan/odice-pytorch","repo_kind":"official","path":"odice.py","file_url":"https://github.com/maoliyuan/odice-pytorch/blob/HEAD/odice.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5a868e3c277da7bb"}},{"code_sha256_prefix":"e92ba9cdfe16394d","entry":"f_star","repo":"maoliyuan/odice-pytorch","repo_kind":"official","path":"odice.py","file_url":"https://github.com/maoliyuan/odice-pytorch/blob/HEAD/odice.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e92ba9cdfe16394d"}},{"code_sha256_prefix":"3448a21f1f811223","entry":"mlp","repo":"maoliyuan/ODICE-Pytorch","repo_kind":"official","path":"util.py","file_url":"https://github.com/maoliyuan/ODICE-Pytorch/blob/HEAD/util.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":"3448a21f1f811223"}},{"code_sha256_prefix":"4f8b1a89e0c93c71","entry":"qlearning_dataset","repo":"maoliyuan/ODICE-Pytorch","repo_kind":"official","path":"dataset_init.py","file_url":"https://github.com/maoliyuan/ODICE-Pytorch/blob/HEAD/dataset_init.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":"4f8b1a89e0c93c71"}},{"code_sha256_prefix":"15761726fa5b822b","entry":"torchify","repo":"maoliyuan/ODICE-Pytorch","repo_kind":"official","path":"util.py","file_url":"https://github.com/maoliyuan/ODICE-Pytorch/blob/HEAD/util.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":"15761726fa5b822b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}