Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacyΒ© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
DVDR_LLM β€” Ensemble framework for software vulnerability detection and repair using multiple large language models, with consensus analysis and evaluation tools for precision-recall trade-offs. | Kitploit
Tools/GitHubGitHub/erroristotle/dvdr_llm
Vulnerability AnalysisCode AnalysisMachine LearningPapers & ResearchLearning & EducationAI Security
GitHuberroristotle/dvdr_llm

DVDR_LLM

Ensemble framework for software vulnerability detection and repair using multiple large language models, with consensus analysis and evaluation tools for precision-recall trade-offs.

View Repository
32710 months agoNot yet reviewed

Most Popular

View all β†’

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools β†’
Share

DVDR-LLM: When Are LLMs Better Together for Software Vulnerability Detection and Repair?

Python 3.8+ Paper

Official implementation and artifact for the research paper:
"DVDR-LLM: When Are LLMs Better Together for Software Vulnerability Detection and Repair?"

🎯 Overview

DVDR-LLM is an ensemble framework that systematically examines the fundamental trade-offs in aggregating multiple Large Language Models (LLMs) for software vulnerability detection and repair. Our comprehensive evaluation reveals critical insights about precision-recall balancing, model diversity benefits, and consensus-based approaches in security-critical applications.

Key Findings

  • Precision-Recall Trade-offs: Ensemble reduces false positives in patch validity assessment (+10-12% accuracy) but increases false negatives in vulnerability identification
  • Complexity Benefits: Model diversity advantages increase with code abstraction level (+18% recall, +11.8% F1 for multi-file vulnerabilities)
  • Conservative Bias: 80% of models exhibit systematic conservative behavior (missing vulnerabilities vs. over-detection)
  • No Unique Specialists: All vulnerability detections overlap across the ensemble, validating majority voting strategies

πŸ“ Repository Structure

DVDR_LLM/
β”œβ”€β”€ dvdr_llm/                  # Main package (professional structure)
β”‚   β”œβ”€β”€ __init__.py            # Package exports
β”‚   β”œβ”€β”€ cli.py                 # Command-line interface
β”‚   β”œβ”€β”€ config.py              # Configuration settings
β”‚   β”œβ”€β”€ core/                  # Core functionality
β”‚   β”‚   β”œβ”€β”€ api_client.py      # LLM API communication
β”‚   β”‚   β”œβ”€β”€ detector.py        # VulnerabilityDetector class
β”‚   β”‚   └── prompts.py         # Prompt generation utilities
β”‚   β”œβ”€β”€ analysis/              # Analysis modules
β”‚   β”‚   β”œβ”€β”€ consensus.py       # Consensus analysis
β”‚   β”‚   └── metrics.py         # Performance metrics
β”‚   β”œβ”€β”€ evaluation/            # Model evaluation
β”‚   β”‚   └── evaluator.py       # ModelEvaluator class
β”‚   β”œβ”€β”€ visualization/         # Plotting and visualization
β”‚   β”‚   └── plotter.py         # ResultsPlotter class
β”‚   └── tools/                 # Additional utilities
β”œβ”€β”€ utils/                     # Original utility modules
β”‚   β”œβ”€β”€ api.py                 # LLM API interaction helpers
β”‚   β”œβ”€β”€ database.py            # SQLite helper functions
β”‚   └── config.py              # Configuration constants
β”œβ”€β”€ data/                      # Datasets and databases
β”‚   β”œβ”€β”€ vulnerabilities.csv    # Vulnerability data
β”‚   └── vulnerable and patched codes.sqlite
β”œβ”€β”€ output/                    # Generated results and databases
β”‚   β”œβ”€β”€ database_*.sqlite      # Model-specific databases
β”‚   β”œβ”€β”€ consensus_analysis/    # Consensus analysis results
β”‚   β”œβ”€β”€ metrics/              # Performance metrics
β”‚   └── database_exports/     # Exported data
β”œβ”€β”€ examples/                  # Usage examples
β”‚   └── basic_usage.py         # Basic usage demonstration
β”œβ”€β”€ docs/                      # Documentation
β”‚   └── README_consensus_analysis.md
β”œβ”€β”€ paper/                     # Research paper
β”‚   β”œβ”€β”€ main.pdf               # Published paper
β”‚   └── main.tex               # LaTeX source
β”œβ”€β”€ setup.py                   # Package installation
β”œβ”€β”€ requirements.txt           # Dependencies
β”œβ”€β”€ CHANGELOG.md              # Change log
β”œβ”€β”€ LICENSE                   # MIT License
└── README.md                 # This file

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • Access to LLM APIs (Ollama, OpenAI, etc.)
  • SQLite for vulnerability databases

