[논문 리뷰] Tree-to-tree Neural Networks for Program Translation
트리-투-트리 신경망을 포함한 주의(attention, 부모 주의 피딩 메커니즘 포함)으로 소스 서브트리를 타깃 서브트리와 정렬해 프로그램을 번역합니다. CoffeeScript↔JavaScript 및 Java→C# 벤치마크에서 최첨단 기준선보다 우수합니다.
Program translation is an important tool to migrate legacy code in one language into an ecosystem built in a different language. In this work, we are the first to employ deep neural networks toward tackling this problem. We observe that program translation is a modular procedure, in which a sub-tree of the source tree is translated into the corresponding target sub-tree at each step. To capture this intuition, we design a tree-to-tree neural network to translate a source tree into a target one. Meanwhile, we develop an attention mechanism for the tree-to-tree model, so that when the decoder expands one non-terminal in the target tree, the attention mechanism locates the corresponding sub-tree in the source tree to guide the expansion of the decoder. We evaluate the program translation capability of our tree-to-tree model against several state-of-the-art approaches. Compared against other neural translation models, we observe that our approach is consistently better than the baselines with a margin of up to 15 points. Further, our approach can improve the previous state-of-the-art program translation approaches by a margin of 20 points on the translation of real-world projects.
연구 동기 및 목표
- 신경 모델이 이점을 제공할 수 있는 모듈식이자 트리 구조화된 작업으로서의 프로그램 번역을 동기 부여한다.
- 소스 파스 트리를 타깃 파스 트리로 번역하는 트리-투-트리 인코더–디코더 아키텍처를 제안한다.
- 타깃 트리 확장 과정에서 대응하는 소스 서브트리를 찾기 위해 어텐션 메커니즘을 도입한다.
- 디코딩 트리로 내려가며 어텐션 정보를 전파하기 위한 부모 어텐션 피딩 메커니즘으로 모델을 향상시킨다.
제안 방법
- 소스와 타깃 파스 트리를 이진 표현(왼쪽 자식-오른쪽 형제)으로 변환한다.
- Tree-LSTM 인코더를 사용해 소스 트리 및 서브트리에 대한 임베딩을 계산한다.
- 공유 어휘에 대한 소프트맥스(Softmax)를 통해 노드 값을 예측하며 큐 기반 확장을 사용해 타깃 트리로 디코드한다.
- 소스 서브트리에 대한 어텐션 가중치를 계산해 임베딩 e_s를 형성한 다음 디코더 상태와 결합해 e_t를 얻는다.
- 왼쪽/오른쪽 자식 디코더에 부모 어텐션 벡터 e_t를 피딩하는 부모 어텐션 피딩 메커니즘을 적용한다.
실험 결과
연구 질문
- RQ1트리-투-트리 신경 아키텍처가 프로그램 번역에서 시퀀스-투-시퀀스 및 트리 기반 베이스라인을 능가할 수 있는가?
- RQ2소스 파스 트리에 걸친 어텐션 메커니즘이 번역 품질을 개선하고, 제안된 부모-어텐션 피딩이 성능에 어떤 영향을 미치는가?
- RQ3모델이 실제 코드베이스의 서로 다른 언어 쌍과 프로그램 길이에 얼마나 잘 확장되는가?
주요 결과
- 트리-투-트리 모델은 프로그램 번역 작업에서 일관되게 베이스라인을 능가하며 벤치마크에서 프로그램 정확도에서 최대 15포인트 향상을 달성한다.
- CoffeeScript→JavaScript 데이터셋에서 모델은 최고 베이스라인 대비 최대 ~20포인트 개선을 달성하며, 특히 더 긴 프로그램에서 두드러진다.
- 어텐션이 없으면 모델은 여러 작업에서 거의 0%에 가깝게 성능을 보이나, 어텐션은 일부 설정에서 성능을 90% 이상으로 끌어올린다.
- Java→C#의 경우 트리-투-트리 접근은 이전 SMT 기반 방법보다 실제 프로젝트에서 약 20% 정도의 프로그램 정확도에서 크게 능가한다(프로젝트별로 다름).
- 부모-어텐션 피딩 메커니즘을 도입하면 그것이 없는 변형들보다 상당한 성능 향상을 보이며 특히 트리 크기가 커질수록 그렇다.
더 나은 연구,지금 바로 시작하세요
연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.