Home >Technology peripherals >AI >Two-stage multi-task Text-to-SQL pre-training model MIGA based on T5
More and more work has proven that pre-trained language models (PLM) contain rich knowledge. For different tasks, using appropriate training methods to leverage PLM can better improve the performance of the model. ability. In Text-to-SQL tasks, the current mainstream generators are based on syntax trees and need to be designed for SQL syntax.
Recently, NetEase Interactive Entertainment AI Lab teamed up with Guangdong University of Foreign Studies and Columbia University to propose a two-stage multi-task pre-training model MIGA based on the pre-training method of the pre-trained language model T5. MIGA introduces three auxiliary tasks in the pre-training stage and organizes them into a unified generation task paradigm, which can uniformly train all Text-to-SQL data sets; at the same time, in the fine-tuning stage, MIGA targets errors in multiple rounds of dialogue The transfer problem is used for SQL perturbation, which improves the robustness of model generation.
Currently for Text-to-SQL research, the mainstream method is mainly the encoder-decoder model based on the SQL syntax tree, which can ensure that the generated results must comply with SQL syntax, but it needs to be targeted SQL syntax is specially designed. There has also been some recent research on Text-to-SQL based on generative language models, which can easily inherit the knowledge and capabilities of pre-trained language models.
In order to reduce the dependence on syntax trees and better tap the ability of pre-trained language models, this study proposed a two-stage multi-language model under the framework of pre-trained T5 models. Task Text-to-SQL pre-training model MIGA (MultI-task Ggeneration frAmework).
MIGA is divided into two stages of training process:
MIGA model performs better than the best syntax tree-based model on two multi-turn dialogue Text-to-SQL public data sets. Related research has been carried out by AAAI 2023 Accepted.
##Paper address: https://arxiv.org/abs/2212.09278
MIGA model details
Figure 1 MIGA model diagram.
Multi-task pre-training phase
This research mainly refers to the pre-training method of T5, based on the The trained T5 model is designed with four pre-training tasks:
Through such a unified training method design, MIGA can be versatile and flexible to handle more task-related additional tasks, and it also has the following advantages:
In the pre-training stage, the study integrated data from the Text-to-SQL dataset Spider and the conversational Text-to-SQL dataset SparC and CoSQL to train the T5 model .
Fine-tuning stage
After the pre-training stage, this study simply uses Text-to-SQL tasks to further fine-tune the model. When predicting the current round of SQL, this study will splice the predicted SQL of the previous round. In this process, in order to try to overcome the error transmission problem caused by multiple rounds of dialogue and generation, this study proposes a SQL perturbation scheme. , perturb the historical rounds of SQL in the input data with α probability. The perturbation of the SQL statement mainly samples the corresponding token with a probability of β, and then performs one of the following perturbations:
The above-mentioned perturbations are the most common SQL generation errors caused by error transmission statistically found in the experiment. Therefore, perturbations are carried out for these situations to reduce the model's dependence on this aspect.
The evaluation dataset is multi-turn dialogue Text-to-SQL: SparC and CoSQL.
The evaluation indicators are:
In the comparative experiment in Table 1, MIGA surpassed the current best multi-turn dialogue in terms of IM scores on the two data sets and CoSQL's QM scores. Text-to-SQL model. And compared with the same type of T5-based solutions, MIGA improved IM by 7.0% and QM by 5.8% respectively.
Table 1 Comparative experimental analysis, the first part is the tree model, and the second part is the generation model based on pre-training.
In the ablation experiment in Table 2, this study explored several tasks in the two-stage training process of MIGA, and at the same time proved that these tasks will respectively affect the target. Tasks have been improved to varying degrees.
Table 2 For the SparC task, if each task or data is removed respectively, the indicators will be reduced.
In the actual case analysis results, the stability and correctness of MIGA generation are better than those based on the T5-3B training model. It can be seen that MIGA is better in generating It is better than other models in multi-table join operations and mapping of columns and tables. In Question#2 of Case#1, the T5-3B model cannot generate effective SQL for the relatively complex JOIN structure (two-table connection), which leads to incorrect predictions for the more complex JOIN structure (three-table connection) in Question#3. . MIGA accurately predicts the JOIN structure and maintains the previous condition t1.sex="f" well. In Case #2, T5-3B confuses multiple columns from different tables and mistakes earnings for a column of the people table, whereas MIGA correctly identifies that column as belonging to the poker_player table and links it to t1.
Table 3 Case analysis.
NetEase Interactive Entertainment AI Lab proposed a two-stage multi-task pre-training model based on T5 for Text-to-SQL: MIGA. In the pre-training stage, MIGA decomposes the Text-to-SQL task into three additional subtasks and unifies them into a sequence-to-sequence generation paradigm to better motivate the pre-trained T5 model. And a SQL perturbation mechanism is introduced in the fine-tuning stage to reduce the impact of error transmission in multiple rounds of Text-to-SQL generation scenarios.
In the future, the research team will further explore more effective strategies to leverage the capabilities of very large language models, and explore more elegant and effective ways to further overcome problems caused by incorrect transmission. Effect reduction problem.
The above is the detailed content of Two-stage multi-task Text-to-SQL pre-training model MIGA based on T5. For more information, please follow other related articles on the PHP Chinese website!