Towards Leveraging Large Language Model Summaries for Topic Modeling in Source Code

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Carissimi, Michele, Saletta, Martina, Ferretti, Claudio
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912344138842112
author Carissimi, Michele
Saletta, Martina
Ferretti, Claudio
author_facet Carissimi, Michele
Saletta, Martina
Ferretti, Claudio
contents Understanding source code is a topic of great interest in the software engineering community, since it can help programmers in various tasks such as software maintenance and reuse. Recent advances in large language models (LLMs) have demonstrated remarkable program comprehension capabilities, while transformer-based topic modeling techniques offer effective ways to extract semantic information from text. This paper proposes and explores a novel approach that combines these strengths to automatically identify meaningful topics in a corpus of Python programs. Our method consists in applying topic modeling on the descriptions obtained by asking an LLM to summarize the code. To assess the internal consistency of the extracted topics, we compare them against topics inferred from function names alone, and those derived from existing docstrings. Experimental results suggest that leveraging LLM-generated summaries provides interpretable and semantically rich representation of code structure. The promising results suggest that our approach can be fruitfully applied in various software engineering tasks such as automatic documentation and tagging, code search, software reorganization and knowledge discovery in large repositories.
format Preprint
id arxiv_https___arxiv_org_abs_2504_17426
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Towards Leveraging Large Language Model Summaries for Topic Modeling in Source Code
Carissimi, Michele
Saletta, Martina
Ferretti, Claudio
Software Engineering
Artificial Intelligence
Understanding source code is a topic of great interest in the software engineering community, since it can help programmers in various tasks such as software maintenance and reuse. Recent advances in large language models (LLMs) have demonstrated remarkable program comprehension capabilities, while transformer-based topic modeling techniques offer effective ways to extract semantic information from text. This paper proposes and explores a novel approach that combines these strengths to automatically identify meaningful topics in a corpus of Python programs. Our method consists in applying topic modeling on the descriptions obtained by asking an LLM to summarize the code. To assess the internal consistency of the extracted topics, we compare them against topics inferred from function names alone, and those derived from existing docstrings. Experimental results suggest that leveraging LLM-generated summaries provides interpretable and semantically rich representation of code structure. The promising results suggest that our approach can be fruitfully applied in various software engineering tasks such as automatic documentation and tagging, code search, software reorganization and knowledge discovery in large repositories.
title Towards Leveraging Large Language Model Summaries for Topic Modeling in Source Code
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2504.17426