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:
- In the pre-training stage, MIGA uses the same pre-training paradigm as T5 , three additional auxiliary tasks related to Text-to-SQL are proposed to better stimulate the knowledge in the pre-trained language model. This training method can unify all Text-to-SQL data sets and expand the scale of training data; it can also flexibly design more effective auxiliary tasks to further explore the potential knowledge of the pre-trained language model.
- In the fine-tuning phase, MIGA targets the error transmission problems that are prone to occur in multi-round conversations and SQL. It perturbs the historical SQL during the training process, making the generation of the current round of SQL more effective. Stablize.
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:
- Text-to-SQL Main task: For the yellow part in the picture above, design the Prompt as "translate dialogue to system query", and then use some special tokens to combine historical dialogue, database information and SQL The statements are spliced and input into T5-encoder, and the decoder directly outputs the corresponding SQL statement;
- Related information prediction: For the green part in the above figure, the design prompt is "translate dialogue to relevant column ", the input of T5-encoder is also consistent with the main task, and the decoder needs to output data tables and columns related to the current problem, in order to enhance the model's understanding of Text-to-SQL;
- Operation prediction of the current round: The gray part in the above picture is designed as "translate dialogue to turn switch". This task is mainly designed for context understanding in multiple rounds of dialogue, comparing the previous round of dialogue and SQL , the decoder needs to output what changes have been made to the purpose of the current dialogue. For example, in the example in the picture, the where condition has been changed;
- Final dialogue prediction: the blue part in the picture above, design Prompt The purpose of "translate dialogue to final utterance" is to allow the model to better understand the contextual dialogue. The decoder needs to output the entire multi-round dialogue and a complete problem description corresponding to the SQL at the last moment.
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:
- Referring to the steps of humans writing SQL, the conversation text to SQL task is decomposed into multiple subtasks, allowing the main task to learn from them;
- The construction format of training samples is consistent with T5, which can maximize the potential of the pre-trained T5 model for target tasks;
- The unified framework allows flexible scheduling of multiple auxiliary tasks. When applied to a specific task, the above pre-trained model only needs to be fine-tuned using the same training objective in the labeled data of the specific task.
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:
- Use columns in the same data table to randomly modify or new Add columns in the SELECT part;
- Randomly modify the structure in the JOIN condition, such as exchanging the positions of the two tables;
- Modify"* ” All columns are some other columns;
- Swap “asc” and “desc”.
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.
Experimental evaluation
The evaluation dataset is multi-turn dialogue Text-to-SQL: SparC and CoSQL.
The evaluation indicators are:
- QM: Question Match, which means that the generated SQL in a single round of questions completely matches the annotation output. Proportion;
- IM: Interaction Match, indicating the proportion of all generated SQL in the entire complete round of multi-round dialogue that completely matches the annotation output.
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.
Conclusion
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

0.What does this article do? We propose DepthFM: a versatile and fast state-of-the-art generative monocular depth estimation model. In addition to traditional depth estimation tasks, DepthFM also demonstrates state-of-the-art capabilities in downstream tasks such as depth inpainting. DepthFM is efficient and can synthesize depth maps within a few inference steps. Let’s read about this work together ~ 1. Paper information title: DepthFM: FastMonocularDepthEstimationwithFlowMatching Author: MingGui, JohannesS.Fischer, UlrichPrestel, PingchuanMa, Dmytr

Imagine an artificial intelligence model that not only has the ability to surpass traditional computing, but also achieves more efficient performance at a lower cost. This is not science fiction, DeepSeek-V2[1], the world’s most powerful open source MoE model is here. DeepSeek-V2 is a powerful mixture of experts (MoE) language model with the characteristics of economical training and efficient inference. It consists of 236B parameters, 21B of which are used to activate each marker. Compared with DeepSeek67B, DeepSeek-V2 has stronger performance, while saving 42.5% of training costs, reducing KV cache by 93.3%, and increasing the maximum generation throughput to 5.76 times. DeepSeek is a company exploring general artificial intelligence

