一句话:提出基于莱维飞行自适应粒子群优化与文本特征的对抗测试样例生成方法,高效测试 NLP 软件。
针对现有 NLP 软件对抗测试方法错误发现能力弱(如 BERT 软件成功率仅 0%–24.6%)且耗时高(单例 177.8–205.28 秒)的问题,本文提出自动化测试方法 LEAP。它采用莱维飞行初始化种群以提升测试样例多样性,设计惯性权重自适应更新算子以改进高维文本的全局优化效率,并引入基于贪心策略的变异算子缩短搜索时间。实验表明,LEAP 生成对抗测试样例的平均成功率达 79.1%,比次优方法 PSOattack 高 6.1%;在保持高成功率的同时,相比其他启发式方法最多减少 147.6 秒时间开销,还能生成更具迁移性的测试样例,显著提升 DNN 系统的鲁棒性。
The widespread adoption of DNNs in NLP software has highlighted the need for robustness. Researchers proposed various automatic testing techniques for adversarial test cases. However, existing methods suffer from two limitations: weak error-discovering capabilities, with success rates ranging from 0% to 24.6% for BERT-based NLP software, and time inefficiency, taking 177.8s to 205.28s per test case, making them challenging for time-constrained scenarios. To address these issues, this paper proposes LEAP, an automated test method that uses LEvy flight-based Adaptive Particle swarm optimization integrated with textual features to generate adversarial test cases. Specifically, we adopt Levy flight for population initialization to increase the diversity of generated test cases. We also design an inertial weight adaptive update operator to improve the efficiency of LEAP's global optimization of high-dimensional text examples and a mutation operator based on the greedy strategy to reduce the search time. We conducted a series of experiments to validate LEAP's ability to test NLP software and found that the average success rate of LEAP in generating adversarial test cases is 79.1%, which is 6.1% higher than the next best approach (PSOattack). While ensuring high success rates, LEAP significantly reduces time overhead by up to 147.6s compared to other heuristic-based methods. Additionally, the experimental results demonstrate that LEAP can generate more transferable test cases and significantly enhance the robustness of DNN-based systems.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2308-11284,
title = {LEAP: Efficient and Automated Test Method for NLP Software},
author = {Mingxuan Xiao and Yan Xiao and Hai Dong and Shunhui Ji and Pengcheng Zhang},
booktitle = {ASE},
year = {2023},
doi = {10.1109/ase56229.2023.00052}
}