Aug 2026· Proceedings of the 2026 ACM Symposium on Document Engineering· 0 citations· 40 references
TL;DR
Two language-model-based strategies are proposed for semantic code document segmentation, including a line-by-line approach that classifies each line of code separately before grouping the results into functional units, and a range-based approach that aims to directly determine groups of code lines from the input.
Abstract
A key task for better understanding and maintaining source code as a code document is semantic code document segmentation, i. e., dividing the code into coherent blocks of functional intent. Despite its potential to enhance code comprehension, navigation, and reuse, this task remains underexplored due to the lack of semantically segmented datasets. Prior work generally relied on syntactic signals (e. g., AST-based features) or manual heuristics, limiting scalability and generalization. We propose two language-model-based strategies: (i) a line-by-line approach that classifies each line of code separately before grouping the results into functional units, and (ii) a range-based approach that aims to directly determine groups of code lines from the input. The latter is particularly suitable for generative language models as they can take an entire code file as the input context. Furthermore, we release two expert-annotated datasets from real-world scientific code in both a low-resource language, R, and the widely used Python language. Experiments show that line-by-line strategy with a local context of K surrounding lines generally outperforms the range-based approach for both programming languages. Fine-tuning smaller models like CodeBERT and CodeT5+ for line-by-line classification generally outperforms larger, generative language models, even without R-specific pretraining. On a single GPU, the runtime of CodeBERT is 100-170x faster than those of the best competing LLMs, supporting the practical integration of semantic segmentation into modern development environments. The code, prompts, and datasets are available at: https://github.com/Dahouabdelhalim/CodeSeg
Compilable Academic Document Parsing (CADP) is proposed, a paradigm that reconstructs a full page as contextual \LaTeX{} plus executable Python, so that structure-preserving elements and executable chart representations can be reconstructed, recompiled, and directly verified against the source page.
Large Language Models (LLMs) perform differently on identical programming tasks when prompted in different natural languages, a phenomenon known as language bias. While this behavior has been widely studied for general text generation, its impact on code generation quality and programming conventions remains largely unexplored. We investigate how the language used to describe programming tasks affects the source code generated by GPT-4o mini, DeepSeek, and Claude. Our study comprises 460 coding tasks spanning Python (230) and Java (230). We translate and manually curate the original English prompts into Chinese, Hindi, Spanish, and Italian while preserving their technical meaning. We evaluate the generated code using multiple dimensions, including functional correctness through test pass rates, structural quality using established code metrics, issues detected by static analysis tools, and lexical characteristics such as the language used in identifiers and comments. Our results show that (i) English prompts do not consistently produce the best functional correctness or code quality, (ii) the impact of prompt language depends on both the programming language and the LLM, and (iii) generated code frequently mixes English with the prompt language in comments and string literals. These findings provide the first curated multilingual benchmark for studying language bias in code generation and offer insights for developing more robust multilingual code generation systems.
Saima Afrin, Alessandro Midolo, C. Escobar-Velasquez et al.· 0 citations
This paper proposes an automated approach to extract domain models from source code using lightweight, locally deployable LLMs and achieves high F1-scores on a dataset of ten projects, each comprising a curated domain model and its corresponding implementation, while remaining fully executable on locally deployable LLMs.
Alessandra Mancas, Mounir Ammam, Hyacinth Ali et al.· 0 citations
This work investigates whether LLMs can accurately judge functional equivalence across different programming languages in human-written code, a setting that requires deeper reasoning beyond superficial similarity, and identifies a difficulty-dependent breakdown in equivalence judgment.
Hui Sun, Anderson G. Uchôa, Rohit Gheyi et al.· 0 citations
Complex source code analysis tasks for program understanding, verification, and compliance with regulatory frameworks and standards require appropriate in-memory models of the source code being analyzed. We present a flexible, multi-language pipeline supporting such analyses. By leveraging configurable front-end parsers and corresponding EBNF grammars, the pipeline automatically identifies the source language, provisions the appropriate parsers and AST factories, and dynamically generates in-memory Abstract Syntax Trees (ASTs) tailored for source code analysis rather than traditional compilation. Individual ASTs generated per source file are linked into a unified structure representing the entire application, with semantic linking that resolves references to functions and variables while respecting scoping. We demonstrate the approach on compliance analyses that trace sensitive data across Java and C++ modules and detect violations of NIST 800-53 controls, and show that it is tractable with respect to parsing time and the size of the ASTs generated.
Mete Isiksalan, K. Kontogiannis, Michael Rennie et al.· Annual International Compute...· 0 citations
This work proposes ComUICoder, a component-based UI code generation framework that emphasizes semantic-aware segmentation, code reuse, and fine-grained refinement and significantly improves overall generation quality and code reusability on complex multipage websites.
Jingyu Xiao, Jiantong Qin, ShuoQiu Li et al.· Proceedings of the 32nd ACM...· 1 citation