Oct 2026· Proceedings of the ACM on Software Engineering· Vol 3, pp. 2092 - 2112· 1 citation· 45 references
Abstract
Recent advances in code intelligence are largely driven by large language models (LLMs), which represent code as token sequences and achieve strong results on many software engineering tasks. However, standard token-based approaches often struggle to capture the inherent structural regularities of programming languages. While grammar-guided approaches can alleviate this limitation by modeling syntax more explicitly, they may sacrifice flexibility. In this work, we propose the Self-Adaptive Code Representation (SACR) framework, which enables models to dynamically select between token-based and grammar-guided representations depending on the problem context. SACR operates in two stages: first, the model is jointly trained on both representations to learn their respective strengths; second, an adaptive mechanism quantifies the generation difficulty for each sample and selects the model’s preferred code representation for training. We implement SACR in three versions of SacrCoder with parameter sizes of 0.5B, 1.3B, and 3B, and evaluate their effectiveness across a range of code generation and code repair benchmarks, including two repository-level pragmatic benchmarks built from real open-source projects. Through empirical analysis, we first demonstrate that token-based and grammar-guided code representations exhibit complementary strengths. Building on this observation, SACR selectively exploits these complementary representations during training to improve overall performance. Experimental results show that SacrCoder consistently achieves state-of-the-art performance. For example, the 3B model obtains a Pass@1 of 84.1% on HumanEval and 30.3% on APPS, corresponding to relative improvements of 9.5% and 32.3% over grammar-only and dual-format baselines, respectively, and SacrCoder also outperforms all single-representation baselines on the real-world programming benchmarks at every scale. Further ablation studies confirm that the effectiveness of SACR in leveraging complementary code representations.
Modern software systems are increasingly variant-rich, and feature models capture this variability formally. The Universal Variability Language (UVL) has emerged as a community-driven standard for expressing such models, but creating and maintaining UVL artifacts remains a manual, expert-driven task. Large Language Mod...
Johannes Stümpfle, Fethiye Tunç, N. Jazdi et al.· Proceedings of the ACM/IEEE...· 0 citations
A novel adaptation approach named DEED, which stands for D ata-E fficient adaptation with E rror-D riven learning for code generation, leverages the errors made by LLMs as learning opportunities, using error revision to overcome their own shortcomings, thus achieving efficient learning.
Xue Jiang, Zhiyuan Fan Zhi Jin YIHONG DONG, Wen-Pin Jiao et al.· 1 citation
Large Language Models (LLMs) have significantly advanced automatic code generation in mainstream, high-resource, general-purpose programming languages. These models are trained on large instruction-code datasets with executable test environments, which can benchmark the performance of the outputs. However, they typical...
Vedad Misirlic, Kevin Innerebner, Gerald Stieglbauer et al.· Proceedings of the 35th ACM...· 0 citations
The results demonstrate that explicit execution semantics can be taught through standard post-training without architectural modification, and introduce attention-based interpretability metrics that diagnose failure modes at individual transformer layers for structured inputs.
Basel Shbita, M. Hind, Chad DeLuca et al.· 0 citations
Many languages lack the vast datasets needed to develop high-performing language models, resulting in significant disparities in performance across various linguistic tasks. The novel recursive instruction tuning approach proposed in this research addresses this challenge through an iterative feedback mechanism that en...
Tilda Harrington, Christian Navarro, Elena Davidson et al.· 3 citations
When generating programs with language models, constrained decoding can apply program analyses to exclude tokens that violate syntax, scope, or typing rules. However, there is a duplication: standard training already teaches the model to suppress the tokens rejected by these analyses. This duplication leads to the ques...
Jinwoo Kim· 0 citations
We use cookies to run the site and, with your consent, for analytics and to show ads.
See our Cookie Policy.