CCJA: هجوم كسر السجن المتماسك سياقياً لنماذج اللغة الكبيرة المتراصة CCJA: Context-Coherent Jailbreak Attack for Aligned Large Language Models

شارك:
المجلة: Machine Learning، المجلد: 115، العدد: 6
DOI: https://doi.org/10.1007/s10994-026-07069-z
تاريخ النشر: 2026-05-23
المؤلف: Guanghao Zhou وآخرون
الموضوع الرئيسي: الصلابة ضد الهجمات في تعلم الآلة

نظرة عامة

تتناول هذه البحث نقاط الضعف في نماذج اللغة الكبيرة (LLMs) تجاه “الاختراق”، حيث يستغل المهاجمون هذه النماذج لاستنباط سلوكيات غير مقصودة. تركز الطرق الحالية بشكل أساسي على التلاعبات المنفصلة في التعليمات لنماذج LLM المغلقة المصدر، ولكن مع زيادة قدرة نماذج LLM مفتوحة المصدر، تزداد إمكانياتها للاستغلال بسبب توفر معلمات النموذج ومعلومات التدرج. لمواجهة هذه المشكلة، يقدم المؤلفون هجوم الاختراق المتماسك سياقياً (CCJA)، حيث يتم تأطير هجمات الاختراق كمشكلة تحسين ضمن مساحة تضمين نماذج اللغة المmasked (MLMs). تستخدم طريقتهم تحسينات تركيبية لتعزيز كل من معدل نجاح الهجمات والتماسك الدلالي للتعليمات المولدة.

تظهر النتائج أن CCJA لا يحافظ فقط على التناسق الدلالي، بل يتفوق أيضًا على الطرق الحالية الرائدة من حيث فعالية الهجوم. علاوة على ذلك، عندما يتم دمج التعليمات المولدة بواسطة CCJA في منهجيات الهجوم التقليدية ذات الصندوق الأسود، هناك تحسين ملحوظ في معدلات النجاح ضد نماذج LLM التجارية المغلقة المصدر. يسلط هذا البحث الضوء على المخاوف المتزايدة بشأن السلامة المرتبطة بنماذج LLM مفتوحة المصدر والتهديدات الأمنية الكبيرة التي تشكلها لنظيراتها التجارية، داعيًا إلى زيادة الوعي بهذه النقاط الضعف. يخطط المؤلفون لإصدار كودهم عند قبول الورقة.

مقدمة

تناقش مقدمة هذه الورقة البحثية التأثير التحويلي لنماذج اللغة الكبيرة (LLMs)، سواء التجارية أو مفتوحة المصدر، على مجالات التطبيقات المختلفة. تبرز الجهود المستمرة لمواءمة نماذج LLM مع القيم الإنسانية والحاجة الملحة لتدابير السلامة، خاصة مع تضاؤل الفجوة في الأداء بين النماذج مفتوحة المصدر والمغلقة المصدر. تؤكد الورقة على المخاطر المتزايدة المرتبطة بنماذج LLM مفتوحة المصدر، حيث يمكن للمهاجمين الوصول ليس فقط إلى المخرجات ولكن أيضًا إلى أوزان النموذج والتدرجات، مما يسهل الاستغلال الخبيث.

يصنف المؤلفون هجمات الاختراق إلى نوعين: هجمات على مستوى التعليمات، والتي تعتمد على تعليمات مصممة لاستنباط محتوى غير آمن، وهجمات على مستوى الرموز، التي تحسن التعليمات الفعالة لتحقيق نتائج مماثلة. يقترحون طريقة جديدة لهجوم الاختراق خصيصًا لنماذج LLM مفتوحة المصدر تقلل من التكاليف الحسابية بينما تعزز معدلات نجاح الهجوم. من خلال استخدام تعليمات أولية لتوليد بادئة متماسكة تتبع التعليمات وتأطير الهجوم كعملية تحسين في مساحة تضمين الكلمات المستمرة، تظهر الطريقة تحسينًا في الطلاقة الدلالية والفعالية في سيناريوهات الصندوق الأسود. تختتم الورقة بالقول إن نهجهم لا يكشف فقط عن نقاط الضعف في نماذج LLM مفتوحة المصدر، بل يشكل أيضًا تهديدات أمنية للنماذج المغلقة المصدر، مدعومة بالنتائج التجريبية التي تظهر أداءً متفوقًا مقارنة بالطرق الحالية.

