{"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-21492","title":"GradAlign: Gradient-Aligned Data Selection for LLM Reinforcement Learning","arxiv_id":"2602.21492","date":"2026-02-25","proceeding":null,"authors":["Ningyuan Yang","Weihua Du","Weiwei Sun","Sean Welleck","Yiming Yang"],"abstract":"Reinforcement learning (RL) has become a central post-training paradigm for large language models (LLMs), but its performance is highly sensitive to the quality of training problems. This sensitivity stems from the non-stationarity of RL: rollouts are generated by an evolving policy, and learning is shaped by exploration and reward feedback, unlike supervised fine-tuning (SFT) with fixed trajectories. As a result, prior work often relies on manual curation or simple heuristic filters (e.g., accuracy), which can admit incorrect or low-utility problems. We propose GradAlign, a gradient-aligned data selection method for LLM reinforcement learning that uses a small, trusted validation set to prioritize training problems whose policy gradients align with validation gradients, yielding an adaptive curriculum. We evaluate GradAlign across three challenging data regimes: unreliable reward signals, distribution imbalance, and low-utility training corpus, showing that GradAlign consistently outperforms existing baselines, underscoring the importance of directional gradient signals in navigating non-stationary policy optimization and yielding more stable training and improved final performance. We release our implementation at https://github.com/StigLidu/GradAlign","url_abs":"https://arxiv.org/abs/2602.21492","url_pdf":"https://arxiv.org/pdf/2602.21492","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.21492","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2602.21492"}},"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/StigLidu/GradAlign","reach":null}],"summary":{"unverified":17},"by_repo_kind":{"found_in_text":{"samples":17,"ran":0,"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":17,"samples":[{"code_sha256_prefix":"bc620ec0d5ea56a5","entry":"aggregate_accuracy","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"automated/aggregate.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/automated/aggregate.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":"bc620ec0d5ea56a5"}},{"code_sha256_prefix":"f8d2cea71368ec06","entry":"aggregate_similarity","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"automated/aggregate.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/automated/aggregate.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":"f8d2cea71368ec06"}},{"code_sha256_prefix":"60f309dc7281baa7","entry":"build_exp_name","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"automated/launch_verl_training.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/automated/launch_verl_training.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":"60f309dc7281baa7"}},{"code_sha256_prefix":"b4b4346238c8b44a","entry":"build_local_dir","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"automated/merge_model.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/automated/merge_model.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":"b4b4346238c8b44a"}},{"code_sha256_prefix":"5149292e77619ae5","entry":"build_target_dir","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"automated/merge_model.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/automated/merge_model.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":"5149292e77619ae5"}},{"code_sha256_prefix":"df7f7b3db9111a60","entry":"compute_grpo_advantages","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"select/grpo_loss.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/select/grpo_loss.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":"df7f7b3db9111a60"}},{"code_sha256_prefix":"c49f6d2c2c74ad34","entry":"compute_kl_loss","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"select/grpo_loss.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/select/grpo_loss.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":"c49f6d2c2c74ad34"}},{"code_sha256_prefix":"9d79168f0a9a110a","entry":"compute_policy_loss","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"select/grpo_loss.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/select/grpo_loss.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":"9d79168f0a9a110a"}},{"code_sha256_prefix":"acebf9fd0c7337b5","entry":"describe_target","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"automated/convert_megatron_optimizer_to_hf.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/automated/convert_megatron_optimizer_to_hf.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":"acebf9fd0c7337b5"}},{"code_sha256_prefix":"d46df850e9d2e176","entry":"detect_parallel_config","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"automated/convert_megatron_optimizer_to_hf.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/automated/convert_megatron_optimizer_to_hf.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":"d46df850e9d2e176"}},{"code_sha256_prefix":"ce946da43a827e70","entry":"find_part_dirs","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"automated/aggregate.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/automated/aggregate.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":"ce946da43a827e70"}},{"code_sha256_prefix":"b160cd5de60e562d","entry":"get_dataset_dir","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"automated/config.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/automated/config.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":"b160cd5de60e562d"}},{"code_sha256_prefix":"99af6d5e08f8669f","entry":"get_model_path","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"automated/config.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/automated/config.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":"99af6d5e08f8669f"}},{"code_sha256_prefix":"17dc8f1091f17309","entry":"get_model_type","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"automated/config.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/automated/config.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":"17dc8f1091f17309"}},{"code_sha256_prefix":"c7cb10df1b7fbd5d","entry":"part_dir_exists","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"automated/run_parallel_analysis.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/automated/run_parallel_analysis.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":"c7cb10df1b7fbd5d"}},{"code_sha256_prefix":"7c336680bdbe7af1","entry":"read_json","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"sort_jsonl.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/sort_jsonl.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":"7c336680bdbe7af1"}},{"code_sha256_prefix":"bb7ead774bbf8c6f","entry":"sort_entries","repo":"StigLidu/GradAlign","repo_kind":"found_in_text","path":"sort_jsonl.py","file_url":"https://github.com/StigLidu/GradAlign/blob/HEAD/sort_jsonl.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":"bb7ead774bbf8c6f"}}]},"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}