Skip to main content
QUICK REVIEW

[논문 리뷰] DefectHunter: A Novel LLM-Driven Boosted-Conformer-based Code Vulnerability Detection Mechanism

Jin Wang, Zishan Huang|arXiv (Cornell University)|2023. 09. 27.
Software Engineering ResearchComputer Science인용 수 8
한 줄 요약

DefectHunter는 구조적 코드 그래프와 Conformer 기반 아키텍처 및 LLM 임베딩을 결합하여 취약점을 탐지하며, CWE, QEMU, FFmpeg 데이터셋에서 기준 모델 대비 눈에 띄는 정확도 향상을 달성한다.

ABSTRACT

One of the most pressing threats to computing systems is software vulnerabilities, which can compromise both hardware and software components. Existing methods for vulnerability detection remain suboptimal. Traditional techniques are both time-consuming and labor-intensive, while machine-learning-based approaches often underperform when applied to complex datasets, due to their inability to capture high-dimensional relationships. Previous deep-learning strategies also fall short in capturing sufficient feature information. Although self-attention mechanisms can process information over long distances, they fail to capture structural information. In this paper, we introduce DefectHunter, an innovative model for vulnerability identification that employs the Conformer mechanism. This mechanism fuses self-attention with convolutional networks to capture both local, position-wise features and global, content-based interactions. Furthermore, we optimize the self-attention mechanisms to mitigate the issue of excessive attention heads introducing extraneous noise by adjusting the denominator. We evaluated DefectHunter against ten baseline methods using six industrial and two highly complex datasets. On the QEMU dataset, DefectHunter exhibited a 20.62\% improvement in accuracy over Pongo-70B, and for the CWE-754 dataset, its accuracy was 14.64\% higher. To investigate how DefectHunter comprehends vulnerabilities, we conducted a case study, which revealed that our model effectively understands the mechanisms underlying vulnerabilities.

연구 동기 및 목표

  • 전통적인 정적/동적 분석 및 일반적인 딥러닝을 넘어 코드에서 강건한 취약점 탐지를 동기 부여한다.
  • 로컬(컨볼루션)과 글로벌(self-attention) 특징 추출을 코드 구조에 융합하는 Conformer 기반 아키텍처를 제안한다.
  • 사전 학습된 LLM으로부터 얻은 의미적 코드 임베딩과 구조적 코드 그래프(AST/CFG/DFG)를 활용하여 탐지 성능을 향상시킨다.
  • 다양한 산업용 및 복합 데이터셋에 대해 평가하여 baselines 대비 성능 향상을 입증하고 구성요소의 기여도를 분석한다.

제안 방법

  • 코드 스니펫으로부터 AST, CFG, DFG 표현을 도출하기 위해 구조적 정보 처리를 사용한다.
  • 사전 학습된 코드 모델로 코드 토큰을 임베딩하여 Code Sequence Embeddings (CSEs)를 얻는다.
  • Conformer 기반 블록을 채택하여 컨볼루션 모듈을 다중 헤드 self-attention 및 수정된 포지셔널 인코딩과 결합한다.
  • 다중 헤드 어텐션에서 과도한 어텐션 헤드로 인한 노이즈를 줄이기 위해 softmax의 어텐션 분모를 수정한다.
  • 융합된 구조적 및 의미적 특징에 대해 다층 퍼셉트론 classifier를 학습시켜 취약점을 예측한다.

실험 결과

연구 질문

  • RQ1구조적 코드 그래프와 의미 임베딩을 통합하는 것이 취약점 탐지 성능에 어떤 영향을 미치는가?
  • RQ2이 도메인에서 표준 Transformer 기반 접근법에 비해 Conformer 아키텍처가 어떤 이점을 제공하는가?
  • RQ3Conformer 구성요소(AST/DFG/CFG, 주의 기법 수정, LLM 사용)의 제거 연구가 다양한 데이터셋에서 성능에 어떤 영향을 미치는가?

주요 결과

  • DefectHunter는 CWE 데이터셋에서 기준선보다 더 높은 정확도를 달성하며, 특정 CWE 유형에서 ACC가 0.9141–0.9999에 이른다.
  • FFmpeg 및 QEMU 데이터셋에서 DefectHunter는 각각 ACC 0.6653 및 0.6459를 달성하여 다수의 지표에서 여러 기준선보다 우수하다.
  • Pongo-70B와 비교할 때 DefectHunter는 CWE 데이터셋에서 ACC를 14.64% 포인트 개선했고 QEMU에서 20.62% 포인트 개선했다.
  • 제거 연구 결과 Conformer와 LLM 구성 요소가 성능에 상당히 기여하는 것으로 나타났으며, AST/DFG/CFG 또는 Conformer 모듈을 제거하면 현저한 감소가 있다.
  • DefectHunter는 더 작고 잘 조정된 모델이 취약점 탐지에서 더 큰 LLM 기반 접근법보다 우수할 수 있음을 보여준다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.