EUVIMEDEUVIMED entdecken
Open Access · CC BY 4.0

StructCoder: Structure-Aware Transformer for Code Generation

Sindhu Tipirneni, Ming Zhu, Chandan K. Reddy

ACM Transactions on Knowledge Discovery from Data · 30.04.2024 · 18 (3) · 1-20

DOI: 10.1145/3636430 ↗

Kurz gefasst

Fachartikel in der Zeitschrift ACM Transactions on Knowledge Discovery from Data, online erschienen am 12.01.2024. Verfasst von Sindhu Tipirneni und 2 weiteren Autor:innen. Die Arbeit wurde bisher 47-mal zitiert (Crossref) und nennt 36 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0).

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

There has been a recent surge of interest in automating software engineering tasks using deep learning. This article addresses the problem of code generation, in which the goal is to generate target code given source code in a different language or a natural language description. Most state-of-the-art deep learning models for code generation use training strategies primarily designed for natural language. However, understanding and generating code requires a more rigorous comprehension of the code syntax and semantics. With this motivation, we develop an encoder-decoder Transformer model in which both the encoder and decoder are explicitly trained to recognize the syntax and dataflow in the source and target codes, respectively. We not only make the encoder structure aware by leveraging the source code’s syntax tree and dataflow graph, but we also support the decoder in preserving the syntax and dataflow of the target code by introducing two novel auxiliary tasks: Abstract Syntax Tree (AST) path prediction and dataflow prediction. To the best of our knowledge, this is the first work to introduce a structure-aware Transformer decoder that models both syntax and dataflow to enhance the quality of generated code. The proposed StructCoder model achieves state-of-the-art performance on code translation and text-to-code generation tasks in the CodeXGLUE benchmark and improves over baselines of similar size on the APPS code generation benchmark. Our code is publicly available at https://github.com/reddy-lab-code-research/StructCoder/ .

Zitieren

APA

Tipirneni, S., Zhu, M., & Reddy, C. K. (2024). StructCoder: Structure-Aware Transformer for Code Generation. ACM Transactions on Knowledge Discovery from Data, 18(3), 1-20. https://doi.org/10.1145/3636430

Vancouver

Tipirneni S, Zhu M, Reddy CK. StructCoder: Structure-Aware Transformer for Code Generation. ACM Transactions on Knowledge Discovery from Data. 2024;18(3):1-20. doi:10.1145/3636430

BibTeX
@article{Tipirneni2024,
  author = {Tipirneni, Sindhu and Zhu, Ming and Reddy, Chandan K.},
  title = {StructCoder: Structure-Aware Transformer for Code Generation},
  journal = {ACM Transactions on Knowledge Discovery from Data},
  year = {2024},
  volume = {18},
  number = {3},
  pages = {1--20},
  doi = {10.1145/3636430}
}
Kostenlos starten →