ISSN 1000-1239 CN 11-1777/TP

计算机研究与发展 ›› 2021, Vol. 58 ›› Issue (3): 638-650.doi: 10.7544/issn1000-1239.2021.20200298

• 软件技术 • 上一篇    下一篇

一种融合程序员和神经网络的自动化程序生成方法

周鹏1,2,武延军1,3,赵琛1,3   

  1. 1(中国科学院软件研究所 北京 100190);2(中国科学院大学 北京 100049);3(计算机科学国家重点实验室(中国科学院软件研究所) 北京 100190) (zhoupengwork01@163.com)
  • 出版日期: 2021-03-01
  • 基金资助: 
    中国科学院战略性先导科技专项(A类)(Y8XD373105);中国科学院前沿科学重点研究计划项目(ZDBS-LY-JSC038)

A Programming Paradigm Combining Programmer and Neural Network to Promote Automated Program Generation

Zhou Peng1,2, Wu Yanjun1,3, Zhao Chen1,3   

  1. 1(Institute of Software, Chinese Academy of Sciences, Beijing 100190);2(University of Chinese Academy of Sciences, Beijing 100049);3(State Key Laboratory of Computer Science (Institute of Software, Chinese Academy of Sciences), Beijing 100190)
  • Online: 2021-03-01
  • Supported by: 
    This work was supported by the Strategic Priority Research Program of Chinese Academy of Sciences(A) (Y8XD373105) and the Key Research Program of Frontier Sciences, CAS (ZDBS-LY-JSC038).

摘要: 程序生成是人工智能的核心研究问题之一, 当前输入-输出样例驱动的神经网络模型是非常流行的研究方法.面临的主要挑战是泛化能力差、生成程序准确率保证、难以处理复杂程序结构(如分支、循环、递归等), 主要原因是模型的输入信息单一(输入-输出对)和完全依赖神经网络.显然单一地通过输入输出样例倒推程序行为存在歧义性, 而神经网络的记忆容量很难满足常规程序的变量存储需求.提出一种人工与神经网络生成相协作的编程模型, 融合神经网络和程序员各自的优势, 其中程序员用高级编程语法编写程序框架, 神经网络自动学习生成程序局部的琐碎细节, 从而促进自动化程序生成方法更好地应对实际应用挑战.实验表明, 研究方法是有效的, 跟同类代表性研究方法相比表现出更好的学习性能.

关键词: 智能软件, 程序生成, 软件工程, 可微分编程语言, 人工智能

Abstract: Program generation is one of the core research challenges in AI. At present, the neural network methods driven by input-output data are very popular for program generation modeling. Because of incomplete information input to the model, and complete dependency and limited memory capacity of the neural network, the learning performances of these models suffer from the challenges of poor generalization, generated program accuracy assurance, and being not competent for dealing with common program structures. The memory capacity of neural network can not meet the variable storage requirements of conventional programs. Thus, we propose a programming paradigm merging the strengths of human’s experience and perception with those of neural network’s learning from data samples. Human programmers provide the overall program structure roughly, and leverage the neural network to generate the local trivial detail automatically. The programs run on an abstract computer like digital computer, but are end-to-end differentiable, which consists of differentiable controller, extended external memory relative to internal memory cells of neural network, and differentiable instruction set represented by differentiable state transfer function library. So, it can not only receive input-output samples but also program and execute instructions like traditional digital computers, and its extended memory visible from outside provides more capacity for program variable representation. The advantage is to promote program generation’s practical applicability. The experimental results indicate that the method is effective and gets much better learning performance than other typical methods in program generation.

Key words: intelligent software, program generation, software engineering, differentiable programming language, artificial intelligence

中图分类号: