{"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/unsupervised-zero-shot-reinforcement-learning","title":"Unsupervised Zero-Shot Reinforcement Learning via Functional Reward Encodings","arxiv_id":"2402.17135","date":"2024-02-27","proceeding":null,"authors":["Kevin Frans","Seohong Park","Pieter Abbeel","Sergey Levine"],"abstract":"Can we pre-train a generalist agent from a large amount of unlabeled offline trajectories such that it can be immediately adapted to any new downstream tasks in a zero-shot manner? In this work, we present a functional reward encoding (FRE) as a general, scalable solution to this zero-shot RL problem. Our main idea is to learn functional representations of any arbitrary tasks by encoding their state-reward samples using a transformer-based variational auto-encoder. This functional encoding not only enables the pre-training of an agent from a wide diversity of general unsupervised reward functions, but also provides a way to solve any new downstream tasks in a zero-shot manner, given a small number of reward-annotated samples. We empirically show that FRE agents trained on diverse random unsupervised reward functions can generalize to solve novel tasks in a range of simulated robotic benchmarks, often outperforming previous zero-shot RL and offline RL methods. Code for this project is provided at: https://github.com/kvfrans/fre","url_abs":"https://arxiv.org/abs/2402.17135v1","url_pdf":"https://arxiv.org/pdf/2402.17135v1.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":"unsupervised-zero-shot-reinforcement-learning","repo_url":"https://github.com/kvfrans/fre","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok"}}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"offline-rl","task_name":"Offline RL"},{"task_slug":"reinforcement-learning","task_name":"Reinforcement Learning"},{"task_slug":"reinforcement-learning-2","task_name":"reinforcement-learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.17135","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.17135"}},"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/kvfrans/fre","reach":{"status":"ok"}}],"summary":{"ran":5,"ran_violates":1,"ran_honours":1,"unverified":4},"by_repo_kind":{"official":{"samples":11,"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":11,"samples":[{"code_sha256_prefix":"645ceabf0ab26408","entry":"evaluate","repo":"kvfrans/fre","repo_kind":"official","path":"common/evaluation.py","file_url":"https://github.com/kvfrans/fre/blob/HEAD/common/evaluation.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":"645ceabf0ab26408"}},{"code_sha256_prefix":"ad221b0896e1bcd0","entry":"expectile_loss","repo":"kvfrans/fre","repo_kind":"official","path":"algs/iql.py","file_url":"https://github.com/kvfrans/fre/blob/HEAD/algs/iql.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ad221b0896e1bcd0"}},{"code_sha256_prefix":"33d24c59c871db71","entry":"expectile_loss","repo":"kvfrans/fre","repo_kind":"official","path":"experiment/run_fre.py","file_url":"https://github.com/kvfrans/fre/blob/HEAD/experiment/run_fre.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":"33d24c59c871db71"}},{"code_sha256_prefix":"12a345043a2eef22","entry":"flatten","repo":"kvfrans/fre","repo_kind":"official","path":"common/evaluation.py","file_url":"https://github.com/kvfrans/fre/blob/HEAD/common/evaluation.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":"12a345043a2eef22"}},{"code_sha256_prefix":"7fc1d127bf81537f","entry":"mish","repo":"kvfrans/fre","repo_kind":"official","path":"common/networks/basic.py","file_url":"https://github.com/kvfrans/fre/blob/HEAD/common/networks/basic.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7fc1d127bf81537f"}},{"code_sha256_prefix":"2c467ba4d50c077e","entry":"shard_batch","repo":"kvfrans/fre","repo_kind":"official","path":"common/train_state.py","file_url":"https://github.com/kvfrans/fre/blob/HEAD/common/train_state.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":"2c467ba4d50c077e"}},{"code_sha256_prefix":"58ec0d58eba92372","entry":"supply_rng","repo":"kvfrans/fre","repo_kind":"official","path":"common/utils.py","file_url":"https://github.com/kvfrans/fre/blob/HEAD/common/utils.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":"58ec0d58eba92372"}},{"code_sha256_prefix":"7f174e0d2fe49c08","entry":"ensemblize","repo":"kvfrans/fre","repo_kind":"official","path":"common/networks/basic.py","file_url":"https://github.com/kvfrans/fre/blob/HEAD/common/networks/basic.py","link_basis":"harvester_set","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":"7f174e0d2fe49c08"}},{"code_sha256_prefix":"2d17f9689108389d","entry":"get_canvas_image","repo":"kvfrans/fre","repo_kind":"official","path":"experiment/ant_helper.py","file_url":"https://github.com/kvfrans/fre/blob/HEAD/experiment/ant_helper.py","link_basis":"harvester_set","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":"2d17f9689108389d"}},{"code_sha256_prefix":"b10ceb550bad20ce","entry":"target_update","repo":"kvfrans/fre","repo_kind":"official","path":"common/train_state.py","file_url":"https://github.com/kvfrans/fre/blob/HEAD/common/train_state.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":"b10ceb550bad20ce"}},{"code_sha256_prefix":"38840ed49d8dfd99","entry":"value_image","repo":"kvfrans/fre","repo_kind":"official","path":"experiment/ant_helper.py","file_url":"https://github.com/kvfrans/fre/blob/HEAD/experiment/ant_helper.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":"38840ed49d8dfd99"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}