{"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/from-text-to-space-mapping-abstract-spatial","title":"From Text to Space: Mapping Abstract Spatial Models in LLMs during a Grid-World Navigation Task","arxiv_id":"2502.16690","date":"2025-02-23","proceeding":null,"authors":["Nicolas Martorell"],"abstract":"Understanding how large language models (LLMs) represent and reason about spatial information is crucial for building robust agentic systems that can navigate real and simulated environments. In this work, we investigate the influence of different text-based spatial representations on LLM performance and internal activations in a grid-world navigation task. By evaluating models of various sizes on a task that requires navigating toward a goal, we examine how the format used to encode spatial information impacts decision-making. Our experiments reveal that cartesian representations of space consistently yield higher success rates and path efficiency, with performance scaling markedly with model size. Moreover, probing LLaMA-3.1-8B revealed subsets of internal units, primarily located in intermediate layers, that robustly correlate with spatial features, such as the position of the agent in the grid or action correctness, regardless of how that information is represented, and are also activated by unrelated spatial reasoning tasks. This work advances our understanding of how LLMs process spatial information and provides valuable insights for developing more interpretable and robust agentic AI systems.","url_abs":"https://arxiv.org/abs/2502.16690v1","url_pdf":"https://arxiv.org/pdf/2502.16690v1.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":"from-text-to-space-mapping-abstract-spatial","repo_url":"https://github.com/mneuronico/griw-world-spatial-orientation-task","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"decision-making","task_name":"Decision Making"},{"task_slug":"navigate","task_name":"Navigate"},{"task_slug":"spatial-reasoning","task_name":"Spatial Reasoning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2502.16690","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.16690"}},"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/mneuronico/griw-world-spatial-orientation-task","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":8},"by_repo_kind":{"official":{"samples":8,"ran":0,"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":"834a70da9e99f667","entry":"build_target_matrix","repo":"mneuronico/griw-world-spatial-orientation-task","repo_kind":"official","path":"analysis/linear_mapping.py","file_url":"https://github.com/mneuronico/griw-world-spatial-orientation-task/blob/HEAD/analysis/linear_mapping.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":"834a70da9e99f667"}},{"code_sha256_prefix":"c69c3ab132d4756b","entry":"build_tokenized_input","repo":"mneuronico/griw-world-spatial-orientation-task","repo_kind":"official","path":"experiments/Agent.py","file_url":"https://github.com/mneuronico/griw-world-spatial-orientation-task/blob/HEAD/experiments/Agent.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":"c69c3ab132d4756b"}},{"code_sha256_prefix":"44eb88612fdfc79e","entry":"build_tokenized_input","repo":"mneuronico/griw-world-spatial-orientation-task","repo_kind":"official","path":"experiments/fns.py","file_url":"https://github.com/mneuronico/griw-world-spatial-orientation-task/blob/HEAD/experiments/fns.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":"44eb88612fdfc79e"}},{"code_sha256_prefix":"e1afd192488a332c","entry":"create_ablation_hook","repo":"mneuronico/griw-world-spatial-orientation-task","repo_kind":"official","path":"experiments/Agent.py","file_url":"https://github.com/mneuronico/griw-world-spatial-orientation-task/blob/HEAD/experiments/Agent.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":"e1afd192488a332c"}},{"code_sha256_prefix":"9db41338ab75ba1e","entry":"extract_assistant_response","repo":"mneuronico/griw-world-spatial-orientation-task","repo_kind":"official","path":"experiments/Agent.py","file_url":"https://github.com/mneuronico/griw-world-spatial-orientation-task/blob/HEAD/experiments/Agent.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":"9db41338ab75ba1e"}},{"code_sha256_prefix":"1380efbe5fa29e71","entry":"get_response","repo":"mneuronico/griw-world-spatial-orientation-task","repo_kind":"official","path":"experiments/fns.py","file_url":"https://github.com/mneuronico/griw-world-spatial-orientation-task/blob/HEAD/experiments/fns.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":"1380efbe5fa29e71"}},{"code_sha256_prefix":"038dc68a58ff4bb6","entry":"load_model","repo":"mneuronico/griw-world-spatial-orientation-task","repo_kind":"official","path":"experiments/fns.py","file_url":"https://github.com/mneuronico/griw-world-spatial-orientation-task/blob/HEAD/experiments/fns.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":"038dc68a58ff4bb6"}},{"code_sha256_prefix":"f105a9126dcc821d","entry":"manhattan_distance","repo":"mneuronico/griw-world-spatial-orientation-task","repo_kind":"official","path":"analysis/correctness_analysis.py","file_url":"https://github.com/mneuronico/griw-world-spatial-orientation-task/blob/HEAD/analysis/correctness_analysis.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":"f105a9126dcc821d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}