Earlier this month, researchers from MIT and other institutions proposed a very promising alternative to MLP - KAN. KAN outperforms MLP in terms of accuracy and interpretability. And it can outperform MLP running with a larger number of parameters with a very small number of parameters. For example, the authors stated that they used KAN to reproduce DeepMind's results with a smaller network and a higher degree of automation. Specifically, DeepMind's MLP has about 300,000 parameters, while KAN only has about 200 parameters. KAN has a strong mathematical foundation like MLP. MLP is based on the universal approximation theorem, while KAN is based on the Kolmogorov-Arnold representation theorem. As shown in the figure below, KAN has

Boston Dynamics Atlas officially enters the era of electric robots! Yesterday, the hydraulic Atlas just "tearfully" withdrew from the stage of history. Today, Boston Dynamics announced that the electric Atlas is on the job. It seems that in the field of commercial humanoid robots, Boston Dynamics is determined to compete with Tesla. After the new video was released, it had already been viewed by more than one million people in just ten hours. The old people leave and new roles appear. This is a historical necessity. There is no doubt that this year is the explosive year of humanoid robots. Netizens commented: The advancement of robots has made this year's opening ceremony look like a human, and the degree of freedom is far greater than that of humans. But is this really not a horror movie? At the beginning of the video, Atlas is lying calmly on the ground, seemingly on his back. What follows is jaw-dropping

AI is indeed changing mathematics. Recently, Tao Zhexuan, who has been paying close attention to this issue, forwarded the latest issue of "Bulletin of the American Mathematical Society" (Bulletin of the American Mathematical Society). Focusing on the topic "Will machines change mathematics?", many mathematicians expressed their opinions. The whole process was full of sparks, hardcore and exciting. The author has a strong lineup, including Fields Medal winner Akshay Venkatesh, Chinese mathematician Zheng Lejun, NYU computer scientist Ernest Davis and many other well-known scholars in the industry. The world of AI has changed dramatically. You know, many of these articles were submitted a year ago.

I cry to death. The world is madly building big models. The data on the Internet is not enough. It is not enough at all. The training model looks like "The Hunger Games", and AI researchers around the world are worrying about how to feed these data voracious eaters. This problem is particularly prominent in multi-modal tasks. At a time when nothing could be done, a start-up team from the Department of Renmin University of China used its own new model to become the first in China to make "model-generated data feed itself" a reality. Moreover, it is a two-pronged approach on the understanding side and the generation side. Both sides can generate high-quality, multi-modal new data and provide data feedback to the model itself. What is a model? Awaker 1.0, a large multi-modal model that just appeared on the Zhongguancun Forum. Who is the team? Sophon engine. Founded by Gao Yizhao, a doctoral student at Renmin University’s Hillhouse School of Artificial Intelligence.

What? Is Zootopia brought into reality by domestic AI? Exposed together with the video is a new large-scale domestic video generation model called "Keling". Sora uses a similar technical route and combines a number of self-developed technological innovations to produce videos that not only have large and reasonable movements, but also simulate the characteristics of the physical world and have strong conceptual combination capabilities and imagination. According to the data, Keling supports the generation of ultra-long videos of up to 2 minutes at 30fps, with resolutions up to 1080p, and supports multiple aspect ratios. Another important point is that Keling is not a demo or video result demonstration released by the laboratory, but a product-level application launched by Kuaishou, a leading player in the short video field. Moreover, the main focus is to be pragmatic, not to write blank checks, and to go online as soon as it is released. The large model of Ke Ling is already available in Kuaiying.

Recently, the military circle has been overwhelmed by the news: US military fighter jets can now complete fully automatic air combat using AI. Yes, just recently, the US military’s AI fighter jet was made public for the first time and the mystery was unveiled. The full name of this fighter is the Variable Stability Simulator Test Aircraft (VISTA). It was personally flown by the Secretary of the US Air Force to simulate a one-on-one air battle. On May 2, U.S. Air Force Secretary Frank Kendall took off in an X-62AVISTA at Edwards Air Force Base. Note that during the one-hour flight, all flight actions were completed autonomously by AI! Kendall said - "For the past few decades, we have been thinking about the unlimited potential of autonomous air-to-air combat, but it has always seemed out of reach." However now,
