<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Adversarial Training on Word-Char Embedding</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Abebaw Tadesse</string-name>
          <email>abebaw@langston.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Joseph B. Collinsy</string-name>
          <email>joseph.collins@nrl.navy.mil</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>A. Tadesse is with the Mathematics Dept., Langston University</institution>
          ,
          <addr-line>Langston, Oklahoma</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this work we propose a robust adversarial training model on hybrid word-char embeddings as developed in (Rei, Crichton, and Pyysalo 2016) based on the recent works of (Miyato, Dai, and Goodfellow 2016). The proposed neural training model addresses the existing critical issues with word-only embeddings which includes: poor vector representation for rare words and no representation for unseen words and the lack of proper mechanism to incorporate morphene-level informations that are not shared with the whole dictionary which, subsequently, leads to poor quality embeddings and hence low quality examples/adversarial examples. We present description of the proposed adversarial training model/architecture and addresses the implementation aspects at the word-char level. Our preliminary result on sequence labeling task on the First Certificate in English (FCE-PUBLIC) dataset (Yannakoudakis, Briscoe, and Medlock 2011) shows an improvement in accuracy of adversarial (regularized) training on word-char embedding over the baseline word-char embedding as well as on individual word/charonly and concatenated embeddings, as expected. The preliminary results also show that perturbation at word-char level yields better accuracy as compared to individual word-only and char-only perturbations.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        In this article we investigate the impact of adversarial
training
        <xref ref-type="bibr" rid="ref4 ref6">(Miyato, Dai, and Goodfellow 2016)</xref>
        on hybrid
word-char embeddings, as developed in
        <xref ref-type="bibr" rid="ref6 ref7">(Rei, Crichton, and
Pyysalo 2016)</xref>
        , on performance of Long Short-Term
Memory (LSTM) based neural training models
        <xref ref-type="bibr" rid="ref2">(Hochreiter and
Schmidhuber 1997)</xref>
        . In
        <xref ref-type="bibr" rid="ref8">(Szegedy et al. 2013)</xref>
        and
        <xref ref-type="bibr" rid="ref1">(Goodfellow, Shlens, and Szegedy 2014)</xref>
        , it was shown that current
neural models, particularly those that are linear or semi–
linear w.r.t. the input are vulnerable to adversarial
examples which are typically generated by simple linear, but
carefully tuned perturbations of the input dataset.
Additionally, in
        <xref ref-type="bibr" rid="ref1">(Goodfellow, Shlens, and Szegedy 2014)</xref>
        , it was
demonstrated that adversarial training improves model
performance at least in image classification tasks. In
        <xref ref-type="bibr" rid="ref4 ref6">(Miyato,
Dai, and Goodfellow 2016)</xref>
        , the authors used adversarial
and virtual adversarial (semi-supervised) training to improve
a text or RNN models. Though word vector embeddings,
in general, yield high quality vector representation for
frequently seen words, they tend to produce poor quality word
vectors for less frequent words and no embedding at all
for previously unseen words (out of vocabulary
representation), and character–level information is not shared with
the whole dictionary
        <xref ref-type="bibr" rid="ref6 ref7">(Rei, Crichton, and Pyysalo 2016)</xref>
        . As
a result, most of the time the generated example either does
not change because there is no neighbor near enough, or else
the perturbed context is not adversarial enough. In this work,
we attempt to address these issues through hybrid
implantation of word–char embedding under the settings described in
        <xref ref-type="bibr" rid="ref6 ref7">(Rei, Crichton, and Pyysalo 2016)</xref>
        to develop a neural
learning scheme for the generation and exploitation of adversarial
examples in Natural Language Processing (NLP) contexts.
We implement the proposed adversarial training model on
LSTM based hybrid word-char embedding on a sequence
labeling task on the FCE–PUBLIC (First Certificate in
English) dataset
        <xref ref-type="bibr" rid="ref9">(Yannakoudakis, Briscoe, and Medlock 2011)</xref>
        .
In section 2, a brief description of our proposed adversarial
training model based on word–char embeddings followed by
preliminary experimental results and discussions in Section
3.
      </p>
      <p>Adversarial Training on the Word–Char</p>
      <p>
        Embedding Architecture
