Generating key points…
Answers are grounded in this paper and cite their sources.
As software systems grow, automatic code summarization is vital for program comprehension and maintenance. While Large Language Models (LLMs) excel at this task, they often generate verbose, incomplete, or hallucinated summaries when relying solely on source code. Retrieval-augmented generation (RAG) addresses this by incorporating external code-summary examples. However, existing single-strategy retrievers struggle to capture both deep semantic similarity and precise keyword matching. To overcome these limitations, we propose HyRALLM, a hybrid retrieval-augmented LLM framework. First, a dense retriever is constructed via cross-modal contrastive learning for semantic alignment, which is then integrated with a keyword-based sparse retriever. During the generation stage, the retrieved context is utilized to guide the LLM in generating summaries, and the quality of the generated summaries is further enhanced through a multi-candidate strategy and a post-processing discrimination mechanism. Experiments on the JCSD and PCSD benchmark datasets demonstrate that HyRALLM achieves highly competitive performance across BLEU, ROUGE-L, METEOR, and CIDEr metrics. Additional analyses confirm our framework effectively improves summary quality, reduces semantic deviation, and enhances generation robustness.
No takes yet. Share an insight, caveat, or question.
Wang et al. (2026) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: