{"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-2605-03465","title":"FINER-SQL: Boosting Small Language Models for Text-to-SQL","arxiv_id":"2605.03465","date":"2026-05-05","proceeding":null,"authors":["Thanh Dat Hoang","Thanh Trung Huynh","Matthias Weidlich","Thanh Tam Nguyen","Tong Chen","Hongzhi Yin","Quoc Viet Hung Nguyen"],"abstract":"Large language models have driven major advances in Text-to-SQL generation. However, they suffer from high computational cost, long latency, and data privacy concerns, which make them impractical for many real-world applications. A natural alternative is to use small language models (SLMs), which enable efficient and private on-premise deployment. Yet, SLMs often struggle with weak reasoning and poor instruction following. Conventional reinforcement learning methods based on sparse binary rewards (0/1) provide little learning signal when the generated SQLs are incorrect, leading to unstable or collapsed training. To overcome these issues, we propose FINER-SQL, a scalable and reusable reinforcement learning framework that enhances SLMs through fine-grained execution feedback. Built on group relative policy optimization, FINER-SQL replaces sparse supervision with dense and interpretable rewards that offer continuous feedback even for incorrect SQLs. It introduces two key reward functions: a memory reward, which aligns reasoning with verified traces for semantic stability, and an atomic reward, which measures operation-level overlap to grant partial credit for structurally correct but incomplete SQLs. This approach transforms discrete correctness into continuous learning, enabling stable, critic-free optimization. Experiments on the BIRD and Spider benchmarks show that FINER-SQL achieves up to 67.73\\% and 85\\% execution accuracy with a 3B model -- matching much larger LLMs while reducing inference latency to 5.57~s/sample. These results highlight a cost-efficient and privacy-preserving path toward high-performance Text-to-SQL generation. Our code is available at https://github.com/thanhdath/finer-sql.","url_abs":"https://arxiv.org/abs/2605.03465","url_pdf":"https://arxiv.org/pdf/2605.03465","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":null,"mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.03465"}},"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/thanhdath/finer-sql","reach":null}],"summary":{"ran":13,"unverified":4},"by_repo_kind":{"found_in_text":{"samples":17,"ran":13,"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":17,"samples":[{"code_sha256_prefix":"d15b3cb7837805e3","entry":"analyze_sql_errors","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"evaluation/analyze_sql_errors.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/evaluation/analyze_sql_errors.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d15b3cb7837805e3"}},{"code_sha256_prefix":"4bc0bd6df4621bba","entry":"call_sql_api","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"reasoning_distilation/check_sql_correctness.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/reasoning_distilation/check_sql_correctness.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4bc0bd6df4621bba"}},{"code_sha256_prefix":"551b409c91a3e967","entry":"call_sql_api","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"build_gt_cache.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/build_gt_cache.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"551b409c91a3e967"}},{"code_sha256_prefix":"d9968f252ea800b1","entry":"canonicalize_for_storage","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"evaluation/add_correct_sqls_from_eval.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/evaluation/add_correct_sqls_from_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d9968f252ea800b1"}},{"code_sha256_prefix":"cc8d0081963d422c","entry":"check_api_health","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"grpo_writer.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/grpo_writer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cc8d0081963d422c"}},{"code_sha256_prefix":"dc377d73d6870e1a","entry":"classify","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"db_execution/api.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/db_execution/api.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dc377d73d6870e1a"}},{"code_sha256_prefix":"536c0bf7ea8655b5","entry":"dataframes_equal","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"evaluation/add_correct_sqls_from_eval.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/evaluation/add_correct_sqls_from_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"536c0bf7ea8655b5"}},{"code_sha256_prefix":"97a38a7e4a12d0ec","entry":"extract_sql_from_response","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"reasoning_distilation/check_sql_correctness.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/reasoning_distilation/check_sql_correctness.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"97a38a7e4a12d0ec"}},{"code_sha256_prefix":"6a0f8c4a557d4229","entry":"is_api_dead_error","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"grpo_writer.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/grpo_writer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6a0f8c4a557d4229"}},{"code_sha256_prefix":"7c3da8c0817eae00","entry":"norm","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"evaluation/_tmp_compare_mismatch.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/evaluation/_tmp_compare_mismatch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7c3da8c0817eae00"}},{"code_sha256_prefix":"2693b93ef9e03214","entry":"normalize_for_compare","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"evaluation/add_correct_sqls_from_eval.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/evaluation/add_correct_sqls_from_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2693b93ef9e03214"}},{"code_sha256_prefix":"80a58884b0c0aded","entry":"process_single_sample","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"build_gt_cache.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/build_gt_cache.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"80a58884b0c0aded"}},{"code_sha256_prefix":"42d2b6d581486984","entry":"reverse_map_db_name","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"db_execution/api.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/db_execution/api.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"42d2b6d581486984"}},{"code_sha256_prefix":"f3cfb6c64f7296f1","entry":"call_deepseek_chat","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"reasoning_distilation/model_pool_generate.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/reasoning_distilation/model_pool_generate.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":"f3cfb6c64f7296f1"}},{"code_sha256_prefix":"d854a01aef1a8c2b","entry":"call_together_chat","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"reasoning_distilation/model_pool_generate.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/reasoning_distilation/model_pool_generate.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":"d854a01aef1a8c2b"}},{"code_sha256_prefix":"28752b860753c789","entry":"is_select_like","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"reasoning_distilation/check_sql_correctness.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/reasoning_distilation/check_sql_correctness.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":"28752b860753c789"}},{"code_sha256_prefix":"f3df66b5e5ef7942","entry":"wait_for_api_recovery","repo":"thanhdath/finer-sql","repo_kind":"found_in_text","path":"grpo_writer.py","file_url":"https://github.com/thanhdath/finer-sql/blob/HEAD/grpo_writer.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":"f3df66b5e5ef7942"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}