Language-Agnostic Generation of Header Comments using Large Language Models

Documentation comments are essential for maintainability, yet they are often missing or outdated. This is true not only for programs in general-purpose languages, but also for artifacts in other languages often found in software projects such as scripts or configuration files. To address this problem, we present an approach that uses Large Language Models (LLMs) to generate header comments (aka, ‘block comments’ or ‘doc-strings’) for elements of different languages in different documentation formats. Given a file in some language and a description of elements in the file to be documented and the documentation format to be used, the approach generates header comments for all undocumented elements in the file that is guaranteed to conform to the documentation format. We describe a prototype implementation and its integration into an industrial development pipeline. Feedback from our industrial partner, an LLM-as-judge evaluation, and the participants of a user study involving a broad range of languages indicates that the approach is viable, able to produce sufficiently high-quality documentation in general, and holds potential for improving industrial documentation practices across different programming languages and teams.

Authors

Institutions

Publication Details

Published
2025-09-08
DOI
https://doi.org/10.1109/scam67354.2025.00013
Primary Topic
Topic Modeling
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Language-Agnostic Generation of Header Comments using Large Language Models

Ali Tizghadam, Ibrahim M. Amer, Juergen Dingel, Nathanael Yao
Topic Modeling
article

Language-Agnostic Generation of Header Comments using Large Language Models

Ali Tizghadam, Ibrahim M. Amer, Juergen Dingel, Nathanael Yao
article en

Abstract

Documentation comments are essential for maintainability, yet they are often missing or outdated. This is true not only for programs in general-purpose languages, but also for artifacts in other languages often found in software projects such as scripts or configuration files. To address this problem, we present an approach that uses Large Language Models (LLMs) to generate header comments (aka, ‘block comments’ or ‘doc-strings’) for elements of different languages in different documentation formats. Given a file in some language and a description of elements in the file to be documented and the documentation format to be used, the approach generates header comments for all undocumented elements in the file that is guaranteed to conform to the documentation format. We describe a prototype implementation and its integration into an industrial development pipeline. Feedback from our industrial partner, an LLM-as-judge evaluation, and the participants of a user study involving a broad range of languages indicates that the approach is viable, able to produce sufficiently high-quality documentation in general, and holds potential for improving industrial documentation practices across different programming languages and teams.

Queen's University (CA), Telus (Canada) (CA)
Openalex Percentile: Top 85%
Topic Modeling
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Language-Agnostic Generation of Header Comments using Large Language Models — Ali Tizghadam, Ibrahim M. Amer, et al. · (2025) | TGRS Research Map | TGRS