{"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/share-an-slm-based-hierarchical-action","title":"SHARE: An SLM-based Hierarchical Action CorREction Assistant for Text-to-SQL","arxiv_id":"2506.00391","date":"2025-05-31","proceeding":null,"authors":["Ge Qu","Jinyang Li","Bowen Qin","Xiaolong Li","Nan Huo","Chenhao Ma","Reynold Cheng"],"abstract":"Current self-correction approaches in text-to-SQL face two critical limitations: 1) Conventional self-correction methods rely on recursive self-calls of LLMs, resulting in multiplicative computational overhead, and 2) LLMs struggle to implement effective error detection and correction for declarative SQL queries, as they fail to demonstrate the underlying reasoning path. In this work, we propose SHARE, an SLM-based Hierarchical Action corREction assistant that enables LLMs to perform more precise error localization and efficient correction. SHARE orchestrates three specialized Small Language Models (SLMs) in a sequential pipeline, where it first transforms declarative SQL queries into stepwise action trajectories that reveal underlying reasoning, followed by a two-phase granular refinement. We further propose a novel hierarchical self-evolution strategy for data-efficient training. Experimental results demonstrate that SHARE effectively enhances self-correction capabilities while proving robust across various LLMs. Furthermore, our comprehensive analysis shows that SHARE maintains strong performance even in low-resource training settings, which is particularly valuable for text-to-SQL applications with data privacy constraints.","url_abs":"https://arxiv.org/abs/2506.00391v1","url_pdf":"https://arxiv.org/pdf/2506.00391v1.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":[],"tasks":[{"task_slug":"text-to-sql","task_name":"Text to SQL"},{"task_slug":"text-to-sql","task_name":"Text-To-SQL"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2506.00391","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2506.00391"}},"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":"deterministic:regex_extraction","url":"https://github.com/quge2023/SHARE","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":11},"by_repo_kind":{"found_in_text":{"samples":11,"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":"490e585f3dbab236","entry":"api_infer","repo":"quge2023/SHARE","repo_kind":"found_in_text","path":"src/call_models/call_apis.py","file_url":"https://github.com/quge2023/SHARE/blob/HEAD/src/call_models/call_apis.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":"490e585f3dbab236"}},{"code_sha256_prefix":"ce4fe4c4ff578829","entry":"api_infer_single","repo":"quge2023/SHARE","repo_kind":"found_in_text","path":"src/call_models/call_apis.py","file_url":"https://github.com/quge2023/SHARE/blob/HEAD/src/call_models/call_apis.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":"ce4fe4c4ff578829"}},{"code_sha256_prefix":"89514e47407d67c9","entry":"api_request","repo":"quge2023/SHARE","repo_kind":"found_in_text","path":"src/call_models/call_apis.py","file_url":"https://github.com/quge2023/SHARE/blob/HEAD/src/call_models/call_apis.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":"89514e47407d67c9"}},{"code_sha256_prefix":"6d74f1fb350a4cad","entry":"filter_output","repo":"quge2023/SHARE","repo_kind":"found_in_text","path":"src/call_models/vllm_infer.py","file_url":"https://github.com/quge2023/SHARE/blob/HEAD/src/call_models/vllm_infer.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":"6d74f1fb350a4cad"}},{"code_sha256_prefix":"68b84e33a25b0012","entry":"generate_schema","repo":"quge2023/SHARE","repo_kind":"found_in_text","path":"src/train/prepare_data_for_sam.py","file_url":"https://github.com/quge2023/SHARE/blob/HEAD/src/train/prepare_data_for_sam.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":"68b84e33a25b0012"}},{"code_sha256_prefix":"3cd8e595be361fb6","entry":"generate_schema_for_db","repo":"quge2023/SHARE","repo_kind":"found_in_text","path":"src/train/prepare_data_for_sam.py","file_url":"https://github.com/quge2023/SHARE/blob/HEAD/src/train/prepare_data_for_sam.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":"3cd8e595be361fb6"}},{"code_sha256_prefix":"f83563c8d3afa0ce","entry":"get_abs_path","repo":"quge2023/SHARE","repo_kind":"found_in_text","path":"src/utils.py","file_url":"https://github.com/quge2023/SHARE/blob/HEAD/src/utils.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":"f83563c8d3afa0ce"}},{"code_sha256_prefix":"32da31b37eea7836","entry":"load_jsonl","repo":"quge2023/SHARE","repo_kind":"found_in_text","path":"src/utils.py","file_url":"https://github.com/quge2023/SHARE/blob/HEAD/src/utils.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":"32da31b37eea7836"}},{"code_sha256_prefix":"709be4079ef13a12","entry":"process_batch_data","repo":"quge2023/SHARE","repo_kind":"found_in_text","path":"src/call_models/vllm_infer.py","file_url":"https://github.com/quge2023/SHARE/blob/HEAD/src/call_models/vllm_infer.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":"709be4079ef13a12"}},{"code_sha256_prefix":"99d7384fefccf53d","entry":"re_keywords","repo":"quge2023/SHARE","repo_kind":"found_in_text","path":"src/utils.py","file_url":"https://github.com/quge2023/SHARE/blob/HEAD/src/utils.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":"99d7384fefccf53d"}},{"code_sha256_prefix":"98f9a5dde4818279","entry":"read_sqls","repo":"quge2023/SHARE","repo_kind":"found_in_text","path":"src/train/prepare_data_for_lom.py","file_url":"https://github.com/quge2023/SHARE/blob/HEAD/src/train/prepare_data_for_lom.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":"98f9a5dde4818279"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}