用自然语言查询结构化数据,小模型也能高精度完成。
Querying Structured Data Through Natural Language Using Language Models
- 训练小模型生成可执行查询,突破大模型在结构数据上的局限。
- 在西班牙多尔加莱亚地区数据集上,跨语言和未知地点均保持高准确率。
- 适合资源受限环境,可扩展至多数据源系统,部署成本低。
本文提出一种开源方法,使用户能通过自然语言查询非文本结构化数据。与依赖检索增强生成(RAG)但难以处理数值和高度结构化信息的方法不同,该方法训练语言模型生成可执行查询。为此,我们设计了系统化的合成训练数据生成流程,生成涵盖用户意图和数据语义的多样化问答对。采用QLoRA与4比特量化对小型模型DeepSeek-R1-Distill-8B进行微调,使其可在普通硬件上部署。在描述西班牙多尔加莱亚地区基本服务可达性的数据集上评估,微调模型在单语、多语及未见地点场景中均表现出高精度,展现出强大的泛化能力与可靠的查询生成性能。结果表明,小规模领域专用模型无需依赖大型专有大模型即可实现高精度任务,适用于资源受限环境,并可拓展至更广泛的多数据集系统。
原文摘要 · Abstract (English)
This paper presents an open source methodology for allowing users to query structured non textual datasets through natural language Unlike Retrieval Augmented Generation RAG which struggles with numerical and highly structured information our approach trains an LLM to generate executable queries To support this capability we introduce a principled pipeline for synthetic training data generation producing diverse question answer pairs that capture both user intent and the semantics of the underlying dataset We fine tune a compact model DeepSeek R1 Distill 8B using QLoRA with 4 bit quantization making the system suitable for deployment on commodity hardware We evaluate our approach on a dataset describing accessibility to essential services across Durangaldea Spain The fine tuned model achieves high accuracy across monolingual multilingual and unseen location scenarios demonstrating both robust generalization and reliable query generation Our results highlight that small domain specific models can achieve high precision for this task without relying on large proprietary LLMs making this methodology suitable for resource constrained environments and adaptable to broader multi dataset systems We evaluate our approach on a dataset describing accessibility to essential services across Durangaldea Spain The fine tuned model achieves high accuracy across monolingual multilingual and unseen location scenarios demonstrating both robust generalization and reliable query generation Our results highlight that small domain specific models can achieve high precision for this task without relying on large proprietary LLMs making this methodology suitable for resource constrained environments and adaptable to broader multi dataset systems.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。