当前位置:网站首页>【AI4Code】《Unified Pre-training for Program Understanding and Generation》 NAACL 2021
【AI4Code】《Unified Pre-training for Program Understanding and Generation》 NAACL 2021
2022-07-25 11:11:00 【chad_lee】
《Unified Pre-training for Program Understanding and Generation》 NAACL 2021
文章提出的PLBART是一种序列到序列模型,能够执行广泛的程序和语言理解和生成任务。 PLBART 通过denoising autoencoding对大量 Java 和 Python 函数以及相关的 NL 文本进行了预训练。代码摘要、代码生成和七种编程语言代码翻译的实验表明,PLBART 优于或与最先进的模型相媲美。此外,在判别任务上的实验,例如程序修复、克隆检测和易受攻击的代码检测,证明了 PLBART 在程序理解方面的有效性。此外,分析表明 PLBART 学习程序语法、样式(例如,标识符命名约定)、逻辑流程(例如,else 块内的 if 块等效于 else if 块)对程序语义至关重要,因此即使在有限的注释下也表现的很好。
去噪预训练
PLBART基于BARTbase架构,使用seq2seq去噪预训练来利用PL和NL中的未标记数据,这里有三种噪声策略:标记屏蔽、标记删除和标记填充,将有噪音的序列输入encoder,原始序列加上位置偏移输入decoder,目标是去除噪声恢复原序列。

其中token infilling是将 0~k 个token替换成 [MASK] ,k=0时就是添加一个 mask而已。
在预训练的时候 NL和 PL比例是1:14,所以需要上采样和下采样去偏。
下游任务

下游任务有根据代码生成描述,根据描述生成代码 和代码翻译,实质上都是seq2seq任务。
还有两个分类任务:克隆代码检测和脆弱代码检测,对于pair输入,将两段数据拼接起来,中间用一个 </s> token连接。decoder的最后一个输出送入线性分类器中分类。
边栏推荐
- 创新突破!亚信科技助力中国移动某省完成核心账务数据库自主可控改造
- 油猴脚本链接
- JS中的数组
- [electronic device notes 5] diode parameters and selection
- PHP uploads the FTP path file to the curl Base64 image on the Internet server
- Differences in usage between tostring() and new string()
- pycharm连接远程服务器ssh -u 报错:No such file or directory
- brpc源码解析(八)—— 基础类EventDispatcher详解
- php 一台服务器传图片到另一台上 curl post file_get_contents保存图片
- Classification parameter stack of JS common built-in object data types
猜你喜欢

Management of software defects

Multi-Label Image Classification(多标签图像分类)

Brpc source code analysis (VIII) -- detailed explanation of the basic class eventdispatcher

brpc源码解析(八)—— 基础类EventDispatcher详解

【GCN-RS】Are Graph Augmentations Necessary? Simple Graph Contrastive Learning for RS (SIGIR‘22)

PHP curl post length required error setting header header

brpc源码解析(一)—— rpc服务添加以及服务器启动主要过程

Teach you how to configure S2E as the working mode of TCP server through MCU

GPT plus money (OpenAI CLIP,DALL-E)

剑指 Offer 22. 链表中倒数第k个节点
随机推荐
微信公众号开发 入手
【图攻防】《Backdoor Attacks to Graph Neural Networks 》(SACMAT‘21)
JS 面试题:手写节流(throttle)函数
奉劝那些刚参加工作的学弟学妹们:要想进大厂,这些并发编程知识是你必须要掌握的!完整学习路线!!(建议收藏)
Power BI----这几个技能让报表更具“逼格“
Start with the development of wechat official account
已解决The JSP specification requires that an attribute name is preceded by whitespace
图神经网络用于推荐系统问题(IMP-GCN,LR-GCN)
【无标题】
Transformer变体(Sparse Transformer,Longformer,Switch Transformer)
【GCN-RS】Are Graph Augmentations Necessary? Simple Graph Contrastive Learning for RS (SIGIR‘22)
What is the global event bus?
【高并发】高并发场景下一种比读写锁更快的锁,看完我彻底折服了!!(建议收藏)
微星主板前面板耳机插孔无声音输出问题【已解决】
油猴脚本链接
[electronic device notes 5] diode parameters and selection
"Mqtt protocol explanation and Practice (access to onenet)" of wiznet w5500 series training activities
The JSP specification requires that an attribute name is preceded by whitespace
Application and innovation of low code technology in logistics management
Introduction to redis