{"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-03645","title":"Reinforcement Fine-Tuning for History-Aware Dense Retriever in RAG","arxiv_id":"2602.03645","date":"2026-02-03","proceeding":null,"authors":["Yicheng Zhang","Zhen Qin","Zhaomin Wu","Wenqi Zhang","Shuiguang Deng"],"abstract":"Retrieval-augmented generation (RAG) enables large language models (LLMs) to produce evidence-based responses, and its performance hinges on the matching between the retriever and LLMs. Retriever optimization has emerged as an efficient alternative to fine-tuning LLMs. However, existing solutions suffer from objective mismatch between retriever optimization and the goal of RAG pipeline. Reinforcement learning (RL) provides a promising solution to address this limitation, yet applying RL to retriever optimization introduces two fundamental challenges: 1) the deterministic retrieval is incompatible with RL formulations, and 2) state aliasing arises from query-only retrieval in multi-hop reasoning. To address these challenges, we replace deterministic retrieval with stochastic sampling and formulate RAG as a Markov decision process, making retriever optimizable by RL. Further, we incorporate retrieval history into the state at each retrieval step to mitigate state aliasing. Extensive experiments across diverse RAG pipelines, datasets, and retriever scales demonstrate consistent improvements of our approach in RAG performance.","url_abs":"https://arxiv.org/abs/2602.03645","url_pdf":"https://arxiv.org/pdf/2602.03645","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.03645","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2602.03645"}},"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/zyc140345/HARR","reach":null}],"summary":{"ran_honours":1,"ran_draft_wrong":1,"unverified":7},"by_repo_kind":{"found_in_text":{"samples":9,"ran":2,"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":"f8ea5de03c824510","entry":"em_check","repo":"zyc140345/HARR","repo_kind":"found_in_text","path":"metric/qa_em.py","file_url":"https://github.com/zyc140345/HARR/blob/HEAD/metric/qa_em.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f8ea5de03c824510"}},{"code_sha256_prefix":"dae7ab386661a4f4","entry":"normalize_answer","repo":"zyc140345/HARR","repo_kind":"found_in_text","path":"metric/qa_em.py","file_url":"https://github.com/zyc140345/HARR/blob/HEAD/metric/qa_em.py","link_basis":"harvester_set","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":"dae7ab386661a4f4"}},{"code_sha256_prefix":"c05aa5267515a8e3","entry":"build_stateful_embedding_query","repo":"zyc140345/HARR","repo_kind":"found_in_text","path":"llama_index_hacked/tool.py","file_url":"https://github.com/zyc140345/HARR/blob/HEAD/llama_index_hacked/tool.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":"c05aa5267515a8e3"}},{"code_sha256_prefix":"dfed7c865ba58bfb","entry":"get_dataset_repo_id","repo":"zyc140345/HARR","repo_kind":"found_in_text","path":"main_grpo.py","file_url":"https://github.com/zyc140345/HARR/blob/HEAD/main_grpo.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":"dfed7c865ba58bfb"}},{"code_sha256_prefix":"e2d305b139e08312","entry":"get_run_name","repo":"zyc140345/HARR","repo_kind":"found_in_text","path":"main_grpo.py","file_url":"https://github.com/zyc140345/HARR/blob/HEAD/main_grpo.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":"e2d305b139e08312"}},{"code_sha256_prefix":"e406373defafb0db","entry":"parse_answer","repo":"zyc140345/HARR","repo_kind":"found_in_text","path":"llama_index_hacked/query_engine.py","file_url":"https://github.com/zyc140345/HARR/blob/HEAD/llama_index_hacked/query_engine.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":"e406373defafb0db"}},{"code_sha256_prefix":"622045576a49f4a0","entry":"plot_wandb_train_grad_norm_area","repo":"zyc140345/HARR","repo_kind":"found_in_text","path":"plot.py","file_url":"https://github.com/zyc140345/HARR/blob/HEAD/plot.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":"622045576a49f4a0"}},{"code_sha256_prefix":"465fac7ce70ede4d","entry":"plot_wandb_train_reward_raw","repo":"zyc140345/HARR","repo_kind":"found_in_text","path":"plot.py","file_url":"https://github.com/zyc140345/HARR/blob/HEAD/plot.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":"465fac7ce70ede4d"}},{"code_sha256_prefix":"fe4144449f785d4c","entry":"subem_check","repo":"zyc140345/HARR","repo_kind":"found_in_text","path":"metric/qa_em.py","file_url":"https://github.com/zyc140345/HARR/blob/HEAD/metric/qa_em.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":"fe4144449f785d4c"}}]},"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}