用搜索+强化学习让小模型也能对话生成准确的NoSQL查询。
Monte Carlo Tree Search with Reasoning Path Refinement for Small Language Models in Conversational Text-to-NoSQL
- 将查询生成转为带规则奖励的蒙特卡洛树搜索,分步推理。
- 在2000+对话上训练,小模型效果超越大模型7.93%。
- 适合想用自然语言操作NoSQL但不懂代码的开发者。
NoSQL数据库因灵活性和可扩展性被广泛应用于大数据分析、地理空间应用和医疗健康服务。然而,查询需专业技能,用户门槛高。现有研究多聚焦单轮交互,忽略真实场景中的对话特性。为此,我们提出对话式文本转NoSQL任务,即根据自然语言问题、数据库及对话历史生成查询。我们设计了Stage-MCTS框架,通过将查询生成建模为搜索问题,利用基于规则的奖励引导蒙特卡洛树搜索(MCTS)生成分步推理数据,并结合渐进式监督微调(SFT)与自训练策略,赋予小语言模型(SLMs)特定推理能力。我们还构建了CoNoSQL数据集,包含超过2000个跨领域对话和150个数据库,用于评估。实验表明,该方法优于当前最优的大模型,在执行值匹配(EVM)准确率上提升最高达7.93%。
原文摘要 · Abstract (English)
NoSQL databases have been widely adopted in big data analytics, geospatial applications, and healthcare services, due to their flexibility and scalability. However, querying NoSQL databases requires specialized technical expertise, creating a high barrier for users. While recent studies have explored text-to-NoSQL problem, they primarily focus on single-turn interactions, ignoring the conversational nature of real-world queries. To bridge this gap, we introduce the Conversational Text-to-NoSQL task, which generates NoSQL queries given a natural language question, a NoSQL database, and the dialogue history. To address this task, we propose Stage-MCTS, a framework that endows small language models (SLMs) with NoSQL-specific reasoning capabilities by formulating query generation as a search problem. The framework employs Monte Carlo Tree Search (MCTS) guided by a rule-based reward to produce stepwise reasoning data, followed by progressive supervised fine-tuning (SFT) and self-training strategies. We further construct CoNoSQL, a cross-domain dataset with over 2,000 dialogues and 150 databases, to support evaluation. Experiments demonstrate that our approach outperforms state-of-the-art large reasoning models, improving execution value match (EVM) accuracy by up to 7.93%.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。