Publish DR evaluation dataset and documentation

#1
by LLMs4CodeSecurity - opened
Files changed (2) hide show
  1. README.md +177 -0
  2. noise_pools_all.zip +3 -0
README.md CHANGED
@@ -1,3 +1,180 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ task_categories:
4
+ - text-classification
5
+ tags:
6
+ - code
7
+ - cybersecurity
8
+ - vulnerability-detection
9
+ - robustness
10
+ - c
11
+ - java
12
+ pretty_name: DR Evaluation Noise Pools
13
+ size_categories:
14
+ - 10K<n<100K
15
  ---
16
+
17
+ # DR Evaluation Noise Pools
18
+
19
+ This dataset contains the retained behavior-preserving code variants and
20
+ realized-distance metadata used to evaluate the robustness of LLM-based
21
+ vulnerability analyzers. The corresponding evaluation and Acc-based DR/SIR
22
+ implementation is available in the
23
+ [TOSEM artifact repository](https://github.com/Jackline97/TOSEM-artifact).
24
+
25
+ ## Files
26
+
27
+ | File | Description |
28
+ |---|---|
29
+ | `noise_pools_all.zip` | Combined Juliet, PrimeVul, and MegaVul perturbation pools |
30
+
31
+ Archive properties:
32
+
33
+ - compressed size: 494,118,658 bytes (471.23 MiB);
34
+ - uncompressed size: 7,188,405,146 bytes (approximately 6.69 GiB);
35
+ - JSON pool files: 22,293;
36
+ - SHA-256: `2EFC57199F3E497D48772FB322D97EA7F1393BC8C1D24EB00D2E1D224F6ED824`.
37
+
38
+ ## Evaluation Scope
39
+
40
+ The reported evaluation uses five dataset-language subsets:
41
+
42
+ | Dataset | Language | Paired base files |
43
+ |---|---:|---:|
44
+ | Juliet | Java | 244 |
45
+ | Juliet | C | 363 |
46
+ | PrimeVul | C | 196 |
47
+ | MegaVul | Java | 335 |
48
+ | MegaVul | C | 335 |
49
+
50
+ Only these dataset-language combinations are part of the reported benchmark.
51
+ The archive is preserved byte-for-byte for reproducibility; consumers should
52
+ use the combinations above when reproducing the evaluation.
53
+
54
+ ## Perturbation Families
55
+
56
+ | Directory | Family | Target levels |
57
+ |---|---|---|
58
+ | `comment_noise` | Contradiction Comments (CC) | 0.2, 0.4, 0.6, 0.8 |
59
+ | `prompt_inject_noise` | Prompt-Injection Comments (PI) | 0.2, 0.4, 0.6, 0.8 |
60
+ | `variable_noise` | Variable Replacement (VR) | 0.2, 0.4, 0.6, 0.8 |
61
+ | `structure_noise_checked` | Structure Perturbation (SP) | 0.03, 0.10, 0.17, 0.24 |
62
+
63
+ After extraction, the top-level layout is:
64
+
65
+ ```text
66
+ noise_pools_juliet/
67
+ noise_pools_megavul/
68
+ noise_pools_primevul/
69
+ ```
70
+
71
+ Within each root, records are organized as:
72
+
73
+ ```text
74
+ <edit_family>/<language>/noise_<target_level>/<base_record>.json
75
+ ```
76
+
77
+ ## JSON Record Structure
78
+
79
+ Each JSON pool record contains:
80
+
81
+ - `cleaned_code`: normalized base source code;
82
+ - `formatted_code`: formatted source representation;
83
+ - `cwe_id`: associated CWE identifier;
84
+ - one function-specific key containing retained `Combo_*` variants.
85
+
86
+ Each retained variant contains the edited code in `code_comment_variant`, safe
87
+ and vulnerable harnesses in `harness_command_good` and
88
+ `harness_command_bad`, and a `meta_info` object. In `meta_info`, `score` is the
89
+ realized normalized perturbation distance consumed by the DR estimator.
90
+ Comment-based families also retain `code_comment_org` where applicable.
91
+
92
+ ## Download and Extract
93
+
94
+ Download with `huggingface_hub`:
95
+
96
+ ```python
97
+ from huggingface_hub import hf_hub_download
98
+
99
+ archive = hf_hub_download(
100
+ repo_id="LLMs4CodeSecurity/DR_Evaluation",
101
+ filename="noise_pools_all.zip",
102
+ repo_type="dataset",
103
+ )
104
+ print(archive)
105
+ ```
106
+
107
+ Extract with Python:
108
+
109
+ ```python
110
+ from pathlib import Path
111
+ from zipfile import ZipFile
112
+
113
+ archive = Path("noise_pools_all.zip")
114
+ with ZipFile(archive) as bundle:
115
+ bundle.extractall(archive.parent)
116
+ ```
117
+
118
+ PowerShell:
119
+
120
+ ```powershell
121
+ Expand-Archive -Path .\noise_pools_all.zip -DestinationPath . -Force
122
+ ```
123
+
124
+ Bash:
125
+
126
+ ```bash
127
+ unzip noise_pools_all.zip
128
+ ```
129
+
130
+ ## Evaluation Code
131
+
132
+ Clone the companion code repository:
133
+
134
+ ```bash
135
+ git clone https://github.com/Jackline97/TOSEM-artifact.git
136
+ cd TOSEM-artifact
137
+ python -m pip install -r requirements.txt
138
+ ```
139
+
140
+ For example, after placing and extracting the archive in the repository root:
141
+
142
+ ```bash
143
+ python evaluation_batch.py \
144
+ --dataset juliet \
145
+ --language java \
146
+ --noise-base noise_pools_juliet \
147
+ --noise-type comment_noise \
148
+ --models deepseek-chat \
149
+ --noise-scales 0.2,0.4,0.6,0.8 \
150
+ --max-combo 20 \
151
+ --num-runs 1 \
152
+ --out-base eval_res
153
+ ```
154
+
155
+ See the [artifact README](https://github.com/Jackline97/TOSEM-artifact#readme)
156
+ for model configuration, Ollama usage, output semantics, and DR/SIR commands.
157
+
158
+ ## Intended Use and Limitations
159
+
160
+ The package is intended for research on vulnerability analysis, robustness,
161
+ and behavior-preserving code transformations. It contains vulnerable code and
162
+ should not be deployed as production software. The package provides retained
163
+ inputs and transformation metadata; model inference outputs are generated by
164
+ the companion evaluation code.
165
+
166
+ The source samples originate from Juliet, PrimeVul, and MegaVul. Users remain
167
+ responsible for following the applicable terms of the upstream datasets and
168
+ projects represented in those corpora.
169
+
170
+ ## Citation
171
+
172
+ ```bibtex
173
+ @misc{dr_evaluation_artifact_2026,
174
+ author = {{LLMs4CodeSecurity}},
175
+ title = {DR Evaluation Noise Pools},
176
+ year = {2026},
177
+ howpublished = {\url{https://huggingface.co/datasets/LLMs4CodeSecurity/DR_Evaluation}},
178
+ note = {Evaluation code: \url{https://github.com/Jackline97/TOSEM-artifact}}
179
+ }
180
+ ```
noise_pools_all.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2efc57199f3e497d48772fb322d97ea7f1393bc8c1d24eb00d2e1d224f6ed824
3
+ size 494118658