Vul-LMGNN
Vulnerability detector that combines CodeBERT with a gated graph network over code graphs.
Graphs and geometry · 422 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Graphs and geometry
- Parameters
- 125.2M
- Operations
- 422
- Framework
- PyTorch
- Recurrent
- No
- Published
- Information Fusion (arXiv 2024)
- Cited by
- 48 (as of 28 October 2026)
- Authors
- Ruitong Liu, Yanbin Wang, Haitao Xu and others
- Source
- GitHub: Vul-LMGNN/vul-LMGGNN
- License
- Apache-2.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m21416
- Graph hash
- 500959ceee908f141d101d83447e70e7fd9f7729365c23c7a983cd256497fe2b
- Skeleton hash
- 4bfd6469a061ddbcfbaf9fd359c00c0a05b1935d9ad022d989472605a255819a
- Architecture hash
- d89bf4a38960a8dea8b73ecfcb8dc9a226cf3e68bb78baae6009157f05a5c5f6
- Diagram SHA-256
- 635bb1eaac352442b85ef9a79f472d1439ce318df13e3e5b662123e9de7ccb64
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
Vul-LMGNN looks for security vulnerabilities in source code by combining two kinds of network: a language model that reads code as text and a graph network that follows its structure. The paper argues that the two are complementary: models of code sequences are strong on context and meaning, while graph networks provide structural insight.
The graph side works on a code property graph, which combines a function's syntax tree with its control flow and data flow. In a gated graph neural network, each node has a gated recurrent unit that updates its state from all of its neighbors. A readout of 1D convolution and dense layers then multiplies two processed versions of the node features to make a prediction. The text side is a pretrained CodeBERT used as an auxiliary classifier. A weight, lambda, sets the balance between the two: 1 uses only the graph-based prediction and 0 only the CodeBERT one.
In the paper, the language model also initializes the node embeddings of the graph network, and the two are trained together. The revised paper adds online knowledge distillation, in which two student graph networks are trained alternately and learn structural information from each other. The README reports 65.70% accuracy for the method on the Devign dataset.
Key idea. The paper built a vulnerability detector that joins a code language model and a gated graph neural network through shared embeddings and interpolated predictions.
- vul-lmgnn
- vul-lmgnns
- vulnerability detection
- code property graph
- code language model
- gated graph neural network
- source code
- software security
- late fusion
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{liu2025vullmgnnsfusinglanguagemodels,
title={Vul-LMGNNs: Fusing language models and online-distilled graph neural networks for code vulnerability detection},
author={Ruitong Liu and Yanbin Wang and Haitao Xu and Jianguo Sun and Fan Zhang and Peiyue Li and Zhenhao Guo},
year={2025},
eprint={2404.14719},
archivePrefix={arXiv},
primaryClass={cs.CR},
doi={https://doi.org/10.1016/j.inffus.2024.102748},
url={https://arxiv.org/abs/2404.14719},
}