{"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/arxiv-2601-21468","title":"MemOCR: Layout-Aware Visual Memory for Efficient Long-Horizon Reasoning","arxiv_id":"2601.21468","date":"2026-01-29","proceeding":"ICML","authors":["Yaorui Shi","Shugui Liu","Yu Yang","Wenyu Mao","Yuxin Chen","Qi GU","Hui Su","Xunliang Cai","Xiang Wang","An Zhang"],"abstract":"Long-horizon agentic reasoning necessitates effectively compressing growing interaction histories into a limited context window. Most existing memory systems serialize history as text, where token-level cost is uniform and scales linearly with length, often spending scarce budget on low-value details. To this end, we introduce MemOCR, a multimodal memory agent that improves long-horizon reasoning under tight context budgets by allocating memory space with adaptive information density through visual layout. Concretely, MemOCR maintains a structured rich-text memory (e.g., headings, highlights) and renders it into an image that the agent consults for memory access, visually prioritizing crucial evidence while aggressively compressing auxiliary details. To ensure robustness across varying memory budgets, we train MemOCR with reinforcement learning under budget-aware objectives that expose the agent to diverse compression levels. Across long-context multi-hop and single-hop question-answering benchmarks, MemOCR outperforms strong text-based baselines and achieves more effective context utilization under extreme budgets.","url_abs":"https://arxiv.org/abs/2601.21468","url_pdf":"https://arxiv.org/pdf/2601.21468","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2601.21468","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2601.21468"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/meituan/MemOCR","reach":null}],"summary":{"ran_honours":3,"ran":6,"ran_fixture":1,"unverified":7},"by_repo_kind":{"found_in_text":{"samples":17,"ran":10,"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":"6e45201fa27cb24a","entry":"ceil_by_factor","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"qwen_vl_utils.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/qwen_vl_utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6e45201fa27cb24a"}},{"code_sha256_prefix":"f220595adfc5e83c","entry":"compute_ce_dpo_loss_rm","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"recipe/prime/prime_core_algos.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/recipe/prime/prime_core_algos.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f220595adfc5e83c"}},{"code_sha256_prefix":"4d91e4383716e42c","entry":"compute_detach_dpo_loss_rm","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"recipe/prime/prime_core_algos.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/recipe/prime/prime_core_algos.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4d91e4383716e42c"}},{"code_sha256_prefix":"f19825983a523003","entry":"compute_online_dpo_loss","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"recipe/spin/core_algos.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/recipe/spin/core_algos.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f19825983a523003"}},{"code_sha256_prefix":"41b6e81dc3ecba79","entry":"compute_onlinedpo_pref","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"recipe/spin/core_algos.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/recipe/spin/core_algos.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"41b6e81dc3ecba79"}},{"code_sha256_prefix":"05a86ccb0b3876dd","entry":"compute_score_data_source","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"recipe/open_math_reasoning/compute_score.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/recipe/open_math_reasoning/compute_score.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"05a86ccb0b3876dd"}},{"code_sha256_prefix":"8155263d7ff19bb3","entry":"floor_by_factor","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"qwen_vl_utils.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/qwen_vl_utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8155263d7ff19bb3"}},{"code_sha256_prefix":"757d109d90121142","entry":"get_kl_controller","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"recipe/spin/core_algos.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/recipe/spin/core_algos.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"757d109d90121142"}},{"code_sha256_prefix":"8a84f8cc921357e2","entry":"reward_func","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"recipe/r1/reward_score.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/recipe/r1/reward_score.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"DEP_MISSING","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8a84f8cc921357e2"}},{"code_sha256_prefix":"e252767324188623","entry":"round_by_factor","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"qwen_vl_utils.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/qwen_vl_utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e252767324188623"}},{"code_sha256_prefix":"648ef3d7fc5c80e3","entry":"batch_subsample_images","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"recurrent/generation_manager.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/recurrent/generation_manager.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"648ef3d7fc5c80e3"}},{"code_sha256_prefix":"f2a7d1d12a2a2a8d","entry":"collate_fn","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"recurrent/generation_manager.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/recurrent/generation_manager.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f2a7d1d12a2a2a8d"}},{"code_sha256_prefix":"6d8fe026abd5fcdd","entry":"format_tool_response_manually","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"recipe/langgraph_agent/chat_model.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/recipe/langgraph_agent/chat_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6d8fe026abd5fcdd"}},{"code_sha256_prefix":"676fd48038c24f33","entry":"image_to_base64","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"taskutils/memory_eval/utils/memocr_md.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/taskutils/memory_eval/utils/memocr_md.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"676fd48038c24f33"}},{"code_sha256_prefix":"c1ec94997a64fa91","entry":"resize_maintain_aspect","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"taskutils/memory_eval/utils/memocr_md.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/taskutils/memory_eval/utils/memocr_md.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c1ec94997a64fa91"}},{"code_sha256_prefix":"0d494d662eb75d0b","entry":"run_coroutine_in_chat_scheduler_loop","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"recurrent/async_utils.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/recurrent/async_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0d494d662eb75d0b"}},{"code_sha256_prefix":"4f4ccb21be8818cb","entry":"trim_whitespace","repo":"meituan/MemOCR","repo_kind":"found_in_text","path":"md2img/markdown_api_server.py","file_url":"https://github.com/meituan/MemOCR/blob/HEAD/md2img/markdown_api_server.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4f4ccb21be8818cb"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.AI","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}