CoCoTen: Detecting Adversarial Inputs to Large Language Models through Latent Space Features of Contextual Co-occurrence Tensors
2508.02997v2
cs.CL
2025-08-09
Авторы:
Sri Durga Sai Sowmya Kadali, Evangelos E. Papalexakis
Резюме на русском
Большинство современных приложений, использующих большие языковые модели (LLMs), сталкиваются с риском атак типа "адверсарь", при которой модель выдает вредоносные ответы. Этот риск усиливается сложностью и непрозрачностью этих моделей. Для обеспечения безопасного идеального использования LLMs необходимо развитие эффективных методов обнаружения таких атак. Мы предлагаем CoCoTen, новую модель, основанную на контекстной матрице согласованности и ее тензорных особенностей в латентном пространстве. Метод эффективен даже при ограниченном количестве меток, так как обнаруживает паттерны в данных без многочисленных примеров. Наши эксперименты показали, что CoCoTen достигает высокого F1-меры 0,83 при использовании только 0,5% меток, что значительно превосходит базовые модели. Кроме того, наше решение работает значительно быстрее, скоростью от 2,3 до 128,4 раз выше, чем основные модели. Мы опубликовали наш код для поддержки дальнейших исследований.
Abstract
The widespread use of Large Language Models (LLMs) in many applications marks
a significant advance in research and practice. However, their complexity and
hard-to-understand nature make them vulnerable to attacks, especially
jailbreaks designed to produce harmful responses. To counter these threats,
developing strong detection methods is essential for the safe and reliable use
of LLMs. This paper studies this detection problem using the Contextual
Co-occurrence Matrix, a structure recognized for its efficacy in data-scarce
environments. We propose a novel method leveraging the latent space
characteristics of Contextual Co-occurrence Matrices and Tensors for the
effective identification of adversarial and jailbreak prompts. Our evaluations
show that this approach achieves a notable F1 score of 0.83 using only 0.5% of
labeled prompts, which is a 96.6% improvement over baselines. This result
highlights the strength of our learned patterns, especially when labeled data
is scarce. Our method is also significantly faster, speedup ranging from 2.3 to
128.4 times compared to the baseline models. To support future research and
reproducibility, we have made our implementation publicly available.
Ссылки и действия
Дополнительные ресурсы: