Edit Readme for clarity and style
Browse files
README.md
CHANGED
|
@@ -9,14 +9,14 @@ tags:
|
|
| 9 |
---
|
| 10 |
|
| 11 |
# Model Description
|
| 12 |
-
ASMTransformers is a
|
| 13 |
-
to aid in the process of reverse engineering.
|
| 14 |
|
| 15 |
# Status
|
| 16 |
Not actively maintained after publishing
|
| 17 |
|
| 18 |
# Relevant links
|
| 19 |
-
* [
|
| 20 |
|
| 21 |
# Version
|
| 22 |
2026-08-06
|
|
@@ -30,20 +30,15 @@ nor has it been tested on other downstream tasks.
|
|
| 30 |
|
| 31 |
# Architecture description
|
| 32 |
|
| 33 |
-
|
| 34 |
-
We also experimented with different training parameters during the Masked Language Modelling (MLM). For example, we set the
|
| 35 |
-
--mlm-prob parameter to 0.4 in accordance to [Wettig et al., 2023](https://aclanthology.org/2023.eacl-main.217.pdf). We have done some experiments with different mlm-probs
|
| 36 |
-
(namely 0.15, 0.3 and 0.4) and found that 0.4 yielded the best results.
|
| 37 |
|
| 38 |
-
|
| 39 |
-
MLM procedure, the model also has to predict jump targets: whenever there is a jump in the code, the model shouldn't only predict it to be a
|
| 40 |
-
jump instruction, but it should also predict to which line of code it's supposed to jump. The idea is that this leads to better understanding of the long-term relations
|
| 41 |
-
in the code, and as Wang et al yielded good results, we have adopted it.
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
ensure that the training task is not too easy.
|
| 46 |
|
|
|
|
|
|
|
| 47 |
|
| 48 |
**Estimated training time:**
|
| 49 |
|
|
@@ -70,8 +65,6 @@ finetuning: 4 hours on 1 NVIDIA H200
|
|
| 70 |
]
|
| 71 |
```
|
| 72 |
|
| 73 |
-
**Pretraining parameters used:**
|
| 74 |
-
|
| 75 |
```
|
| 76 |
{
|
| 77 |
"architectures": [
|
|
@@ -99,7 +92,7 @@ finetuning: 4 hours on 1 NVIDIA H200
|
|
| 99 |
}
|
| 100 |
```
|
| 101 |
|
| 102 |
-
**
|
| 103 |
|
| 104 |
```
|
| 105 |
{
|
|
@@ -113,21 +106,18 @@ finetuning: 4 hours on 1 NVIDIA H200
|
|
| 113 |
}
|
| 114 |
```
|
| 115 |
|
| 116 |
-
|
| 117 |
# Output
|
| 118 |
-
The model outputs embeddings of size 768
|
| 119 |
|
| 120 |
# Data
|
| 121 |
-
The dataset is
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
The dataset is split into a train, test and an evaluation set. This in done on source package, so all binaries and functions belonging to one source package are part of
|
| 130 |
-
either the train or the test set, not both.
|
| 131 |
|
| 132 |
**Total amount of functions per architecture**
|
| 133 |
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
# Model Description
|
| 12 |
+
The ASMTransformers model is a machine learning model that calculates embeddings of assembly functions to enable comparison and similarity
|
| 13 |
+
operations. Instruction set architectures (ISAs) ARM, AMD64, RISC-V and i386 assembly are supported. The aim is to aid in the process of reverse engineering.
|
| 14 |
|
| 15 |
# Status
|
| 16 |
Not actively maintained after publishing
|
| 17 |
|
| 18 |
# Relevant links
|
| 19 |
+
* [ASMtransformers on GitHub](https://github.com/NetherlandsForensicInstitute/asmtransformers)
|
| 20 |
|
| 21 |
# Version
|
| 22 |
2026-08-06
|
|
|
|
| 30 |
|
| 31 |
# Architecture description
|
| 32 |
|
| 33 |
+
The model is a Bert-base architecture with 12 layers, 12 attention heads and a hidden size of 768. It uses a vocabulary of size 6161 derived from a custom assembler architecture-aware tokenizer.
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
+
The model is trained in two phases - a masked language modeling (MLM) pretraining phase and a fine-tuning phase for function similarity.
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
+
The MLM pre-training phase uses a loss function that includes jump target prediction (see [Wang et al.](https://arxiv.org/pdf/2205.12713)).
|
| 38 |
+
This pretraining was perfomed using a masking probability of 0.4 that was determined through ablation experiments. This is in line with the findings of [Wettig et al., 2023](https://aclanthology.org/2023.eacl-main.217.pdf).
|
|
|
|
| 39 |
|
| 40 |
+
We perform the finetuning phase using [Batched Semi Hard Triplet Loss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#batchsemihardtripletloss) on batches of size 1024.
|
| 41 |
+
The training set for this phase includes triplets that are formed using versions of the same function compiled for different instruction set architectures.
|
| 42 |
|
| 43 |
**Estimated training time:**
|
| 44 |
|
|
|
|
| 65 |
]
|
| 66 |
```
|
| 67 |
|
|
|
|
|
|
|
| 68 |
```
|
| 69 |
{
|
| 70 |
"architectures": [
|
|
|
|
| 92 |
}
|
| 93 |
```
|
| 94 |
|
| 95 |
+
**Pre-training parameters used:**
|
| 96 |
|
| 97 |
```
|
| 98 |
{
|
|
|
|
| 106 |
}
|
| 107 |
```
|
| 108 |
|
|
|
|
| 109 |
# Output
|
| 110 |
+
The model outputs embeddings of size 768.
|
| 111 |
|
| 112 |
# Data
|
| 113 |
+
The dataset is derived from the official [Debian Repository](https://wiki.debian.org/DebianRepository). We used the distribution's build and packaging system `apt` to
|
| 114 |
+
cross-compile source packages for multiple ISAs and optimisation levels. We used the standard optimisation levels supported by the distribution's compiler, O0, O1, O2, O3 and Os.
|
| 115 |
+
We also added an optimization level that includes vectorization and cryptographic instructions that we refer to as Optimized-custom, or Oc.
|
| 116 |
+
This results in a maximum of 24 (6 optimisation levels and 4 ISAs) potentially different functions which are semantically identical, i.e. they represent the same functionality.
|
| 117 |
+
However, because not all source packages can be built for all ISAs and because some optimisation levels result in identical functions, the actual number is often lower than that.
|
| 118 |
+
|
| 119 |
+
The dataset is split into a train, test and an evaluation set. This in done on source package basis, so all binaries and functions belonging to one source package are part of
|
| 120 |
+
either the training set or the test set, not both.
|
|
|
|
|
|
|
| 121 |
|
| 122 |
**Total amount of functions per architecture**
|
| 123 |
|