طرق

في هذا القسم، يوضح المؤلفون منهجيتهم للتحقق من هجوم الاختراق ضد عدة طرق أساسية، بما في ذلك GCG وAutoDAN وBEAST وCOLD-Attack. تستخدم كل طريقة أساسية استراتيجيات متميزة لتوليد تعليمات الاختراق، مثل البحث عن التدرجات، والخوارزميات الجينية، وفك التشفير المقيد القائم على الطاقة. تأكد المؤلفون من إجراء مقارنة عادلة من خلال تعديل COLD-Attack لتكون متوافقة مع تنسيق الدردشة لنماذج اللغة الكبيرة (LLMs) أثناء التحسين. تم تقديم إعدادات تجريبية مفصلة في الملحق B.5.

تظهر النتائج التجريبية، الملخصة في الجدول 1، أن طريقة المؤلفين تحقق باستمرار أعلى أو ثاني أعلى معدلات نجاح الهجوم (ASR) عبر نماذج LLM المختلفة، مما يشير إلى فعالية نهجهم في التحسين. من الجدير بالذكر أنه بينما تؤدي AutoDAN بشكل جيد، فإن اعتمادها على خوارزمية جينية معقدة ونماذج LLM من طرف ثالث يزيد من صعوبة التنفيذ. يستكشف المؤلفون أيضًا تعزيز طرق الهجوم ذات الصندوق الأسود من خلال توليد تعليمات اختراق متعددة لنماذج LLM تستهدف نماذج مختلفة، بما في ذلك Mistral-7B-Instruct-v0.3 وVicuna-7B-v1.5. من خلال دمج هذه التعليمات في الطرق الحالية ذات الصندوق الأسود، يظهرون تحسينًا في معدلات نجاح الهجوم، مما يبرز التهديد المحتمل الذي تشكله النماذج مفتوحة المصدر على نماذج LLM المغلقة المصدر. ستستكشف الأعمال المستقبلية المزيد من تداعيات تضييق الفجوات في الأداء بين هذه الأنواع من النماذج.

مناقشة

في هذا القسم، يناقش المؤلفون منهجيات هجوم الاختراق المختلفة التي تستهدف نماذج اللغة الكبيرة (LLMs)، مصنفين إياها إلى هجمات ذات صندوق أسود وهجمات ذات صندوق أبيض. تعتمد الهجمات ذات الصندوق الأسود، كما أبرزها شين وآخرون (2023) وآخرون، على صياغة تعليمات معقدة دون الوصول إلى معلمات النموذج الداخلية، وغالبًا ما تستخدم تقنيات الهندسة الاجتماعية للتلاعب باستجابات LLM. على النقيض من ذلك، تستخدم الهجمات ذات الصندوق الأبيض، مثل تلك التي قام بها زو وآخرون (2023) وزو وآخرون (2023)، الوصول المباشر إلى داخل النموذج لتحسين التعليمات على مستوى الرموز، على الرغم من أن ذلك غالبًا ما يكون على حساب قابلية القراءة الدلالية. يقترح المؤلفون طريقة جديدة تعزز معدل نجاح هجمات الاختراق مع الحفاظ على التماسك الدلالي، مما يميزها عن التقنيات الحالية التي تعتمد بشكل كبير على صياغة التعليمات يدويًا أو تنتج مخرجات أقل قابلية للقراءة.

