VulRepair
A T5-based model that takes a vulnerable C function and generates a repaired version of it.
Language · 1,522 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
- 222.9M
- Operations
- 1,522
- Framework
- PyTorch
- Recurrent
- No
- Published
- ESEC/FSE 2022
- Cited by
- 214 (as of 26 October 2026)
- Authors
- Michael Fu, Chakkrit Tantithamthavorn, Trung Le and others
- License
- MIT
- 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
- m21420
- Graph hash
- 3dcf389fbc6e30a9f52ec04399c79d298d0706bc5bba5fda68a6bb34d188b093
- Skeleton hash
- 837e5defed51ed8c6f898330f386677eb2d5c060b9cc063fb53583038f1b8aaa
- Architecture hash
- ee09d3eeae3eb5c57fd4605c39ed177bc862888ef0f9087ba1ba2d0a96da61ee
- Diagram SHA-256
- 132377a0bdfc9d5fee3f70956409a81f2667154030f9f73613dd58ec34b11c42
- 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
VulRepair is a model for automated software vulnerability repair: given a vulnerable function, it generates a repair, work that security analysts otherwise do by hand. It is a T5-based model, with an encoder stack and a decoder stack followed by a linear layer with softmax activation.
The paper presents the design as an answer to three limitations of VRepair, an earlier repair approach built on a vanilla Transformer. Where VRepair was trained on a small bug-fix corpus, VulRepair starts from a CodeT5 component pre-trained on a large codebase. Where VRepair used word-level tokenization with a copy mechanism, VulRepair uses Byte Pair Encoding (BPE) subword tokenization to handle out-of-vocabulary tokens. And where VRepair used absolute positional encoding, VulRepair uses relative position embedding inside self-attention.
On the CVEFixes dataset of 8,482 vulnerability fixes, the paper reports a Perfect Prediction of 44% for VulRepair, which it puts 21% above VRepair and 13% above CodeBERT. Its ablation finds the pre-training component to be the most important one. The code repository now carries an alert that a later study identified data duplication between the training and testing sets of this benchmark dataset.
Key idea. The paper shows that a pre-trained CodeT5 model with BPE tokenization and the T5 architecture repairs vulnerable functions more accurately than the earlier VRepair and CodeBERT baselines on CVEFixes.
- vulrepair
- vulnerability repair
- automated vulnerability repair
- software vulnerability repair
- code repair
- program repair
- c function repair
- software security
- neural machine translation
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@inproceedings{Fu_2022, series={ESEC/FSE ’22}, title={VulRepair: a T5-based automated software vulnerability repair}, url={http://dx.doi.org/10.1145/3540250.3549098}, DOI={10.1145/3540250.3549098}, booktitle={Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering}, publisher={ACM}, author={Fu, Michael and Tantithamthavorn, Chakkrit and Le, Trung and Nguyen, Van and Phung, Dinh}, year={2022}, month=Nov, pages={935–947}, collection={ESEC/FSE ’22} }