jTrans
A BERT-based Transformer that embeds binary-code functions, tying jump operands to their targets' positions.
Language · 320 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
- 87.9M
- Operations
- 320
- Framework
- PyTorch
- Recurrent
- No
- Published
- ISSTA 2022
- Cited by
- 9 (as of 28 October 2026)
- Authors
- Hao Wang, Wenjie Qu, Gilad Katz and others
- Source
- GitHub: vul337/jTrans
- 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
- m21646
- Graph hash
- 0490bd6f486bc58f4854975378ad8eb29171963305335465dda27043512eb262
- Skeleton hash
- de2ec8ec044a0531cc2058b5b2e49702a2270768aaeeffd21d20a84cb9e55adf
- Architecture hash
- f1e567a1f225d30775070be274ce378b69e378660ff254ebfd50a78f3eb1a274
- Diagram SHA-256
- c0b430355865ef9421a378e9752213119804276a087a0b71a58eb2b94b48bdb4
- 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
jTrans is a Transformer-based model that learns representations of binary code for binary code similarity detection (BCSD). The paper lists vulnerability detection, software component analysis and reverse engineering as applications of that task. Its approach is to put control-flow information into the language model itself, combining features from each basic block without a graph neural network traversing the control-flow graph.
The model is based on the BERT architecture. Assembly instructions are tokenized by mnemonic and operand, with string literals and constant values replaced by special tokens. To capture control flow, the embedding of a jump instruction's operand token shares parameters with the position embedding of the jump's target. Only direct jump instructions are handled this way. Pre-training keeps BERT's masked language model task and replaces its second task with Jump Target Prediction, in which the model predicts where a jump goes.
After fine-tuning, function similarity is measured by the cosine similarity of the embeddings. On BinaryCorp, the dataset of binaries released with the paper, the authors report that jTrans gives the correct matching function the highest similarity score with a probability of 62.5% on average, while the best earlier approach reaches 32.0%.
Key idea. jTrans embeds control-flow information into a Transformer language model by sharing jump-operand token embeddings with jump-target position embeddings and pre-training with a jump target prediction task.
- jTrans
- Jump-Aware Transformer
- binary code similarity detection
- BCSD
- binary function embedding
- assembly language model
- BinaryCorp
- jump target prediction
- vulnerability search
- reverse engineering
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{wang2022jtransjumpawaretransformerbinary,
title={jTrans: Jump-Aware Transformer for Binary Code Similarity},
author={Hao Wang and Wenjie Qu and Gilad Katz and Wenyu Zhu and Zeyu Gao and Han Qiu and Jianwei Zhuge and Chao Zhang},
year={2022},
eprint={2205.12713},
archivePrefix={arXiv},
primaryClass={cs.CR},
url={https://arxiv.org/abs/2205.12713},
}