在天然語言處理領域,對抗樣本的攻擊與防護近來受到不少研究者的關注,咱們但願構建更穩健的 NLP 模型。在本文中,咱們簡要討論了攻防的概念,並介紹了清華大學近日開源的 NLP 對抗樣本攻防必讀論文列表。git
天然語言處理方面的研究在近幾年取得了驚人的進步,深度神經網絡模型已經取代了許多傳統的方法。可是,當前提出的許多天然語言處理模型並不可以反映文本的多樣特徵。所以,許多研究者認爲應該開闢新的研究方法,特別是利用近幾年較爲流行的對抗樣本生成和防護的相關研究方法。github
使用對抗樣本生成和防護的天然語言處理研究能夠基本歸納爲如下三種:1. 用未察覺的擾動迷惑模型,並評價模型在這種狀況下的表現;2. 有意的改變深度神經網絡的輸出;3. 檢測深度神經網絡是否過於敏感或過於穩定,並尋找防護攻擊的方法。網絡
Jia 和 Liang 首先考慮在深度神經網絡中採用對抗樣本生成(或者「對抗攻擊」,二者皆可)方法完成文本處理相關任務。他們的研究在天然語言處理社區很快得到了研究方面的關注。app
然而,因爲圖片和文本數據內在的不一樣,用於圖像的對抗攻擊方法沒法直接應用與文本數據上。首先,圖像數據(例如像素值)是連續的,但文本數據是離散的。其次,僅僅對像素值進行微小的改變就能夠形成圖像數據的擾動,並且這種擾動是很難被人眼差距的。可是對於文本的對抗攻擊中,小的擾動很容易被察覺,但人類一樣能「猜出」原本表達的意義。所以 NLP 模型須要對可辨識的特徵魯棒,而不像視覺只須要對「不過重要」的特徵魯棒。ide
與圖像領域同樣,有進攻就會有防護,目前也有不少研究嘗試構建更魯棒的天然語言處理模型。例如在 CMU 的一篇對抗性拼寫錯誤論文(arXiv:1905.11268)中,研究者經過移除、添加或調序單詞內部的字符,以構建更穩健的文本分類模型。這些增減或調序都是一種擾動,就像人類也極可能出現這些筆誤同樣。經過這些擾動,模型能學會如何處理錯別字,從而不至於對分類結果產生影響。學習
除了文本分類,也有不少研究者經過對抗訓練構建更穩健的翻譯系統。清華大學劉洋老師表示,若是咱們修改原文的某個字,那麼極可能譯文就徹底變了,目前的 NMT 系統並非太穩健。ui
劉洋老師表示,目前比較多的方法是在訓練中加入噪聲而讓 NMT 模型學會抵禦隨機擾動。以下圖所示,X 是正確的輸入,會加一些噪聲以造成 X'。當咱們用神經網絡進行學習的時候,會生成兩種內部表示 H_x 和 H_x'。咱們但願這兩種內部表示對於判別器 Discriminator 是不可區分的,若是不可區分,就說明噪聲不會對預測作出更大的影響。lua
其中噪聲能夠是從真實數據獲取的人類偏差,也能夠是隨機生成的噪聲。當機器翻譯模型能抵禦這些噪聲,那麼它就很是魯棒了。spa
NLP 對抗樣本攻防戰必讀論文翻譯
雖然,天然語言領域的對抗攻防仍然有不少困難,但目前已經有一批優秀的論文。最近清華大學楊承昊、豈凡超和臧原同窗整理了一份必讀論文,其從總體的綜述論文到攻擊、防護方法介紹了該領域的前沿研究工做。以下僅展現了論文名,具體的論文地址可查看原 GitHub 項目。
項目地址:https://github.com/thunlp/TAADpapers
綜述論文
文本攻擊與防護的論文概述:
Analysis Methods in Neural Language Processing: A Survey. Yonatan Belinkov, James Glass. TACL 2019.
Towards a Robust Deep Neural Network in Text Domain A Survey. Wenqi Wang, Lina Wang, Benxiao Tang, Run Wang, Aoshuang Ye. 2019.
Adversarial Attacks on Deep Learning Models in Natural Language Processing: A Survey. Wei Emma Zhang, Quan Z. Sheng, Ahoud Alhazmi, Chenliang Li. 2019.
黑盒攻擊
PAWS: Paraphrase Adversaries from Word Scrambling. Yuan Zhang, Jason Baldridge, Luheng He. NAACL-HLT 2019.
Text Processing Like Humans Do: Visually Attacking and Shielding NLP Systems. Steffen Eger, Gözde Gül ¸Sahin, Andreas Rücklé, Ji-Ung Lee, Claudia Schulz, Mohsen Mesgar, Krishnkant Swarnkar, Edwin Simpson, Iryna Gurevych.NAACL-HLT 2019.
Adversarial Over-Sensitivity and Over-Stability Strategies for Dialogue Models. Tong Niu, Mohit Bansal. CoNLL 2018.
Generating Natural Language Adversarial Examples. Moustafa Alzantot, Yash Sharma, Ahmed Elgohary, Bo-Jhang Ho, Mani Srivastava, Kai-Wei Chang. EMNLP 2018.
Breaking NLI Systems with Sentences that Require Simple Lexical Inferences. Max Glockner, Vered Shwartz, Yoav Goldberg ACL 2018.
AdvEntuRe: Adversarial Training for Textual Entailment with Knowledge-Guided Examples. Dongyeop Kang, Tushar Khot, Ashish Sabharwal, Eduard Hovy. ACL 2018.
Semantically Equivalent Adversarial Rules for Debugging NLP Models. Marco Tulio Ribeiro, Sameer Singh, Carlos Guestrin ACL 2018.
Robust Machine Comprehension Models via Adversarial Training. Yicheng Wang, Mohit Bansal. NAACL-HLT 2018.
Adversarial Example Generation with Syntactically Controlled Paraphrase Networks. Mohit Iyyer, John Wieting, Kevin Gimpel, Luke Zettlemoyer. NAACL-HLT 2018.
Black-box Generation of Adversarial Text Sequences to Evade Deep Learning Classifiers. Ji Gao, Jack Lanchantin, Mary Lou Soffa, Yanjun Qi. IEEE SPW 2018.
Synthetic and Natural Noise Both Break Neural Machine Translation. Yonatan Belinkov, Yonatan Bisk. ICLR 2018.
Generating Natural Adversarial Examples. Zhengli Zhao, Dheeru Dua, Sameer Singh. ICLR 2018.
Adversarial Examples for Evaluating Reading Comprehension Systems. Robin Jia, and Percy Liang. EMNLP 2017.
白盒攻擊
On Adversarial Examples for Character-Level Neural Machine Translation. Javid Ebrahimi, Daniel Lowd, Dejing Dou. COLING 2018.
HotFlip: White-Box Adversarial Examples for Text Classification. Javid Ebrahimi, Anyi Rao, Daniel Lowd, Dejing Dou. ACL 2018.
Towards Crafting Text Adversarial Samples. Suranjana Samanta, Sameep Mehta. ECIR 2018.
同時探討了黑盒和白盒攻擊
TEXTBUGGER: Generating Adversarial Text Against Real-world Applications. Jinfeng Li, Shouling Ji, Tianyu Du, Bo Li, Ting Wang. NDSS 2019.
Comparing Attention-based Convolutional and Recurrent Neural Networks: Success and Limitations in Machine Reading Comprehension. Matthias Blohm, Glorianna Jagfeld, Ekta Sood, Xiang Yu, Ngoc Thang Vu. CoNLL 2018.
Deep Text Classification Can be Fooled. Bin Liang, Hongcheng Li, Miaoqiang Su, Pan Bian, Xirong Li, Wenchang Shi.IJCAI 2018.
對抗防護
Combating Adversarial Misspellings with Robust Word Recognition. Danish Pruthi, Bhuwan Dhingra, Zachary C. Lipton. ACL 2019.
評估
對文本攻擊和防護研究提出新的評價方法:
On Evaluation of Adversarial Perturbations for Sequence-to-Sequence Models. Paul Michel, Xian Li, Graham Neubig, Juan Miguel Pino. NAACL-HLT 2019