A Review of Schema Representation and Compression Techniques in Large Language Models

Main Article Content

Qibin He

Keywords

large language model, schema representation, schema compression, embedding, schema linking, Text-to-SQL, token optimization

Abstract

With the increasing application of large language models (LLMs) in text-to-Structured Query Language (Text-to-SQL) and intelligent data querying, database schemas have become an important context that affects query understanding, schema linking, and SQL generation. Based on benchmarks including WikiSQL, Spider, BIRD, and Spider 2.0, this paper reviews six directions: natural-language representation and prompt construction, semantic representation and embedding, relevance modeling and dynamic selection, schema compression and token optimization, structural relation modeling and auxiliary information enhancement, and LLM-driven Text-to-SQL applications. This paper compares the publicly reported results of representative methods, including RESDSQL, CHESS, RSL-SQL, CodeS, DAIL-SQL, and MAC-SQL, as well as RAT-SQL, SDSQL, and LGESQL, and points out that schema compression is not simple text deletion. Instead, it combines retrieval, ranking, pruning, structural constraints, and dynamic sub-database construction to balance information retention and context cost. Existing research still has several prominent problems: relevance ranking has difficulty considering both semantic matching and join-path completeness; compression effectiveness lacks unified and comparable evaluation metrics; and some methods do not adequately report token costs and end-to-end latency. In addition, the generalization ability of related methods in complex, real-world business databases remains to be verified. In response to these problems, this paper summarizes research gaps concerning dynamic K values, unified compression metrics, end-to-end efficiency, and real-world database validation, and proposes directions such as a closed loop of retrieval, compression, generation, and execution verification.

Abstract 8 | PDF Downloads 3