تصيغ الطريقة المقترحة مهمة الاختراق كمشكلة تحسين ضمن مساحة التضمين المستمرة لنموذج اللغة المmasked (MLM). من خلال الاستفادة من آلية أخذ العينات Gumbel-softmax ومصفوفة الربط لربط معرفات الرموز بين MLM وLLM المستهدف، تهدف المؤلفون إلى توليد تعليمات اختراق فعالة تستنبط استجابات إيجابية لاستفسارات ضارة. توازن عملية التحسين بين الحاجة إلى تنفيذ اختراق ناجح والحفاظ على سلامة الدلالة، كما يتضح من وظيفة الخسارة المزدوجة التي تتضمن كل من أداء الاختراق وقابلية قراءة التعليمات. تظهر النتائج التجريبية أن النهج المقترح لا يحقق فقط معدلات نجاح أعلى في الهجوم مقارنة بالطرق الحالية، بل يحافظ أيضًا على علاقة دلالية قوية بين التعليمات الأولية والمحسنة، مما يعزز الفعالية العامة لاستراتيجية الاختراق.

القيود

تتعلق قيود خوارزمية هجوم الاختراق للنماذج مفتوحة المصدر بشكل أساسي بتقييمها وقابليتها للتطبيق. تم إجراء التجارب حصريًا على مجموعة بيانات AdvBench للحفاظ على التناسق مع الأسس الحالية، والتي قد لا تلتقط تمامًا التعقيد المتطور للتعليمات الضارة في نماذج اللغة الكبيرة (LLMs). تم تصميم الطريقة خصيصًا لنماذج مفتوحة المصدر وقد لا تكون فعالة في سيناريوهات الصندوق الأسود. بالإضافة إلى ذلك، بينما يمكن للخوارزمية التلاعب بنماذج مثل LLaMA 2 وLLaMA 3 من خلال إضافة استجابات إيجابية لتوليد محتوى غير آمن، ستركز الأبحاث المستقبلية على تطوير تعليمات الاختراق بناءً على قوالب المحادثة وتكييفها لهجمات الصندوق الأسود.

أخلاقيًا، تهدف الأبحاث إلى تسليط الضوء على مخاطر السلامة المرتبطة بالنماذج مفتوحة المصدر والحاجة الملحة لتدابير السلامة. بينما تؤدي طريقة الهجوم إلى توليد محتوى ضار، إلا أنها لا تزيد من المخاطر الكامنة في مجموعة بيانات AdvBench، التي تم دراستها بشكل مكثف. يعتزم المؤلفون مواصلة التحقيق في سلامة نماذج LLM واستكشاف آليات الدفاع المحتملة ضد هجمات الاختراق في الأعمال المستقبلية.

Journal: Machine Learning, Volume: 115, Issue: 6
DOI: https://doi.org/10.1007/s10994-026-07069-z
Publication Date: 2026-05-23
Author(s): Guanghao Zhou et al.
Primary Topic: Adversarial Robustness in Machine Learning

Overview

The research addresses the vulnerabilities of large language models (LLMs) to “jailbreaking,” where attackers exploit these models to elicit unintended behaviors. Current methods primarily focus on discrete prompt manipulations for closed-source LLMs, but as open-source LLMs become more capable, their potential for exploitation increases due to accessible model parameters and gradient information. To tackle this issue, the authors introduce the Context-Coherent Jailbreak Attack (CCJA), framing jailbreak attacks as an optimization problem within the embedding space of masked language models (MLMs). Their approach utilizes combinatorial optimization to enhance both the success rate of attacks and the semantic coherence of the generated prompts.

The findings demonstrate that CCJA not only maintains semantic consistency but also outperforms existing state-of-the-art methods in terms of attack effectiveness. Furthermore, when CCJA-generated prompts are integrated into traditional black-box attack methodologies, there is a marked improvement in success rates against closed-source commercial LLMs. This research underscores the growing safety concerns associated with open-source LLMs and the significant security threats they pose to commercial counterparts, advocating for increased awareness of these vulnerabilities. The authors plan to release their code upon acceptance of the paper.

Introduction

The introduction of this research paper discusses the transformative impact of large language models (LLMs), both commercial and open-source, on various application domains. It highlights the ongoing efforts to align LLMs with human values and the critical need for safety measures, particularly as the performance gap between open-source and closed-source models narrows. The paper emphasizes the heightened risks associated with open-source LLMs, where attackers can access not only outputs but also model weights and gradients, potentially facilitating malicious exploitation.

