論文の概要: SPARK: Security Knowledge Priming and Representation-Guided Knowledge Activation for LLM-based Secure Code Generation
- arxiv url: http://arxiv.org/abs/2606.16244v1
- Date: Mon, 15 Jun 2026 05:43:37 GMT
- ステータス: 翻訳完了
- システム内更新日: 2026-06-16 18:36:05.028149
- Title: SPARK: Security Knowledge Priming and Representation-Guided Knowledge Activation for LLM-based Secure Code Generation
- Title(参考訳): SPARK: LLMベースのセキュアコード生成のためのセキュリティ知識プライミングと表現誘導型知識活性化
- Authors: Xiaoyun Xu, Lichao Wu, Jona te Lintelo, Siyu Zhang, Stjepan Picek,
- Abstract要約: 以前の文献では、この制限はセキュリティに関する専門知識の欠如によるものとされている。
プレトレーニングコーパスはすでにセキュリティ材料に富んでいると我々は主張する。
我々は、この潜伏知識を再訓練せずに活性化する推論時セキュリティハーネスであるSPARKを提案する。
- 参考スコア(独自算出の注目度): 18.3981349747131
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Large language models routinely generate code with exploitable security flaws. Prior literature attributes this limitation to a lack of security expertise, steering current defense mechanisms toward heavy fine-tuning or external knowledge retrieval, which introduces significant computational overhead and data bias through redundant code examples. Contrary to this view, we argue that pretraining corpora are already rich in security material. The bottleneck is activation: without an explicit and brief cue, statistical pressure toward common training-distribution patterns suppresses the model's safety-relevant representations. We present SPARK, an inference-time security harness that activates this latent knowledge without any retraining. The harness has two parts. Component~I retrieves a few of the relevant Common Weakness Enumeration (CWE) entries for each coding task and appends a short structured cue to the prompt; this alone is enough to surface the model's existing security representations. Component~II adds a precomputed token bias to the logits at every decoding step. We obtain the bias by projecting a safe-direction vector, the unit difference between the mean safe and mean unsafe last-layer hidden states, through the language model head. The bias is computed once offline; applying it costs a single vector addition per generated token. We evaluate SPARK on 9 open-source models across C++, Java, and Python, and compare with 7 baselines spanning fine-tuning and retrieval-augmented methods. SPARK matches or improves on the best baseline in every setting while preserving HumanEval utility. We further test Component~I in a black-box setting on 7 of today's strongest models, including Claude, DeepSeek, and GPT, demonstrating the bottleneck of insecure code generation and the improvements enabled by our method.
- Abstract(参考訳): 大規模な言語モデルは、悪用可能なセキュリティ欠陥のあるコードを生成する。
以前の文献では、この制限はセキュリティに関する専門知識の欠如によるものであり、過剰なコード例を通じて計算オーバーヘッドとデータのバイアスを生じさせる重い微調整や外部知識の検索に向けて、現在の防御メカニズムを推し進めている。
この見解とは対照的に、プレトレーニングコーパスはすでにセキュリティ材料に富んでいると論じる。
アクティベーションはアクティベーションであり、明示的で短いキューがなければ、一般的なトレーニング・ディストリビューション・パターンに対する統計的圧力はモデルの安全性関連表現を抑制する。
我々は、この潜伏知識を再訓練せずに活性化する推論時セキュリティハーネスであるSPARKを提案する。
ハーネスには2つの部分があります。
Component~Iは、各コーディングタスクに関連するCommon Weakness Enumeration(CWE)エントリを検索し、プロンプトに短い構造化キューを追加する。
Component~IIは、デコードステップ毎に、事前に計算されたトークンバイアスをロジットに追加します。
我々は、言語モデルヘッドを介して、平均セーフと平均アンセーフな最終層隠れ状態の単位差である安全方向ベクトルを投影することでバイアスを得る。
バイアスはオフラインで計算される。それを適用すると、生成されたトークン毎に1つのベクトル加算がかかる。
我々は、C++、Java、Pythonの9つのオープンソースモデル上でSPARKを評価し、微調整および検索拡張メソッドにまたがる7つのベースラインと比較した。
SPARKはHumanEvalユーティリティを保持しながら、すべての設定で最高のベースラインにマッチまたは改善する。
我々は、Claude、DeepSeek、GPTを含む今日の最強モデルの7つのブラックボックス設定でComponent~Iをさらにテストし、安全でないコード生成のボトルネックと、我々のメソッドによって実現された改善を実証した。
関連論文リスト
- Secure Code Generation via Online Reinforcement Learning with Vulnerability Reward Model [60.60587869092729]
大規模言語モデル(LLM)は、ソフトウェア開発でますます使われているが、安全でないコードを生成する傾向は、現実世界のデプロイメントにとって大きな障壁である。
機能保存型セキュアコード生成のためのオンライン強化学習フレームワークSecCoderXを提案する。
論文 参考訳(メタデータ) (2026-02-07T07:42:07Z) - SABER: Uncovering Vulnerabilities in Safety Alignment via Cross-Layer Residual Connection [16.38885847999291]
セーフアライメントトレーニングを備えた大規模言語モデル(LLM)は、堅牢な言語理解能力を備えた強力な機器である。
2つの中間層を$s$と$e$で接続し、残余接続を通じて$s e$と$e$を接続する新しいホワイトボックスジェイルブレイク手法であるSABERを導入する。
提案手法は,HarmBenchテストセット上での最高性能ベースラインよりも51%向上する。
論文 参考訳(メタデータ) (2025-09-19T15:10:19Z) - One Trigger Token Is Enough: A Defense Strategy for Balancing Safety and Usability in Large Language Models [20.42976162135529]
大規模言語モデル(LLM)は、仮想アシスタント、自動コード生成、科学研究など、さまざまな領域で広く使われている。
我々は,与えられた安全対応LLMの安全トリガトークンを識別し,明示的に復号する,シンプルで効果的な防衛アルゴリズムであるtextttD-STT を提案する。
論文 参考訳(メタデータ) (2025-05-12T01:26:50Z) - HexaCoder: Secure Code Generation via Oracle-Guided Synthetic Training Data [60.75578581719921]
大規模言語モデル(LLM)は、自動コード生成に大きな可能性を示している。
最近の研究は、多くのLLM生成コードが深刻なセキュリティ脆弱性を含んでいることを強調している。
我々は,LLMがセキュアなコードを生成する能力を高めるための新しいアプローチであるHexaCoderを紹介する。
論文 参考訳(メタデータ) (2024-09-10T12:01:43Z) - CodeAttack: Revealing Safety Generalization Challenges of Large Language Models via Code Completion [117.178835165855]
本稿では,自然言語入力をコード入力に変換するフレームワークであるCodeAttackを紹介する。
我々の研究は、コード入力に対するこれらのモデルの新たな、普遍的な安全性の脆弱性を明らかにした。
CodeAttackと自然言語の分布ギャップが大きくなると、安全性の一般化が弱くなる。
論文 参考訳(メタデータ) (2024-03-12T17:55:38Z) - CodeLMSec Benchmark: Systematically Evaluating and Finding Security
Vulnerabilities in Black-Box Code Language Models [58.27254444280376]
自動コード生成のための大規模言語モデル(LLM)は、いくつかのプログラミングタスクにおいてブレークスルーを達成した。
これらのモデルのトレーニングデータは、通常、インターネット(例えばオープンソースのリポジトリから)から収集され、障害やセキュリティ上の脆弱性を含む可能性がある。
この不衛生なトレーニングデータは、言語モデルにこれらの脆弱性を学習させ、コード生成手順中にそれを伝播させる可能性がある。
論文 参考訳(メタデータ) (2023-02-08T11:54:07Z) - Multi-context Attention Fusion Neural Network for Software Vulnerability
Identification [4.05739885420409]
ソースコードのセキュリティ脆弱性の共通カテゴリのいくつかを効率的に検出することを学ぶディープラーニングモデルを提案する。
モデルは、学習可能なパラメータの少ないコードセマンティクスの正確な理解を構築します。
提案したAIは、ベンチマークされたNIST SARDデータセットから特定のCWEに対して98.40%のF1スコアを達成する。
論文 参考訳(メタデータ) (2021-04-19T11:50:36Z)
関連論文リストは本サイト内にある論文のタイトル・アブストラクトから自動的に作成しています。
指定された論文の情報です。
本サイトの運営者は本サイト(すべての情報・翻訳含む)の品質を保証せず、本サイト(すべての情報・翻訳含む)を使用して発生したあらゆる結果について一切の責任を負いません。