Word embeddings, in general, yield high quality
distributional vector representation for frequently seen words, with
semantically and functionally similar words having similar
representations. However, they tend to produce poor
quality word vectors for less frequent words and no
embedding at all for previously unseen words (Out of
Vocabulary words). Furthermore, there is no mechanism to exploit
character–level patterns and sentimental words that are
commonly unseen words in sentimental datasets such as
Twitter datasets 1, and no immunity to typos
        <xref ref-type="bibr" rid="ref6 ref7">(Rei, Crichton, and
Pyysalo 2016)</xref>
        . Consequently, the quality of adversarial
examples generated using word-level only embeddings will
inherit these weaknesses. In an attempt to address these
critical issues we propose adversarial training on a bi–directional
LSTM–based hybrid word-char architecture [ Rei, Crichton,
and Pyysalo2016)] as described in equation 1 below:
      </p>
      <p>
        In the word–char embedding settings
        <xref ref-type="bibr" rid="ref6 ref7">(Rei, Crichton, and
Pyysalo 2016)</xref>
        , a given word w will have dual vector
representations, namely xw and cw as modeled in word2vec and
the bidirectional char LSTM embeddings respectively. The
hybrid architecture has a gating mechanism, also referred
to as attention, which allows the model dynamically decide
which level of information to tune into for each such word
w in the dataset.
      </p>
      <p>This will be achieved through two additional layers
im1Ashby, Charless, TensorFlow tutorial-analyzing Tweet’s
sentiment with character Level LSTM’s, Deep Learning Blog,
https://charlesashby.github.io/2017/06/05/sentiment-analyssiwithchar-lstm/
plementing the weight vector
z = (Wz(3) tanh(Wz(1)xw + Wz(2)cw));
(1)
where Wz(1); Wz(2); Wz(3) respectively are weight matrices
for calculating z, and is the sigmoid function. The hybrid
embedding vector x~w (x~ in Figure 1) will then be expressed
as the z–weighted sum of xw (x in Figure 1) and cw (m in
Figure 1), given by
x~w = z
xw + (1
z) cw
(2)
(point–wise multiplication). The bidirectional LSTM
realization of the character based word embedding m (Figure 1)
is given by m = tanh(Wmh ) where h = [h!R; hL] where
the h!R and hL are the extreme left and right hidden
vectors (resp.) from each of the two LSTM components, namely
h!i = LST M (ci; hi!1) and hi = LST M (ci; hi+1), i =
1; :::length(w). Furthermore, the attention–based
architecture requires that the learned features in both word vectors
xwand cw align. This will need to be incorporated as extra
constraint on the loss function to encourage this agreement
by optimizing</p>
      <p>J~ = J +</p>
      <p>
        T
X gk(1
k=1
cos(cwk xwk ));
(3)
where J is the original embedding cost and J~ is the
modified cost function and gk is defined as gk(wk) = 0 for
wk = OOV (Out Of Vocabulary words) and gk(wk) = 1
otherwise, k = 1; ::; T (T is the size of the input
sequence (text)). Adversarial perturbation will then be
applied on x~w, as implemented in
        <xref ref-type="bibr" rid="ref6 ref7">(Rei, Crichton, and Pyysalo
2016)</xref>
        to generate its adversarial counterpart, x~awdv, given
by x~awdv = x~w + r~wadv where r~wadv = rx~w J(yjx~w; ) ,
jjrx~w J(yjx~w; )jj2
J (x~w; ) is the loss function (the negative loss likelihood
function log(p(yjx; )) for a classifier), is the
parameter of the model (which should be viewed as a constant
throughout the adversarial example generation process) and
is the perturbation parameter. This needs to be done
dynamically for each word vector x~w to generate the needed
adversarial examples. The aggregated adversarial
perturbation on the concatenated sequence s (the labeled input text)
of the (normalized) embedding vectors [x1; x2; :::; xT ] is
defined as r~sadv = rsJ(yjs; ) and it’s corresponding
adverjjrsJ(yjs; )jj2
sarial loss is defined as
      </p>
      <p>Jadv( ) =</p>
      <p>n=1
