基于Source Code的开放式词汇学习
Open Vocabulary Learning on Source Code with a Graph-Structured Cache
摘要:
将计算机程序源代码作为输入的机器学习模型通常使用自然语言处理(NLP)技术。然而,一个主要的挑战是,代码是使用开放的、快速变化的词汇表编写的,例如,新变量和方法名称的一致性。在这样的词汇表上进行推理并不是大多数NLP方法的设计目标。我们引入了一个图结构缓存来解决这个问题;这个缓存包含模型遇到的每个新单词的节点,并将每个单词连接到代码中的出现。我们发现,结合这种图形结构的缓存策略与最近的图形神经网络为基础的模型进行监督学习的代码,提高了模型的性能上的代码完成任务和变量命名任务--与$100\%$相对改善后者--在成本的适度增加计算时间。
英文摘要:
Machine learning models that take computer program source code as input typically use Natural Language Processing (NLP) techniques. However, a major challenge is that code is written using an open, rapidly changing vocabulary due to, e.g., the coinage of new variable and method names. Reasoning over such a vocabulary is not something for which most NLP methods are designed. We introduce a Graph-Structured Cache to address this problem; this cache contains a node for each new word the model encounters with edges connecting each word to its occurrences in the code. We find that combining this graph-structured cache strategy with recent Graph-Neural-Network-based models for supervised learning on code improves the models' performance on a code completion task and a variable naming task --- with over $100\%$ relative improvement on the latter --- at the cost of a moderate increase in computation time.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。