[论文解读] SQLNet: Generating Structured Queries From Natural Language Without Reinforcement Learning
SQLNet 通过使用基于草图的、序列到集合的方法并带有列注意力,避免 NL2SQL 的顺序问题,在 WikiSQL 上无需强化学习就取得了最先进的结果。
Synthesizing SQL queries from natural language is a long-standing open problem and has been attracting considerable interest recently. Toward solving the problem, the de facto approach is to employ a sequence-to-sequence-style model. Such an approach will necessarily require the SQL queries to be serialized. Since the same SQL query may have multiple equivalent serializations, training a sequence-to-sequence-style model is sensitive to the choice from one of them. This phenomenon is documented as the "order-matters" problem. Existing state-of-the-art approaches rely on reinforcement learning to reward the decoder when it generates any of the equivalent serializations. However, we observe that the improvement from reinforcement learning is limited. In this paper, we propose a novel approach, i.e., SQLNet, to fundamentally solve this problem by avoiding the sequence-to-sequence structure when the order does not matter. In particular, we employ a sketch-based approach where the sketch contains a dependency graph so that one prediction can be done by taking into consideration only the previous predictions that it depends on. In addition, we propose a sequence-to-set model as well as the column attention mechanism to synthesize the query based on the sketch. By combining all these novel techniques, we show that SQLNet can outperform the prior art by 9% to 13% on the WikiSQL task.
研究动机与目标
- 解决 NL2SQL 挑战中查询顺序可能是非确定的并且会阻碍 seq2seq 模型的问题。
- 提出一种基于草图的生成框架以避免顺序问题。
- 引入序列到集合的预测与列注意力机制以改进 SQL 综合。
- 在 WikiSQL 数据集上展示了在无强化学习情况下超过 Seq2SQL 的性能。
- 提供有关基于草图的生成如何对未知模式泛化的见解。
提出的方法
- 定义一个反映 SQL 语法和槽之间依赖关系的 SQL 草图。
- 将 WHERE 子句预测为列值约束的集合(序列到集合),而不是有序序列。
- 引入列注意力机制,使问题嵌入能够以特定列为条件进行调整。
- 使用带列感知注意力的指针式解码器来生成 VALUE 子串。
- 像 WHERE 一样预测 SELECT 子句的组成部分(列和聚合函数),但仅针对单个列。
- 使用针对集合预测的修改损失以及其他组成部分的标准交叉熵进行训练。
实验结果
研究问题
- RQ1在子句顺序是任意的 NL2SQL 任务中,基于草图的序列到集合方法是否能够消除对强化学习的需求?
- RQ2列注意力是否提高了预测 WHERE 和 SELECT 子句中出现的列的准确性?
- RQ3在 WikiSQL 上,SQLNet 相对于 Seq2SQL 在逻辑形式、查询匹配和执行准确性方面的比较?
- RQ4在优化过程中训练词嵌入对 NL2SQL 性能的影响?
- RQ5当测试模式来自未见过的表或从训练分布中抽取时,SQLNet 的表现如何?
主要发现
- SQLNet 在 WikiSQL 上取得了最先进的结果,测试集的精确查询匹配和执行准确度分别为 61.5% 和 68.3%。
- 用序列到集合的方法替代序列到序列生成器可消除顺序敏感性的限制,并消除了对强化学习的需求。
- 列注意力比纯粹的序列到集合模型大约提高约 3 个点,若再结合训练时嵌入更新,再增加大约 2 点。
- WHERE 子句预测最受益于所提出的架构,在该子任务上相对于 Seq2SQL 取得了显著提升。
- 总体而言,SQLNet 在 WikiSQL 的多项指标上比 Seq2SQL 提升约 9–13 点,为无强化学习的 NL2SQL 设置了新的基线。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。