{"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/tree-search-for-language-model-agents","title":"Tree Search for Language Model Agents","arxiv_id":"2407.01476","date":"2024-07-01","proceeding":null,"authors":["Jing Yu Koh","Stephen Mcaleer","Daniel Fried","Ruslan Salakhutdinov"],"abstract":"Autonomous agents powered by language models (LMs) have demonstrated promise in their ability to perform decision-making tasks such as web automation. However, a key limitation remains: LMs, primarily optimized for natural language understanding and generation, struggle with multi-step reasoning, planning, and using environmental feedback when attempting to solve realistic computer tasks. Towards addressing this, we propose an inference-time search algorithm for LM agents to explicitly perform exploration and multi-step planning in interactive web environments. Our approach is a form of best-first tree search that operates within the actual environment space, and is complementary with most existing state-of-the-art agents. It is the first tree search algorithm for LM agents that shows effectiveness on realistic web tasks. On the challenging VisualWebArena benchmark, applying our search algorithm on top of a GPT-4o agent yields a 39.7% relative increase in success rate compared to the same baseline without search, setting a state-of-the-art success rate of 26.4%. On WebArena, search also yields a 28.0% relative improvement over a baseline agent, setting a competitive success rate of 19.2%. Our experiments highlight the effectiveness of search for web agents, and we demonstrate that performance scales with increased test-time compute. We conduct a thorough analysis of our results to highlight improvements from search, limitations, and promising directions for future work. Our code and models are publicly released at https://jykoh.com/search-agents.","url_abs":"https://arxiv.org/abs/2407.01476v2","url_pdf":"https://arxiv.org/pdf/2407.01476v2.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":"tree-search-for-language-model-agents","repo_url":"https://github.com/kohjingyu/search-agents","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":"natural-language-understanding","task_name":"Natural Language Understanding"},{"task_slug":"model","task_name":"model"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2407.01476","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2407.01476"}},"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":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/kohjingyu/search-agents","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":4,"ran_draft_wrong":2,"unverified":1},"by_repo_kind":{"listed":{"samples":7,"ran":6,"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":"824ae078c5d3295a","entry":"get_site_comb_from_filepath","repo":"kohjingyu/search-agents","repo_kind":"listed","path":"browser_env/auto_login.py","file_url":"https://github.com/kohjingyu/search-agents/blob/HEAD/browser_env/auto_login.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"824ae078c5d3295a"}},{"code_sha256_prefix":"1829c408a278c974","entry":"parse_action","repo":"kohjingyu/search-agents","repo_kind":"listed","path":"browser_env/envs.py","file_url":"https://github.com/kohjingyu/search-agents/blob/HEAD/browser_env/envs.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":"1829c408a278c974"}},{"code_sha256_prefix":"d8254925e6697a59","entry":"pil_to_b64","repo":"kohjingyu/search-agents","repo_kind":"listed","path":"browser_env/utils.py","file_url":"https://github.com/kohjingyu/search-agents/blob/HEAD/browser_env/utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d8254925e6697a59"}},{"code_sha256_prefix":"71ec370bd2568e5b","entry":"pil_to_vertex","repo":"kohjingyu/search-agents","repo_kind":"listed","path":"browser_env/utils.py","file_url":"https://github.com/kohjingyu/search-agents/blob/HEAD/browser_env/utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"71ec370bd2568e5b"}},{"code_sha256_prefix":"04ba3dcf1bb13e4f","entry":"png_bytes_to_numpy","repo":"kohjingyu/search-agents","repo_kind":"listed","path":"browser_env/utils.py","file_url":"https://github.com/kohjingyu/search-agents/blob/HEAD/browser_env/utils.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":"04ba3dcf1bb13e4f"}},{"code_sha256_prefix":"b3cfdfe328f76c2d","entry":"remove_unicode","repo":"kohjingyu/search-agents","repo_kind":"listed","path":"browser_env/processors.py","file_url":"https://github.com/kohjingyu/search-agents/blob/HEAD/browser_env/processors.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b3cfdfe328f76c2d"}},{"code_sha256_prefix":"14343f643521d39a","entry":"action2str","repo":"kohjingyu/search-agents","repo_kind":"listed","path":"browser_env/actions.py","file_url":"https://github.com/kohjingyu/search-agents/blob/HEAD/browser_env/actions.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":"14343f643521d39a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}