1 N</p>
      <p>X J (yn; sn + r~nadv; )</p>
      <p>N
which will ensure robustness to the specified adversarial
perturbation.</p>
      <p>
        Here N denotes the number of labeled examples,
s1; s2; :::sN are the input sequence of texts with
corresponding labels y1; y2; :::yn. For virtual adversarial training
(semisupervised training), following the formalism in
        <xref ref-type="bibr" rid="ref3">(Miyato et
al. 2015)</xref>
        , we define the virtual adversarial perturbation as
r~vadv =
      </p>
      <p>rs+dKL[p(:; s; )][p(:; s + d; )]
jjrs+dKL[p(:; s; )][p(:; s + d; )]jj2
(4)
(5)
where KL[p][q] denotes the KL divergence between
distributions p and q.</p>
      <p>The associated virtual adversarial loss will then be defined
by</p>
      <p>Jvadv( ) =
1 XN0 KL[p(:; sn; )][p(:; sn + r~nvadv; )]
(6)
where r~nvadv is the adversarial perturbation for the nth text
(unlabeled) and N 0 is the number of such unlabeled texts
(examples).</p>
      <p>
        The crucial distinction between the adversarial
(supervised) and the virtual adversarial (unsupervised) is that the
perturbation (equation 5) and the loss function (equation 6)
do not depend on the input labels which makes it applicable
to unlabeled examples. (semi-supervised adversarial
training). Furthermore, to regularize the flow of adversarial
examples we use
        <xref ref-type="bibr" rid="ref4 ref6">(Miyato, Dai, and Goodfellow 2016)</xref>
        the
regularized adversarial loss
      </p>
      <p>
        J~(x; ) = J (x; ) + (1 )J (x + r~adv; ) (7)
(where 0 1 is the regularizing parameter) which will
effectively make them resist and keep up with the current
version of the model. The main of the paper is the proposal
and preliminary testing of the adversarial training
architecture on hybrid word–char embedding based on the
existing framework (word–char embedding and adversarial
training for semi–supervised text classification) as developed in
        <xref ref-type="bibr" rid="ref6 ref7">(Rei, Crichton, and Pyysalo 2016)</xref>
        and
        <xref ref-type="bibr" rid="ref4 ref6">(Miyato, Dai, and
Goodfellow 2016)</xref>
        . In the next section, we present the
experimental settings and some preliminary results on a
neural sequence labeling task on FCE–PUBLIC dataset
        <xref ref-type="bibr" rid="ref9">(Yannakoudakis, Briscoe, and Medlock 2011)</xref>
        .
      </p>
      <p>
        Experiments on FCE–PUBLIC Dataset
The FCE–PUBLIC (for Error detection) dataset
        <xref ref-type="bibr" rid="ref9">(Yannakoudakis, Briscoe, and Medlock 2011)</xref>
        <xref ref-type="bibr" rid="ref6 ref7">(Rei and
Yannakoudakis 2016)</xref>
        consists of 1141 examination Scripts for
training, 97 examination Scripts for testing, 6 examination
scripts for outliers experiments and 80 randomly selected
scripts for developmental set. Tokens that have been
annotated with an error tag are labeled as incorrect (i), otherwise,
they are labeled as correct (c). The data is organized in a the
Conference on Natural Language Learning (CoNLL)
tabseparated format. Each line contains one token, followed
by a tab and then the error label. With CoNLL format the
dataset has 452833 train, 34599 developmental and 41477
test tokens. The total number of parameter count for the
three representation are 2972052 (Word–based), 3452052
(Char concat) and 3152352 (Char attention) of which only
a small fraction of the embeddings are utilized at every
iteration. We performed the proposed adversarial trainings
on Sequence Labeling (bidirectional LSTM) on word-char
embedding on the FCE–PUBLIC Dataset 2. The
preliminary experimental results are briefly shown in Table 1 and
2We adopted here Tensorflow implementation of
sequence labeling on FCE–PUBLIC dataset available at
https://github.com/marekrei/sequence-labeler.
This work seeks to develop improved adversarial training
model acting on word–char embeddings. It is well known
that word–only/char–only embeddings have a major
drawbacks in handling rare/unseen words and character–level
information which subsequently leads to poor representation
of valid and hence adversarial examples. The proposed
adversarial training model is intended to overcome these
challenges by applying the adversarial perturbation on word–
char embeddings. It is envisioned that the proposed model
along with adversarial regularization (i.e, fine tuning the
parameter ) will bring significant improvements over the
existing word–only/char–only adversarial training
architectures. We performed some preliminary numerical
experiments on the impact of regularized adversarial training on
word–char embedding on a neural sequence labeling task on
the FCE-PUBLIC dataset. Our preliminary result shows an
improvement in accuracy of adversarial (regularized)
training on word-char embedding over both the baseline
wordchar embedding as well as on individual word/char-only and
concatenated embeddings. These preliminary results also
show that perturbation at word-char level yields a better
accuracy as compared to individual word-only and char-only
perturbation. Further testing of the model need to be
performed on several representative neural sequence labeling
and text classification tasks and various datasets.
      </p>
    </sec>
    <sec id="sec-2">
      <title>Acknowledgment</title>
      <p>We would like to thank Dr. Prithviraj Dasgupta, Dr. Ira
