I AE S In t er na t io na l J o urna l o f   Art if icia l In t ellig ence   ( I J - AI )   Vo l.  1 5 ,   No .   1 ,   Feb r u ar y   2 0 2 6 ,   p p .   941 ~ 952   I SS N:  2 2 5 2 - 8 9 3 8 ,   DOI : 1 0 . 1 1 5 9 1 /ijai.v 15 .i 1 . p p 9 4 1 - 9 5 2        941     J o ur na l ho m ep a g e h ttp : //ij a i . ia esco r e. co m   Adv ersa ria l ex a m ples in A ra bic lan g ua g e       Sa f a L a a t y a o ui,  M o ha mm e d Sa ber   S martI C La b o r a t o r y ,   EN S A O ,   M o h a mm e d   F i r s t   U n i v e r s i t y ,   O u j d a ,   M o r o c c o       Art icle  I nfo     AB S T RAC T   A r ticle  his to r y:   R ec eiv ed   J u n   1 6 ,   2 0 2 4   R ev is ed   No v   1 4 ,   2 0 2 5   Acc ep ted   J an   1 0 ,   2 0 2 6       Ad v e rsa rial  a tt a c k h a v e   a   g re a t   p o p u larit y   in   th e   a rti ficia l   in tell ig e n c e   (AI)  d o m a in .   In   th e   n a tu ra l   lan g u a g e   p ro c e ss in g   (NLP field ,   v a ri o u t e c h n iq u e s   h a v e   b e e n   u se d   t o   e v a lu a te t h e   v u ln e ra b il it y   o f   d e e p   lea rn in g   (DL)  m o d e ls.  It   is   o b se rv e d   t h a w h il e   m o st  st u d ies   f o c u se d   o n   g e n e ra ti n g   a d v e rsa rial  e x a m p les   in   En g li s h   lan g u a g e ,   Ar a b ic  a d v e rsa rial  a tt a c k h a v e   re c e iv e d   li tt le   a tt e n ti o n .   T h is  p a p e p re se n t s   a   two - ste p   m e th o d   to   c re a te  a d v e rsa rial  e x a m p les   in   Ara b ic  lan g u a g e fir st,  th e   m o st  imp o rtan wo r d a re   id e n ti fie d .   Th e n ,   t h e   p ro p o se d   tra n sfo rm a ti o n   a lg o rit h m   is  a p p li e d .   On ly   s m a ll   a n d   imp e rc e p ti b le  m a n ip u lati o n b a se d   o n   c o m m o n   m istak e in   Ara b ic  writi n g   m islea d   th e   p o p u lar   p re - trai n e d   lan g u a g e   m o d e (P LM )   b i d irec ti o n a e n c o d e r   re p re se n tatio n fr o m   tran sf o rm e rs  (BERT re train e d   o n   t h e   b o o k   re v iew in   Ara b ic  d a tas e t   (BRAD o n   th e   se n ti m e n a n a ly sis  (S A)  tas k   a n d   d e c re a s e   it s   p e rfo rm a n c e th e   c las sifica ti o n   a c c u ra c y   wa re d u c e d   b y   a n   a v e ra g e   o f   3 . 4 4 % .   T h is  d r o p   in   a c c u ra c y   sh o ws   t h a t h e   m o d e l   wa su c c e ss fu ll y   a tt a c k e d .   K ey w o r d s :   Ad v er s ar ial  attac k   B E R T   L o w - r eso u r ce   la n g u a g e   Natu r al  lan g u ag e   p r o ce s s in g   Pre - tr ain ed   lan g u ag m o d el   Sen tim en t a n aly s is   T h is i a n   o p e n   a c c e ss   a rticle   u n d e r th e   CC B Y - SA   li c e n se .     C o r r e s p o nd ing   A uth o r :   Saf ae   L aa ty ao u i   Sm ar tI C T   L ab o r ato r y ,   E NSAO,   Mo h am m ed   First Un iv er s ity   Ou jd 6 0   0 0 0 ,   Mo r o cc o   E m ail:  s . laaty ao u i@ u m p . ac . m a       1.   I NT RO D UCT I O   Dee p   lear n in g   ( DL )   m o d els  ar v u ln er ab le  to   ad v er s ar ial  ex am p les p er tu r b e d   in p u ts   th a m ay   b im p er ce p tib le  t o   th e   h u m an   ey co u ld   f o r ce   t h s y s tem   to   p r o d u ce   in co r r ec o u tp u ts   [ 1 ] [ 3 ] .   Mo s t o f   t h ea r l y   s tu d ies  f o cu s   o n   im ag in p u t s   [ 4 ] [ 7 ] .   As  n atu r al  lan g u ag p r o ce s s in g   ( NL P )   h as  ad v an ce d   s ig n if ican tly ,   s tu d ies ar also   f o cu s ed   o n   ev alu atin g   th r o b u s tn ess   o f   NL P m o d els u s in g   ad v e r s ar ial  attac k s   [ 8 ] [ 1 2 ] .   Mo s wo r k s   in   th e   NL f ield   f o cu s   o n   co n s tr u ctin g   ad v e r s ar ial  ex am p les  in   E n g lis h .   T ex t Gu is [ 1 3 ]   is   an   ad a p tiv b lack   b o x   ( B B )   m eth o d   th at   u s es  p er tu r b atio n s   at  b o th   wo r d   an d   s en t en ce   g r an u lar ity   to   p r eser v s em an tics   an d   f o o class if ier s .   Dee p W o r d B u g   [ 1 4 ]   d ef in es  s co r in g   s tr ateg ies  to   id en tify   th to k en s   th at,   if   m o d if ied ,   will  ch a n g t h p r e d ictio n   o f   th class if ier   i n   B B   s ettin g s .   Qi  et  a l.   [ 1 5 ]   p r o p o s es  g r a d ien t - g u id ed ,   wo r d - lev el   m eth o d   f o r   g en er atin g   a d v er s ar ial  e x am p les  th at  f o o l   tex class if icatio n   m o d els.  T o   ev alu ate  an   ex tr em m u ltil ab e tex class if icatio n   ( XM T C )   s y s tem ,   Qar ae an d   B ab b ar   [ 1 6 ]   g en e r ates  wo r d - lev el  ad v e r s ar ial  ex am p les  b y   m ask in g   a   wo r d   a n d   t h en   r ep l ac in g   it  with   a   tr an s f o r m er - p r ed icted   alter n ativ e.   W an g   et  a l.  [ 1 7 ]   p r o p o s es  wo r d - lev el  attac k   th at  em p lo y s   p ar allel  p ar ticle  s war m   o p tim izatio n   ( PS O)   alg o r ith m   to   cr af a d v er s ar ial   tex ex am p les.  T h m eth o d   [ 1 8 ]   i n tr o d u ce s   B B   attac k   o n   n e u r al  r a n k in g   m o d els.  I t   u s es  s u r r o g ate   m o d el  an d   p er f o r m s   wo r d - s u b s t itu tio n   p e r tu r b atio n s   to   p r o m o te  th r a n k in g   o f   a   tar g et  d o cu m e n t.  Kh an   et  a l.  [ 1 9 ]   p r o p o s ch ar ac ter - lev el  attac k   th at  g en er ates  ad v er s ar i al  tex g u id ed   b y   a   b ea m - s ea r ch .   I t su cc ess f u lly   f o o ls   tex t c lass if ier s   o n   s o cial  m ed ia  s ty le  tex ts .   Fu r s o v   et  a l.   [ 2 0 ]   p r o p o s es a   B B   s en ten ce - lev el  attac k   f in e - tu n in g   p r e - tr ai n ed   lan g u ag m o d el  ( PLM )   to   g e n er ate  ad v er s ar ial  ex am p les So m s tu d ies  ex am in ed   ad v er s ar ial  ex am p les  g en e r atio n   in   h ig h - r eso u r ce   lan g u ag es   ( HR L )   o th er   th an   Evaluation Warning : The document was created with Spire.PDF for Python.
                   I SS N :   2252 - 8 9 3 8   I n t J Ar tif   I n tell Vo l.  1 5 ,   No .   1 ,   Feb r u ar y   2 0 2 6 :   941 - 9 5 2   942   E n g lis h   s u ch   as  C h in ese  [ 2 1 ] [ 2 3 ] ,   R u s s ian   [ 2 4 ] ,   an d   J ap a n ese  [ 2 5 ] o th er s   p r o p o s atta ck s   in   lo w - r eso u r ce   lan g u ag es  ( L R L )   lik B asq u l an g u ag e   [ 2 6 ] .   I n   Ar ab ic  lan g u ag e,   o n o f   th L R L s ,   o n ly   f ew  wo r k s   h av ex am in e d   ad v e r s ar ial  ex am p les T h er ef o r e,   th is   s tu d y   aim s   to   in v esti g ate  th ad v er s ar ial  r o b u s tn ess   o f   PLM   m o d el  u s ed   f o r   b in ar y   s en tim en t   an aly s is   ( SA )   task .   ch ar ac te r - lev el  m eth o d   is   p r o p o s ed   to   g en er ate  Ar ab ic   ad v e r s ar ial  ex am p les  th at  f o o le d   b id ir ec tio n al   en co d er   r ep r es en tatio n s   f r o m   tr an s f o r m er s   ( B E R T )   [ 2 7 ]   m o d el  t r ain ed   o n   th b o o k   r ev iews  in   Ar ab ic  d ataset  ( B R AD )   [ 2 8 ] .   T h p r o p o s ed   attac k   d ec r ea s e d   th class if icatio n   ac cu r ac y   o f   th SA  class if ier   b y   an   av e r ag o f   3 . 4 4 %.  Ou r   m eth o d   u s es,  o n   th o n h an d ,   th co m b in ed   s co r f u n ctio n   ( C SF )   [ 1 4 ]   to   id en tify   th m o s in f lu en tial   to k en s   in   th in p u tex t.  T h s ec o n d   s tep   is   to   m o d if y   th ese  wo r d s   wh ile  p r eser v in g   th eir   s im ilar ity   to   th o r ig in al  o n es  co n s id er in g   th p ar ticu lar ity   o f   t h Ar ab ic  lan g u a g e.   O u r   ad v er s ar ial  ex am p les  ca n   b b u ilt  in   B B   s ettin g s   with o u k n o wled g o f   th e   in n e r   c o n f ig u r atio n   o f   th e   m o d el.   Ad d itio n ally ,   it  is   s im p le,   h ar d ly   n o ticea b le,   an d   r e q u ir es  m in o r   tr a n s f o r m atio n s .   Fu r th e r m o r e,   to   th e   b est  o f   o u r   k n o wled g e ,   o u r   s tu d y   is   t h f ir s to   ev alu ate  th a d v er s ar ial  r o b u s tn es s   o f   PLM   m o d el  f o r   th e   SA  task ,   u s in g   ch ar ac ter - lev el  attac k ,   co m p ar ed   to   p r io r   r esear c h   th a t e x am in ed   a d v er s ar ial  ex am p l es  in   Ar ab ic.   T h e   r em ai n d e r   o f   t h e   p ap er   i s   o r g an ize d   as   f o ll o ws :   s e cti o n   2   p r o v id es   a   r e v i ew   o f   r e la ted   wo r k s .   Secti o n   3   p r es en ts   o u r   m et h o d   t o   g e n e r at e   a d v e r s a r i al   e x a m p les   an d   g i v es   i n f o r m a ti o n   ab o u t   o u r   e x p e r i m e n t .   Secti o n   4   d is c u s s es  o u r   r es u lts   a n d   p r ese n ts   s o m e   g e n er ate d   a d v er s ar ial   e x a m p les .   I t   als o   c o n tai n s   co m p le m e n t ar y   a n a ly s es,   n a m ely   co m p o n en t - w is e   a n a ly s is ,   ab l ati o n   s t u d y ,   co m p a r is o n   w i th   b ase li n e   m et h o d ,   co m p a r is o n   wi th   e x is ti n g   A r a b ic   att ac k ,   a n d   tr a n s f er a b ili ty   a n aly s is .   Fi n a ll y ,   s e cti o n   5   p r o v i d es   c o n cl u s i o n .       2.   RE L AT E WO RK   T h is   s ec tio n   p r esen t stu d ies   th at  in v esti g ate  ad v er s ar ial  attac k s   in   th Ar ab ic  L an g u ag e.   T h ese  wo r k s   co n d u ct   attac k s   em p l o y in g   d i f f er en a p p r o ac h es  a n d   e x am i n in g   v ar io u s   co n tex ts .   T h en ,   T ab le  1   s y n th esizes  th ese  s tu d ies b ased   o n   th y ea r   o f   p u b licatio n ,   th NL P task ,   th f o o le d   m o d el,   an d   th atta ck   g r an u lar ity .   Als h em ali  an d   Kalita  [ 2 9 ]   v i o lated   th n o u n - ad jectiv a g r ee m en to   g en e r ate  ad v e r s ar ial  ex am p les b id ir ec tio n al  lo n g   s h o r t - ter m   m em o r y   ( B iLST M)   m o d el  [ 3 0 ]   a n d   c o n v o lu tio n al  n e u r al  n etwo r k   ( C NN)   m o d el  [ 3 1 ]   is   s u cc ess f u lly   f o o led .   As a  r esu lt,  th eir   p er f o r m a n ce s   o n   th SA ta s k   d eter io r at e.     Alb ilali  et  a l.  [ 3 2 ]   ch an g r an d o m ly   th wo r d s   o r d e r s   in   th in p u t.  T h e y   g en e r ate  ad v er s ar ial   ex am p les  i n   th is   m an n er   to   p r o b Ar ab ic  b id ir ec tio n al  en co d er   r ep r esen tatio n s   f r o m   tr an s f o r m er s   ( Ar aBER T )   [ 3 3 ] ,   an   Ar a b ic  PLM   b ased   o n   B E R T .   C o n s eq u e n tly ,   t h p er f o r m a n ce s   o f   th m o d el  d ec r ea s ed   in   th e   m ac h in r ea d i n g   co m p r e h en s io n   ( MRC )   task .   Acc o r d in g   to   Als h em ali  an d   Kalita  [ 3 4 ] ,   b ased   o n   v is u al  s im ilar ity   b etwe en   s o m e   Ar ab ic   letter s ,   an   alg o r ith m   to   g e n er ate  ch ar ac ter - lev el  ad v er s ar ial  ex am p le s   was  s u g g ested .   I h as  s u cc ess f u lly   f o o led   a   B iLST m o d el  an d   C NN  m o d el  f o r   th SA  task .   B E R T   an d   XL Net  [ 3 5 ]   m o d els  wer a ls o   in v esti g ated   f o r   th task   o f   n ews c ateg o r izatio n   ( NC ) .   A l s h al a n   a n d   R e k a b d a r   [ 3 6 ]   s u g g e s t s   t w o   w o r d - l e v e l   ap p r o a c h e s   t o   t r i c k   t h A r aB E R T   a n d   c o m p r e h e n s i v e ,   A r a b i c ,   m u lt i - d i a l ec t ,   e x t e n s i v e ,   l e a r n i n g   b i d i r e c t i o n a l   e n c o d e r   r e p r e s e n t a ti o n s   f r o m   t r a n s f o r m e r s   ( C A M e L B E R T )   m o d e l s   [ 3 7 ] .   T h e y   s u b s t i t u t e   th e   w o r d s   o n c e   a t   r a n d o m   a n d   a g a i n   b a s e d   o n   t h e i r   w e i g h t s .   T h e r e f o r e ,   t h e   a c c u r ac y   o f   t r a n s f o r m e r - b a s e d   t e x t   cl a s s i f i e r s   h as   b e e n   r e d u c e d .   A ls h a h r a n i   e t   a l .   [ 3 8 ]   p r o p o s s y n o n y m - b ased   wo r d - lev el  attac k .   T h ey   u s B E R T   m o d el  t o   g e n er ate  a d v er s ar ia ex am p les .   T h ese  ad v er s ar ial  ex am p les  ar em p l o y ed   a g ain s t th C NN,   B iLST M ,   an d   B E R T   m o d els.   Nak h leh   et  a l.  [ 3 9 ]   ex am in e d   th ad v e r s ar ial  r o b u s tn ess   o f   t wo   Ar aBER T   m o d els  u s in g   a d v er s ar ial  ex am p les   b ased   o n   s p ellin g   er r o r s .   T h r ep lace m e n was  i n s p ir ed   b y   th at  s u g g ested   b y   th s tu d y   [ 3 4 ] .   T h e   wo r d   to   b tr an s f o r m ed   was  ch o s en   b ased   o n   th e   B E R T   s en tim en s co r e,   wh ich   ca lc u lates  th co n tr i b u tio n   o f   ea ch   wo r d   to   th p r ed ictio n .   An   in v esti g atio n   o f   th ad v er s ar ial  r o b u s tn ess   o f   a n   Ar ab ic   o f f en s iv lan g u ag e   class if ier   wa s   p er f o r m ed   in   [ 4 0 ] .   An   ex p lain a b le  ar tific ial  in tellig en ce   ( XAI )   ap p r o ac h   was  em p lo y ed   to   g en er ate  a d v er s ar ial   ex am p les .   T h e   Ar aBER T   an d   Qata r   C o m p u tin g   R esear ch   I n s titu te  Ar ab ic  an d   D ialec tal  ( QARi B )   m o d els we r f o o led   b y   th ese  ad v e r s ar ial  ex am p les.       T ab le  1 .   R elate d   wo r k   S t u d y   Y e a r   N LP t a s k     M o d e l   A t t a c k   g r a n u l a r i t y   [ 2 9 ]   2 0 1 9   SA   C N N ,   B i LST M   C h a r a c t e r - l e v e l   [ 3 2 ]   2 0 2 1   M R C   A r a B ER T   W o r d - l e v e l   [ 3 4 ]   2 0 2 1   SA   C N N ,   B i LST M   C h a r a c t e r - l e v e l   [ 3 5 ]   2 0 1 9   NC   B ER T,   X LN e t   C h a r a c t e r - l e v e l   [ 3 6 ]   2 0 2 3   Te x t   c l a ssi f i c a t i o n   A r a B ER T,   C a m e l B E R T   W o r d - l e v e l   [ 3 8 ]   2 0 2 4   SA   C N N ,   B i LST M ,   B ER T   W o r d - l e v e l   [ 3 9 ]   2 0 2 4   SA   A r a B ER T   C h a r a c t e r - l e v e l   [ 4 0 ]   2 0 2 4   Te x t   c l a ssi f i c a t i o n   A r a B ER T,   Q A R i B   W o r d - l e v e l   Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J Ar tif   I n tell     I SS N:   2252 - 8 9 3 8         A d ve r s a r ia l e xa mp les in   A r a b ic  la n g u a g e   ( S a fa La a tya o u i )   943   3.   M E T H O D   Af ter   p r esen tin g   s ev er al   p ap e r s   th at  p r o v id e   s u g g esti o n s   f o r   g e n er atin g   ad v er s ar ial  ex a m p les th is   s ec tio n   d escr ib es  th p r o p o s e d   m eth o d .   I is   two - s tep   m eth o d   to   g en er ate  ad v er s ar ial  ex am p l es  in   Ar ab ic  lan g u ag e:  f ir s t,  s co r is   ca l cu lated   f o r   ea ch   to k en   b ased   o n   its   ef f ec o n   th m o d el  p r ed ictio n ,   an d   t h s eq u en ce   to k en s   ar e   r an k ed   a cc o r d in g   to   th is   s co r e.   T h en ,   th m o s im p o r tan t o k en s   a r e   tr an s f o r m e d   wh ile   p r eser v in g   t h eir   s im ilar ity   to   t h in itial o n es.     3 . 1 .     T o k en  s co ring   a nd   ra nk ing   Fig u r 1   s u m m ar izes  th f ir s t   s tep   o f   th s u g g ested   m eth o d .   T h im p o r tan ce   o f   ea ch   to k en   in   th s eq u en ce   is   esti m ated .   T h to k en s   ar th en   r a n k ed   b ased   o n   t h eir   im p o r tan ce .             Fig u r 1 .   I ll u s tr atio n   o f   s tep   1       T o   ev alu ate  th im p o r tan ce   o f   ea ch   to k en   in   th in p u tex s eq u en ce ,   th C SF   f u n ctio n   is   u s ed   [ 1 4 ] .   E ac h   to k en s   s co r is   d eter m in ed   b y   t h is   f u n ctio n .   I t is d ef in e d   as in   ( 1 ) .      ( ) =  ( ) + ( ( )   ( 1 )     W h e r e     i s   t h e   i t h   t o k e n   o f   t h e   in p u t   t e x t   s e q u e n c e .    ( )   i s   t h e   t e m p o r a l   h e a d   s c o r e   o f   t h e   it h   t o k e n .   I t   i s   t h d i f f e r e n c e   b e t w e e n   t h e   m o d e l s   p r e d i c ti o n   s c o r e   as   i r e a d s   th e   s e q u e n c e   u p   t o   t h e   it h   t o k en ,   a n d   t h e   m o d e l s   p r e d i c t i o n   s c o r e   a s   it   r e a d s   i u p   t o   t h e   ( 1 )   t h   t o k e n .   I t   r e f l e c t s   t h e   i n f l u e n c e   o f   t h e   t o k en   o n   t h e   f i n a l   p r e d i c t i o n   w h e n   c o u p l e d   w it h   th e   t o k e n s   t h a t   p r e c e d e   i t .   F   b e in g   t h e   t a r g e t e d   m o d e l ,   TH S   i s   ca l c u l a t e d   as   i n   ( 2 ) .     ( ) = ( 1   , 2   , . . . , 1   , )     ( 1   , 2   , . . . , 1 )   ( 2 )     W h e r e     is   h y p er p ar am eter .   I n   th is   ca s e,   λ =1   is   u s ed ,   g iv i n g   th s am im p o r tan ce   to   th two   ter m s T HS   an d   T T S.   ( )   is   th tem p o r al  tail  s co r o f   th i - th   to k en .   I is   th d if f er en ce   b etwe en   two   tr ailin g   p ar ts   o f   th s eq u en ce ,   o n e   co n tain in g   th ith   t o k en   wh ile  t h o th er   d o es  n o t.  I t   r ef lects  t h in f lu e n ce   o f   th e   to k en   o n   th f in al  p r e d ictio n   wh e n   co u p led   with   to k en s   th at  f o llo wed   i t.  I t is co m p u ted   ac co r d i n g   to   ( 3 ) .     ( ) = (   , + 1   , . . . , 1   , )     (   + 1   , . . . , 1   , )     ( 3 )     As  s ee n   in   its   d ef in itio n ,   th is   s co r f u n ctio n   is   ad ap te d   to   B B   s ettin g s .   T h is   i s   b ec au s it  r elies  o n ly   o n   th p r e d ictio n   o f   th in iti al  m o d el.   On ce   th to k en s   ar s co r ed   an d   r an k ed ,   th n ex s tep ,   n am ely   th tr an s f o r m atio n ,   is   p er f o r m ed .     3 . 2 .     T o k en  t ra ns f o r m er   Ou r   tr an s f o r m atio n   is   ch ar ac te r - lev el.   I t a f f ec ts   ju s t o n ch ar ac ter   o f   th m o s t im p o r tan t w o r d s   o f   th e   in p u tex t   s eq u en ce .   Fig u r e   2   s u m m ar izes  th s ec o n d   s tep   o f   th s u g g ested   m et h o d ,   wh ic h   co n s is ts   o f   t h r ee   v ar ian ts Ar - Attack 1   as  in   Fig u r 2 ( a) ,   Ar - Attack 2   as  in   Fig u r 2 ( b ) ,   an d   Ar - Attack 5   as  in   Fig u r 2 ( c) .   T h tr an s f o r m atio n   alg o r ith m   ap p li es o n o f   th two   m o d if icatio n s   lis ted .   Evaluation Warning : The document was created with Spire.PDF for Python.
                   I SS N :   2252 - 8 9 3 8   I n t J Ar tif   I n tell Vo l.  1 5 ,   No .   1 ,   Feb r u ar y   2 0 2 6 :   941 - 9 5 2   944     ( a)     ( b )       ( c)     Fig u r 2 .   I ll u s tr atio n   o f   s tep   2   o f   ( a)   Ar - Attack 1 ,   ( b )   Ar - Attack 2 ,   an d   ( c)   Ar - Attack 5       3 . 2 . 1 .   M o difica t io n 1 :   re pla c em ent   o f   o ne  cha ra ct er   Sev er al  Ar ab ic  letter s   s o u n d   e x tr em ely   s im ilar ,   b u s o m ar mu r a q a q a   an d   o th e r s   ar m u fa kh a ma T ab le  2   p r esen ts   co m p ilati o n   o f   letter s   ca teg o r ized   as  mu r a q a q a   an d   t h eir   co r r esp o n d in g   c o u n ter p ar ts   class if ied   as  mu fa kh a ma ,   ac c o m p an ied   b y   th eir   r esp ec tiv e   in ter n atio n al   p h o n etic  alp h a b et  ( I PA)   n o tatio n s   en clo s ed   in s id p ar en th eses .   Fo r   th is   m o d if icatio n ,   th mu r a q a q a   c h ar ac ter   is   r ep lace d   with   its   co r r esp o n d in g   mu fa kh a ma   o n an d   v ice  v er s a.       T ab le  2 .   T h mu r a q a q a   letter s   an d   th c o r r esp o n d in g   mu fa k h a ma   o n es   Mu r a q a q a   c h a r a c t e r   Mu f a k h a m a   c h a r a c t e r   س   ( s)   ص   (s ʕ )   د   ( d )   ض   (d ʕ )   ت   ( t )   ط   (t ʕ )       3 . 2 . 2 .   M o difica t io n 2 :   a dd it io n o f   o ne  cha ra c t er   A lif  A lma d   is   s p ec ial  ch ar ac ter   in   Ar ab ic.   So m etim es  it  is   wr itten   with o u b ein g   r ea d ,   an d   o th e r   tim es  it  is   r ea d   with o u b ein g   wr itten .   T ab le  3   s h o ws  s o m wo r d s   th at  co n tain   A lif  A lma d   an d   h o r ea d   th em .   T h f ir s co lu m n   p r esen ts   h o to   wr ite  th em   a n d   th s ec o n d   o n e   p r esen ts   h o w   to   r ea d   th em .   Fu r th er m o r e,   its   s o u n d   is   v er y   s im ilar   to   th at  o f   th d iacr itical  m ar k   A lfa th a       T ab le  3 .   W o r d s   co n tain in g   t h e   A lif A lma d   ch ar ac ter   W o r d s   H o w   t o   r e a d   t h e m   ك لذ ك   ( Li k e   t h a t )   ك لا ذ ك     اذ ه   ( T h i s)   اذ ا ه     هذ ه   ( T h i s     f o r   t h e   f e m i n i n e )   هذ ا ه     اول م ع   ( Th e y   w o r k e d )   ولم ع   اوس ر د   ( T h e y   s t u d i e d )     وس ر د       T ab le  4   p r esen ts ,   in   th f ir s lin e,   th A lif  A lma d ‘s   I PA  n o tatio n .   I p r esen ts ,   in   th s ec o n d   lin e,   th I PA n o tatio n   o f   th d iacr itical  m ar k   A lfa th a .   Fo r   th is   s ec o n d   m o d if icatio n ,   A lif A lma d   is   p r o p o s ed   to   b a d d ed   to   th en d   o f   th e   m o d i f ied   wo r d .     Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J Ar tif   I n tell     I SS N:   2252 - 8 9 3 8         A d ve r s a r ia l e xa mp les in   A r a b ic  la n g u a g e   ( S a fa La a tya o u i )   945   T ab le  4 .   A lif A lma d   a n d   A lfa t h a s   I PA n o tatio n   C h a r a c t e r   I P A   n o t a t i o n   Al i f   A l m a d   a   Al f a t h a   a:       3 . 2 . 3 .   T ra ns f o rm a t i o a lg o ri t hm   Fo r   th to k en   th at  will  b t r a n s f o r m ed ,   th al g o r ith m   p r ese n ted   in   Fig u r 3   is   ap p lied .   I f   th to k en   th at  will  b tr an s f o r m ed   d o es  n o co n tain   an y   ch a r ac ter   f r o m   th T ar g etC h ar   lis t,  th A lif   A lma d   ch ar ac ter   is   ad d ed   at   th e n d   o f   t h wo r d .   I f   it  co n tain s   ju s o n e   ch ar ac te r   am o n g   th e   ch ar ac te r s   o n   th e   lis t,  th is   ch ar ac ter   will b r ep lace d   with   th co r r e s p o n d in g   o n as d ef in e d   in   T a b le  2 .   I f   it c o n tain s   m an y   ch a r ac ter s   f r o m   th lis t,  s in g le  ch ar ac ter   is   r an d o m ly   s elec ted   an d   r ep lace d   in   th s a m way .           Fig u r 3 .   T r an s f o r m ati o n   alg o r ith m       3 . 3 .     P r o po s ed  a dv er s a ria l a t t a ck s   T h is   wo r k   p r o p o s es  th r ee   ad v er s ar ial  attac k s Ar - Attack 1 ,   Ar - Attack 2 ,   an d   Ar - Attack 5 .   Fo r   th   Ar - Attack 1 ,   th ab o v tr an s f o r m atio n   alg o r ith m   is   ap p lied   t o   o n to k e n th m o s im p o r tan to k en   b ased   o n   th C SF .   Fo r   th Ar - Attack 2 ,   th ab o v e   tr an s f o r m atio n   al g o r ith m   is   a p p lied   t o   two   t o k en s th f ir s a n d   s ec o n d   two   m o s im p o r tan o n es.  Fo r   th Ar - Attack 5 ,   th ab o v tr a n s f o r m atio n   alg o r ith m   is   ap p lied   to   f i v to k en s th f iv m o s im p o r tan o n es.  Fro m   o n in p u te x t,  th r ee   ad v e r s ar ial  ex am p le s   ar cr ea ted .   An   ex am p le  is   s h o wn   in   T a b le  5 .       T ab le  5 .   Dif f e r en ad v er s ar ial  ex am p les g en er ate d   b ased   o n   an   in p u t te x t seq u en ce   O r i g i n a l   i n p u t   t e x t       ي ف  ةلا م ع لا   ةي ض ق ل  ض ر ع ت   هن أ  ي ن ب ج ع أ  ا م   ر ث ك أ ك ا ن ه ع ا ض و ا  ي ف  ك ش أ  ت ن ك   ا م لا ط  . ء ا ح ط ب لا     ( W h a t   I   f o u n d   i n t e r e st i n g   w a s   t h a t   h e   w a e x p o se d   t o   t h e   l a b o r   i ss u e   i n   A l b a t h a .     A s l o n g   a s I   d o u b t e d   t h e   s i t u a t i o n   t h e r e . )   Ar - A t t a c k 1   ب لا   ي ف  ةلا م ع لا   ةي ض ق ل  ض ر ع ت   هن أ  ي ن ب ج ع أ  ا م   ر ث ك أ ت   ي ف  ك ش أ  ت ن ك   ا م لا ط  . ء ا ح ك ا ن ه ع ا ض و ا   Ar - A t t a c k 2     ا م   ر ث ك أ ا ض و ا  ي ف  ك ش أ  ت ن ك   ا م لا ط  . ء ا ح ت ب لا   ي ف  ةلا م ع لا   ةي د ق ل  ض ر ع ت   هن أ  ي ن ب ج ع أ ك ا ن ه ع   Ar - A t t a c k 5   ر ث ك أ   د و ا  ي ف  ك ش أ  طن ك   ا م لا ط  . ء ا ح ت ب لا   ي ف  ةلا م ع ل ا  ةي د ق ل  ض ر ع ت   هن أ  ي ن ب ج ع أ  اا م ك ا ن ه ع ا       3 . 4 .     Sim ila ri t y   is s ue   T h d if f er en ce   b etwe e n   th o r ig in al  in p u an d   th ad v er s ar ial  in p u s h o u ld   n o b as  p er ce p tib le  as  p o s s ib le  wh ile  cr ea tin g   an   a d v er s ar ial  ex a m p le .   Fo r   th is   r ea s o n ,   th e   ap p lied   m o d if icat io n s   as  d etailed   in     s u b - s ec tio n s   3 . 2 . 1   an d   3 . 2 . 2   ar e   ca r ef u lly   ch o s en th e   o r ig in al  ch a r ac ter   a n d   th e   m o d if ied   o n e   s o u n d   r em ar k ab l y   s im ilar ,   a n d   t h ese  m o d if icatio n s   p r esen t   co m m o n   m is tak es  in   Ar ab ic  w r itin g   [ 4 1 ] .   T h is   m ak es  it   p o s s ib le  f o r   ad v er s ar ial  e x am p les to   g o   u n n o ticed   o r   f o r   th r ea d er   to   th in k   it is   s im p ly   s p ellin g   er r o r .     T o   m ea s u r h o s im ilar   th g en er ated   ad v e r s ar ial  ex am p les  ar to   th o r ig in al  in p u ts ,   th n u m b er   o f   ch an g es  m etr ic   is   u s ed .   I is   an   ed it - b ased   m ea s u r em en t,  a   way   o f   q u an tif y in g   c h an g es  f r o m   o n s tr in g   t o   an o th er   [ 8 ] .   I t e q u als 1 ,   2 ,   a n d   5   f o r   A r - attac k 1 ,   Ar - attac k 2 ,   a n d   Ar - attac k 5   r esp ec tiv ely .     3 . 5 .     E x perim ent   Ou r   ad v e r s ar ial  attac k s   wer im p lem en ted   u s in g   Py th o n   o n   Go o g le  C o lab o r ato r y .   T h e   ex p er im en t   was  ap p lied   t o   a   b in a r y   class if ier   b ased   o n   B E R T   an d   tr ai n ed   o n   th B R AD  d ataset  f o r   th e   SA  task .   T h p er f o r m an ce   was e v alu ated   u s in g   ac cu r ac y   m etr ic.   T h test in g   s tr ateg y   is   also   d escr ib ed   in   th is   s u b - s ec tio n .     Evaluation Warning : The document was created with Spire.PDF for Python.
                   I SS N :   2252 - 8 9 3 8   I n t J Ar tif   I n tell Vo l.  1 5 ,   No .   1 ,   Feb r u ar y   2 0 2 6 :   941 - 9 5 2   946   3 . 5 . 1 .   Wo rk s pa ce   a nd   lib ra ries   C o lab o r ato r y ,   o r   C o lab   f o r   s h o r t,  is   p r o d u ct  f r o m   Go o g le  R esear ch .   C o lab   allo ws  y o u   to   wr ite  an d   ex ec u te  Py th o n   co d th r o u g h   th b r o wser .   T o   b en e f it  f r o m   b etter   r eso u r ce s   th an   th o s g iv en   b y   th f r ee   v er s io n   o f   C o lab ,   th p aid   v e r s io n   C o lab   Pro   was  u s ed .   A   v ar iety   o f   Py th o n   lib r ar ies  wer u s ed Pan d as,   Nu m Py ,   Scik it - lear n ,   T e n s o r f l o w,   Ker as,  an d   tr a n s f o r m e r s .     3 . 5 . 2 .   Da t a s et   T h b alan ce d   v e r s io n   o f   B R A D   is   u s ed .   lar g tex tu al  d at aset  f o r   th SA  task   th at  co n t ain s   m o r e   th an   1 5 6 , 0 0 0   r ev iews  co llected   f r o m   th G o o d R ea d s . co m   web s ite  in   2 0 1 6 .   T h r e v iews  wer wr itten   m ain ly   in   s tan d ar d   Ar ab ic  b u also   u s in g   d ialec tal  Ar ab ic.   Fiv co lu m n s   co m p o s th is   d atas et:  u s er _ id ,   b o o k _ id ,   r ev iew,   r ev iew_ id ,   an d   r atin g .       3 . 5 . 3 .   Da t a   prepro ce s s ing   W ar in ter ested   o n ly   in   r ev i ews  an d   th ei r   co r r esp o n d in g   r atin g s .   R ev iews  in   th e   b alan c ed   v e r s io n   ar m ap p ed   to   f o u r   r atin g   v alu es:  1   o r   2   f o r   th e   n eg ati v s en tim en t   an d   4   o r   5   f o r   th p o s itiv o n e.     T o   ex p er im en t   with   b in ar y   c lass if icatio n ,   two   class es   is   cr ea ted n e g ativ class   th at  c o r r esp o n d s   t o   r atin g s   1   an d   2 ,   an d   a   p o s itiv class   t h at  co r r esp o n d s   to   r atin g s   4   a n d   5 .   T h d ata  was  s p lit  in to   s u b s ets  as  f o llo ws:   6 0 f o r   th tr ain in g   s et,   2 0 f o r   th v alid atio n   s et,   an d   2 0 f o r   th test   s et.   Du to   co m p u tatio n al   co n s tr ain ts ,   tr u n ca tio n   was  ap p lied ,   r esu ltin g   in   an   av e r ag e   in p u le n g th   o f   ap p r o x i m ately   3 3   wo r d s .   T h is   is   co m p ar ab le  t o   th at  o f   s ev er al  wid ely   u s ed   d atasets   f o r   im p le m en tin g   attac k s   ag ain s t b in a r y   SA   m o d els.     3 . 5 . 4 .   M o del   Ou r   s u g g ested   attac k s   wer ap p lied   to   class if icatio n   m o d el  f in etu n in g   B E R T ,   tr ain ed   o n   th B R A d ata s et   as d escr ib ed   in   s u b - s ec tio n s   3 . 5 . 2   an d   3 . 5 . 3   f o r   1 0   ep o ch s .   T h p r et r ain ed   m o d el  an d   to k en ize r   ar e   b er t - b ase - u n ca s ed   f o r   T e n s o r Flo w.   T h o p tim izer   is   Ad am   1 2 .   T h lear n in g   r ate  eq u als  to   5 e - 0 5 .   T h b atch   s iz is   3 2 .       3 . 5 . 5 .   P er f o r m a nce  ev a lua t io n   T o   ass ess   th ef f ec tiv en ess   o f   th ad v er s ar ial  attac k s ,   th class if icatio n   ac cu r ac y   m etr ic  was  in itially   u s ed .   I is   co m p u ted   b ef o r a n d   af ter   attac k i n g   t h m o d el  to   q u an tify   th o v er all  d eg r ad ati o n   in   class if icatio n   p er f o r m an ce .   T h class if icatio n   ac cu r ac y   is   d ef in ed   as in   ( 4 ) .       =    +   +  +  +    ( 4 )     T r u p o s itiv e s   ( T P)  an d   tr u e   n eg ativ es  ( T N)   ar e   co r r ec tly   p r ed icted   p o s itiv a n d   n eg ativ e   in p u ts ,   r esp ec tiv ely ,   wh ile  f alse  p o s itiv es  ( FP )   an d   f alse  n e g ativ es  ( FN)   ar in co r r ec p r ed ictio n s .   I n   o t h e r   wo r d s ,   ac c u r ac y   m ea s u r es th p r o p o r tio n   o f   co r r ec tly   p r ed icted   in p u ts   am o n g   all  in p u ts .   P r ec is io n ,   r ec all,   an d   F1 - s co r e   h av also   b ee n   in clu d ed ,   b e f o r an d   af ter   attac k ,   to   p r o v i d m o r d etailed   an aly s is   o f   th e   m is class if icatio n s   in tr o d u ce d   b y   th ad v er s ar ial  attac k .   T h ese  m etr ics  ar d ef in e d   as   in   ( 5 )   t o   ( 7 ) .         =     +      ( 5 )       =     +      ( 6 )     1  = 2 ×  ×    +      ( 7 )     3 . 5 . 6 .   T esting   s t ra t eg y   B y   s elec tin g   v ar io u s   in p u ts   a n d   f o llo win g   th e m   g r ad u ally ,   th p r o g r a m   was  test ed   f o r   th th r ee   s tep s .   Fo r   th s co r in g   s tep ,   b y   m ak in g   s u r th e   v ar i o u s   s co r in g   ca lcu latio n s   ar e   p er f o r m e d   co r r ec tly .   Fo r   th e   r an k in g   s tep ,   b y   e n s u r in g   th at   th tr an s f o r m atio n s   ar ap p li ed   to   th m o s im p o r tan to k e n   b ased   o n   t h C SF   f o r   Ar - Attack 1 ,   th f ir s an d   s ec o n d   two   m o s im p o r ta n to k en s   f o r   Ar - Attack 2 ,   an d   th f iv m o s im p o r tan t   o n es  f o r   A r - Attack 5 .   Fo r   th e   tr an s f o r m in g   s tep ,   b y   en s u r i n g   th at  th e   tr an s f o r m atio n   al g o r ith m   is   co r r ec tly   ap p lied   to   th e   to k en   th at  n ee d s   to   b tr an s f o r m ed .         4.   RE SU L T S AN D I SCU SS I O N   I n   th is   s ec tio n ,   s o m g en e r ated   ad v er s ar ial  ex am p les  ar f ir s p r esen ted ,   alo n g   with   d escr ip tio n   o f   h o th e   ef f ec tiv e n ess   o f   th s u g g ested   attac k s   o n   th e   m o d el   in tr o d u ce d   in   s ec tio n   3   is   ev a lu ated T h r esu lts   Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J Ar tif   I n tell     I SS N:   2252 - 8 9 3 8         A d ve r s a r ia l e xa mp les in   A r a b ic  la n g u a g e   ( S a fa La a tya o u i )   947   o f   th ex p e r im en ar th e n   s u m m ar ized ,   in clu d in g   co m p lem en tar y   a n aly s es  to   f u r th er   ex p lo r th e   ch ar ac ter is tics   an d   im p ac t o f   th attac k s .   Fin ally ,   d is cu s s io n   o f   th e   f in d i n g s   is   p r o v i d ed .     4 . 1 .     Sa m ples   o f   g ener a t ed  a dv er s a ria l e x a m ples   T ab le  6   p r esen ts   an   e x am p le  o f   th tex s eq u e n ce   o u tp u p r o d u ce d   wh en   a p p ly in g   th a d v er s ar ial   attac k   Ar - Attack 1 .   T h f ir s co lu m n   s h o ws  th o r ig i n al  in p u an d   th a d v er s ar ial  e x a m p le .   T h s ec o n d   co lu m n   s h o ws th eir   m o d el’ s   f i n al  p r ed ictio n .     T ab le  7   s h o ws  an   ex am p le   o f   th te x s eq u en ce   o u tp u p r o d u ce d   u n d er   ad v er s ar ial  a ttack     Ar - Attack 2 .   T h f ir s co lu m n   co n tain s   th o r ig in al  in p u an d   th ad v er s ar ial  ex am p le.   T h s ec o n d   co lu m n   s h o ws th eir   m o d el’ s   f in al  p r ed ictio n .   T ab le  8   illu s tr ates  an   ex am p le  o f   th tex t   s eq u en ce   o u tp u p r o d u ce d   u n d er   ad v e r s ar ial  attac k     Ar - Attack 5 .   T h f ir s co lu m n   co n tain s   th o r ig in al  in p u an d   th ad v er s ar ial  ex am p le .   T h s ec o n d   co lu m n   r ep o r ts   th eir   m o d el’ s   f in al  p r e d ictio n .       T ab le  6 .   An   a d v er s ar ial  ex a m p le  g en er ated   wh en   a p p ly in g   Ar - Attack 1   Te x t   P r e d i c t i o n   ي ن ب ج ع ت   م ل  ا ه ن ك ل  و  م و ج ن   ةث ث   ق ح ت س ت   ت ن ا ك   ا م ب ر   0   ( Ev e n   t h o u g h   i t   ma y   d e s e r v e   t h r e e   st a r s;   I   w a s n o t   A maz e d   b y   i t . )     م ل  ا ه ن ك ل  و  م و ج ن   ةث ث   ق ح ت س ت   ت ن ا ك   ا م ب ر   ج ع ت   ا   ي ن ب   1       T ab le  7 .   An   a d v er s ar ial  ex a m p le  g en er ated   wh en   a p p ly in g   Ar - Attack 2   Te x t   P r e d i c t i o n   ت ؤا س ت   د ر ج م   . ف د ه    و  ةي ا ه ن   ب   . ةر ي ح   و  ةب ر غ ب   ك ك ر ت ي   ب ا ت ك     0   ( A   b o o k   l e a v i n g   y o u   p e r p l e x e d   a n d   b a f f l e d .   W i t h   n o   e n d   o r   p u r p o se .   J u st   q u e st i o n s.)       ب   . ةر ي ح   و  ةب ر غ ب   ك ك ر ت ي   ب ا ت ك م   . ف د ه    و  ةي ا ه ن س ط  ض ر ج ت ؤا     1       T ab le  8 .   An   a d v er s ar ial  ex a m p le  g en er ated   wh en   a p p ly in g   Ar - Attack 5   Te x t   P r e d i c t i o n   ب ر ا ح   ر س ا ي   ار ك ش   . ت أر ق  ا م   لم ج أ  ن م   ت ا ق م   ةع وم ج م   1   ( A   w o n d e r f u l   c o l l e c t i o n   o f   a r t i c l e s.   T h a n k   y o u ,   Y a sser H a r e b . )       ن م   ط ا ق م   ةع وم ج م   ب ر ا ح   ر ص ا ي   اا ر ك ش   . طأر ق  اا م   لم ج أ   0       4 . 2 .     E v a lua t i o n pro ce du re   B ef o r attac k in g ,   th e   m o d el  h ad   an   ac cu r ac y   o f   7 4 . 0 8 %.  T o   ev alu ate   th im p ac o f   th e   attac k s   o n   ac cu r ac y ,   s u b s et  was  cr ea te d   f r o m   th e   test   s et .   T h is   n ew  s u b s et  co n tain s   ju s th in p u ts   th at  h av e   c o r r ec t   p r ed ictio n   wh en   test in g   th e   m o d el  b ef o r e   attac k in g .   Usi n g   th e   cr ea ted   s u b s et,   th e   th r e attac k s   d ef in e d   i n   s ec tio n   3   wer ap p lied T h en ,   th ac cu r ac y   o f   th e   m o d el  af ter   ea ch   attac k   was  ca lcu la ted .   I n p u ts   th at  ar e   in itially   m is clas s if ied   ar n o in clu d ed ,   as  th ey   co u ld   b ec o m co r r ec tly   class if ied   af ter   th attac k ,   wh ich   wo u ld   ar tific ially   in cr ea s p o s t - attac k   ac cu r ac y   a n d   c o n tr ad i ct  th o b jectiv e     4 . 3 .     E v a lua t i o n o f   t he  pro po s ed  a t t a ck s   T ab le  9   s h o ws  th ev alu atio n   o f   th e   p r o p o s ed   attac k s ,   Ar - At tack 1 ,   Ar - Attack 2 ,   a n d   Ar - Attack 5 .   T h e   f ir s co lu m n   p r esen ts   th m o d el’ s   ac cu r ac y   in   t h in itial  s ettin g s   an d   u n d er   th s p ec if ied   a ttack s .   T h s ec o n d   co lu m n   p r esen ts   d ec r ea s es  o f   th m o d el’ s   ac cu r ac y   f o r   ea ch   attac k .   T h f o llo win g   co lu m n s   r ep o r th v alu es  o f   p r ec is io n r ec all ,   an d   F1 - s c o r e,   ea ch   ac co m p an ied   b y   th e ir   r esp ec tiv v ar iatio n s   to   in d i ca te  th im p ac o f   ea ch   attac k   o n   th ese  m etr ics.       T ab le  9 .   E x p er im en t s   r esu lts     A c c u r a c y   ( %)   D e l t a   a c c u r a c y   ( %)   P r e c i s i o n   ( %)   D e l t a   p r e c i si o n   ( %)   R e c a l l   ( %)   D e l t a   r e c a l l   ( %)   F1 - sc o r e   ( %)   D e l t a   F 1 - sco r e   ( %)   I n i t i a l   s e t t i n g s   7 4 . 0 8   -   7 5 . 8 9   -   7 0 . 4 6   -   7 3 . 0 7   -   Ar - A t t a c k 1   7 1 . 8 4   2 . 2 4   7 2 . 8 6   3 . 0 3   6 9 . 4 5   1 . 0 1   7 1 . 1 1   1 . 9 6   Ar - A t t a c k 2   7 0 . 8 6   3 . 2 2   7 1 . 5 7   4 . 3 2   6 8 . 9 5   1 . 5 1   7 0 . 2 4   2 . 8 3   Ar - A t t a c k 5   6 9 . 2 3   4 . 8 5   6 9 . 6 2   6 . 2 7   6 7 . 0 8   3 . 3 8   6 8 . 3 3   4 . 7 4       Fig u r 4   s h o ws  th e   r o b u s tn ess   cu r v es  f o r   th 4 - ev alu atio n   m etr ics:   ac cu r ac y ,   p r ec is io n ,   r ec all,   an d   F1 - s co r e,   u n d er   th in itial  c o n d itio n   a n d   th th r ee   attac k   s ce n ar io s   ( 1 ,   2 ,   an d   5   ed i ts ) .   I is   clea r   th at  Evaluation Warning : The document was created with Spire.PDF for Python.
                   I SS N :   2252 - 8 9 3 8   I n t J Ar tif   I n tell Vo l.  1 5 ,   No .   1 ,   Feb r u ar y   2 0 2 6 :   941 - 9 5 2   948   ad v er s ar ial  ex am p les  ca n   b e   s u cc ess f u lly   g en er ate d   to   f o o th m o d el  b y   m o d if y i n g   o r   ad d in g   ju s o n e   ch ar ac ter   to   th m o s im p o r tan wo r d   o f   th in p u s eq u e n ce .   T h ese  g en er ated   ad v er s ar ial  ex am p les  an d   r ed u ce d   t h m o d el s   ac cu r ac y   f r o m   7 4 . 0 8   to   7 1 . 8 4 %.  W h en   th m o d if icatio n   is   ap p li ed   to   th two   m o s im p o r tan to k en s   o f   th e   in p u s eq u en ce ,   th m o d el’ s   ac cu r ac y   is   r ed u ce d   to   7 0 . 8 6 a n d   it  is   r ed u ce d   t o   6 9 . 2 3 wh en   th m o d if icatio n   af f ec ts   th f iv m o s im p o r tan to k en s .   T h m etr ic  v alu es  r ep o r ted   in   th tab le  an d   th r o b u s tn ess   cu r v es  f o r   p r ec is io n ,   r ec all ,   an d   F1 - s co r ex h ib it  p atter n s   v e r y   s im ilar   to   th o s o f   ac cu r ac y ,   s u g g esti n g   th at  th t wo   class es a r f air ly   b alan ce d   with   n o   d o m in an d is tr ib u tio n   b ias.           Fig u r 4 .   R o b u s tn ess   cu r v es: m etr ics as a   f u n ctio n   o f   n u m b er   o f   e d its       4 . 4 .     Dis cus s io n   T ab les  6   to   8   p r o v id e   ex a m p les  o f   h o in p u ts   co u ld   b m is class if ied   wh en   an   ad v er s ar ial   p er tu r b atio n   b ased   o n   au d ito r y   s im ilar ity   is   ap p lied   to   th m o s im p o r tan wo r d s .   T h ese  m in im al  ch an g es  ca n   in v o lv e   alter in g   o r   in s er tin g   ju s o n e,   two ,   o r   f iv e   ch ar ac ter s   in   s en te n ce .   As  a   r esu lt,  a   n eg ativ r ev iew  ca n   b tu r n e d   in to   f av o r ab le  o n o r   v ice  v e r s a.     T ab le  9   s h o ws  th ef f ec o f   a p p ly in g   th th r ee   ad v er s ar ial  attac k s   to   th d ec eiv ed   m o d el ac cu r ac y   d ec r ea s es  b y   2 . 2 4 f o r   Ar - A ttack 1 ,   3 . 2 2 f o r   Ar - Attack 2 ,   an d   4 . 8 5 f o r   Ar - Attack 5   with   an   av er ag o f   3 . 4 4 f o r   th th r ee   s ce n ar io s .   T h ese  r esu lts   s h o th at  B E R T   b in ar y   class if ier s   ar s en s itiv to   co m m o n   s p ellin g   m is tak es  m ad e   b y   Ar ab ic  wr iter s   wh o   m o d if y   ch a r ac ter   with   a   s im ilar   o n o r   a d d   c h ar ac ter   at  th en d   o f   th e   wo r d .   Fu r th er m o r e,   g iv en   th at  it  h as  r esu lted   in   g r ea ter   r e d u ctio n   in   ac c u r ac y ,   co m b in in g   m u ltip le  m o d if icatio n s ch an g in g   o r   ad d in g   two   o r   f iv e   t o k en s   in s tead   o f   o n e lead s   to   m o r e   ef f ec tiv e   attac k .   T h is   clea r ly   s h o ws  th in v er s r elatio n s h ip   b etwe en   th d eg r ee   o f   s im ilar ity   an d   th ef f ec tiv en ess   o f   th attac k .     4 . 5 .   Co m plem ent a r y   a na ly s i s   I n   th is   s u b s ec tio n ,   co m p lem e n tar y   an aly s es  ar p r esen ted   to   g ain   d ee p er   u n d er s tan d i n g   o f   t h b eh av io r   an d   ef f ec tiv en ess   o f   o u r   attac k .   R ep lace - o n ly   v er s u s   ad d - o n ly   s tr ateg ies  ar e   f ir s ass es s ed ,   an d   t h e   im p ac o f   C SF   to k en   s elec tio n   is   test ed   v ia   an   ab latio n T h m eth o d   is   t h en   co m p a r ed   t o   s im p le   b aselin e   an d   an   e x is tin g   Ar ab ic  attac k ,   an d   f in ally   th tr a n s f er ab ilit y   o f   th g en e r ated   ad v er s ar ial  ex am p les  is   ev alu ated .   All e x p e r im en ts   ar e   co n d u cted   u n d er   id e n tical  tech n ical  s ettin g s   to   en s u r co m p ar ab le  r esu lts .     4 . 5 . 1 .   Co m po nent - wis a na ly s is     I n   th is   s u b s ec tio n ,   t h two   at tack   co m p o n en ts   ar e   ev alu ate d   s ep ar ately .   Fo r   ea ch   s am p le,   th to p   to k en   is   s elec ted   u s in g   C SF   an d   ap p ly   s in g le  p e r tu r b atio n ,   eith er   r ep lace m en t o r   an   ad d itio n .   T h r esu ltin g   ac cu r ac y   an d   ac cu r ac y   d r o p   a r r ep o r te d   in   T ab le  1 0 .       T ab le  1 0 .   C o m p o n e n t - wis attac k   r esu lts     A c c u r a c y   ( %)   D e l t a   a c c u r a c y   ( %)   R e p l a c e   o n l y   7 2 . 9 7   1 . 1 1   A d d   o n l y   7 2 . 3 5   1 . 7 3       I is   o b s er v ed   th at  ad d - o n ly   p er f o r m s   b etter   th an   r ep lace - o n ly .   R ep lace - o n ly   o n ly   tar g ets  s m all  s et   o f   ch ar ac ter s ,   s o   if   th e   m o s t   im p o r tan to k en   d o esn co n tai n   an y   o f   th em ,   n o   ch a n g is   m ad e.   B y   ap p ly i n g   r ep lace   o r   ad d   d ep e n d in g   o n   t h to k en ,   o u r   f u ll  attac k   Ar - Attack 1   ac h iev es  b etter   o v er a ll  p er f o r m an ce   th a n   eith er   co m p o n en t a lo n e.   Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J Ar tif   I n tell     I SS N:   2252 - 8 9 3 8         A d ve r s a r ia l e xa mp les in   A r a b ic  la n g u a g e   ( S a fa La a tya o u i )   949   4 . 5 . 2 .   Abla t io s t ud y   I n   th is   s u b s ec tio n ,   th r o le  o f   th e   C SF - b ased   to k en   s ele ctio n   is   ex am in e d   b y   ch o o s i n g   to k en s   ar b itra r ily   in s tead .   T h p e r tu r b atio n   its elf   is   k ep th s am e,   s o   d if f er en ce s   in   p er f o r m a n ce   d ir ec tly   r ef lect  th im p ac o f   t h C SF .   T h ese  r esu lts   ar co m p ar e d   with   th e   o r ig in al  C SF - d r iv en   Ar Attack 1   to   s ee   h o m u ch   th e   s elec tio n   m ec h an is m   c o n tr ib u t es  to   th e   attac k s   ef f ec tiv en es s .   Acc u r ac y   af ter   attac k   a n d   th d r o p   in   ac cu r ac y   ar p r esen ted   in   T ab le  1 1 .       T ab le  1 1 .   A b latio n   s tu d y   r esu l ts     A c c u r a c y   ( %)   D e l t a   a c c u r a c y   ( %)   Ar - A t t a c k 1 - o r i g i n a l   7 1 . 8 4   2 . 2 4   Ar - A t t a c k 1 - w i t h o u t   C S F   7 2 . 8 8   1 . 2 0       W ith   C S F - b ased   s elec tio n ,   th attac k   r ed u ce s   ac c u r ac y   b y   2 . 2 4 %,  wh ile  u s in g   a   r an d o m   to k en   y iel d   o n ly   a   1 . 2 0 d r o p .   I n   o th er   wo r d s ,   th e   C SF   ac co u n ts   f o r   ab o u 4 6 o f   th e   o b s er v ed   ac c u r ac y   d e cr ea s e.   T h is   co n f ir m s   th at  tar g etin g   th m o s t im p o r tan t to k e n   s u b s tan tially   b o o s ts   th attac k s   ef f ec tiv e n ess .     4 . 5 . 3 .   Co m pa riso wit h r a nd o m   cha ra c t er   s wa   I n   th is   s u b s ec tio n ,   Ar - Attac k 2   is   co m p a r ed   with   s im p le  b aselin th at  r an d o m ly   s wap s   two   ch ar ac ter s   with in   r an d o m l y   s elec ted   wo r d .   B o th   attac k s   ap p ly   th s am n u m b er   o f   ed its ,   m ak in g   th co m p ar is o n   m ea n in g f u l.  Acc u r ac y   af ter   attac k   an d   t h d r o p   i n   ac cu r ac y   ar s h o wn   in   T ab le   1 2 .       T ab le  1 2 .   C o m p ar ativ r esu lts   with   r an d o m   ch ar ac ter   s wap     A c c u r a c y   ( %)   D e l t a   a c c u r a c y   ( %)   Ar - A t t a c k 2   7 0 . 8 6   3 . 2 2   C h a r a c t e r   sw a p   b a s e l i n e   7 2 . 3 4   1 . 7 4       T h ch ar ac ter   s wap   b aselin y ield s   an   ac cu r ac y   d r o p   o f   1 . 7 4 %,  wh er ea s   o u r   A r - Attack 2   ac h iev es  lar g er   d ec r ea s o f   3 . 2 2 u n d er   th s am e d it  d is tan ce   ( two   ed its ) .   E v en   Ar - Attack 1 ,   w h ich   u s es  o n l y   o n e   ed it,  s u r p ass es  th b aselin w ith   2 . 2 4 d r o p .   T h ese  r esu l ts   s h o th at  o u r   p r o p o s ed   attac k s   g en er ate  m o r e   ef f ec tiv p er tu r b atio n s   th a n   s im p le  ch ar ac ter   s wap s ,   ev e n   wi th   f ewe r   ed its .     4 . 5 . 4 .   Co m pa riso n wit ex is t i ng   Ara bic  a t t a c k   I n   th is   s u b s ec tio n ,   Ar - Attack 1   is   co m p ar ed   with   th Ar a b ic  attac k   in tr o d u ce d   in   [ 3 4 ] .   B o th   m eth o d s   ar ev alu ated   u n d er   th s am e   n u m b er   o f   ed its   to   k ee p   th e   co m p ar is o n   f air .   W h ile  o u r   ap p r o ac h   r elies  o n   au d ito r y   s im ilar ity   b etwe en   Ar ab ic  ch ar ac ter s ,   th eir s   is   b ase d   o n   v is u al  s im ilar ity .   A   q u an t itativ ev alu atio n   is   p er f o r m ed   b ased   o n   attac k   ef f ec tiv en ess ,   an d   q u alitativ o n ass ess in g   h u m an   p er ce p tib i lity .   i)   A t t a c k   ef f ec t i v en e s s   e v a l u a ti o n th e   im p ac t   o f   ea c h   a t ta c k   o n   t h c l a s s i f i e r s   a c cu r a c y   i s   f ir s t   e v a l u a t e d .   R e s u l t s   a r e   s u m m a r i z e d   i n   T a b l e   1 3 .   T h e   f ir s c o l u m n   r e p o r t s   ac c u r a c y   a f te r   t h a t t a ck ,   a n d   t h s e c o n d   c o lu m n   s h o ws   t h e   d r o p   i n   a c cu r a cy   r e l a t iv e   t o   t h o r i g in a l   cl e a n   m o d e l.   A s   s h o wn   in   T a b l e   1 3 ,   th e   v i s u a l - s i m i l a r i t y   m e th o d   p r o d u c e s   a   la r g e r   a c cu r a c y   d r o p   o n   th e   t ar g e t   c l a s s i f i er     t h a n   Ar - A t t ac k 1   w h e n   b o th   m e t h o d s   u s e   t h s a m e   n u m b e r   o f   ed i t s .   T h e s e   r e s u l t s   in d i c a t e   t h a t   t h v i s u a l - b a s e d   m e th o d   y i e l d s   a   l a r g er   p r o p o r t i o n   o f   in p u t s   t h a t   t h c l a s s i f i e r   m i s l a b e l s   t h an   A r - A t t a c k 1 .       T ab le  1 3 .   Attack   e f f ec tiv en ess   co m p ar is o n     A c c u r a c y   ( %)   D e l t a   A c c u r a c y   ( %)   Ar - A t t a c k 1   ( a u d i t o r y - b a s e d ,   o u r s)   7 1 . 8 4   2 . 2 4   V i su a l - b a se d   A r a b i c   a t t a c k   6 9 . 8   4 . 2 8       ii)   Hu m an   p er ce p tib ilit y   ev alu at io n to   co m p lem e n th q u a n titativ r esu lts ,   h u m an   ev alu atio n   was  co n d u cte d   with   2 0   n ativ an n o tato r s   o n   1 0 0   p er tu r b ed   r e v iews,  5 0   v is u al - b ased   an d   th ei r   5 0   au d ito r y   co u n ter p a r ts .   E ac h   an n o tato r   r ec eiv ed   d is tin ct  test   s et,   e n s u r in g   n o   o n s aw  th s am r ev iew  u n d er   b o th   p e r tu r b atio n   ty p es.  E ac h   tr ial  last ed   1 5   s ec o n d s .   R esu lts   ar r ep o r te d   in   T ab le  1 4 .   T h r esu lts   s h o th at   p er t u r b atio n s   f r o m   Ar - Attack 1   wer less   o f ten   d etec ted   th an   t h o s e   f r o m   th e   v is u al - b ased   attac k .   T h is   in d icate s   th at  au d ito r y   s u b s titu ti o n s   ap p ea r   m o r n atu r al  an d   h ar d er   to   n o tice .   Evaluation Warning : The document was created with Spire.PDF for Python.
                   I SS N :   2252 - 8 9 3 8   I n t J Ar tif   I n tell Vo l.  1 5 ,   No .   1 ,   Feb r u ar y   2 0 2 6 :   941 - 9 5 2   950   W ith in   Ar - Attack 1 ,   6 9 o f   a u d ito r y - ad d   a n d   3 3 o f   au d it o r y - r e p lace   ca s es  wen u n n o ti ce d ,   s u g g esti n g   th at   th ad d itiv m o d if icatio n   is   le s s   p er ce p tib le  th an   r e p lace m e n t o n es.       T ab le  1 4 .   H u m an   p er ce p tib ilit y   co m p a r is o n     N u mb e r   o f   p e r t u r b e d   r e v i e w s   D e t e c t i o n   ra te   ( %)   Ar - A t t a c k 1   ( a u d i t o r y - b a s e d ,   o u r s)   50   44   V i su a l - b a se d   A r a b i c   a t t a c k   50   52       4 . 5 . 5 .   T ra ns f er a bil it y   a na ly s is   Ho ad v er s ar ial   ex am p les   g en er ated   u s in g   t h Ar - Attack 1   m et h o d   o n   th e   s o u r ce   B E R T - b ased   m o d el  tr an s f er   to   Ar aBER T n am ely   ar ab er t - s en tim en t - m o d el - Mu h an n e d Sh ,   p r etr a in ed   Ar ab ic  m o d el     f in e - tu n e d   f o r   b i n ar y   SA   a v ailab le  o n   H u g g in g   Face is   ev alu ated .   T h e   tr an s f er ab ilit y   is   ass es s ed   u s in g   th e   tr an s f er   s u cc ess   r ate  ( T SR )   d e f in ed   as  th e   r atio   o f   s u cc ess f u ad v er s ar ial  attac k s   o n   th e   tar g et  m o d el   to   t h o s e   th at  s u cc ee d   o n   th s o u r ce   m o d el.   R esu lts   ar r ep o r ted   in   T ab le  1 5 .   A b o u 3 1 . 4 7 %   o f   th ad v e r s ar ial  ex am p les  th at  f o o led   B E R T   also   f o o led   Ar aBER T ,   s h o win g   m o d er ate  tr a n s f er ab ilit y .       T ab le  1 5 .   T r an s f er a b ilit y   r esu lts   f o r   Ar aBER T     N u mb e r   o f   su c c e sses  o n   s o u r c e   N u mb e r   o f   su c c e sses  o n   t a r g e t   TSR   ( %)   A r a B ER T   6 9 6   2 1 9   3 1 . 4 7       5.   CO NCLU SI O N   T h is   p ap er   p r o p o s ed   c h ar a cter - lev el  m eth o d   to   g en er at ad v er s ar ial  ex am p les  in   A r ab ic.   T h e   s u g g ested   ap p r o ac h   is   s im p le  an d   h ar d l y   p er ce p tib le,   r e q u ir i n g   o n ly   f ew  ca r ef u lly   s elec ted   tr an s f o r m atio n s .   I o p er ates  u n d er   BB   s ettin g s ,   with o u ac ce s s   to   th in ter n al  p ar am eter s   o f   th m o d el.   T h g en er ated   ad v er s ar ial  ex am p les  ap p ea r   n atu r al  y et  ef f ec tiv ely   co n f u s th class if ier ,   lead in g   to   an   av er ag ac cu r ac y   d r o p   o f   3 . 4 4 f o r   B E R T   m o d el  r etr ain ed   o n   th B R AD  Ar ab ic  d ataset ,   th u s   d em o n s tr atin g   th m eth o d s   ef f ec tiv en ess .   C o m p ar ed   to   ch ar ac ter - s wap   b aselin e,   o u r   m eth o d   ca u s es  lar g er   ac c u r a cy   d r o p .   W h ile  th e   v is u al - b ased   r ep lace   m eth o d   ac h iev es  lar g er   ac cu r ac y   d r o p   o n   Ar ab ic  tex t,  o u r   au d ito r y - ad d   p e r tu r b atio n s   d em o n s tr ate  s u p er io r   h u m an   i m p er ce p tib ilit y .   B u ild in g   o n   th ese  r esu lts ,   f u tu r wo r k   co u l d   ex p lo r ad d itio n al   attac k   v ar ian ts ,   ex ten d   th m eth o d   to   au d io - b ased   in p u ts ,   an d   ass es s   ad v er s ar ial  r o b u s tn ess   b ey o n d     ch ar ac ter - lev el  p er tu r b atio n s .       ACK NO WL E DG M E N T S   W wo u ld   lik to   ex p r ess   o u r   g r atitu d to   Dr .   Mo s taf Ay y a d   f o r   h is   E n g lis h   r ev iew  o f   th i s   p ap er .       F UNDING   I NF O R M A T I O   Au th o r s   s tate  n o   f u n d in g   in v o lv ed .       AUTHO CO NT RI B UT I O NS ST A T E M E N T   T h is   jo u r n al  u s es  th C o n tr ib u to r   R o les  T ax o n o m y   ( C R ed iT )   to   r ec o g n ize  in d iv id u al  au th o r   co n tr ib u tio n s ,   r ed u ce   au th o r s h ip   d is p u tes,  an d   f ac ilit ate  co llab o r atio n .       Na m o f   Aut ho r   C   M   So   Va   Fo   I   R   D   O   E   Vi   Su   P   Fu   Saf ae   L aa ty ao u i                               Mo h am m ed   Sab e r                                 C     C o n c e p t u a l i z a t i o n   M     M e t h o d o l o g y   So     So f t w a r e   Va     Va l i d a t i o n   Fo     Fo r mal   a n a l y s i s   I     I n v e s t i g a t i o n   R     R e so u r c e s   D   :   D a t a   C u r a t i o n   O   :   W r i t i n g   -   O r i g i n a l   D r a f t   E   :   W r i t i n g   -   R e v i e w   &   E d i t i n g   Vi     Vi su a l i z a t i o n   Su     Su p e r v i s i o n   P     P r o j e c t   a d mi n i st r a t i o n   Fu     Fu n d i n g   a c q u i si t i o n       Evaluation Warning : The document was created with Spire.PDF for Python.