Code Comprehensor: Hierarchical Documentation and Cross-Modal Retrieval for Large Repositories
Sujoy Roychowdhury, Joseph H. R. Isaac, Jiangning Gao, Martin Klitte, Diarmuid Corcoran
Key points
From the paper's conclusion- We propose Code Comprehensor, a hybrid retrieval-reasoning framework combining (i) a code dependency callgraph, (ii) CodeScribe, which uses code-aware LLMs to generate hierarchical documentation across repository call graphs, and (iii) CodeContrast, a CLIP-style dual-encoder model trained on CodeScribe output to learn aligned text-code embeddings.
Abstract
Understanding large, complex, and rapidly evolving code bases remains a core challenge for software engineering at scale, hindering onboarding, maintenance, refactoring, and impact analysis. Providing this information to a Large-Language Model (LLM) is another hurdle, as the LLM must understand not only the required code method but also its associated methods in the grand scheme of the repository. We propose Code Comprehensor, a hybrid retrieval-reasoning framework combining (i) a code dependency callgraph, (ii) CodeScribe, which uses code-aware LLMs to generate hierarchical documentation across repository call graphs, and (iii) CodeContrast, a CLIP-style dual-encoder model trained on CodeScribe output to learn aligned text-code embeddings. CodeContrast enables fast, semantically precise retrieval of relevant code-context neighborhoods, which serve as grounded evidence for an MCP-based LLM orchestrator answering domain-specific queries. Evaluation on OpenCV and a proprietary 5M-LOC repository shows that CodeScribe-derived supervision significantly improves cross-modal retrieval in text-to-code accuracy over baseline approaches. Richer textual supervision (hierarchical documentation, parent/sibling context, and LLM-generated synthetic questions) consistently enhances performance across both repositories. LLM-as-a-judge evaluation using the popular RAGAS of the Code Comprehensor output yields above 90% faithfulness scores.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- What to Retrieve? Investigating Effective Call Information in Repository-level Code GenerationACM Transactions on Software Engineering and Methodology · 2026
- LLM See, LLM Do: Enhancing Repository-Aware Code Generation in LLMs Through Logical Context and Usage KnowledgeACM Transactions on Software Engineering and Methodology · 2026
- Seeing Is Coding: On the Effectiveness of Vision Language Models in Code UnderstandingProceedings of the ACM on Software Engineering · 2026
- Better Call Grep: Evaluating and Improving Grep-Like Lexical Retrieval for Repository-Level Code CompletionProceedings of the ACM on Software Engineering · 2026
- Context Matters: Improving LLM-Based Code Summarization with Hierarchical InformationarXiv · 2026
- Contextualized Code Pretraining for Code GenerationACM Transactions on Software Engineering and Methodology · 2026