LongCoder: A Long-Range Pre-trained Language Model for Code Completion

By Daya Guo, Canwen Xu, Nan Duan, Jian Yin, Julian McAuley. 2023

166 citations recorded by the source corpus.

In this paper, we introduce a new task for code completion that focuses on handling long code input and propose a sparse Transformer model, called LongCoder, to address this task. LongCoder employs a sliding window mechanism for self-attention and introduces two types of globally accessible tokens - bridge tokens and memory tokens - to improve performance and efficiency. Bridge tokens are inserted throughout the input sequence to aggregate local information and facilitate global interaction, while memory tokens are included to highlight important statements that may be invoked later and need to be memorized, such as package imports and definitions of classes, functions, or structures. We conduct experiments on a newly constructed dataset that contains longer code context and the publicly available CodeXGLUE benchmark. Experimental results demonstrate that LongCoder achieves superior performance on code completion tasks compared to previous models while maintaining comparable efficiency in terms of computational resources during inference. All the codes and data are available at https://github.com/microsoft/CodeBERT.

Subfields: Artificial Intelligence, Computer Networks and Communications, Information Systems, Natural Language Processing

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Gabriel Synnaeve
  2. Yossi Adi
  3. Jade Copet
  4. Nicolas Usunier
  5. Tal Remez
  6. Hugo Touvron
  7. Jianfeng Gao
  8. Itai Gat

In Computer Networks and Communications

  1. Nicolas Usunier
  2. Yuxiao Dong
  3. Hugo Touvron
  4. Wenhan Xiong
  5. Baptiste Rozière

In Information Systems

  1. Gabriel Synnaeve
  2. Xiao Liu
  3. Nicolas Usunier
  4. Yuxiao Dong
  5. Wenhan Xiong
  6. Baptiste Rozière
  7. Wen Xiao
  8. Thomas Scialom

In Natural Language Processing

  1. Gabriel Synnaeve
  2. Yossi Adi
  3. Nicolas Usunier
  4. Thomas Scialom
  5. Louis Martin
  6. Jade Copet
  7. Yuxiao Dong
  8. Aohan Zeng

Citations in the corpus