Installation

  1. Clone the repository:

    git clone https://github.com/Erroristotle/DVDR_LLM.git
    cd DVDR_LLM
    
  2. Install dependencies:

    pip install -r requirements.txt
    pip install -e .  # Install package in development mode
    
  3. Verify installation:

    python verify_package.py
    

Basic Usage

Command Line Interface

# Run vulnerability detection with ensemble
dvdr-llm detect --models llama3-8b,codellama-7b --database data/vulnerabilities.sqlite

# Analyze consensus patterns (RQ2)
dvdr-llm analyze consensus --input results/metrics/model_predictions.csv --threshold 0.6

# Generate conflict pattern visualization (Figure in paper)
python dvdr_llm/visualization/conflict_pattern_plot.py results/metrics/reviewer_insights_disagreement_patterns.csv -o reviewer_insights

# Evaluate ensemble performance across abstraction levels (RQ3)
dvdr-llm evaluate --models-dir output/ --abstraction-analysis

Python API

from dvdr_llm import VulnerabilityDetector, ConsensusAnalyzer, ModelEvaluator

# Initialize vulnerability detector
detector = VulnerabilityDetector("llama3-8b-instruct")

# Connect to database
detector.connect_to_database("data/vulnerabilities.sqlite")

# Analyze code for vulnerabilities
code = """
void vulnerable_function(char *input) {
    char buffer[100];
    strcpy(buffer, input);  // Buffer overflow
}
"""

# Get CVE predictions
cve_names = detector.analyze_code_for_cves(code, 2023)
print(f"Identified CVEs: {cve_names}")

# Detect vulnerability
is_vulnerable = detector.detect_vulnerability(code)
print(f"Is vulnerable: {is_vulnerable}")

# Process database entries
stats = detector.process_database_entries(limit=100)
print(f"Processed {stats['processed']} entries")

# Clean up
detector.close()

# Multi-model consensus analysis
model_databases = {
    "llama3-8b": "output/database_llama3-8b-instruct.sqlite",
    "codellama-7b": "output/database_codellama-7b-instruct.sqlite",
    "gemma2-9b": "output/database_gemma2-9b.sqlite"
}

analyzer = ConsensusAnalyzer()
consensus_results = analyzer.run_full_analysis(model_databases)

# Model evaluation
evaluator = ModelEvaluator()
evaluation_results = evaluator.evaluate_multiple_models(
    model_databases, 
    "data/ground_truth.csv"
)

πŸ“Š Reproducing Paper Results

Research Questions

RQ1: Impact of Aggregating Multiple LLMs

# Generate Table 2 (Model comparison with delta percentages)
python dvdr_llm/tools/model_contribution_analysis.py results/metrics/model_predictions.csv --compare-ensemble --threshold 0.7

# Analyze individual vs ensemble performance
dvdr-llm evaluate --comparison-analysis --threshold 0.7

RQ2: Optimal Consensus Threshold

# Generate Figure 3 (Threshold sensitivity analysis)
python dvdr_llm/tools/threshold_analysis.py results/metrics/model_predictions.csv --range 0.3-0.8

# Statistical validation of threshold selection
python dvdr_llm/analysis/statistical_validation.py --threshold-analysis

RQ3: Performance Across Abstraction Levels

# Generate Table 3 (Abstraction level analysis)
python dvdr_llm/evaluation/evaluator.py --abstraction-analysis --threshold 0.6

# Level-specific performance evaluation
dvdr-llm evaluate --abstraction-levels 1,2,3 --ensemble

RQ4: Weighted Aggregation for Patch Quality

# Analyze patch quality metrics (ROUGE, CodeBLEU, Complexity)
python dvdr_llm/tools/patch_quality_analysis.py results/patches/ --weighted-scoring

# Generate Figure 4 (Patch similarity and complexity analysis)
dvdr-llm visualize --patch-analysis --metrics results/patch_metrics.csv

Key Figures Generation

# Main conflict pattern analysis figure (Figure 2)
python dvdr_llm/visualization/conflict_pattern_plot.py results/metrics/reviewer_insights_disagreement_patterns.csv -o reviewer_insights

# Threshold sensitivity analysis (Figure 3)
python dvdr_llm/visualization/enhanced_figure3_generator.py results/metrics/model_predictions.csv

# Statistical validation plots (Appendix)
python dvdr_llm/analysis/statistical_significance_analysis.py --generate-plots

πŸ”§ Configuration

Model Configuration

Edit dvdr_llm/config.py to configure LLM endpoints:

Download Tool