{"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/dots-learning-to-reason-dynamically-in-llms","title":"DOTS: Learning to Reason Dynamically in LLMs via Optimal Reasoning Trajectories Search","arxiv_id":"2410.03864","date":"2024-10-04","proceeding":null,"authors":["Murong Yue","Wenlin Yao","Haitao Mi","Dian Yu","Ziyu Yao","Dong Yu"],"abstract":"Enhancing the capability of large language models (LLMs) in reasoning has gained significant attention in recent years. Previous studies have demonstrated the effectiveness of various prompting strategies in aiding LLMs in reasoning (called \"reasoning actions\"), such as step-by-step thinking, reflecting before answering, solving with programs, and their combinations. However, these approaches often applied static, predefined reasoning actions uniformly to all questions, without considering the specific characteristics of each question or the capability of the task-solving LLM. In this paper, we propose DOTS, an approach enabling LLMs to reason dynamically via optimal reasoning trajectory search, tailored to the specific characteristics of each question and the inherent capability of the task-solving LLM. Our approach involves three key steps: i) defining atomic reasoning action modules that can be composed into various reasoning action trajectories; ii) searching for the optimal action trajectory for each training question through iterative exploration and evaluation for the specific task-solving LLM; and iii) using the collected optimal trajectories to train an LLM to plan for the reasoning trajectories of unseen questions. In particular, we propose two learning paradigms, i.e., fine-tuning an external LLM as a planner to guide the task-solving LLM, or directly fine-tuning the task-solving LLM with an internalized capability for reasoning actions planning. Our experiments across eight reasoning tasks show that our method consistently outperforms static reasoning techniques and the vanilla instruction tuning approach. Further analysis reveals that our method enables LLMs to adjust their computation based on problem complexity, allocating deeper thinking and reasoning to harder problems.","url_abs":"https://arxiv.org/abs/2410.03864v1","url_pdf":"https://arxiv.org/pdf/2410.03864v1.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":"dots-learning-to-reason-dynamically-in-llms","repo_url":"https://github.com/MurongYue/DOTS","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":null}],"tasks":[],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.03864","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.03864"}},"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":"deterministic:regex_extraction","url":"https://github.com/MurongYue/DOTS","reach":null}],"summary":{"ran":1,"ran_fixture":1,"ran_draft_wrong":1,"unverified":6},"by_repo_kind":{"official":{"samples":9,"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":9,"samples":[{"code_sha256_prefix":"1a37980d506b8259","entry":"ChatVLLM","repo":"MurongYue/DOTS","repo_kind":"official","path":"src/LLM_reasoning_workflow_general.py","file_url":"https://github.com/MurongYue/DOTS/blob/HEAD/src/LLM_reasoning_workflow_general.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1a37980d506b8259"}},{"code_sha256_prefix":"28d859eb7e2dd96e","entry":"map_without_progress","repo":"MurongYue/DOTS","repo_kind":"official","path":"src/LLM_reasoning_workflow_general.py","file_url":"https://github.com/MurongYue/DOTS/blob/HEAD/src/LLM_reasoning_workflow_general.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"28d859eb7e2dd96e"}},{"code_sha256_prefix":"66746627e941f046","entry":"safe_exec","repo":"MurongYue/DOTS","repo_kind":"official","path":"src/LLM_reasoning_workflow_general.py","file_url":"https://github.com/MurongYue/DOTS/blob/HEAD/src/LLM_reasoning_workflow_general.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"66746627e941f046"}},{"code_sha256_prefix":"dbd5431bf6a544a5","entry":"ChatGPTOpenAI","repo":"MurongYue/DOTS","repo_kind":"official","path":"src/LLM_reasoning_workflow_general.py","file_url":"https://github.com/MurongYue/DOTS/blob/HEAD/src/LLM_reasoning_workflow_general.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":"dbd5431bf6a544a5"}},{"code_sha256_prefix":"58cd906feaaac942","entry":"ClaudeAthropic","repo":"MurongYue/DOTS","repo_kind":"official","path":"src/LLM_reasoning_workflow_general.py","file_url":"https://github.com/MurongYue/DOTS/blob/HEAD/src/LLM_reasoning_workflow_general.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":"58cd906feaaac942"}},{"code_sha256_prefix":"384beef0524c20df","entry":"LLMReasoningWorkflowGeneral","repo":"MurongYue/DOTS","repo_kind":"official","path":"src/LLM_reasoning_workflow_general.py","file_url":"https://github.com/MurongYue/DOTS/blob/HEAD/src/LLM_reasoning_workflow_general.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":"384beef0524c20df"}},{"code_sha256_prefix":"c2b17e65be4d6490","entry":"ReasoningModulesGeneral","repo":"MurongYue/DOTS","repo_kind":"official","path":"src/LLM_reasoning_workflow_general.py","file_url":"https://github.com/MurongYue/DOTS/blob/HEAD/src/LLM_reasoning_workflow_general.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":"c2b17e65be4d6490"}},{"code_sha256_prefix":"d87b285fd88d1a96","entry":"run_code","repo":"MurongYue/DOTS","repo_kind":"official","path":"src/LLM_reasoning_workflow_general.py","file_url":"https://github.com/MurongYue/DOTS/blob/HEAD/src/LLM_reasoning_workflow_general.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":"d87b285fd88d1a96"}},{"code_sha256_prefix":"59434e8b586eed39","entry":"select_llm_model","repo":"MurongYue/DOTS","repo_kind":"official","path":"src/LLM_reasoning_workflow_general.py","file_url":"https://github.com/MurongYue/DOTS/blob/HEAD/src/LLM_reasoning_workflow_general.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":"59434e8b586eed39"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}