{"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/archer-training-language-model-agents-via","title":"ArCHer: Training Language Model Agents via Hierarchical Multi-Turn RL","arxiv_id":"2402.19446","date":"2024-02-29","proceeding":null,"authors":["Yifei Zhou","Andrea Zanette","Jiayi Pan","Sergey Levine","Aviral Kumar"],"abstract":"A broad use case of large language models (LLMs) is in goal-directed decision-making tasks (or \"agent\" tasks), where an LLM needs to not just generate completions for a given prompt, but rather make intelligent decisions over a multi-turn interaction to accomplish a task (e.g., when interacting with the web, using tools, or providing customer support). Reinforcement learning (RL) provides a general paradigm to address such agent tasks, but current RL methods for LLMs largely focus on optimizing single-turn rewards. By construction, most single-turn RL methods cannot endow LLMs with the ability to intelligently seek information over multiple turns, perform credit assignment, or reason about their past actions -- all of which are critical in agent tasks. This raises the question: how can we design effective and efficient multi-turn RL algorithms for LLMs? In this paper, we develop a framework for building multi-turn RL algorithms for fine-tuning LLMs, that preserves the flexibility of existing single-turn RL methods for LLMs (e.g., proximal policy optimization), while accommodating multiple turns, long horizons, and delayed rewards effectively. To do this, our framework adopts a hierarchical RL approach and runs two RL algorithms in parallel: a high-level off-policy value-based RL algorithm to aggregate reward over utterances, and a low-level RL algorithm that utilizes this high-level value function to train a token policy within each utterance or turn. Our hierarchical framework, Actor-Critic Framework with a Hierarchical Structure (ArCHer), can also give rise to other RL methods. Empirically, we find that ArCHer significantly improves efficiency and performance on agent tasks, attaining a sample efficiency of about 100x over existing methods, while also improving with larger model capacity (upto the 7 billion scale that we tested on).","url_abs":"https://arxiv.org/abs/2402.19446v1","url_pdf":"https://arxiv.org/pdf/2402.19446v1.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":"archer-training-language-model-agents-via","repo_url":"https://github.com/yifeizhou02/archer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"archer-training-language-model-agents-via","repo_url":"https://github.com/ragen-ai/vagen","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"reinforcement-learning-1","task_name":"Reinforcement Learning (RL)"}],"methods":[{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2402.19446","atlas_url":"https://app.syntology.ai/?focus=2402.19446","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.19446"}},"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/ragen-ai/vagen","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yifeizhou02/archer","reach":null}],"summary":{"ran_draft_wrong":1,"ran":3,"unverified":2},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1},"listed":{"samples":5,"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":"e154ffa50c4434d1","entry":"dict_mean","repo":"yifeizhou02/archer","repo_kind":"official","path":"archer/algorithms/archer/trainer.py","file_url":"https://github.com/yifeizhou02/archer/blob/HEAD/archer/algorithms/archer/trainer.py","link_basis":"first_harvest_node","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":"e154ffa50c4434d1"}},{"code_sha256_prefix":"8b14e542ea0a28ee","entry":"optional","repo":"ragen-ai/vagen","repo_kind":"listed","path":"vagen/algorithms/_common/params.py","file_url":"https://github.com/ragen-ai/vagen/blob/HEAD/vagen/algorithms/_common/params.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":"8b14e542ea0a28ee"}},{"code_sha256_prefix":"117bc284bd4e592d","entry":"required","repo":"ragen-ai/vagen","repo_kind":"listed","path":"vagen/algorithms/_common/params.py","file_url":"https://github.com/ragen-ai/vagen/blob/HEAD/vagen/algorithms/_common/params.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":"117bc284bd4e592d"}},{"code_sha256_prefix":"b9ddb635cb193269","entry":"to_int64_codes","repo":"ragen-ai/vagen","repo_kind":"listed","path":"vagen/algorithms/_common/trajectory.py","file_url":"https://github.com/ragen-ai/vagen/blob/HEAD/vagen/algorithms/_common/trajectory.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":"b9ddb635cb193269"}},{"code_sha256_prefix":"4887dd399c56530a","entry":"get_env_cls","repo":"ragen-ai/vagen","repo_kind":"listed","path":"vagen/envs/registry.py","file_url":"https://github.com/ragen-ai/vagen/blob/HEAD/vagen/envs/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":"4887dd399c56530a"}},{"code_sha256_prefix":"027f2b6fb5a9b14a","entry":"needs_value_mask","repo":"ragen-ai/vagen","repo_kind":"listed","path":"vagen/algorithms/_common/registry.py","file_url":"https://github.com/ragen-ai/vagen/blob/HEAD/vagen/algorithms/_common/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":"027f2b6fb5a9b14a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}