Instruction Tuning for Secure Code Generation

要約

現代言語モデル (LM) は、特にプログラミングにおいて、日常および専門的な状況で広く受け入れられるようになりました。
この導入を可能にする重要な手順は、ユーザーの指示や人間の好みに従うように訓練することで LM の実用性を大幅に高める命令チューニングです。
しかし、既存の命令チューニング方式では、生成されたコードのセキュリティという重要な側面が見落とされています。
その結果、最先端の命令チューニングされた LM であっても安全でないコードが頻繁に生成され、重大なセキュリティ リスクが生じます。
この作業では、このギャップに対処するために SafeCoder を導入します。
SafeCoder は、自動パイプラインを使用して収集した多様で高品質のデータセットを使用して、セキュリティ中心の微調整を実行します。
セキュリティの微調整を標準の命令調整と統合し、セキュリティとユーティリティの両方の最適化を促進します。
そのシンプルさにもかかわらず、SafeCoder がさまざまな一般的な LM やデータセットにわたって効果的であることを示します。
実用性を維持しながら、セキュリティを大幅に向上(約30%)することができます。

要約(オリジナル)

Modern language models (LMs) have gained widespread acceptance in everyday and professional contexts, particularly in programming. An essential procedure enabling this adoption is instruction tuning, which substantially enhances LMs’ practical utility by training them to follow user instructions and human preferences. However, existing instruction tuning schemes overlook a crucial aspect: the security of generated code. As a result, even the state-of-the-art instruction-tuned LMs frequently produce unsafe code, posing significant security risks. In this work, we introduce SafeCoder to address this gap. SafeCoder performs security-centric fine-tuning using a diverse and high-quality dataset that we collected using an automated pipeline. We integrate the security fine-tuning with standard instruction tuning, to facilitate a joint optimization of both security and utility. Despite its simplicity, we show that SafeCoder is effective across a variety of popular LMs and datasets. It is able to drastically improve security (by about 30%), while preserving utility.

arxiv情報

著者 Jingxuan He,Mark Vero,Gabriela Krasnopolska,Martin Vechev
発行日 2024-07-12 15:45:57+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CR, cs.LG, cs.SE パーマリンク