Can LLMs Replace Humans During Code Chunking?

Christopher Glasz, Emily Escamilla, Eric O. Scott, Anand Patel, Jacob Zimmer +12 more
6/24/2025
cs.SEcs.AI

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Large language models (LLMs) have become essential tools in computer science, especially for tasks involving code understanding and generation. However, existing work does not address many of the unique challenges presented by code written for government applications. In particular, government enterprise software is often written in legacy languages like MUMPS or assembly language code (ALC) and the overall token lengths of these systems exceed the context window size for current commercially available LLMs. Additionally, LLMs are primarily trained on modern software languages and have undergone limited testing with legacy languages, making their ability to understand legacy languages unknown and, hence, an area for empirical study. This paper examines the application of LLMs in the modernization of legacy government code written in ALC and MUMPS, addressing the challenges of input limitations. We investigate various code-chunking methods to optimize the generation of summary module comments for legacy code files, evaluating the impact of code-chunking methods on the quality of documentation produced by different LLMs, including GPT-4o, Claude 3 Sonnet, Mixtral, and Llama 3. Our results indicate that LLMs can select partition points closely aligned with human expert partitioning. We also find that chunking approaches have significant impact on downstream tasks such as documentation generation. LLM-created partitions produce comments that are up to 20% more factual and up to 10% more useful than when humans create partitions. Therefore, we conclude that LLMs can be used as suitable replacements for human partitioning of large codebases during LLM-aided modernization.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{glasz2025llms,
  title  = {Can LLMs Replace Humans During Code Chunking?},
  author = {Christopher Glasz and Emily Escamilla and Eric O. Scott and Anand Patel and Jacob Zimmer and Colin Diggs and Michael Doyle and Scott Rosen and Nitin Naik and Justin F. Brunelle and Samruddhi Thaker and Parthav Poudel and Arun Sridharan and Amit Madan and Doug Wendt and William Macke and Thomas Schill},
  year   = {2025},
  eprint = {2506.19897},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.19897v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.19897.svg)](https://codeofpaper.com/paper/2506.19897)

Discussion