Skip to main content
QUICK REVIEW

[논문 리뷰] Neural Edit Completion.

Shaked Brody, Uri Alon|arXiv (Cornell University)|2020. 05. 27.
Software Engineering ResearchComputer Science참고 문헌 12인용 수 7
한 줄 요약

이 논문은 편집 완성(edit completion) 작업을 위한 새로운 신경망 접근법을 제안하며, 프로그램의 추상구문트리(Abstract Syntax Tree, AST)에서의 편집 경로로 구조적 편집을 모델링하여 직접 코드 편집 완성 예측을 수행한다. 이는 최신 순차 모델 대비 28%의 상대적 향상과, 편집된 코드를 생성하는 대신 편집 자체를 모델링하는 문법 모델 대비 두 배의 정확도를 달성한다.

ABSTRACT

We address the problem of predicting edit completions based on a learned model that was trained on past edits. Given a code snippet that is partially edited, our goal is to predict a completion of the edit for the rest of the snippet. We refer to this task as the EditCompletion task and present a novel approach for tackling it. The main idea is to directly represent structural edits. This allows us to model the likelihood of the edit itself, rather than learning the likelihood of the edited code. We represent an edit operation as a path in the program's Abstract Syntax Tree (AST), originating from the source of the edit to the target of the edit. Using this representation, we present a powerful and lightweight neural model for the EditCompletion task. We conduct a thorough evaluation, comparing our approach to a variety of representation and modeling approaches that are driven by multiple strong models such as LSTMs, Transformers, and neural CRFs. Our experiments show that our model achieves 28% relative gain over state-of-the-art sequential models and 2$ imes$ higher accuracy than syntactic models that learn to generate the edited code instead of modeling the edits directly. We make our code, dataset, and trained models publicly available.

연구 동기 및 목표

  • 부분적으로 편집된 코드 스니펫의 완성 예측 과제를 해결하기 위해.
  • 결과로 생성된 편집된 코드의 확률이 아닌, 편집 작업의 확률을 직접 모델링하기 위해.
  • 편집을 추상구문트리(Abstract Syntax Tree, AST) 내의 구조적 경로로 표현하여 편집 예측 정확도를 향상시키기 위해.
  • 편집 의미를 효과적으로 포착하는 가벼운 대신 강력한 신경망 모델을 개발하기 위해.
  • 편집 완성 작업에서 기존의 순차 모델 및 문법 모델 접근 방식을 능가하기 위해.

제안 방법

  • 각 편집을 프로그램의 추상구문트리(Abstract Syntax Tree, AST)에서 소스 노드에서 타겟 노드로 이르는 경로로 표현하기.
  • AST 경로 표현을 기반으로 편집 완성 예측을 수행할 수 있도록 신경망 모델을 훈련하기.
  • AST 경로를 처리하고 나머지 편집을 예측하기 위해 순차 모델링 아키텍처(LSTM, Transformer, 또는 CRF 등)를 사용하기.
  • 완전한 편집된 코드를 생성할 필요 없이 편집 가능성 확률을 직접 학습하기.
  • AST 내의 구조적 정보를 활용하여 일반화 능력과 정확도 향상시키기.
  • 최소한의 계산 오버헤드로 높은 성능을 유지하는 가벼운 모델 설계하기.

실험 결과

연구 질문

  • RQ1편집 작업을 AST 경로로 모델링하는 것이 순차 기반 모델 대비 편집 완성 예측 성능을 향상시키는가?
  • RQ2편집된 코드를 생성하는 모델 대비 편집 가능성 확률을 직접 모델링하는 것이 우월한가?
  • RQ3제안된 접근 방식은 편집 완성 작업에서 최신 순차 모델 및 문법 모델과 비교해 어떻게 성능을 내는가?
  • RQ4AST 기반의 구조적 표현 방식이 예측 정확도 향상에 어느 정도 기여하는가?
  • RQ5가벼운 신경망 모델이 편집 완성 작업에서 뛰어난 성능을 달성할 수 있는가?

주요 결과

  • 제안된 모델은 편집 완성 작업에서 최신 순차 모델 대비 28%의 상대적 성능 향상을 달성한다.
  • 편집된 코드를 생성하는 대신 편집 자체를 직접 모델링하는 문법 모델 대비 정확도가 두 배에 달한다.
  • AST 경로를 사용해 편집 가능성 확률을 직접 모델링함으로써 뛰어난 성능을 발휘한다.
  • 강력한 순차 모델(LSTM, Transformer 등)과 문법 모델 모두를 능가하는 성능을 보인다.
  • 가벼운 구조이면서도 효과적이므로, 코드 편집 도구에서의 실용적 구현에 적합하다.
  • 코드, 데이터셋, 학습된 모델을 모두 공개하여 재현 가능성과 향후 연구 지원을 위해 기여한다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.