| # CompRealVul_LLVM Dataset | |
| [](https://huggingface.co/datasets/compAgent/CompRealVul_LLVM) | |
| ## Dataset Summary | |
| **CompRealVul_LLVM** is the LLVM IR (Intermediate Representation) version of the [CompRealVul_C](https://huggingface.co/datasets/compAgent/CompRealVul_C) dataset. This version is designed specifically for **training and evaluating machine learning models** on the task of **binary vulnerability detection** in a setting that closely mimics how models are used in practice — operating on the compiled representation of code rather than raw source code. | |
| Each function in this dataset was compiled from C code to LLVM IR, enabling robust training of models on semantically rich, architecture-independent binary representations. | |
| This dataset supports research aligned with the methodology described in our paper, where the goal is to predict vulnerabilities directly from **compiled IR representations** rather than from source code. | |
| ## Key Features | |
| - ✅ **LLVM IR representation** of each function (field: `llvm_ir_function`) | |
| - ✅ Includes **train**, **validation**, and **test** splits (see below) | |
| - ✅ Vulnerability labels (`label`) for supervised learning | |
| - ✅ Metadata about original source (`dataset`, `file`, `fun_name`) | |
| ## Dataset Structure | |
| Each record contains: | |
| - `dataset`: Original dataset source of the function (e.g., Juliet, NVD) | |
| - `file`: File path of the source from which the function was extracted | |
| - `fun_name`: Name of the function in the source code | |
| - `llvm_ir_function`: LLVM IR string representing the function | |
| - `label`: Binary label indicating vulnerability (`1` for vulnerable, `0` for non-vulnerable) | |
| - `split`: Dataset split (`train`, `validation`, `test`) | |
| ## Split Information | |
| This dataset is split into **train**, **validation**, and **test** sets, following the exact partitioning strategy used in the experiments described in our paper. The split ensures a fair evaluation of generalization performance by separating functions into disjoint sets with no overlap. This allows researchers to directly reproduce our results or compare against them under consistent conditions. | |
| - `train`: Used to fit model parameters | |
| - `validation`: Used for model selection and hyperparameter tuning | |
| - `test`: Used exclusively for final evaluation and benchmarking | |
| ## Usage | |
| You can load and explore the dataset using the 🤗 `datasets` library: | |
| ```python | |
| from datasets import load_dataset | |
| # Load a specific split | |
| train_ds = load_dataset("compAgent/CompRealVul_LLVM", split="train") | |
| print(train_ds[0]) | |
| ## Example | |
| ```json | |
| { | |
| "dataset": "CompRealVul", | |
| "file": "app_122.c", | |
| "fun_name": "app", | |
| "llvm_ir_function": "define dso_local i32 @app() #0 { ... }", | |
| "label": "1", | |
| "split": "train" | |
| } | |
| ``` | |
| ## License | |
| This dataset is released under the Apache 2.0 License. | |
| ## Citation | |
| ```cite | |
| @misc{comprealvul_llvm, | |
| author = {comp agent}, | |
| title = {CompRealVul_LLVM: A Dataset of Vulnerable and Non-Vulnerable Functions in LLVM IR}, | |
| howpublished = {\url{https://huggingface.co/datasets/compAgent/CompRealVul_LLVM}}, | |
| year = {2025} | |
| } | |
| ``` |