Lune

ICML2020Top-tier venue

Structural Language Models of Code

Uri Alon, Roy Sadaka, Omer Levy, Eran Yahav

Abstract

We address the problem of any-code completion - generating a missing piece of source code in a given program without any restriction on the vocabulary or structure. We introduce a new approach to any-code completion that leverages the strict syntax of programming languages to model a code snippet as a tree - structural language modeling (SLM). SLM estimates the probability of the program's abstract syntax tree (AST) by decomposing it into a product of conditional probabilities over its nodes. We present a neural model that computes these conditional probabilities by considering all AST paths leading to a target node. Unlike previous techniques that have severely restricted the kinds of expressions that can be generated in this task, our approach can generate arbitrary code in any programming language. Our model significantly outperforms both seq2seq and a variety of structured approaches in generating Java and C# code. Our code, data, and trained models are available at http://github.com/tech-srl/slm-code-generation/ . An online demo is available at http://AnyCodeGen.org .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

31 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • ReACC: A Retrieval-Augmented Code Completion Framework cites Code Prediction by Feeding Trees to Transformers
  • Code Prediction by Feeding Trees to Transformers cites Adversarial examples for models of code
  • You Autocomplete Me: Poisoning Vulnerabilities in Neural Code Completion cites Adversarial examples for models of code
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers31

  1. ReACC: A Retrieval-Augmented Code Completion FrameworkShuai Lu, Nan Duan, Hojae Han, Daya Guo et al.ACL 2022 · 208 citations
  2. You Autocomplete Me: Poisoning Vulnerabilities in Neural Code CompletionRoei Schuster, Congzheng Song, Eran Tromer, Vitaly ShmatikovUSENIX Security 2021 · 199 citations
  3. Code Prediction by Feeding Trees to TransformersSeohyun Kim, Jinman Zhao, Yuchi Tian, Satish ChandraICSE 2021 · 179 citations
  4. Adversarial examples for models of codeNoam Yefet, Uri Alon, Eran YahavOOPSLA 2020 · 162 citations
  5. TFix: Learning to Fix Coding Errors with a Text-to-Text TransformerBerkay Berabi, Jingxuan He, Veselin Raychev, Martin T. VechevICML 2021 · 143 citations

Builds on1

  1. On the Bottleneck of Graph Neural Networks and its Practical ImplicationsUri Alon, Eran YahavICLR 2021 · 90 citations

Related papers

  1. A structural model for contextual code changesShaked Brody, Uri Alon, Eran YahavOOPSLA 2020 · 36 citations
  2. AST-Probe: Recovering abstract syntax trees from hidden representations of pre-trained language modelsJosé Antonio Hernández López, Martin Weyssow, Jesús Sánchez Cuadrado, Houari A. SahraouiASE 2022 · 18 citations
  3. Code Summarization with Structure-induced TransformerHongqiu Wu, Hai Zhao, Min ZhangACL Findings 2021 · 70 citations
  4. AST-T5: Structure-Aware Pretraining for Code Generation and UnderstandingLinyuan Gong, Mostafa Elhoushi, Alvin CheungICML 2024 · 42 citations
  5. Analysis of Tree-Structured Architectures for Code GenerationSamip Dahal, Adyasha Maharana, Mohit BansalACL Findings 2021 · 9 citations
Dusk over the sea between two cliffs drawn in fine vertical lines