arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2201.10005cs.CLcs.LG
收藏

基于对比预训练的文本和代码嵌入

Text and Code Embeddings by Contrastive Pre-Training

OpenAI(OpenAI(OpenAI公司))
Arvind Neelakantan, Tao Xu, Raul Puri, Alec Radford, Jesse Michael Han, Jerry Tworek, Qiming Yuan, Nikolas Tezak, Jong Wook Kim, Chris Hallacy, Johannes Heideck… 展开作者

Arvind Neelakantan, Tao Xu, Raul Puri, Alec Radford, Jesse Michael Han, Jerry Tworek, Qiming Yuan, Nikolas Tezak, Jong Wook Kim, Chris Hallacy, Johannes Heidecke, Pranav Shyam, Boris Power, Tyna Eloundou Nekoul, Girish Sastry, Gretchen Krueger, David Schnurr, Felipe Petroski Such, Kenny Hsu, Madeleine Thompson, Tabarak Khan, Toki Sherbakov, Joanne Jang, Peter Welinder, Lilian Weng

摘要:

文本嵌入在诸如语义搜索和计算文本相似度等许多应用中是有用的特征。以前的工作通常训练为不同用例定制的模型,这些用例在数据集选择、训练目标和模型架构方面各不相同。在这项工作中,我们证明了在大规模的无监督数据上进行对比预训练可以获得高质量的文本和代码矢量表示。同样的无监督文本嵌入在线性探针分类中实现了新的最先进的结果,也显示出令人印象深刻的语义搜索能力,有时甚至与微调模型竞争。在平均超过7个任务的线性探针分类准确率上,我们最好的无监督模型分别比以前最好的无监督和有监督文本嵌入模型相对提高了4%和1.8%。相同的文本嵌入在大规模语义搜索上进行评估时,在MSMARCO、Natural Questions和TriviaQA基准测试中,分别比以前最好的无监督方法提高了23.4%、14.7%和10.6%。与文本嵌入类似,我们在(文本,代码)对上训练代码嵌入模型,在代码搜索上获得了20.8%的相对改进。

英文摘要:

Text embeddings are useful features in many applications such as semantic search and computing text similarity. Previous work typically trains models customized for different use cases, varying in dataset choice, training objective and model architecture. In this work, we show that contrastive pre-training on unsupervised data at scale leads to high quality vector representations of text and code. The same unsupervised text embeddings that achieve new state-of-the-art results in linear-probe classification also display impressive semantic search capabilities and sometimes even perform competitively with fine-tuned models. On linear-probe classification accuracy averaging over 7 tasks, our best unsupervised model achieves a relative improvement of 4% and 1.8% over previous best unsupervised and supervised text embedding models respectively. The same text embeddings when evaluated on large-scale semantic search attains a relative improvement of 23.4%, 14.7%, and 10.6% over previous best unsupervised methods on MSMARCO, Natural Questions and TriviaQA benchmarks, respectively. Similarly to text embeddings, we train code embedding models on (text, code) pairs, obtaining a 20.8% relative improvement over prior best work on code search.

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

↑