Code-Craft: Hierarchical Graph-Based Code Summarization for Enhanced Context Retrieval
Understanding and navigating large-scale codebases remains a significant challenge in software engineering. Existing methods often treat code as flat text or focus primarily on local structural relationships, limiting their ability to provide holistic, context-aware information retrieval. We present Hierarchical Code Graph Summarization (HCGS), a novel approach that constructs a multi-layered representation of a codebase by generating structured summaries in a bottom-up fashion from a code graph. HCGS leverages the Language Server Protocol for language-agnostic code analysis and employs a parallel level-based algorithm for efficient summary generation. Through extensive evaluation on five diverse codebases totaling 7,531 functions, HCGS demonstrates significant improvements in code retrieval accuracy, achieving up to 82 percentage relative improvement in top-1 retrieval precision for large codebases like libsignal (27.15 percentage points), and perfect Pass@3 scores for smaller repositories. The system's hierarchical approach consistently outperforms traditional code-only retrieval across all metrics, with particularly substantial gains in larger, more complex codebases where understanding function relationships is crucial.
Code (0)
등록된 구현이 없습니다.
Tasks
Code SummarizationInformation RetrievalRetrievalMethods 이 논문이 사용한 방법론
Similar Papers 제목 키워드 기반
Modeling Hierarchical Syntax Structure with Triplet Position for Source Code Summarization
Automatic code summarization, which aims to describe the source code in natural language, has become an essential task in software maintenance. Our fellow researchers have attempted to achieve such a purpose through vari…
Code SummarizationGraph Neural NetworkPositionSource Code Summarization+1Modeling Hierarchical Syntax Structure with Triplet Position for Source Code Summarization
Automatic code summarization, which aims to describe the source code in natural language, has become an essential task in software maintenance. Our fellow researchers have attempted to achieve such a purpose through vari…
Code SummarizationGraph Neural NetworkPositionSource Code Summarization+1Hierarchical Learning for Generation with Long Source Sequences
One of the challenges for current sequence to sequence (seq2seq) models is processing long sequences, such as those in summarization and document level machine translation tasks. These tasks require the model to reason a…
DecoderDocument Level Machine TranslationDocument SummarizationDocument Translation+6Hierarchical Attention Graph for Scientific Document Summarization in Global and Local Level
Scientific document summarization has been a challenging task due to the long structure of the input text. The long input hinders the simultaneous effective modeling of both global high-order relations between sentences …
Document SummarizationExtractive SummarizationScientific Document SummarizationSentenceCommenting Higher-level Code Unit: Full Code, Reduced Code, or Hierarchical Code Summarization
Commenting code is a crucial activity in software development, as it aids in facilitating future maintenance and updates. To enhance the efficiency of writing comments and reduce developers' workload, researchers has pro…
Code Summarization