{"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/ras-retrieval-and-structuring-for-knowledge","title":"RAS: Retrieval-And-Structuring for Knowledge-Intensive LLM Generation","arxiv_id":"2502.10996","date":"2025-02-16","proceeding":null,"authors":["Pengcheng Jiang","Lang Cao","Ruike Zhu","Minhao Jiang","Yunyi Zhang","Jimeng Sun","Jiawei Han"],"abstract":"Large language models (LLMs) have achieved impressive performance on knowledge-intensive tasks, yet they often struggle with multi-step reasoning due to the unstructured nature of retrieved context. While retrieval-augmented generation (RAG) methods provide external information, the lack of explicit organization among retrieved passages limits their effectiveness, leading to brittle reasoning pathways. Recent interpretability studies highlighting the importance of structured intermediate reasoning further align with this perspective. We propose Retrieval-And-Structuring (RAS), a framework that dynamically constructs query-specific knowledge graphs through iterative retrieval and structured knowledge building. RAS interleaves targeted retrieval planning with incremental graph construction, enabling models to assemble and reason over evolving knowledge structures tailored to each query. On seven knowledge-intensive benchmarks, RAS consistently outperforms strong baselines, achieving up to 6.4% and 7.0% gains with open-source and proprietary LLMs, respectively. Our results demonstrate that dynamic, query-specific knowledge structuring offers a robust path to improving reasoning accuracy and robustness in language model generation. Our data and code can be found at https://github.com/pat-jj/RAS.","url_abs":"https://arxiv.org/abs/2502.10996v2","url_pdf":"https://arxiv.org/pdf/2502.10996v2.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":"ras-retrieval-and-structuring-for-knowledge","repo_url":"https://github.com/pat-jj/ras","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"ras-retrieval-and-structuring-for-knowledge","repo_url":"https://github.com/pat-jj/Retrieval-And-Structure","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"rag","task_name":"RAG"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"retrieval-augmented-generation","task_name":"Retrieval-augmented Generation"},{"task_slug":"graph-construction","task_name":"graph construction"}],"methods":[{"method_slug":"align","method_name":"ALIGN"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2502.10996","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.10996"}},"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/pat-jj/ras","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pat-jj/Retrieval-And-Structure","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":1,"unverified":12},"by_repo_kind":{"official":{"samples":11,"ran":0,"repositories":2},"community":{"samples":2,"ran":1,"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":2,"samples":[{"code_sha256_prefix":"32b42053b96ab3ff","entry":"bge_rerank_result","repo":"haruhi-sudo/rpg","repo_kind":"community","path":"inference/long_form_demo.py","file_url":"https://github.com/haruhi-sudo/rpg/blob/HEAD/inference/long_form_demo.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"32b42053b96ab3ff"}},{"code_sha256_prefix":"b17548f37cf21541","entry":"convert_index_to_l2","repo":"pat-jj/Retrieval-And-Structure","repo_kind":"official","path":"archived/theme_dense_ret_gpu_v1.py","file_url":"https://github.com/pat-jj/Retrieval-And-Structure/blob/HEAD/archived/theme_dense_ret_gpu_v1.py","link_basis":"harvester_set","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":"b17548f37cf21541"}},{"code_sha256_prefix":"56a4c2457dfdb116","entry":"cpu_cuda","repo":"pat-jj/Retrieval-And-Structure","repo_kind":"official","path":"baselines/start_knowtrace_retrieval_server_cpu.py","file_url":"https://github.com/pat-jj/Retrieval-And-Structure/blob/HEAD/baselines/start_knowtrace_retrieval_server_cpu.py","link_basis":"harvester_set","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":"56a4c2457dfdb116"}},{"code_sha256_prefix":"6645463255861c20","entry":"find_ras_result_files","repo":"pat-jj/ras","repo_kind":"official","path":"framework/evaluate_ras_results.py","file_url":"https://github.com/pat-jj/ras/blob/HEAD/framework/evaluate_ras_results.py","link_basis":"harvester_set","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":"6645463255861c20"}},{"code_sha256_prefix":"c65ec42fd5ea52f5","entry":"generate_text_iter","repo":"haruhi-sudo/rpg","repo_kind":"community","path":"inference/long_form_demo.py","file_url":"https://github.com/haruhi-sudo/rpg/blob/HEAD/inference/long_form_demo.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":"c65ec42fd5ea52f5"}},{"code_sha256_prefix":"abe55d649017f1d8","entry":"load_and_filter_indices","repo":"pat-jj/Retrieval-And-Structure","repo_kind":"official","path":"archived/split_indices.py","file_url":"https://github.com/pat-jj/Retrieval-And-Structure/blob/HEAD/archived/split_indices.py","link_basis":"harvester_set","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":"abe55d649017f1d8"}},{"code_sha256_prefix":"4e5819f26351b1ef","entry":"load_data","repo":"pat-jj/ras","repo_kind":"official","path":"framework/run_ras_pre.py","file_url":"https://github.com/pat-jj/ras/blob/HEAD/framework/run_ras_pre.py","link_basis":"harvester_set","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":"4e5819f26351b1ef"}},{"code_sha256_prefix":"9f3a09d9e617e3b3","entry":"load_knowledge","repo":"pat-jj/Retrieval-And-Structure","repo_kind":"official","path":"archived/theme_dense_ret.py","file_url":"https://github.com/pat-jj/Retrieval-And-Structure/blob/HEAD/archived/theme_dense_ret.py","link_basis":"harvester_set","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":"9f3a09d9e617e3b3"}},{"code_sha256_prefix":"775f52b9a2fccf7b","entry":"load_knowledge","repo":"pat-jj/Retrieval-And-Structure","repo_kind":"official","path":"archived/theme_dense_ret_all.py","file_url":"https://github.com/pat-jj/Retrieval-And-Structure/blob/HEAD/archived/theme_dense_ret_all.py","link_basis":"harvester_set","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":"775f52b9a2fccf7b"}},{"code_sha256_prefix":"0fca4db50662c50f","entry":"load_knowledge","repo":"pat-jj/Retrieval-And-Structure","repo_kind":"official","path":"archived/theme_dense_ret_gpu_v1.py","file_url":"https://github.com/pat-jj/Retrieval-And-Structure/blob/HEAD/archived/theme_dense_ret_gpu_v1.py","link_basis":"harvester_set","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":"0fca4db50662c50f"}},{"code_sha256_prefix":"742860f487a75103","entry":"prepare_split_mappings","repo":"pat-jj/Retrieval-And-Structure","repo_kind":"official","path":"archived/split_efficient.py","file_url":"https://github.com/pat-jj/Retrieval-And-Structure/blob/HEAD/archived/split_efficient.py","link_basis":"harvester_set","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":"742860f487a75103"}},{"code_sha256_prefix":"87ab1eb8f4c9f280","entry":"retrieve","repo":"pat-jj/Retrieval-And-Structure","repo_kind":"official","path":"archived/theme_dense_ret.py","file_url":"https://github.com/pat-jj/Retrieval-And-Structure/blob/HEAD/archived/theme_dense_ret.py","link_basis":"harvester_set","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":"87ab1eb8f4c9f280"}},{"code_sha256_prefix":"dcab01df1508833b","entry":"save_faiss_index_safely","repo":"pat-jj/Retrieval-And-Structure","repo_kind":"official","path":"archived/theme_dense_ret_gpu_v2.py","file_url":"https://github.com/pat-jj/Retrieval-And-Structure/blob/HEAD/archived/theme_dense_ret_gpu_v2.py","link_basis":"harvester_set","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":"dcab01df1508833b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}