{"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/arxiv-2602-04417","title":"EMA Policy Gradient: Taming Reinforcement Learning for LLMs with EMA Anchor and Top-k KL","arxiv_id":"2602.04417","date":"2026-02-04","proceeding":null,"authors":["Lunjun Zhang","Jimmy Ba"],"abstract":"Reinforcement Learning (RL) has enabled Large Language Models (LLMs) to acquire increasingly complex reasoning and agentic behaviors. In this work, we propose two simple techniques to improve policy gradient algorithms for LLMs. First, we replace the fixed anchor policy during RL with an Exponential Moving Average (EMA), similar to a target network in deep Q-learning. Second, we introduce Top-k KL estimator, which allows for flexible interpolation between exact KL and sampled KL. We derive the stability conditions for using EMA anchor; moreover, we show that our Top-k KL estimator yields both unbiased KL values and unbiased gradients at any k, while bringing the benefits of exact KL. When combined with GRPO, the two techniques (EMA-PG) lead to a significant performance boost. On math reasoning, it allows R1-distilled Qwen-1.5B to reach 53.9% on OlympiadBench compared to 50.8% by GRPO. On agentic RL domains, with Qwen-3B base, EMA-PG improves GRPO by an average of 33.3% across 7 datasets of Q&A with search engines, including 29.7% $\\rightarrow$ 44.1% on HotpotQA, 27.4% $\\rightarrow$ 40.1% on 2WikiMultiHopQA. Overall, we show that EMA-PG is a simple, principled, and powerful approach to scaling RL for LLMs. Code: https://github.com/LunjunZhang/ema-pg","url_abs":"https://arxiv.org/abs/2602.04417","url_pdf":"https://arxiv.org/pdf/2602.04417","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2602.04417","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2602.04417"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/LunjunZhang/ema-pg","reach":null}],"summary":{"ran":1,"ran_draft_wrong":2,"unverified":7},"by_repo_kind":{"found_in_text":{"samples":10,"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":0,"samples":[{"code_sha256_prefix":"360c671d6041ba3b","entry":"create_huggingface_actor","repo":"LunjunZhang/ema-pg","repo_kind":"found_in_text","path":"search/verl/utils/model.py","file_url":"https://github.com/LunjunZhang/ema-pg/blob/HEAD/search/verl/utils/model.py","link_basis":"harvester_set","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":"360c671d6041ba3b"}},{"code_sha256_prefix":"8709b4b7236b87d7","entry":"get_query","repo":"LunjunZhang/ema-pg","repo_kind":"found_in_text","path":"search/infer.py","file_url":"https://github.com/LunjunZhang/ema-pg/blob/HEAD/search/infer.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8709b4b7236b87d7"}},{"code_sha256_prefix":"25f0ea3f460f6ce1","entry":"unpad_dataproto","repo":"LunjunZhang/ema-pg","repo_kind":"found_in_text","path":"search/verl/protocol.py","file_url":"https://github.com/LunjunZhang/ema-pg/blob/HEAD/search/verl/protocol.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"25f0ea3f460f6ce1"}},{"code_sha256_prefix":"19472d4343d0a082","entry":"get_huggingface_actor_config","repo":"LunjunZhang/ema-pg","repo_kind":"found_in_text","path":"search/verl/utils/model.py","file_url":"https://github.com/LunjunZhang/ema-pg/blob/HEAD/search/verl/utils/model.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":"19472d4343d0a082"}},{"code_sha256_prefix":"8e21ff6e15adbc8f","entry":"get_image","repo":"LunjunZhang/ema-pg","repo_kind":"found_in_text","path":"math/rllm/misc.py","file_url":"https://github.com/LunjunZhang/ema-pg/blob/HEAD/math/rllm/misc.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":"8e21ff6e15adbc8f"}},{"code_sha256_prefix":"919cf310ad4c189a","entry":"get_weight_loader","repo":"LunjunZhang/ema-pg","repo_kind":"found_in_text","path":"search/verl/models/weight_loader_registry.py","file_url":"https://github.com/LunjunZhang/ema-pg/blob/HEAD/search/verl/models/weight_loader_registry.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":"919cf310ad4c189a"}},{"code_sha256_prefix":"b7aec73d6258eba0","entry":"merge_dicts","repo":"LunjunZhang/ema-pg","repo_kind":"found_in_text","path":"math/rllm/misc.py","file_url":"https://github.com/LunjunZhang/ema-pg/blob/HEAD/math/rllm/misc.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":"b7aec73d6258eba0"}},{"code_sha256_prefix":"15c74c1c2cf76cf7","entry":"pad_from_left","repo":"LunjunZhang/ema-pg","repo_kind":"found_in_text","path":"math/rllm/misc.py","file_url":"https://github.com/LunjunZhang/ema-pg/blob/HEAD/math/rllm/misc.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":"15c74c1c2cf76cf7"}},{"code_sha256_prefix":"b0919972b9febb29","entry":"search","repo":"LunjunZhang/ema-pg","repo_kind":"found_in_text","path":"search/infer.py","file_url":"https://github.com/LunjunZhang/ema-pg/blob/HEAD/search/infer.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":"b0919972b9febb29"}},{"code_sha256_prefix":"3b15e2ac7497c441","entry":"squeeze","repo":"LunjunZhang/ema-pg","repo_kind":"found_in_text","path":"search/verl/utils/model.py","file_url":"https://github.com/LunjunZhang/ema-pg/blob/HEAD/search/verl/utils/model.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":"3b15e2ac7497c441"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}