{"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/can-large-language-models-be-good-path","title":"Can Large Language Models be Good Path Planners? A Benchmark and Investigation on Spatial-temporal Reasoning","arxiv_id":"2310.03249","date":"2023-10-05","proceeding":null,"authors":["Mohamed Aghzal","Erion Plaku","Ziyu Yao"],"abstract":"Large language models (LLMs) have achieved remarkable success across a wide spectrum of tasks; however, they still face limitations in scenarios that demand long-term planning and spatial reasoning. To facilitate this line of research, in this work, we propose a new benchmark, termed $\\textbf{P}$ath $\\textbf{P}$lanning from $\\textbf{N}$atural $\\textbf{L}$anguage ($\\textbf{PPNL}$). Our benchmark evaluates LLMs' spatial-temporal reasoning by formulating ''path planning'' tasks that require an LLM to navigate to target locations while avoiding obstacles and adhering to constraints. Leveraging this benchmark, we systematically investigate LLMs including GPT-4 via different few-shot prompting methodologies as well as BART and T5 of various sizes via fine-tuning. Our experimental results show the promise of few-shot GPT-4 in spatial reasoning, when it is prompted to reason and act interleavedly, although it still fails to perform long-term temporal reasoning. In contrast, while fine-tuned LLMs achieved impressive results on in-distribution reasoning tasks, they struggled to generalize to larger environments or environments with more obstacles.","url_abs":"https://arxiv.org/abs/2310.03249v2","url_pdf":"https://arxiv.org/pdf/2310.03249v2.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":"can-large-language-models-be-good-path","repo_url":"https://github.com/mohamedaghzal/llms-as-path-planners","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"navigate","task_name":"Navigate"},{"task_slug":"spatial-reasoning","task_name":"Spatial Reasoning"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adafactor","method_name":"Adafactor"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bart","method_name":"BART"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt-4","method_name":"GPT-4"},{"method_slug":"glu","method_name":"Gated Linear Unit"},{"method_slug":"inverse-square-root-schedule","method_name":"Inverse Square Root Schedule"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"sentencepiece","method_name":"SentencePiece"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"t5","method_name":"T5"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2310.03249","atlas_url":"https://app.syntology.ai/?focus=2310.03249","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.03249"}},"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/mohamedaghzal/llms-as-path-planners","reach":{"status":"ok"}}],"summary":{"ran":28},"by_repo_kind":{"official":{"samples":28,"ran":28,"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":28,"samples":[{"code_sha256_prefix":"1d7ecad86c4cf33d","entry":"a_star","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/generate_samples.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/generate_samples.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":"1d7ecad86c4cf33d"}},{"code_sha256_prefix":"f514998c2d24dde3","entry":"actions_and_effects","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"ppnl-spatial-temporal-reasoning/ICL/actions_and_effect_prompts.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/ppnl-spatial-temporal-reasoning/ICL/actions_and_effect_prompts.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f514998c2d24dde3"}},{"code_sha256_prefix":"e668aeb35a33a774","entry":"build_path","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/place_agent_goals_sg.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/place_agent_goals_sg.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":"e668aeb35a33a774"}},{"code_sha256_prefix":"8419ce244e148b28","entry":"construct_grid","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/place_agent_goals_sg.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/place_agent_goals_sg.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":"8419ce244e148b28"}},{"code_sha256_prefix":"f7e0e94c07eec3e4","entry":"count_obstacles","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"ppnl-spatial-temporal-reasoning/ICL/actions_and_effect_prompts.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/ppnl-spatial-temporal-reasoning/ICL/actions_and_effect_prompts.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":"f7e0e94c07eec3e4"}},{"code_sha256_prefix":"5a4054d663046894","entry":"draw_path","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/prompting.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/prompting.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":"5a4054d663046894"}},{"code_sha256_prefix":"806fb301720451ec","entry":"exact_match","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/evaluate.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/evaluate.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":"806fb301720451ec"}},{"code_sha256_prefix":"caa8df4c4d1fd565","entry":"fixed_length","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/helpers.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/helpers.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":"caa8df4c4d1fd565"}},{"code_sha256_prefix":"c274f392ee719051","entry":"generate_code","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/generate_samples.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/generate_samples.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":"c274f392ee719051"}},{"code_sha256_prefix":"0702ff5547719980","entry":"generate_code_alternate_column","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/representations.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/representations.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":"0702ff5547719980"}},{"code_sha256_prefix":"b1c836fbb3f4d4fc","entry":"generate_code_rectangle","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/representations.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/representations.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":"b1c836fbb3f4d4fc"}},{"code_sha256_prefix":"35a7867d3c2e93af","entry":"generate_code_spiral","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/representations.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/representations.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":"35a7867d3c2e93af"}},{"code_sha256_prefix":"00e00e527a7e268c","entry":"generate_effects","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/prompting.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/prompting.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":"00e00e527a7e268c"}},{"code_sha256_prefix":"89b81366df015ab8","entry":"generate_grid","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/generate_samples.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/generate_samples.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":"89b81366df015ab8"}},{"code_sha256_prefix":"cebb72c7aecd9c49","entry":"generate_worlds","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/place_agent_goals_sg.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/place_agent_goals_sg.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":"cebb72c7aecd9c49"}},{"code_sha256_prefix":"d3e9e3908a9df9c8","entry":"get_actual","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"ppnl-spatial-temporal-reasoning/ICL/parse_react_mg_path.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/ppnl-spatial-temporal-reasoning/ICL/parse_react_mg_path.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":"d3e9e3908a9df9c8"}},{"code_sha256_prefix":"3a2159f19cba31c7","entry":"is_row","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/planning_samples.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/planning_samples.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":"3a2159f19cba31c7"}},{"code_sha256_prefix":"1ddb64e34d0ffc15","entry":"one_opening_per_column","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/one_entrance.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/one_entrance.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":"1ddb64e34d0ffc15"}},{"code_sha256_prefix":"f62c1ffb342ad79d","entry":"one_opening_per_row","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/one_entrance.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/one_entrance.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":"f62c1ffb342ad79d"}},{"code_sha256_prefix":"a93c8460f75834dc","entry":"out_of_bounds","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/prompting.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/prompting.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":"a93c8460f75834dc"}},{"code_sha256_prefix":"2aa266d417a4012c","entry":"parse_react_path","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"ppnl-spatial-temporal-reasoning/ICL/parse_react_mg_path.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/ppnl-spatial-temporal-reasoning/ICL/parse_react_mg_path.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":"2aa266d417a4012c"}},{"code_sha256_prefix":"ba3aa7daeaf50708","entry":"rectangle","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/geometries.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/geometries.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":"ba3aa7daeaf50708"}},{"code_sha256_prefix":"822d5128406dc0b4","entry":"sample","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/one_entrance.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/one_entrance.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":"822d5128406dc0b4"}},{"code_sha256_prefix":"8ed9120665b11d99","entry":"single_environment","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/helpers.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/helpers.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":"8ed9120665b11d99"}},{"code_sha256_prefix":"8d0323e6656ee492","entry":"spiral_maze","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/geometries.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/geometries.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":"8d0323e6656ee492"}},{"code_sha256_prefix":"d74bce6422f92cd8","entry":"success_sg","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/evaluate.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/evaluate.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":"d74bce6422f92cd8"}},{"code_sha256_prefix":"02579eedf3922c00","entry":"triangle","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/geometries.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/geometries.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":"02579eedf3922c00"}},{"code_sha256_prefix":"4ac5d326cb14bb91","entry":"valid_position","repo":"mohamedaghzal/llms-as-path-planners","repo_kind":"official","path":"gpt-4-path-planning/src/evaluate.py","file_url":"https://github.com/mohamedaghzal/llms-as-path-planners/blob/HEAD/gpt-4-path-planning/src/evaluate.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":"4ac5d326cb14bb91"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}