File size: 2,470 Bytes
6cb528f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
license: other
task_categories:
- text-classification
tags:
- vulnerability-detection
- software-security
- code-property-graph
- retrieval-augmented-generation
- cwe
configs:
- config_name: primevul
  data_files:
  - split: train
    path: primevul/train.parquet
  - split: val
    path: primevul/val.parquet
  - split: test
    path: primevul/test.parquet
- config_name: megavul
  data_files:
  - split: train
    path: megavul/train.parquet
  - split: val
    path: megavul/val.parquet
  - split: test
    path: megavul/test.parquet
- config_name: crossvul
  data_files:
  - split: train
    path: crossvul/train.parquet
  - split: val
    path: crossvul/val.parquet
  - split: test
    path: crossvul/test.parquet
---

# DELTA vulnerability datasets

This repository contains the three benchmark splits used by **DELTA:
Differential Evidence for LLM Taxonomy-Aware Software Vulnerability
Detection**.

## Configurations

| config | task | training knowledge base | validation/test |
|---|---|---|---|
| `primevul` | single-language | C/C++ | C/C++ |
| `megavul` | cross-language | C/C++ | Java |
| `crossvul` | multi-language transfer | C, Go, Java, PHP, TypeScript | C++, C#, JavaScript, Python, Ruby, Rust, Scala |

Each config has `train`, `val` and `test` splits. The training split is the
knowledge-base construction set. In DELTA, each pair contributes two
classification items during evaluation: the vulnerable version (label `1`) and
the fixed version (label `0`).

## Loading

```python
from datasets import load_dataset

primevul = load_dataset("codemetic/DELTA", "primevul", split="train")
megavul_java = load_dataset("codemetic/DELTA", "megavul", split="test")
crossvul = load_dataset("codemetic/DELTA", "crossvul", split="val")
```

Or use the DELTA code directly:

```bash
python -m delta.cli run --config configs/primevul.yaml --run-id primevul-full
```

The loader pulls the data from this repository by default (`data.source: hf`).

## Columns

The parquet files preserve the original benchmark columns, including:

- `vul_code`, `fixed_code`
- `cwe` or `cwe_id`, and `cwe_description` where available
- `language` for CrossVul
- project/CVE metadata for PrimeVul and MegaVul

## Citation

Please cite the DELTA paper. See the project repository for the full author list
and bibliography.

## Notes

These datasets are redistributed for research convenience. Please also follow
the terms of the original PrimeVul, MegaVul and CrossVul releases.