{"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/rao-blackwellizing-the-straight-through-1","title":"Rao-Blackwellizing the Straight-Through Gumbel-Softmax Gradient Estimator","arxiv_id":"2010.04838","date":"2020-10-09","proceeding":"ICLR 2021 1","authors":["Max B. Paulus","Chris J. Maddison","Andreas Krause"],"abstract":"Gradient estimation in models with discrete latent variables is a challenging problem, because the simplest unbiased estimators tend to have high variance. To counteract this, modern estimators either introduce bias, rely on multiple function evaluations, or use learned, input-dependent baselines. Thus, there is a need for estimators that require minimal tuning, are computationally cheap, and have low mean squared error. In this paper, we show that the variance of the straight-through variant of the popular Gumbel-Softmax estimator can be reduced through Rao-Blackwellization without increasing the number of function evaluations. This provably reduces the mean squared error. We empirically demonstrate that this leads to variance reduction, faster convergence, and generally improved performance in two unsupervised latent variable models.","url_abs":"https://arxiv.org/abs/2010.04838v1","url_pdf":"https://arxiv.org/pdf/2010.04838v1.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":"rao-blackwellizing-the-straight-through-1","repo_url":"https://github.com/chijames/gst","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"rao-blackwellizing-the-straight-through-1","repo_url":"https://github.com/nshepperd/gumbel-rao-pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"rao-blackwellizing-the-straight-through-1","repo_url":"https://github.com/tgisaturday/dalle-lightning","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok"}},{"paper_slug":"rao-blackwellizing-the-straight-through-1","repo_url":"https://github.com/tgisaturday/dalle-lightning-tpu","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok"}},{"paper_slug":"rao-blackwellizing-the-straight-through-1","repo_url":"https://github.com/tgisaturday/taming-transformers-tpu","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"unanswered"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2010.04838","atlas_url":"https://app.syntology.ai/?focus=2010.04838","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2010.04838"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tgisaturday/taming-transformers-tpu","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tgisaturday/dalle-lightning","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/nshepperd/gumbel-rao-pytorch","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/chijames/gst","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tgisaturday/dalle-lightning-tpu","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":1,"ran_fixture":2,"ran_honours":1},"by_repo_kind":{"listed":{"samples":3,"ran":3,"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":1,"samples":[{"code_sha256_prefix":"940e64fcef5003eb","entry":"conditional_gumbel","repo":"nshepperd/gumbel-rao-pytorch","repo_kind":"listed","path":"gumbel_rao.py","file_url":"https://github.com/nshepperd/gumbel-rao-pytorch/blob/HEAD/gumbel_rao.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"940e64fcef5003eb"}},{"code_sha256_prefix":"5eddcca4893e7715","entry":"exact_conditional_gumbel","repo":"nshepperd/gumbel-rao-pytorch","repo_kind":"listed","path":"gumbel_rao.py","file_url":"https://github.com/nshepperd/gumbel-rao-pytorch/blob/HEAD/gumbel_rao.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5eddcca4893e7715"}},{"code_sha256_prefix":"2482f03ac1b8b9bb","entry":"loss_function","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"2482f03ac1b8b9bb"}},{"code_sha256_prefix":"a66f8c63fbf468ff","entry":"replace_gradient","repo":"nshepperd/gumbel-rao-pytorch","repo_kind":"listed","path":"gumbel_rao.py","file_url":"https://github.com/nshepperd/gumbel-rao-pytorch/blob/HEAD/gumbel_rao.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a66f8c63fbf468ff"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}