Metraipolis › archive › dc_a1cb1ede552c

Type-Constrained Code Generation with Language Models (2025) · OpenAlex W4411267925

Source
OpenAlex
Original
https://doi.org/10.1145/3729274
License (as archived)
CC-BY-SA-4.0
Archived
2026-10-08T03:41:03.355Z
SHA-256 of the archived text
34735977c72db056e8e53b2e52aa12215d8eb474101960ec2982120af0ff8104
Stable URL of this page
https://metraipolis.com/documento/dc_a1cb1ede552c

How to cite

Type-Constrained Code Generation with Language Models (2025) · OpenAlex W4411267925 — OpenAlex, https://doi.org/10.1145/3729274 (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_a1cb1ede552c (Metraipolis archive dc_a1cb1ede552c, sha256 34735977c72db056e8e53b2e52aa12215d8eb474101960ec2982120af0ff8104)
BibTeX
@misc{dca1cb1ede552c,
  title = {Type-Constrained Code Generation with Language Models (2025) · OpenAlex W4411267925},
  howpublished = {OpenAlex},
  url = {https://doi.org/10.1145/3729274},
  note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_a1cb1ede552c; sha256 34735977c72db056e8e53b2e52aa12215d8eb474101960ec2982120af0ff8104},
  year = {2026}
}

Archived text

Reproduced under CC-BY-SA-4.0. Attribution: OpenAlex, https://doi.org/10.1145/3729274. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

Opera scientifica in accesso aperto: scheda dai metadati OpenAlex (article).
Titolo: Type-Constrained Code Generation with Language Models
Autori: Niels Mündler, Jingxuan He, Hao Wang, Koushik Sen, Dawn Xiaodong Song, Martin Vechev
Anno: 2025 · Sede: Proceedings of the ACM on Programming Languages · Lingua: en
DOI: https://doi.org/10.1145/3729274
Accesso aperto: diamond · testo: https://doi.org/10.1145/3729274 · licenza del testo: cc-by-sa
Citazioni ricevute (OpenAlex): 11
Temi (OpenAlex): Software Engineering Research; Logic, programming, and type systems; Teaching and Learning Programming

Abstract (testo degli autori, licenza cc-by-sa):
Large language models (LLMs) have achieved notable success in code generation. However, they still frequently produce uncompilable output because their next-token inference procedure does not model formal aspects of code. Although constrained decoding is a promising approach to alleviate this issue, it has only been applied to handle either domain-specific languages or syntactic features of general-purpose programming languages. However, LLMs frequently generate code with typing errors, which are beyond the domain of syntax and generally hard to adequately constrain. To address this challenge, we introduce a type-constrained decoding approach that leverages type systems to guide code generation. For this purpose, we develop novel prefix automata and a search over inhabitable types, forming a sound approach to enforce well-typedness on LLM-generated code. We formalize our approach on a foundational simply-typed language and extend it to TypeScript to demonstrate practicality. Our evaluation on the HumanEval and MBPP datasets shows that our approach reduces compilation errors by more than half and significantly increases functional correctness in code synthesis, translation, and repair tasks across LLMs of various sizes and model families, including state-of-the-art open-weight models with more than 30B parameters. The results demonstrate the generality and effectiveness of our approach in constraining LLM code generation with formal rules of type systems.

Fonte: https://openalex.org/W4411267925 — metadati OpenAlex (CC0 1.0), consultati il 2026-10-07 via api.openalex.org. Interrogazione: «code generation language models».