GALLa: Graph Aligned Large Language Models for Improved Source Code Understanding
On the map: LLM alignment / RLHF / preference optimisation → LLM preference optimization methods
Abstract (arXiv)
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.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Placed in LLM preference optimization methods, one of 10 directions in LLM alignment / RLHF / preference optimisation. Builds on 31 of its 41 references that are in the map. First posted on arXiv 6 Sep 2024.
Builds on
31 of 41 references.
References · 31
- 2017Attention Is All You Needcited by 59,932
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2023Visual Instruction Tuningcited by 7,792
- 2020Scaling Laws for Neural Language Modelscited by 6,411
- 2022Scaling Instruction-Finetuned Language Modelscited by 2,997
- 2023MiniGPT-4: Enhancing Vision-Language Understanding with Advanced Large Language Modelscited by 2,689
- 2023Qwen-VL: A Versatile Vision-Language Model for Understanding, Localization, Text Reading, and Beyondcited by 2,179
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
19 more
- 2019ZeRO: Memory Optimizations Toward Training Trillion Parameter Modelscited by 1,278
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2023StarCoder: may the source be with you!cited by 790
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
- 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 325
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 199
- 2021MagNet: A Neural Network for Directed Graphscited by 104
- 2021SynCoBERT: Syntax-Guided Multi-Modal Contrastive Pre-Training for Code Representationcited by 63
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2022Code Translation with Compiler Representationscited by 42
- 2021TreeBERT: A Tree-Based Pre-Trained Model for Programming Languagecited by 40
- 2022SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code Representationscited by 35
- 2022StructCoder: Structure-Aware Transformer for Code Generationcited by 33
- 2023CodeFuse-13B: A Pretrained Multi-lingual Code Large Language Modelcited by 14
- 2024DUPLEX: Dual GAT for Complex Embedding of Directed Graphscited by 7
Built on by
Citing papers per year: 2025: 6; 2026: 1.
7 papers.
- 2025Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Taskscited by 27
- 2025Knowledge Augmented Complex Problem Solving with Large Language Models: A Surveycited by 6
- 2025Large Language Models Meet Text-Attributed Graphs: A Survey of Integration Frameworks and Applicationscited by 5
- 2025When Structure Doesn't Help: LLMs Do Not Read Text-Attributed Graphs as Effectively as We Expectedcited by 3
- 2025CGP-Tuning: Structure-Aware Soft Prompt Tuning for Code Vulnerability Detectioncited by 2
- 2025Vector Graph-Based Repository Understanding for Issue-Driven File Retrievalcited by 1
- 2026The Patchwork Problem in LLM-Generated Codecited by 0
- 2026The Patchwork Problem in LLM-Generated Code9 Jul 2026
- 2025When Structure Doesn't Help: LLMs Do Not Read Text-Attributed Graphs as Effectively as We Expected20 Nov 2025
- 2025Large Language Models Meet Text-Attributed Graphs: A Survey of Integration Frameworks and Applications24 Oct 2025
- 2025Vector Graph-Based Repository Understanding for Issue-Driven File Retrieval10 Oct 2025
- 2025Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Tasks22 May 2025
- 2025Knowledge Augmented Complex Problem Solving with Large Language Models: A Survey6 May 2025
- 2025CGP-Tuning: Structure-Aware Soft Prompt Tuning for Code Vulnerability Detection8 Jan 2025
Similar, not cited
Close in wording, no citation either way
- 2026Deep Graph-Language Fusion for Structure-Aware Code Generation ↗
- 2024Enhance Graph Alignment for Large Language Models
- 2026Teaching LLMs to See Graphs: Unifying Text and Structural Reasoning
- 2026A Unified Graph Language Model for Multi-Domain Multi-Task Graph Alignment Instruction Tuning
- 2025Scalability Matters: Overcoming Challenges in InstructGLM with Similarity-Degree-Based Sampling
- 2023Large Language Models on Graphs: A Comprehensive Survey
- 2024CodeGRAG: Bridging the Gap between Natural Language and Programming Language via Graphical Retrieval Augmented Generation
- 2025A Code Comprehension Benchmark for Large Language Models for Code