References

  • [1]Yaodong Zheng, Xufeng Li, Heping Chen. Research on the Application of Chinese NL2SQL Technology Based on Deep Learning Models[J]. Microcomputer Applications, 2025, 41(04): 295-298, 303.
  • [2]Yumeng Liu, Yijing Zhao, Bicong Wang, et al. Research Progress in Intelligent Synthesis Technology for Structured Database Query Languages[J]. Computer Science, 2024, 51(07): 40-48.
  • [3]Jun Huang, Fei Lin, Jing Yang, et al. Large-Model Prompt Engineering for Generative Artificial Intelligence: Methods, Current Status, and Prospects[J]. Chinese Journal of Intelligent Science and Technology, 2024, 6(02): 115-133.
  • [4]Mengke Chen, Yun Bian, Yunhao Liang, et al. WH-CoT: A 6W2H-Based Chain-of-Thought Prompting Framework for Large Language Models[J]. Journal of Computer Applications, 2024, 44(Suppl. 2): 1-6.
  • [5]Lu Rong. Research on Large Language Model Prompt Learning for Automatic Book Classification[J]. Research on Library Science, 2024(01): 86-103.
  • [6]Junhui Kang, Jianbin Wang. Research on an Intelligent Query Method for Special-Operation Information in Chemical Enterprises Based on Multi-Level Indexing[J]. Safety, Health & Environment, 2026, 26(06): 28-34.
  • [7]Haifeng He, Jide Xu, Han Lü. Construction of an Intelligent Data Querying System Based on Large Language Models and Its Application in Hospital Operations Management[J]. China Medical Equipment, 2026, 23(07): 77-83.
  • [8]Qing Shu, Xiping Liu, Zhao Tan, et al. An SQL Generation Method Based on a Dependency-Graph Attention Network[J]. Journal of Zhejiang University (Engineering Science), 2024, 58(05): 908-917.
  • [9]Yu Fu, Haoran Li. SQL Generation Based on Structure Awareness and Monte Carlo Tree Search[J]. Computer Technology and Development, 2026, 36(03): 118-123, 117.
  • [10]Yuhan Peng, Shaojie Qiao, Qi Xue, et al. A Review of Text Information Processing Techniques for Text-to-SQL[J]. Radio Engineering, 2024, 54(05): 1053-1062.
  • [11]Yang Zhou, Peihan Cai, Zhenjiang Dong. Large-Model Knowledge Management System[J]. ZTE Technology Journal, 2024, 30(02): 63-71.
  • [12]Mengyi Liu, Jianqiu Xu, Yongxin Tong. Natural-Language Query Conversion for Spatial Databases Based on Large Language Models[J]. Journal of Software, 2026, 37(03): 1121-1142. DOI: 10.13328/j.cnki.jos.007514.
  • [13]V. Zhong, C. Xiong, R. Socher. Seq2SQL: Generating Structured Queries from Natural Language Using Reinforcement Learning[EB/OL]. arXiv:1709.00103, 2017.
  • [14]T. Yu, R. Zhang, K. Yang, et al. Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task[C]//Proceedings of EMNLP. 2018: 3911-3921.
  • [15]J. Li, B. Hui, G. Qu, et al. Can LLM Already Serve as a Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLs[C]//Advances in Neural Information Processing Systems. 2023, 36.
  • [16]F. Lei, J. Chen, Y. Ye, et al. Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows[C]//International Conference on Learning Representations. 2025.
  • [17]B. Wang, R. Shin, X. Liu, et al. RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers[C]//Proceedings of ACL. 2020: 7567-7578.
  • [18]B. Hui, X. Shi, R. Geng, et al. Improving Text-to-SQL with Schema Dependency Learning[EB/OL]. arXiv:2103.04399, 2021.
  • [19]R. Cao, L. Chen, Z. Chen, et al. LGESQL: Line Graph Enhanced Text-to-SQL Model with Mixed Local and Non-Local Relations[C]//Proceedings of ACL-IJCNLP. 2021: 2541-2555.
  • [20]H. Li, J. Zhang, C. Li, H. Chen. RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQL[C]//Proceedings of the AAAI Conference on Artificial Intelligence. 2023, 37(11): 13067-13075.
  • [21]Z. Cao, Y. Zheng, Z. Fan, X. Zhang, W. Chen, X. Bai. RSL-SQL: Robust Schema Linking in Text-to-SQL Generation[EB/OL]. arXiv:2411.00073, 2024.
  • [22]S. Talaei, M. Pourreza, Y. C. Chang, et al. CHESS: Contextual Harnessing for Efficient SQL Synthesis[EB/OL]. arXiv:2405.16755, 2024.
  • [23]Z. Li, S. Zhang, J. Liu, et al. CodeS: Towards Building Open-source Language Models for Text-to-SQL[J]. Proceedings of the ACM on Management of Data, 2024, 2(3): 127.
  • [24]D. Gao, H. Wang, Y. Li, et al. Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation[J]. Proceedings of the VLDB Endowment, 2024, 17(5): 1132-1145. DOI: 10.14778/3641204.3641221.
  • [25]B. Wang, C. Ren, J. Yang, et al. MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQL[EB/OL]. arXiv:2312.11242, 2023.
  • [26]Shengda Wu, Hui Yu. Research on a Hierarchical Prompt Engineering Method for Automatic Construction of Domain Knowledge Graphs[J]. Data Communications, 2026(04): 19-25.
  • [27]M. Pourreza, D. Rafiei. DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction[C]//Advances in Neural Information Processing Systems. 2023.
  • [28]X. Dong, C. Zhang, Y. Ge, et al. C3: Zero-shot Text-to-SQL with ChatGPT[EB/OL]. arXiv:2307.07306, 2023.
  • [29]Y. Gan, X. Chen, M. Purver. Re-appraising the Schema Linking for Text-to-SQL[C]//Findings of the Association for Computational Linguistics: ACL 2023. 2023: 835-852.
  • [30]Meng Zhao, Ke Chen, Lidan Shou, et al. Research on Converting Complex Natural-Language Queries to SQL Based on a Tree Model[J]. Journal of Software, 2022, 33(12): 4727-4745.
  • [31]Xiaoliang Cao. Design of a Natural-Language Query Parsing Architecture for Intelligent Databases[J]. Information Recording Materials, 2026, 27(18): 100-102. DOI: 10.16009/j.issn.1009-5624.2026.18.032.