Run this model with HF Jobs

Run Chidamtek/bert-llvm-ir-vulnerability-detection on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/Chidamtek/bert-llvm-ir-vulnerability-detection. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/Chidamtek/bert-llvm-ir-vulnerability-detection on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

BERT LLVM IR Vulnerability Detection

This model is a BERT-based classifier trained to detect vulnerable vs non-vulnerable program slices represented in LLVM IR.

Model

Base model: bert-base-uncased

Task: Binary classification

Labels

0 β†’ Non-vulnerable
1 β†’ Vulnerable

Repository

Training and preprocessing code: https://github.com/forwardtech/bert-llvm-ir-vulnerability-detection

Dataset

This model was trained on data derived from previously published vulnerability detection research datasets.

This repository does not redistribute the dataset. Please obtain the dataset from the original sources referenced below and follow their licensing terms.

References

Original Dataset

Zhen Li, Deqing Zou, Shouhuai Xu, Zhaoxuan Chen, Yawei Zhu, and Hai Jin.
VulDeeLocator: A Deep Learning-based Fine-grained Vulnerability Detector.
IEEE Transactions on Dependable and Secure Computing.

@article{vuldeelocator,
  title={VulDeeLocator: A Deep Learning-based Fine-grained Vulnerability Detector},
  author={Li, Zhen and Zou, Deqing and Xu, Shouhuai and Chen, Zhaoxuan and Zhu, Yawei and Jin, Hai},
  journal={IEEE Transactions on Dependable and Secure Computing},
  year={2021}
}

Follow-up Research

Andrew Arash Mahyari.
Harnessing the Power of LLMs in Source Code Vulnerability Detection.

@article{mahyari_llm_vuln_detection,
  title={Harnessing the Power of LLMs in Source Code Vulnerability Detection},
  author={Mahyari, Andrew Arash},
  journal={IEEE},
  year={2023}
}

Intended Use

This model is intended for research and experimentation in vulnerability detection using LLVM IR.

It should not be used as a standalone production vulnerability scanner.

Usage

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model_name = "chidamtek/bert-llvm-ir-vulnerability-detection"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

code = "LLVM IR snippet here"

inputs = tokenizer(code, return_tensors="pt", truncation=True)
outputs = model(**inputs)

prediction = torch.argmax(outputs.logits, dim=-1).item()
print(prediction)
Downloads last month
9
Safetensors
Model size
0.1B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support