Lune

ACL Findings2025

Grammar-Based Code Representation: Is It a Worthy Pursuit for LLMs?

Qingyuan Liang, Zhao Zhang, Zeyu Sun, Zheng Lin, Qi Luo, Yueyi Xiao, Yizhou Chen, Yuqun Zhang, Haotian Zhang, Lu Zhang, Chen Bin, Yingfei Xiong

摘要

Grammar serves as a cornerstone in programming languages and software engineering, providing frameworks to define the syntactic space and program structure. Existing research demonstrates the effectiveness of grammarbased code representations in small-scale models, showing their ability to reduce syntax errors and enhance performance. However, as language models scale to the billion level or beyond, syntax-level errors become rare, making it unclear whether grammar information still provides performance benefits. To explore this, we develop a series of billion-scale Grammar-Coder models, incorporating grammar rules in the code generation process. Experiments on HumanEval (+) and MBPP (+) demonstrate a notable improvement in code generation accuracy. Further analysis shows that grammarbased representations enhance LLMs' ability to discern subtle code differences, reducing semantic errors caused by minor variations. These findings suggest that grammar-based code representations remain valuable even in billion-scale models, not only by maintaining syntax correctness but also by improving semantic differentiation.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • SelfCodeAlign: Self-Alignment for Code Generation 引用了 CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
  • SelfCodeAlign: Self-Alignment for Code Generation 引用了 OpenCodeInterpreter: Integrating Code Generation with Execution and Refinement
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper2

  1. Evaluating and Improving Automated Repository-Level Rust Issue Resolution with LLM-based AgentsJiahong Xiang, Wenxiao He, Xihua Wang, Hongliang Tian 等ICSE 2026
  2. AgentVocab: Structure-Aware Vocabulary Adaptation for Efficient LLM AgentsKai Bian, Haosi Mo, Xuebo Liu, Shuangyong Song 等ICML 2026

它引用的 Paper9

  1. GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng 等ICLR 2021 · 1,644 次引用
  2. CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 1,224 次引用
  3. TreeGen: A Tree-Based Transformer Architecture for Code GenerationZeyu Sun, Qihao Zhu, Yingfei Xiong, Yican Sun 等AAAI 2020 · 196 次引用
  4. SelfCodeAlign: Self-Alignment for Code GenerationYuxiang Wei, Federico Cassano, Jiawei Liu, Yifeng Ding 等NeurIPS 2024 · 79 次引用
  5. OpenCodeInterpreter: Integrating Code Generation with Execution and RefinementTianyu Zheng, Ge Zhang, Tianhao Shen, Xueling Liu 等ACL Findings 2024 · 46 次引用

相关 Paper

  1. Towards Understanding the Characteristics of Code Generation Errors Made by Large Language ModelsZhijie Wang, Zijie Zhou, Da Song, Yuheng Huang 等ICSE 2025 · 12 次引用
  2. Self-Adaptive Code Representation: Grammar-Guided or Token-Based?Qingyuan Liang, Zhao Zhang, Chen Liu, Zeyu Sun 等ISSTA 2026
  3. PairCoder: Pair Programming-Inspired Two-Agent Collaboration for Code GenerationJunhao Chen, Xiang Li, Yibin Xu, Yuehan Cui 等ACL Findings 2026 · 2 次引用
  4. Getting the most out of your tokenizer for pre-training and domain adaptationGautier Dagan, Gabriel Synnaeve, Baptiste RozièreICML 2024 · 68 次引用
  5. Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step by StepLi Zhong, Zilong Wang, Jingbo ShangACL Findings 2024 · 69 次引用
黄昏的海面,两侧是细线勾勒的悬崖