Label smoothing is a regularization technique for neural networks. Normally neural models are trained to an output distribution that is a vector with a single 1 for the correct prediction, and 0 for all other elements. Label smoothing converts the correct prediction location to something slightly less than 1, then distributes the remainder to the other elements such that they are slightly greater than 0. A conceptual explanation behind label smoothing is that it helps prevent a neural model from becoming "overconfident" by forcing it to consider alternatives, even if only slightly. Label smoothing has been shown to help several areas of language generation, yet typically requires considerable tuning and testing to achieve the optimal results. This tuning and testing has not been reported for neural source code summarization - a growing research area in software engineering that seeks to generate natural language descriptions of source code behavior. In this paper, we demonstrate the effect of label smoothing on several baselines in neural code summarization, and conduct an experiment to find good parameters for label smoothing and make recommendations for its use.
翻译:标签平滑是一种用于神经网络的正则化技术。通常,神经模型训练时会得到一个输出分布向量,其中正确预测位置为1,其他所有元素为0。标签平滑将正确预测位置的值调整为略小于1,并将剩余部分分配到其他元素,使其略大于0。标签平滑背后的概念解释是,它通过迫使模型考虑替代选项(即使程度微弱)来防止模型变得"过度自信"。研究表明,标签平滑有助于多个语言生成领域,但通常需要大量调参和测试才能达到最优效果。这种调参与测试尚未在神经源代码摘要领域(软件工程中一个新兴研究方向,旨在生成描述源代码行为的自然语言)得到报道。本文展示了标签平滑对多个神经代码摘要基线模型的影响,并通过实验确定了标签平滑的优良参数,为其使用提出了建议。