paper-with-me

홈 › Papers

Bridging Code Graphs and Large Language Models for Better Code Understanding

2025-12-08 · Zeqi Chen, Zhaoyang Chu, Yi Gui, Feng Guo, Yao Wan, Chuan Shi arxiv

Large Language Models (LLMs) have demonstrated remarkable performance in code intelligence tasks such as code generation, summarization, and translation. However, their reliance on linearized token sequences limits their ability to understand the structural semantics of programs. While prior studies have explored graphaugmented prompting and structure-aware pretraining, they either suffer from prompt length constraints or require task-specific architectural changes that are incompatible with large-scale instructionfollowing LLMs. To address these limitations, this paper proposes CGBridge, a novel plug-and-play method that enhances LLMs with Code Graph information through an external, trainable Bridge module. CGBridge first pre-trains a code graph encoder via selfsupervised learning on a large-scale dataset of 270K code graphs to learn structural code semantics. It then trains an external module to bridge the modality gap among code, graph, and text by aligning their semantics through cross-modal attention mechanisms. Finally, the bridge module generates structure-informed prompts, which are injected into a frozen LLM, and is fine-tuned for downstream code intelligence tasks. Experiments show that CGBridge achieves notable improvements over both the original model and the graphaugmented prompting method. Specifically, it yields a 16.19% and 9.12% relative gain in LLM-as-a-Judge on code summarization, and a 9.84% and 38.87% relative gain in Execution Accuracy on code translation. Moreover, CGBridge achieves over 4x faster inference than LoRA-tuned models, demonstrating both effectiveness and efficiency in structure-aware code understanding.

📄 PDF Abstract BibTeX arXiv:2512.07666

Code (0)

등록된 구현이 없습니다.

Tasks

Code TranslationCode Generation

Similar Papers 제목 키워드 기반

Bridging the KB-Text Gap: Leveraging Structured Knowledge-aware Pre-training for KBQA

2023-08-28 · Guanting Dong, Rumei Li, Sirui Wang, Yupeng Zhang 외

Knowledge Base Question Answering (KBQA) aims to answer natural language questions with factual information such as entities and relations in KBs. However, traditional Pre-trained Language Models (PLMs) are directly pre-…

Knowledge Base Question AnsweringQuestion AnsweringRetrieval

Graph Tokenization for Bridging Graphs and Transformers

2026-03-11 · Zeyuan Guo, Enmao Diao, Cheng Yang, Chuan Shi arxiv

The success of large pretrained Transformers is closely tied to tokenizers, which convert raw input into discrete symbols. Extending these models to graph-structured data remains a significant challenge. In this work, we…

Explanation Graph Generation via Generative Pre-training over Synthetic Graphs

2023-06-01 · Han Cui, Shangzhan Li, Yu Zhang, Qi Shi

The generation of explanation graphs is a significant task that aims to produce explanation graphs in response to user input, revealing the internal reasoning process. This task is challenging due to the significant disc…

Graph GenerationLanguage Modelling

The Pragmatic Persona: Discovering LLM Persona through Bridging Inference

2026-04-27 · Jisoo Yang, Jongwon Ryu, Minuk Ma, Trung X. Pham 외 arxiv

Large Language Models (LLMs) reveal inherent and distinctive personas through dialogue. However, most existing persona discovery approaches rely on surface-level lexical or stylistic cues, treating dialogue as a flat seq…

Knowledge Graphs

Bridging Molecular Graphs and Large Language Models

2025-03-05 · Runze Wang, Mingqi Yang, Yanming Shen

While Large Language Models (LLMs) have shown exceptional generalization capabilities, their ability to process graph data, such as molecular structures, remains limited. To bridge this gap, this paper proposes Graph2Tok…

Few-Shot Learning