ReGVD
A residual graph neural network that flags vulnerable functions in raw source code.
Language · 48 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
- Language
- Parameters
- 124.8M
- Operations
- 48
- Framework
- PyTorch
- Recurrent
- No
- Published
- ICSE 2022 (Companion)
- Cited by
- 46 (as of 28 October 2026)
- Authors
- Van-Anh Nguyen, Dai Quoc Nguyen, Van Nguyen and others
- 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
- m19760
- Graph hash
- e9809e1809f51462097035d92b5efaf6c09643f1fe67dd997ac6314d036ae3da
- Skeleton hash
- 9938ad20f5875bedc69af037da05740ccd5dcb5a8dd73c18c83c9f8d72a84477
- Architecture hash
- 30c6b8f2c3bc1d49669831d100924c3baecf56759e86be093496c41f63cf80f9
- Diagram SHA-256
- ce6f899938d1bd2189a3325401973866d0156671557d811dbed7a994596a90bd
- 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
ReGVD is a graph neural network that decides whether a function in raw source code contains a security vulnerability. The authors treat this as a text classification problem. They note that no perfect parser exists in practice for each programming language. The code is read as a flat sequence of tokens, and a graph is built from it, with node features taken only from the token embeddings of a pre-trained code model.
The nodes are unique tokens, and an edge means that two tokens occur together within a sliding window of fixed size. The GNN layers are joined by residual connections, and the node features are combined by a mixture of sum and max pooling into one vector for the code. A single fully connected layer turns that vector into the vulnerable or not vulnerable prediction. Multiplication, used in this model to mix the two poolings, generally gave the highest accuracies in the paper's comparison.
On the CodeXGLUE vulnerability detection benchmark, the paper reports an accuracy of 63.69%, with gains of 1.61% and 1.39% over CodeBERT and GraphCodeBERT.
Key idea. ReGVD detects vulnerabilities by building a graph directly from code tokens and pooling GNN features with a mixture of sum and max.
- ReGVD
- vulnerability detection
- source code vulnerability
- graph neural network
- code classification
- residual GNN
- software security
- CodeXGLUE
- token graph
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{nguyen2022regvdrevisitinggraphneural,
title={ReGVD: Revisiting Graph Neural Networks for Vulnerability Detection},
author={Van-Anh Nguyen and Dai Quoc Nguyen and Van Nguyen and Trung Le and Quan Hung Tran and Dinh Phung},
year={2022},
eprint={2110.07317},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2110.07317},
}