arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2003.10555cs.CL
收藏

ELECTRA:预训练文本编码器作为鉴别器而不是生成器

ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators

Stanford University(斯坦福大学);Google Brain(谷歌大脑)

Kevin Clark, Minh-Thang Luong, Quoc V. Le, Christopher D. Manning

摘要:

诸如BERT之类的掩蔽语言建模(MLM)预训练方法通过用[MASK]替换一些标记来破坏输入,然后训练模型以重构原始标记。虽然它们在转移到下游NLP任务时会产生良好的结果,但它们通常需要大量的计算才能有效。作为替代方案,我们提出了一种更有效的样本预训练任务,称为替换令牌检测。我们的方法不是屏蔽输入,而是通过用从小型生成器网络中采样的看似合理的替代品替换一些令牌来破坏它。然后,我们不是训练一个预测损坏令牌的原始身份的模型,而是训练一个判别模型,该模型预测损坏输入中的每个令牌是否被生成器样本替换。彻底的实验表明,这种新的预训练任务比MLM更有效,因为该任务是在所有输入令牌上定义的,而不仅仅是被屏蔽的小子集。因此,在相同的模型大小、数据和计算条件下,通过我们的方法学习的上下文表示大大优于通过BERT学习的上下文表示。对于小型模型来说,这种优势尤其明显;例如,我们在一个GPU上对一个模型进行了为期4天的训练,该模型在GLUE自然语言理解基准测试中的性能优于GPT(使用30倍以上的计算进行训练)。我们的方法在大规模上也能很好地工作,它在使用不到1/4的计算量的情况下执行Roberta和XLNet,并且在使用相同的计算量时优于它们。

英文摘要:

Masked language modeling (MLM) pre-training methods such as BERT corrupt the input by replacing some tokens with [MASK] and then train a model to reconstruct the original tokens. While they produce good results when transferred to downstream NLP tasks, they generally require large amounts of compute to be effective. As an alternative, we propose a more sample-efficient pre-training task called replaced token detection. Instead of masking the input, our approach corrupts it by replacing some tokens with plausible alternatives sampled from a small generator network. Then, instead of training a model that predicts the original identities of the corrupted tokens, we train a discriminative model that predicts whether each token in the corrupted input was replaced by a generator sample or not. Thorough experiments demonstrate this new pre-training task is more efficient than MLM because the task is defined over all input tokens rather than just the small subset that was masked out. As a result, the contextual representations learned by our approach substantially outperform the ones learned by BERT given the same model size, data, and compute. The gains are particularly strong for small models; for example, we train a model on one GPU for 4 days that outperforms GPT (trained using 30x more compute) on the GLUE natural language understanding benchmark. Our approach also works well at scale, where it performs comparably to RoBERTa and XLNet while using less than 1/4 of their compute and outperforms them when using the same amount of compute.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