通过输入去噪即时提升深度代码模型的性能
On-the-fly Improving Performance of Deep Code Models via Input Denoising
AI总结:
针对深度代码模型受噪声输入影响且重训练成本高的问题,提出 CodeDenoise,通过定位并清洗噪声标识符即时提升18个模型的预测准确率。
摘要:
深度学习已被广泛用于通过基于大量代码片段构建深度代码模型来处理各种代码任务。尽管这些深度代码模型取得了巨大成功,但即使是最先进的模型也会受到输入中存在的噪声影响,从而导致错误预测。虽然可以通过重新训练或微调来增强模型,但这并非一劳永逸的方法,并且会产生显著开销。特别是,这些技术无法即时提升(已部署)模型的性能。目前,其他领域(如图像处理)已有一些输入去噪技术,但由于代码输入是离散的,并且必须严格遵守复杂的语法和语义约束,其他领域的输入去噪技术几乎不适用。在本工作中,我们提出了首个面向深度代码模型的输入去噪技术(即 CodeDenoise)。其核心思想是在(可能)被错误预测的输入中定位有噪声的标识符,并通过清洗所定位的标识符来对此类输入去噪。该方法不需要重新训练或重构模型,而只需即时清洗输入以提升性能。我们在18个深度代码模型(即三个预训练模型与六个基于代码的数据集)上的实验证明了 CodeDenoise 的有效性和效率。例如,平均而言,CodeDenoise 成功对21.91%的错误预测输入进行去噪,并在所有受试对象上使原始模型的准确率提升2.04%,而每个输入平均耗时0.48秒,显著优于广泛使用的微调策略。
英文摘要:
Deep learning has been widely adopted to tackle various code-based tasks by building deep code models based on a large amount of code snippets. While these deep code models have achieved great success, even state-of-the-art models suffer from noise present in inputs leading to erroneous predictions. While it is possible to enhance models through retraining/fine-tuning, this is not a once-and-for-all approach and incurs significant overhead. In particular, these techniques cannot on-the-fly improve performance of (deployed) models. There are currently some techniques for input denoising in other domains (such as image processing), but since code input is discrete and must strictly abide by complex syntactic and semantic constraints, input denoising techniques in other fields are almost not applicable. In this work, we propose the first input denoising technique (i.e., CodeDenoise) for deep code models. Its key idea is to localize noisy identifiers in (likely) mispredicted inputs, and denoise such inputs by cleansing the located identifiers. It does not need to retrain or reconstruct the model, but only needs to cleanse inputs on-the-fly to improve performance. Our experiments on 18 deep code models (i.e., three pre-trained models with six code-based datasets) demonstrate the effectiveness and efficiency of CodeDenoise. For example, on average, CodeDenoise successfully denoises 21.91% of mispredicted inputs and improves the original models by 2.04% in terms of the model accuracy across all the subjects in an average of 0.48 second spent on each input, substantially outperforming the widely-used fine-tuning strategy.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。