ARTICLE

Volume 3,Issue 7

Cite this article
19
Citations
97
Views
28 May 2025

基于BERT-CNN-LSTM 的大语言模型提示词安全分类方法研究

强 李1,2 文君 顾1,2 昱昊 吴2 杨凡 卢2
Show Less
1 嘉兴市工业智能与数字孪生重点实验室, 中国
2 嘉兴职业技术学院, 中国
TACS 2025 , 2(10), 8–10; https://doi.org/10.61369/TACS.2025100014
© 2025 by the authors. Licensee Art and Technology, USA. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution -Noncommercial 4.0 International License (CC BY-NC 4.0) ( https://creativecommons.org/licenses/by-nc/4.0/ )
Keywords
大模型安全
多模型融合
提示词工程
风险治理

大语言模型在开放场景使用中会面临多方面的安全风险,本研究结合BERT 的语义表示能力和CNN-LSTM 提取序列特征的优势设计出一种双流神经网络分类框架。通过系统化提示词工程构建包含6类安全风险(诱导性问题、恶意问题、不确定性问题、对抗攻击问题、隐私性问题和正常问题)的中文基准数据集,用分层参数微调方法优化模型。实验表明,模型在4800多条样本的基准测试中平均F1值达到0.972,在160条样本的独立测试集上准确率达98.5%,比单一BERT 模型提高了3.3 个百分点。

References

[1] 姜毅, 杨勇, 印佳丽等. 大语言模型安全与隐私风险综述[J]. 计算机研究与发展,2025,62(8):1979-2018.
[2] Tao C, Shen T, Gao S, et al., LLMs are Also Effective Embedding Models: An In - depth Overview[J]. arXiv preprint arXiv:2412.12591, 2024.
[3] 赵鸿山, 范贵生, 虞慧群. 基于归一化文档频率的文本分类特征选择方法[J]. 华东理工大学学报( 自然科学版),2019,45(5):809-814.
[4] FU X, WEI Y, XU F, et al. Semi-supervised aspect-level sentiment classification model based on variational autoen coder[J]. Knowledge-Based Systems, 2019, 171:
81-92.
[5] 李明, 刘磊, 王宏志.CBLGA 和CBLCA 混合模型用于长文本和短文本的分类[J]. 吉林大学学报( 信息科学版),2021,39(3):285-292.
[6] VASWANI A, SHAZEER N, PARMAR N, et al. Attention is all you need[C]//Neural Information Processing Systems(NIPS). USA: MIT Press, 2017: 6000-6010.
[7] Adhikari A, Ram A, Tang R, et al., DocBERT: BERT for Document Classification[J]. arXiv preprint arXiv:1904.08398, 2019.
[8] Minaee S, Kalchbrenner N, Cambria E, et al., Deep learning based text classification: A comprehensive review [J]. ACM Computing Surveys,2021,54 (3):62.
[9] Iz Beltagy, Matthew E. Peters, Arman Cohan. Longformer: The Long-Document Transformer[J]. Transactions of the Association for Computational Linguistics, 2020, 8:
171-185.
[10] R Pappagari, P Zelasko, J Villalba, et al., "Hierarchical transformers for long document classification," in 2019 IEEE Automatic Speech Recognition and Understanding
Workshop (ASRU), Singapore: IEEE, 2019, pp. 814-821.
[11]S Khandve, V Wagh, A Wani, et al., "Hierarchical neural network approaches for long document classification," in Proc. 14th Int. Conf. Mach. Learn. Comput.,
Guangzhou, China: ACM, 2022, pp. 52-59, DOI: 10.1145/3529836.3529901.

Share
Back to top