S Moskowitz and Espiritu Hugo for their invaluable
comments, suggestions and technical help during the progress of
the research and the development of the paper.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Goodfellow</surname>
            ,
            <given-names>I. J.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Shlens</surname>
          </string-name>
          , J.; and
          <string-name>
            <surname>Szegedy</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>2014</year>
          .
          <article-title>Explaining and harnessing adversarial examples</article-title>
          .
          <source>arXiv preprint arXiv:1412</source>
          .
          <fpage>6572</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Hochreiter</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Schmidhuber</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <year>1997</year>
          .
          <article-title>Long short-term memory</article-title>
          .
          <source>Neural computation</source>
          <volume>9</volume>
          (
          <issue>8</issue>
          ):
          <fpage>1735</fpage>
          -
          <lpage>1780</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Miyato</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Maeda</surname>
            , S.-i.; Koyama,
            <given-names>M.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Nakae</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Ishii</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <year>2015</year>
          .
          <article-title>Distributional smoothing with virtual adversarial training</article-title>
          .
          <source>arXiv preprint arXiv:1507</source>
          .
          <fpage>00677</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Miyato</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Dai</surname>
            ,
            <given-names>A. M.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Goodfellow</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          <year>2016</year>
          .
          <article-title>Adversarial training methods for semi-supervised text classification</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <source>arXiv preprint arXiv:1605</source>
          .
          <fpage>07725</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Rei</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Yannakoudakis</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          <year>2016</year>
          .
          <article-title>Compositional sequence labeling models for error detection in learner writing</article-title>
          .
          <source>arXiv preprint arXiv:1607</source>
          .
          <fpage>06153</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Rei</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Crichton</surname>
            ,
            <given-names>G. K.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Pyysalo</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <year>2016</year>
          .
          <article-title>Attending to characters in neural sequence labeling models</article-title>
          .
          <source>arXiv preprint arXiv:1611</source>
          .
          <fpage>04361</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Szegedy</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Zaremba</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ; Sutskever,
          <string-name>
            <surname>I.</surname>
          </string-name>
          ; Bruna,
          <string-name>
            <given-names>J.</given-names>
            ;
            <surname>Erhan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ;
            <surname>Goodfellow</surname>
          </string-name>
          ,
          <string-name>
            <surname>I.;</surname>
          </string-name>
          and Fergus,
          <string-name>
            <surname>R.</surname>
          </string-name>
          <year>2013</year>
          .
          <article-title>Intriguing properties of neural networks</article-title>
          .
          <source>arXiv preprint arXiv:1312</source>
          .
          <fpage>6199</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Yannakoudakis</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ; Briscoe,
          <string-name>
            <given-names>T.</given-names>
            ; and
            <surname>Medlock</surname>
          </string-name>
          ,
          <string-name>
            <surname>B.</surname>
          </string-name>
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <article-title>A new dataset and method for automatically grading esol texts</article-title>
          .
          <source>In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies-Volume</source>
          <volume>1</volume>
          ,
          <fpage>180</fpage>
          -
          <lpage>189</lpage>
          . Association for Computational Linguistics.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>