The authors categorize jailbreak attacks into two types: prompt-level attacks, which rely on crafted instructions to elicit unsafe content, and token-level attacks, which optimize for effective prompts to achieve similar outcomes. They propose a novel jailbreak attack method specifically for open-source LLMs that minimizes computational costs while enhancing attack success rates. By utilizing a seed prompt to generate a coherent instruction-following prefix and framing the attack as an optimization process in the continuous word embedding space, the method demonstrates improved semantic fluency and effectiveness in black-box scenarios. The paper concludes with the assertion that their approach not only reveals vulnerabilities in open-source LLMs but also poses security threats to closed-source models, supported by experimental results showcasing superior performance compared to existing methods.

Methods

In this section, the authors outline their methodology for validating a jailbreak attack against several baseline methods, including GCG, AutoDAN, BEAST, and COLD-Attack. Each baseline employs distinct strategies for generating jailbreak prompts, such as gradient search, genetic algorithms, and energy-based constrained decoding. The authors ensured a fair comparison by adapting COLD-Attack to be compatible with the chat format of the large language models (LLMs) during optimization. Detailed experimental settings are provided in Appendix B.5.

The experimental results, summarized in Table 1, reveal that the authors’ method consistently achieves the highest or second-highest attack success rates (ASR) across various LLMs, indicating the effectiveness of their optimization approach. Notably, while AutoDAN performs well, its reliance on a complex genetic algorithm and third-party LLMs increases implementation difficulty. The authors also explore enhancing black-box attack methods by generating multi-LLM jailbreak prompts that target various models, including Mistral-7B-Instruct-v0.3 and Vicuna-7B-v1.5. By integrating these prompts into existing black-box methods, they demonstrate improved attack success rates, underscoring the potential threat posed by open-source models to closed-source LLMs. Future work will further investigate the implications of narrowing performance gaps between these model types.

Discussion

In this section, the authors discuss various jailbreak attack methodologies targeting large language models (LLMs), categorizing them into black-box and white-box attacks. Black-box attacks, as highlighted by Shen et al. (2023) and others, rely on crafting complex prompts without access to internal model parameters, often employing social engineering techniques to manipulate LLM responses. Conversely, white-box attacks, such as those by Zou et al. (2023) and Zhu et al. (2023), utilize direct access to model internals to optimize prompts at the token level, albeit often at the cost of semantic readability. The authors propose a novel method that enhances the success rate of jailbreak attacks while maintaining semantic coherence, distinguishing it from existing techniques that either rely heavily on manual prompt crafting or produce less readable outputs.

The proposed method formulates the jailbreak task as an optimization problem within the continuous embedding space of a masked language model (MLM). By leveraging a Gumbel-softmax sampling mechanism and a mapping matrix to connect token IDs between the MLM and the target LLM, the authors aim to generate effective jailbreak prompts that elicit affirmative responses to harmful queries. The optimization process balances the need for successful jailbreak execution with the preservation of semantic integrity, as indicated by the dual loss function that incorporates both jailbreak performance and prompt readability. Experimental results demonstrate that the proposed approach not only achieves higher attack success rates compared to existing methods but also maintains a strong semantic relationship between the initial and optimized prompts, thereby enhancing the overall effectiveness of the jailbreak strategy.

Limitations

The limitations of the jailbreak attack algorithm for open-source models are primarily related to its evaluation and applicability. The experiments were conducted exclusively on the AdvBench dataset to maintain consistency with existing baselines, which may not fully capture the evolving complexity of harmful instructions in large language models (LLMs). The method is specifically designed for open-source models and may not be effective in black-box scenarios. Additionally, while the algorithm can manipulate models like LLaMA 2 and LLaMA 3 by appending affirmative responses to generate unsafe content, future research will focus on developing jailbreak instructions based on conversational templates and adapting them for black-box attacks.

Ethically, the research aims to highlight the safety risks associated with open-source models and the urgent need for safety measures. While the attack method does lead to the generation of harmful content, it does not exacerbate the inherent risks of the AdvBench dataset, which has been extensively studied. The authors intend to further investigate the safety of LLMs and explore potential defense mechanisms against jailbreak attacks in future work.