{"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/hindsight-value-function-for-variance","title":"Hindsight Value Function for Variance Reduction in Stochastic Dynamic Environment","arxiv_id":"2107.12216","date":"2021-07-26","proceeding":null,"authors":["Jiaming Guo","Rui Zhang","Xishan Zhang","Shaohui Peng","Qi Yi","Zidong Du","Xing Hu","Qi Guo","Yunji Chen"],"abstract":"Policy gradient methods are appealing in deep reinforcement learning but suffer from high variance of gradient estimate. To reduce the variance, the state value function is applied commonly. However, the effect of the state value function becomes limited in stochastic dynamic environments, where the unexpected state dynamics and rewards will increase the variance. In this paper, we propose to replace the state value function with a novel hindsight value function, which leverages the information from the future to reduce the variance of the gradient estimate for stochastic dynamic environments. Particularly, to obtain an ideally unbiased gradient estimate, we propose an information-theoretic approach, which optimizes the embeddings of the future to be independent of previous actions. In our experiments, we apply the proposed hindsight value function in stochastic dynamic environments, including discrete-action environments and continuous-action environments. Compared with the standard state value function, the proposed hindsight value function consistently reduces the variance, stabilizes the training, and improves the eventual policy.","url_abs":"https://arxiv.org/abs/2107.12216v2","url_pdf":"https://arxiv.org/pdf/2107.12216v2.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":"hindsight-value-function-for-variance","repo_url":"https://github.com/guojm14/HVF","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"deep-reinforcement-learning","task_name":"Deep Reinforcement Learning"},{"task_slug":"policy-gradient-methods","task_name":"Policy Gradient Methods"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2107.12216","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2107.12216"}},"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/guojm14/HVF","reach":null}],"summary":{"ran":6,"unverified":2},"by_repo_kind":{"listed":{"samples":8,"ran":6,"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":"f9dab6339e71b2bb","entry":"Actor","repo":"guojm14/HVF","repo_kind":"listed","path":"reduce_var/mlp.py","file_url":"https://github.com/guojm14/HVF/blob/HEAD/reduce_var/mlp.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":"f9dab6339e71b2bb"}},{"code_sha256_prefix":"843e21ea97909b70","entry":"CLUB","repo":"guojm14/HVF","repo_kind":"listed","path":"reduce_var/mlp.py","file_url":"https://github.com/guojm14/HVF/blob/HEAD/reduce_var/mlp.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":"843e21ea97909b70"}},{"code_sha256_prefix":"05a92190f86414b3","entry":"Critic","repo":"guojm14/HVF","repo_kind":"listed","path":"reduce_var/mlp.py","file_url":"https://github.com/guojm14/HVF/blob/HEAD/reduce_var/mlp.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":"05a92190f86414b3"}},{"code_sha256_prefix":"781c9791864d968d","entry":"FC","repo":"guojm14/HVF","repo_kind":"listed","path":"reduce_var/mlp.py","file_url":"https://github.com/guojm14/HVF/blob/HEAD/reduce_var/mlp.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"781c9791864d968d"}},{"code_sha256_prefix":"6ef29899c0c79c2b","entry":"MLP","repo":"guojm14/HVF","repo_kind":"listed","path":"reduce_var/mlp.py","file_url":"https://github.com/guojm14/HVF/blob/HEAD/reduce_var/mlp.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":"6ef29899c0c79c2b"}},{"code_sha256_prefix":"a7e740d8e575e056","entry":"Pre","repo":"guojm14/HVF","repo_kind":"listed","path":"reduce_var/mlp.py","file_url":"https://github.com/guojm14/HVF/blob/HEAD/reduce_var/mlp.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":"a7e740d8e575e056"}},{"code_sha256_prefix":"d6e2dd5c77bfdf2d","entry":"Critic_net_lstm","repo":"guojm14/HVF","repo_kind":"listed","path":"reduce_var/mlp.py","file_url":"https://github.com/guojm14/HVF/blob/HEAD/reduce_var/mlp.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":"d6e2dd5c77bfdf2d"}},{"code_sha256_prefix":"a1dc1eb245fd0d7d","entry":"Lucky","repo":"guojm14/HVF","repo_kind":"listed","path":"reduce_var/mlp.py","file_url":"https://github.com/guojm14/HVF/blob/HEAD/reduce_var/mlp.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":"a1dc1eb245fd0d7d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}