CGBridge: Bridging Code Graphs and Large Language Models for Better Structure-Aware Code Understanding
Zeqi Chen, Zhaoyang Chu, Yi Gui, Feng Guo, Yao Wan, Chuan Shi
Abstract
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 makes them brittle to long-range program dependencies and superficial lexical shifts such as identifier renaming. Existing structure-aware approaches typically treat structure as serialized text prompts or auxiliary training objectives, which often inflate context length or rely on internalized structural priors, failing to provide explicit guidance during inference. To address these limitations, we propose CGBridge, a novel plug-and-play method that enhances LLMs with Code Graph information through an external, trainable Bridge module. It aligns Code Property Graph structure with code semantics and compresses them into compact soft-prefixes, decoupling structural reasoning from textual generation without updating the backbone. Experiments across multiple code LLM backbones and scales show consistent gains over both text-only adaptation and graph-augmented baselines. Furthermore, CGBridge remains robust under identifier renaming and enables over 4× faster inference than LoRA-tuned models, demonstrating both effectiveness and efficiency in structure-aware code understanding.- Anthology ID:
- 2026.findings-acl.434
- Volume:
- Findings of the Association for Computational Linguistics: ACL 2026
- Month:
- July
- Year:
- 2026
- Address:
- San Diego, California, United States
- Editors:
- Maria Liakata, Viviane P. Moreira, Jiajun Zhang, David Jurgens
- Venue:
- Findings
- SIG:
- Publisher:
- Association for Computational Linguistics
- Note:
- Pages:
- 8945–8966
- Language:
- URL:
- https://preview.aclanthology.org/ingest-acl/2026.findings-acl.434/
- DOI:
- Cite (ACL):
- Zeqi Chen, Zhaoyang Chu, Yi Gui, Feng Guo, Yao Wan, and Chuan Shi. 2026. CGBridge: Bridging Code Graphs and Large Language Models for Better Structure-Aware Code Understanding. In Findings of the Association for Computational Linguistics: ACL 2026, pages 8945–8966, San Diego, California, United States. Association for Computational Linguistics.
- Cite (Informal):
- CGBridge: Bridging Code Graphs and Large Language Models for Better Structure-Aware Code Understanding (Chen et al., Findings 2026)
- PDF:
- https://preview.aclanthology.org/ingest-acl/2026.findings-acl.434.pdf