Prompt Tuning for Enhancing Security of Code in Code Generation Language Models

코드 생성 언어 모델의 코드 보안성 향상을 위한 프롬프트 튜닝

  • Miseon Yu (Dept. of Electrical and Computer Engineering and Inter-University Semiconductor Research Center(ISRC), Seoul National University) ;
  • Woorim Han (Dept. of Electrical and Computer Engineering and Inter-University Semiconductor Research Center(ISRC), Seoul National University) ;
  • Yungi Cho (Dept. of Electrical and Computer Engineering and Inter-University Semiconductor Research Center(ISRC), Seoul National University) ;
  • Yunheung Peak (Dept. of Electrical and Computer Engineering and Inter-University Semiconductor Research Center(ISRC), Seoul National University)
  • 유미선 (서울대학교 전기정보공학부, 서울대학교 반도체 공동연구소) ;
  • 한우림 (서울대학교 전기정보공학부, 서울대학교 반도체 공동연구소) ;
  • 조윤기 (서울대학교 전기정보공학부, 서울대학교 반도체 공동연구소) ;
  • 백윤흥 (서울대학교 전기정보공학부, 서울대학교 반도체 공동연구소)
  • Published : 2024.05.23

Abstract

최근 거대 언어 모델의 발전으로 프로그램 합성 분야에서 활용되고 있는 코드 생성 언어 모델의 보안적 측면에 대한 중요성이 부각되고 있다. 그러나, 이를 위해 모델 전체를 재학습하기에는 많은 자원과 시간이 소모된다. 따라서, 본 연구에서는 효율적인 미세조정 방식 중 하나인 프롬프트 튜닝으로 코드 생성 언어 모델이 안전한 코드를 생성할 확률을 높이는 방법을 탐구한다. 또한 이에 따른 기능적 정확성 간의 상충 관계를 분석한다. 실험 결과를 통해 프롬프트 튜닝이 기존 방법에 비해 추가 파라미터를 크게 줄이면서도 보안률을 향상시킬 수 있음을 알 수 있었다. 미래 연구 방향으로는 새로운 조정 손실함수와 하이퍼파라미터 값을 조정하여 성능을 더욱 향상시킬 수 있는지 조사할 것이다. 이러한 연구는 보다 안전하고 신뢰할 수 있는 코드 생성을 위한 중요한 발전을 이끌 수 있을 것으로 기대된다.

Keywords

Acknowledgement

이 논문은 2024 년도 정부(과학기술정보통신부)의 재원으로 한국연구재단의 지원을 받아 수행된 연구임(RS-2023-00277326). 이 논문은 2024 년도 BK21 FOUR 정보기술 미래인재 교육연구단에 의하여 지원되었음. 이 논문은 2020 년도 정부(과학기술정보통신부)의 재원으로 정보통신기획평가원의 지원을 받아 수행된 연구임 (No.2020-0-01840,스마트폰의 내부데이터 접근 및 보호 기술 분석). 이 논문은 2023 년도 정부(과학기술정보통신부)의 재원으로 정보통신기획평가원의 지원을 받아 수행된 연구임 (IITP-2023-RS-2023-00256081) 본 연구는 반도체 공동연구소 지원의 결과물임을 밝힙니다.

References

  1. Thomas Dohmke. 2023. GitHub Copilot X: the AI-powered Developer Experience. https://github.blog/2023-03-22-github-copilot-x-the-ai-powered-developer-experience/.
  2. Hammond Pearce, et al. Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions. IEEE S&P. 2022.
  3. Jingxuan He, et al. Instruction Tuning for Secure Code Generation. arXiv. 2024.
  4. Jingxuan He, et al. Large language models for code: security hardening and adversarial testing. CCS. 2023.
  5. Brian Lester, et al. The Power of Scale for Parameter-Efficient Prompt Tuning. EMNLP. 2021
  6. Hanqing Zhang, et al. A Survey of Controllable Text Generation Using Transformer-based Pre-trained Language Models. ACM Comput. Surv. 56, 3, Article 64, 37 pages. 2024.
  7. Erik Nijkamp, et al. CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis. ICLR. 2023.
  8. 2023. CodeQL-GitHub. https://codeql.github.com.
  9. Mark Chen, et al. 2021. Evaluating Large Language Models Trained on Code. arXiv. 2021.