AST-T5: Structure-aware pretraining for code generation and understanding
Open accessAbstract
Large language models (LLMs) have made significant advancements in code-related tasks, yet many LLMs treat code as simple sequences, neglecting its structured nature. We introduce AST-T5, a novel pretraining paradigm that leverages the Abstract Syntax Tree (AST) for enhanced code generation, transpilation, and understanding. Using dynamic programming, our AST-Aware Segmentation retains code structure, while our AST-Aware Span Corruption objective equips the model to reconstruct various code structures. Unlike other models, AST-T5 avoids intricate program analyses or architectural changes, so it integrates seamlessly with any encoder-decoder Transformer. Evaluations show that AST-T5 consistently outperforms similar-sized LMs across various code-related tasks. Structure-awareness makes AST-T5 particularly powerful in code-to-code tasks, surpassing CodeT5 by 2 points in exact match score for the Bugs2Fix task and by 3 points in exact match score for Java-C# Transpilation in CodeXGLUE. Our code and model are publicly available at https://github.com/gonglinyuan/ast_t5.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
Explicitly incorporating structural knowledge into models enhances their perceptual understanding of code, thereby aiding software mining tasks, including code translation.
“explicitly incorporating structural knowledge into models enhances their perceptual understanding of code, thereby aiding software mining tasks [14], [15], including code translation [9], [13].”
From Post-Incorporating Code Structural Knowledge Into Pretrained Models via ICL for Code Translation (2025) · cites this paper as [15]
Cited by
Sorted by citations
Zhang, Y., Zhao, X., Wang, Z. Z., Yang, C., Wei, J., & Wu, T. (2025) · Findings of the Association for Computational Linguistics: EMNLP 2025 · doi:10.18653/v1/2025.findings-emnlp.430 · Cited by 11 · see citing works
Post-Incorporating Code Structural Knowledge Into Pretrained Models via ICL for Code Translation
Du, Y., Sun, H., & Li, M. (2025) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2025.3605768
- Authors
- Gong, L., Elhoushi, M., & Cheung, A.
- Venue
- arXiv
- Publisher
- arXiv
- Published
- 2024
- ISSN
- 2331-8422 (ISSN-L)
- arXiv
- 2401.03003
- OpenAlex
- W4390723549
- Cited by
- 7
- References
- 0
- Citations by year
- 2026: 1 · 2025: 3 · 2024: 3
- Type
- posted content
- Language
- en
- Open access
- green
- arxiv.org
- Licence
- Locations
- arXiv (Cornell University) (submittedVersion, other-oa)
- arXiv (Cornell University)
- Funders
- National Science Foundation (1955488, 2027575)
- U.S. Department of Energy (DESC0016260)
- Styrelsen för Internationellt Utvecklingssamarbete
- Instituto de Ciencias del Mar y Limnología, Universidad Nacional Autónoma de México
- Office of Naval Research (N00014-21-1-2724, ONR-N00014, N00014)
- Army Research Office (W911NF2110339)
- Topics
- Physical Sciences › Computer Science › Information Systems › Software Engineering Research
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Physical Sciences › Computer Science › Computer Science Applications › Teaching and Learning Programming
- Keywords
- abstract syntax tree, code generation, program comprehension, CodeXGLUE, transformer encoder-decoder
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review