Relational databases are integral to modern information systems, serving as the foundation for storing, querying, and managing data efficiently and effectively. Advancements in large language modeling have led to the emergence of text-to-SQL technologies, significantly enhancing the querying and extracting of information from these databases and raising concerns about privacy and security. Our research extracts the database schema elements underlying a text-to-SQL model. Knowledge of the schema can make attacks such as SQL injection easier. By asking specially crafted questions, we have developed a zero-knowledge framework designed to probe various database schema elements without knowledge of the database itself. The text-to-SQL models then process these questions to produce an output that we use to uncover the structure of the database schema. We apply it to specialized text-to-SQL models fine-tuned on text-SQL pairs and generative language models used for SQL generation. Overall, we can reconstruct the table names with an F1 of nearly .75 for fine-tuned models and .96 for generative.
翻译:关系数据库是现代信息系统的核心组成部分,作为高效存储、查询和管理数据的基础。大型语言建模的进步催生了文本到SQL技术,显著提升了从这些数据库中查询和提取信息的能力,同时也引发了人们对隐私和安全性的担忧。我们的研究旨在提取文本到SQL模型背后的数据库模式元素。掌握模式信息可使SQL注入等攻击更容易实施。通过提出精心设计的问题,我们开发了一个零知识框架,旨在无需了解数据库本身的情况下探测各种数据库模式元素。文本到SQL模型随后处理这些问题,生成我们用于揭示数据库模式结构的输出。我们将该方法应用于在文本-SQL对上微调的专用文本到SQL模型以及用于SQL生成的生成式语言模型。总体而言,我们能够以微调模型接近0.75和生成式模型0.96的F1分数重建表名。