Lune

ACL2025Top-tier venue

GALLa: Graph Aligned Large Language Models for Improved Source Code Understanding

Ziyin Zhang, Hang Yu, Sage Lee, Peng Di, Jianguo Li, Rui Wang

Abstract

Programming languages possess rich semantic information - such as data flow - that is represented by graphs and not available from the surface form of source code. Recent code language models have scaled to billions of parameters, but model source code solely as text tokens while ignoring any other structural information. Conversely, models that do encode structural information of code make modifications to the Transformer architecture, limiting their scale and compatibility with pretrained LLMs. In this work, we take the best of both worlds with GALLa - Graph Aligned Large Language Models. GALLa utilizes graph neural networks and cross-modal alignment technologies to inject the structural information of code into LLMs as an auxiliary task during finetuning. This framework is both model-agnostic and task-agnostic, as it can be applied to any code LLM for any code downstream task, and requires the structural graph data only at training time from a corpus unrelated to the finetuning data, while incurring no cost at inference time over the baseline LLM. Experiments on five code tasks with seven different baseline LLMs ranging in size from 350M to 14B validate the effectiveness of GALLa, demonstrating consistent improvement over the baseline, even for powerful models such as LLaMA3 and Qwen2.5-Coder.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Tasks cites LoRA: Low-Rank Adaptation of Large Language Models
  • Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Tasks cites Visual Instruction Tuning
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering TasksHongyuan Tao, Ying Zhang, Zhenhao Tang, Hongen Peng et al.NeurIPS 2025 · 41 citations

Builds on17

  1. LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
  2. Visual Instruction TuningHaotian Liu, Chunyuan Li, Qingyang Wu, Yong Jae LeeNeurIPS 2023 · 11,349 citations
  3. MiniGPT-4: Enhancing Vision-Language Understanding with Advanced Large Language ModelsDeyao Zhu, Jun Chen, Xiaoqian Shen, Xiang Li et al.ICLR 2024 · 3,079 citations
  4. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
  5. Multitask Prompted Training Enables Zero-Shot Task GeneralizationVictor Sanh, Albert Webson, Colin Raffel, Stephen H. Bach et al.ICLR 2022 · 1,976 citations

Related papers

  1. MLaGA: Multimodal Large Language and Graph AssistantDongzhe Fan, Jiajin Liu, Yi Fang, Djellel Difallah et al.KDD 2026 · 13 citations
  2. AlchemistCoder: Harmonizing and Eliciting Code Capability by Hindsight Tuning on Multi-source DataZifan Song, Yudong Wang, Wenwei Zhang, Kuikun Liu et al.NeurIPS 2024 · 8 citations
  3. CGBridge: Bridging Code Graphs and Large Language Models for Better Structure-Aware Code UnderstandingZeqi Chen, Zhaoyang Chu, Yi Gui, Feng Guo et al.ACL Findings 2026 · 1 citation
  4. Multi-View Empowered Structural Graph Wordification for Language ModelsZipeng Liu, Likang Wu, Ming He, Zhong Guan et al.AAAI 2025 · 7 citations
  5. Formalizing and Mitigating Structural Distortion in LLM Attention for Graph ReasoningDonald Loveland, Puja Trivedi, Ari Weinstein, Edward W. Huang et al.KDD 2026
Dusk over the sea between two cliffs drawn in fine vertical lines