{"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/structgpt-a-general-framework-for-large","title":"StructGPT: A General Framework for Large Language Model to Reason over Structured Data","arxiv_id":"2305.09645","date":"2023-05-16","proceeding":null,"authors":["Jinhao Jiang","Kun Zhou","Zican Dong","Keming Ye","Wayne Xin Zhao","Ji-Rong Wen"],"abstract":"In this paper, we study how to improve the zero-shot reasoning ability of large language models~(LLMs) over structured data in a unified way. Inspired by the study on tool augmentation for LLMs, we develop an \\emph{Iterative Reading-then-Reasoning~(IRR)} approach for solving question answering tasks based on structured data, called \\textbf{StructGPT}. In our approach, we construct the specialized function to collect relevant evidence from structured data (\\ie \\emph{reading}), and let LLMs concentrate the reasoning task based on the collected information (\\ie \\emph{reasoning}). Specially, we propose an \\emph{invoking-linearization-generation} procedure to support LLMs in reasoning on the structured data with the help of the external interfaces. By iterating this procedures with provided interfaces, our approach can gradually approach the target answer to a given query. Extensive experiments conducted on three types of structured data demonstrate the effectiveness of our approach, which can significantly boost the performance of ChatGPT and achieve comparable performance against the full-data supervised-tuning baselines. Our codes and data are publicly available at~\\url{https://github.com/RUCAIBox/StructGPT}.","url_abs":"https://arxiv.org/abs/2305.09645v2","url_pdf":"https://arxiv.org/pdf/2305.09645v2.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":"structgpt-a-general-framework-for-large","repo_url":"https://github.com/rucaibox/structgpt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":"question-answering","task_name":"Question Answering"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2305.09645","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.09645"}},"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/rucaibox/structgpt","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/RUCAIBox/StructGPT","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":4,"ran_violates":3,"unverified":3},"by_repo_kind":{"official":{"samples":10,"ran":7,"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":"f52947a30b78f4b4","entry":"ChatGPT","repo":"RUCAIBox/StructGPT","repo_kind":"official","path":"structgpt_for_tableqa.py","file_url":"https://github.com/RUCAIBox/StructGPT/blob/HEAD/structgpt_for_tableqa.py","link_basis":"first_harvest_node","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":"f52947a30b78f4b4"}},{"code_sha256_prefix":"8d2a6c5b5165e0c8","entry":"Retriever","repo":"RUCAIBox/StructGPT","repo_kind":"official","path":"structgpt_for_tableqa.py","file_url":"https://github.com/RUCAIBox/StructGPT/blob/HEAD/structgpt_for_tableqa.py","link_basis":"first_harvest_node","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":"8d2a6c5b5165e0c8"}},{"code_sha256_prefix":"8231e3fdffa9c8ee","entry":"condition_has_like","repo":"rucaibox/structgpt","repo_kind":"official","path":"evaluate_for_spider.py","file_url":"https://github.com/rucaibox/structgpt/blob/HEAD/evaluate_for_spider.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8231e3fdffa9c8ee"}},{"code_sha256_prefix":"f2d76234528d3b57","entry":"condition_has_or","repo":"rucaibox/structgpt","repo_kind":"official","path":"evaluate_for_spider.py","file_url":"https://github.com/rucaibox/structgpt/blob/HEAD/evaluate_for_spider.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f2d76234528d3b57"}},{"code_sha256_prefix":"954c76e256cc7220","entry":"condition_has_sql","repo":"rucaibox/structgpt","repo_kind":"official","path":"evaluate_for_spider.py","file_url":"https://github.com/rucaibox/structgpt/blob/HEAD/evaluate_for_spider.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"954c76e256cc7220"}},{"code_sha256_prefix":"0992d2a47ae733fa","entry":"get_schema","repo":"rucaibox/structgpt","repo_kind":"official","path":"process_sql.py","file_url":"https://github.com/rucaibox/structgpt/blob/HEAD/process_sql.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0992d2a47ae733fa"}},{"code_sha256_prefix":"c4dcaf29b663a364","entry":"get_schema_from_json","repo":"rucaibox/structgpt","repo_kind":"official","path":"process_sql.py","file_url":"https://github.com/rucaibox/structgpt/blob/HEAD/process_sql.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":"c4dcaf29b663a364"}},{"code_sha256_prefix":"930ccc93da2ca9ed","entry":"Solver","repo":"RUCAIBox/StructGPT","repo_kind":"official","path":"structgpt_for_tableqa.py","file_url":"https://github.com/RUCAIBox/StructGPT/blob/HEAD/structgpt_for_tableqa.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":"930ccc93da2ca9ed"}},{"code_sha256_prefix":"66d6969df5d33fe1","entry":"evaluate_example","repo":"rucaibox/structgpt","repo_kind":"official","path":"evaluate_for_wikisql.py","file_url":"https://github.com/rucaibox/structgpt/blob/HEAD/evaluate_for_wikisql.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":"66d6969df5d33fe1"}},{"code_sha256_prefix":"a906f5de1f5971b0","entry":"tokenize","repo":"rucaibox/structgpt","repo_kind":"official","path":"process_sql.py","file_url":"https://github.com/rucaibox/structgpt/blob/HEAD/process_sql.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":"a906f5de1f5971b0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}