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!

1 前言在发布DALL·E的15个月后,OpenAI在今年春天带了续作DALL·E 2,以其更加惊艳的效果和丰富的可玩性迅速占领了各大AI社区的头条。近年来,随着生成对抗网络(GAN)、变分自编码器(VAE)、扩散模型(Diffusion models)的出现,深度学习已向世人展现其强大的图像生成能力;加上GPT-3、BERT等NLP模型的成功,人类正逐步打破文本和图像的信息界限。在DALL·E 2中,只需输入简单的文本(prompt),它就可以生成多张1024*1024的高清图像。这些图像甚至

Wav2vec 2.0 [1],HuBERT [2] 和 WavLM [3] 等语音预训练模型,通过在多达上万小时的无标注语音数据(如 Libri-light )上的自监督学习,显著提升了自动语音识别(Automatic Speech Recognition, ASR),语音合成(Text-to-speech, TTS)和语音转换(Voice Conversation,VC)等语音下游任务的性能。然而这些模型都没有公开的中文版本,不便于应用在中文语音研究场景。 WenetSpeech [4] 是

“Making large models smaller”这是很多语言模型研究人员的学术追求,针对大模型昂贵的环境和训练成本,陈丹琦在智源大会青源学术年会上做了题为“Making large models smaller”的特邀报告。报告中重点提及了基于记忆增强的TRIME算法和基于粗细粒度联合剪枝和逐层蒸馏的CofiPruning算法。前者能够在不改变模型结构的基础上兼顾语言模型困惑度和检索速度方面的优势;而后者可以在保证下游任务准确度的同时实现更快的处理速度,具有更小的模型结构。陈丹琦 普

由于复杂的注意力机制和模型设计,大多数现有的视觉 Transformer(ViT)在现实的工业部署场景中不能像卷积神经网络(CNN)那样高效地执行。这就带来了一个问题:视觉神经网络能否像 CNN 一样快速推断并像 ViT 一样强大?近期一些工作试图设计 CNN-Transformer 混合架构来解决这个问题,但这些工作的整体性能远不能令人满意。基于此,来自字节跳动的研究者提出了一种能在现实工业场景中有效部署的下一代视觉 Transformer——Next-ViT。从延迟 / 准确性权衡的角度看,

3月27号,Stability AI的创始人兼首席执行官Emad Mostaque在一条推文中宣布,Stable Diffusion XL 现已可用于公开测试。以下是一些事项:“XL”不是这个新的AI模型的官方名称。一旦发布稳定性AI公司的官方公告,名称将会更改。与先前版本相比,图像质量有所提高与先前版本相比,图像生成速度大大加快。示例图像让我们看看新旧AI模型在结果上的差异。Prompt: Luxury sports car with aerodynamic curves, shot in a

人工智能就是一个「拼财力」的行业,如果没有高性能计算设备,别说开发基础模型,就连微调模型都做不到。但如果只靠拼硬件,单靠当前计算性能的发展速度,迟早有一天无法满足日益膨胀的需求,所以还需要配套的软件来协调统筹计算能力,这时候就需要用到「智能计算」技术。最近,来自之江实验室、中国工程院、国防科技大学、浙江大学等多达十二个国内外研究机构共同发表了一篇论文,首次对智能计算领域进行了全面的调研,涵盖了理论基础、智能与计算的技术融合、重要应用、挑战和未来前景。论文链接:https://spj.scien

译者 | 李睿审校 | 孙淑娟近年来, Transformer 机器学习模型已经成为深度学习和深度神经网络技术进步的主要亮点之一。它主要用于自然语言处理中的高级应用。谷歌正在使用它来增强其搜索引擎结果。OpenAI 使用 Transformer 创建了著名的 GPT-2和 GPT-3模型。自从2017年首次亮相以来,Transformer 架构不断发展并扩展到多种不同的变体,从语言任务扩展到其他领域。它们已被用于时间序列预测。它们是 DeepMind 的蛋白质结构预测模型 AlphaFold

说起2010年南非世界杯的最大网红,一定非「章鱼保罗」莫属!这只位于德国海洋生物中心的神奇章鱼,不仅成功预测了德国队全部七场比赛的结果,还顺利地选出了最终的总冠军西班牙队。不幸的是,保罗已经永远地离开了我们,但它的「遗产」却在人们预测足球比赛结果的尝试中持续存在。在艾伦图灵研究所(The Alan Turing Institute),随着2022年卡塔尔世界杯的持续进行,三位研究员Nick Barlow、Jack Roberts和Ryan Chan决定用一种AI算法预测今年的冠军归属。预测模型图


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

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

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

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Zend Studio 13.0.1
Powerful PHP integrated development environment
