T E L K O M N I K A  T elec o m m un ica t io n Co m pu t ing   E lect ro nics   a nd   Co ntr o l   Vo l.  24 ,   No .   5 ,  Octo b er   20 26 ,   p p .   1 5 9 7 ~ 1 6 1 0   I SS N:  1 6 9 3 - 6 9 3 0 ,   DOI : 1 0 . 1 2 9 2 8 /TE L KOM NI KA. v 24 i 5 . 2 7 8 8 4          1597       J o ur na l ho m ep a g e :   h ttp : //telko mn ika . u a d . a c. i d   Enha ncing  SQ L   i nject io n  det e ction  accura cy  wit h  f in e - tuni ng   LL a M a  3.2  1B  usi ng   lo w - ra nk ad a p tatio n       Dia s h F irda us 1 ,   I di S um a rdi 2 ,   M uh a m m a d Ichwa n 1 ,   M a ula na   Seno   Aj i   Yudh a nta ra 1     1 F a c u l t y   o f   I n f o r m a t i c s  a n d   Te c h n o l o g y   I n d u st r y ,  I n st i t u t   Te k n o l o g i   N a s i o n a l   B a n d u n g   ( I TEN A S ) ,   B a n d u n g ,   I n d o n e s i a   2 D e p a r t me n t   o f   I n f o r mat i c s   E n g i n e e r i n g ,  Al - G h i f a r i   U n i v e r si t y ,   B a n d u n g ,   I n d o n e s i a       Art icle  I nfo     AB S T RAC T     A r ticle  his to r y:   R ec eiv ed   Feb   20 ,  2 0 2 6   R ev is ed   J u n   11 ,  2 0 2 6   Acc ep ted   J u n   30 ,  2 0 2 6       S tru c tu re d   q u e ry   lan g u a g e   i n jec ti o n   (S QL  i n jec ti o n /S QLi )   re m a in s  a   c rit ica l   th re a t  to   we b   a p p li c a ti o n   se c u rit y ,   p a rti c u larly   b e c a u se   it   c a n   b y p a ss   trad it io n a l  d e tec ti o n   sy ste m s  th ro u g h   o b f u sc a ti o n .   Ex isti n g   a p p ro a c h e s,   in c lu d in g   ru le - b a se d   sy ste m s  a n d   c las sic a l  m a c h in e   lea rn in g   (M L)   m o d e ls,   o ften   fa il   to   c a p tu re   th e   c o n tex tu a l  se m a n ti c s  o f  c o m 0 p lex   S QL   q u e ries .   Th is   stu d y   p ro p o se s  a   li g h twe ig h t  a n d   c o n tex t - a wa re   S QL i   d e tec ti o n   m o d e l  b y   fin e - tu n in g   t h e   larg e   lan g u a g e   m o d e l  M e ta  a rti ficia l  in telli g e n c e   ( LL a M A )   3 . 2 – 1 B   larg e   lan g u a g e   m o d e l  u si n g   lo w - ra n k   a d a p tatio n   (Lo RA).   Th e   m o d e l  wa s  train e d   u sin g   t h e   S QL - I n jec ti o n - E x ten d   d a tas e t  o b tain e d   fr o m   Ka g g le,  c o n sistin g   o f  5 7 , 3 1 0   m a li c io u s  S QL i  sa m p les   a n d   5 2 , 2 0 8   b e n ig n   u se r - in p u t  sa m p les .   Th e   b e n ig n   d a ta  c o m p r ise   g e n e ra l  u se r - g e n e ra ted   tex t  c o m m o n ly   su b m it ted   t h ro u g h   we b   a p p li c a ti o n   in terfa c e s.  Ex p e rime n ta l  re su lt s  d e m o n stra te  th a t  th e   p ro p o se d   m o d e l  a c h iev e s  a n   a c c u ra c y   o f   9 9 . 9 1 % ,   p re c isio n   o f  9 9 . 9 6 % ,   re c a ll   o f   9 9 . 8 6 % ,   a n d   a n   F 1 - sc o re   o f   9 9 . 9 1 % ,   o u t p e rfo rm in g   b a se li n e   m o d e ls   in c lu d in g   c o n v o l u ti o n a l  n e u ra l  n e two r k   (CNN ),   lo n g   sh o rt - term   m e m o ry   ( LS TM ),   a n d   n o n - fin e - t u n e d   larg e   lan g u a g e   m o d e ls  (LL M s) .   Th e se   fi n d i n g s  in d ica te  th a t   L o RA - b a se d   fi n e - tu n in g   su b sta n ti a ll y   e n h a n c e s  d e tec ti o n   p e rfo rm a n c e   wh il e   m a in tain i n g   c o m p u tati o n a l  e fficie n c y ,   m a k i n g   th e   a p p ro a c h   su i tab le  fo r   re a l - ti m e   d e p lo y m e n t  in   m o d e r n   we b   se c u rit y   s y ste m s.  F u r th e rm o re ,   th e   in te g ra ti o n   o f   c o n tex t - a wa re   d ig i tal  fo re n sic   re p o rti n g   s u p p o rts  p o st - i n c id e n t  i n v e stig a ti o n   a n d   imp r o v e s t h e   in ter p re tab il it y   o f  d e tec ti o n   o u tco m e s.    K ey w o r d s :   Dig ital f o r en s ics   L ar g e  lan g u ag e  m o d el   L L aM A  3 . 2   L o w - r an k   ad ap tatio n   SQL  in jectio n   W eb   ap p licatio n   s ec u r ity   T h is i s  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 :   I d i Su m ar d i   Dep ar tm en t o f   I n f o r m atics E n g in ee r in g ,   Alg h if ar i U n i v er s ity   1 4 0   C is ar an ten   Ku lo n   Stre et,   So ek ar n o - Hatta,   B an d u n g ,   W est J av a  4 0 2 9 3 ,   I n d o n esia   E m ail: id is u m ar d i@ g m ail. co m       1.   I NT RO D UCT I O N   Stru ctu r ed   q u er y   lan g u ag e   in j ec tio n   ( SQL  in jectio n /SQLi)   attac k s   ar e  am o n g   t h e  m o s t  d an g er o u s   th r ea ts   in   th e  web   ap p licatio n   ec o s y s tem   d u e  to   th eir   ab ilit y   to   d ir ec tly   ex p lo it  d atab ases ,   lead in g   to   f atal   co n s eq u en ce s   s u c h   as   s en s itiv e  d ata  ( PII )   leak ag e,   u n au th o r ized   d ata   m o d i f icatio n ,   an d   e v en   s er v e r   ta k eo v er   th r o u g h   r e m o te  c o d e   ex ec u tio n   ( R C E )   [ 1 ] .   T h ese  d estru cti v e  im p ac ts   n o t  o n ly   d is r u p t  t ec h n ical  o p er atio n s   b u t  also   tr ig g er   m ass iv e  f in an cial  lo s s e s   an d   v io latio n s   o f   s tr ict  d ata  p r iv ac y   r eg u latio n s .   As  em p h asized   in   r ec en t  s tu d ies,  SQLi  r em ain s   a  p r im ar y   attac k   v ec to r   d o m in atin g   th e  cy b er   th r ea t  la n d s ca p e  d u e  to   its   ef f ec tiv en ess   in   p en etr atin g   w ea k   ap p licatio n   d ef en s es  an d   i ts   o n g o in g   ex p lo itatio n   b y   s ec u r ity   r esear ch er s   in   p u r s u it  o f   im p r o v ed   m itig ati o n   s o lu tio n s   [ 2 ] ,   [ 3 ] .  T h e  p r im ar y   is s u e  n o   lo n g er   lies   in   s im p le,   ea s ily   id en tifia b le  attac k s   b u t  r ath e r   in   attac k er s ’   ab ilit y   to   lev er ag e  th ese  tech n iq u es  to   m an ip u late  d atab ases   u n d etec ted   b y   s tan d ar d   s ec u r ity   s y s tem s .   T h is   th r ea t  is   f u r th er   in ten s if ied   b y   tec h n o lo g ical  ev o lu ti o n ,   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   TEL KOM NI KA   T elec o m m u n   C o m p u t E l  C o n tr o l ,   Vo l.  24 ,   No .   5 ,  Octo b e r   20 26 :  1 5 9 7 - 1 6 1 0   1598   in clu d in g   t h e  ad o p tio n   o f   lar g e  lan g u a g e  m o d els  ( L L Ms)   an d   m ac h i n e  lear n in g   ( ML )   alg o r ith m s   th at  ca n   ass is t  attac k er s   in   au to m atic ally   g en er atin g   d i v er s e  p ay l o ad   v ar iatio n s ,   th er e b y   r en d er in g   co n v en tio n al   d etec tio n   m eth o d s ,   s u ch   as si g n atu r e - b ased   d etec tio n ,   in cr ea s in g ly   in ef f ec tiv e  [ 4 ] ,   [ 5 ] .   Ov er   th e  p ast  two   d ec ad es,  s ec u r ity   r esear ch er s   an d   p r ac ti tio n er s   h av e  d ev elo p ed   v ar io u s   d ef en s e   m ec h an is m s ;  h o wev er ,   ea c h   e x h ib its   f u n d a m en tal  lim itatio n s   wh en   co n f r o n ted   with   m o d e r n   attac k s   [ 6 ] .   First,  tr ad itio n al  ap p r o ac h es  th at  r ely   o n   s ig n atu r e - b ased   s y s tem s ,   s u ch   as  clas s ical  web   a p p licatio n   f ir ewa lls   ( W AFs ) ,   o p er ate  b y   m atch in g   tr af f ic  ag ai n s t  d atab ases   o f   k n o wn   attac k   p atter n s .   T h e   cr itic al  wea k n ess   o f   th is   ap p r o ac h   lies   in   it s   r ig id ity :  ev en   m in o r   m o d if icatio n s   to   a  p ay lo ad   ca n   alter   its   s ig n at u r e,   allo win g   n ew   attac k s   to   b y p ass   d etec tio n   an d   r esu ltin g   in   a   h ig h   f alse - n eg ativ e  r ate  [ 7 ] .   Nu m er o u s   s tu d ies  h a v e  p r ev i o u s ly   attem p ted   to   a d d r ess   SQLi  th r ea ts   u s in g   ML   an d   d e ep   lear n in g   ( DL )   alg o r ith m s ,   ac h iev in g   p r o m is in g   r esu lts   b u t  s till   f ac i n g   s tr u ctu r al  lim itatio n s .   R ec en t  s u r v ey s   in d icate   th at  class if ier s   lik e  Naïv e  B ay es  an d   s u p p o r t  v ec to r   m ac h in e  ( SVM)   ar e  ef f ec tiv e  f o r   s tan d ar d   p a y lo ad s   [ 8 ] ,   [ 9 ] .   T h e y   r em ain   v u l n er ab le  t o   ad v er s ar ial  ev asio n   tech n iq u es,  wh er e  attac k er s   s u b tly   m o d if y   q u er y   s y n tax   to   b y p ass   d etec tio n   [ 1 0 ] .   A  p r e v io u s   s tu d y ,   R o s ca   et  a l .  [ 5 ]   in tr o d u ce d   a  ML – b ased   f r a m ewo r k   f o r   SQLi   d etec tio n   b y   d ev el o p in g   a  tw o - s tag e  p r o ce s s in g   m ec h an is m   th at  in teg r ates  SQL  q u er y   n o r m aliza tio n   with   s em an tic  f ea tu r e  ex tr ac tio n .   As  its   p r im ar y   co n tr ib u tio n ,   th e   ap p r o ac h   ex tr ac ts   eig h t  s em a n tic  ch ar ac ter is tics   f r o m   SQL  s tatem en ts   af ter   tr an s f o r m in g   r aw  q u er ies  in to   g en er alize d   r ep r esen tatio n s   th at  ar e  m o r e  s u itab le   f o r   ML   ap p licatio n s .   T o   s u p p o r t  m o d el  d ev elo p m en t,  th e  a u th o r s   co m p iled   a  lar g e - s ca le  d ataset  co n tain in g   9 0 , 0 0 0   SQL  q u er ies,  c o m p r is in g   1 7 , 6 9 5   leg itima te  q u er ies   an d   7 2 , 3 0 4   m alicio u s   q u er ie s .   T h e  d ataset  was  g en er ated   th r o u g h   a  co m b in atio n   o f   p u b licly   av ailab le  s o u r ce s   an d   s y n th etic  s am p l es  p r o d u ce d   u s in g   g en er ativ e  p r e - tr ain ed   tr an s f o r m er   4 o   ( GPT - 4 o ) ,   aim in g   to   m itig ate  p r iv ac y   is s u es  an d   ad d r ess   th e  lim ited   av ailab ilit y   o f   lab eled   SQLi  d ata.   Mu ltip le  ML   alg o r ith m s   wer e  s u b s eq u en tly   ass ess ed   u s in g   Azu r e  ML   Stu d io   u n d er   v a r io u s   s am p lin g   co n f i g u r atio n s .   Am o n g   th e  f if teen   ev alu ated   m o d el – s am p lin g   co m b in atio n s ,   a   v o tin g   en s em b le  m o d el   in co r p o r atin g   ex t r em e  g r ad ien t   b o o s tin g   ( XGBo o s t)   a n d   lig h t   g r ad ie n t  b o o s tin g   m ac h in e  ( L i g h tGB M )   d em o n s tr ated   th e  h i g h est  p er f o r m a n c e,   ac h iev in g   an   ac cu r ac y   o f   9 6 . 8 6 %,  a   weig h ted   ar ea   u n d er   th e   r ec eiv e r   o p er ati n g   ch a r ac ter is tic  cu r v e   ( AUC)  o f   9 8 . 2 5 %,  a  weig h ted   F1 - s co r e  o f   9 6 . 7 7 %,   an d   a  Ma tth ews  co r r elatio n   co ef f icien t  ( MCC )   o f   8 9 . 8 9 %.  Nev er th eless ,   d esp ite  th e  p r o m is in g   p r ed ictiv e   p er f o r m an ce ,   co n v en tio n al  ML   ap p r o ac h es  m ay   s till   h av e  d if f icu lty   ca p tu r in g   th e  co n tex tu al  an d   s em an tic   co m p lex ities   ass o ciate d   with   s o p h is ticated   an d   o b f u s ca ted   SQLi  attac k s .   Su b s eq u en tly ,   v ar io u s   s tu d i es  h av e  in v esti g ated   SQLi   d etec tio n   tech n iq u es  u s in g   d iv er s e   ap p r o ac h es,  r an g in g   f r o m   p a tter n - b ased   m eth o d s   to   ML   an d   DL .   Falo r   et  a l .  [ 1 1 ]   d em o n s tr ated   th at  a  co n v o l u tio n al  n eu r al   n etwo r k   ( C NN) – b ased   ap p r o ac h   ca n   ac h iev e  a   h ig h   ac cu r ac y   o f   9 8 . 6 %,  h i g h lig h tin g   C NNs’  ef f ec tiv en ess   in   lear n in g   SQLi  attac k   p atter n s ,   alb ei t  at  th e  co s t  o f   h i g h   co m p u tat io n al  o v er h ea d .   I n   co n tr ast,  R au t  et  a l .  [ 1 2 ]   ad o p ted   th e  Ah o – C o r asick   p atter n - m atch in g   al g o r ith m ,   w h ich   is   co m p u tatio n ally   lig h tweig h t  b u t  ac h ie v ed   o n ly   9 1 . 3 %  ac cu r ac y   an d   ten d s   to   f ail  in   d etec tin g   a d v an ce d   o r   o b f u s ca ted   attac k s .   A  m o r e   co m p le x   DL   ap p r o ac h   was  in tr o d u ce d   b y   [ 1 3 ]   th r o u g h   a   h y b r id   lo n g   s h o r t - ter m   m em o r y   ( L STM ) – C NN  m o d el,   wh ich   r ep o r ted   th e  h ig h est  ac c u r ac y   o f   9 9 . 9 6 %,  th o u g h   it  r eq u ir es  s u b s tan tial  co m p u tatio n a l   r eso u r ce s .   C o n v e n t i o n a l   M L   a p p r o a c h es  c o n t i n u e   t o   d e m o n s t r a t e   c o m p e t i t i v e   p e r f o r m a n c e .   Pa t il   e t   a l .  [ 1 4 ]   a p p l i e d   d e c i s i o n   t r e e s   ( D T ) ,   r a n d o m   f o r e s t   ( R F ) ,   a n d   SV M ,   a c h i e v i n g   a c c u r a c ie s   o f   u p   t o   9 6 % ,   w h i l e   e m p h a s i z i n g   t h e   i m p o r ta n c e   o f   m o d e l   e x p l a i n a b i l it y   i n   e n h a n c i n g   t r u s t   i n   d e t ec t i o n   s y s t e m s ,   d e s p i t e   c h a ll e n g es  i n   r e a l - ti m e   d e p l o y m e n t .   Si m i la r l y ,   M u s t a p h a   et   a l .  [ 1 5 ]   s h o w e d   t h a t  R F  a n d   a r t i f i c i al   n e u r a l   n e tw o r k s   ( AN N )   c a n   r e a c h   9 7 %   a cc u r a c y ;   h o we v e r ,   e v a l u a ti o n   o n   a  s i n g le   d a t a s et   l i m i ts   t h e   g e n e r al i z a b il it y   o f   t h e i r   m o d e ls .   F u r t h e r m o r e ,   s e v e r al   s t u d i es   h a v e   p r o p o s e d   h y b r i d   a n d   d o m a i n - s p e c i f ic   a p p r o a c h e s .   W a n g   e t   a l .   [ 1 6 ]   u tili ze d   a   co m b in atio n   o f   C NN  an d   b id i r ec tio n al  lo n g   s h o r t - ter m   m e m o r y   ( B iLST M ) ,   ac h ie v in g   a n   ac cu r ac y   o f   9 9 . 3 %,  alth o u g h   th ei r   wo r k   p r im ar il y   f o cu s ed   o n   in p u t  in jectio n   r ath er   th an   SQLi  s p ec if ically .   Alth o u g h   th ese  s tu d ies  r ep o r t  h ig h   d etec tio n   ac cu r ac y ,   t h ey   s h ar e  c o m m o n   lim itatio n s .   T h e  p r im ar y   lim itatio n   lies   in   th e  s em an tic  g ap ,   n am ely   th e  i n a b ilit y   o f   th ese  m o d els  to   u n d er s tan d   th e  c o n tex t   an d   in ten t   b eh in d   SQL  q u er y   s tr u ctu r es,  p ar ticu lar ly   w h en   a ttack s   ar e  m o d if ied   u s in g   s o p h is ticated   s y n tax   o b f u s ca tio n   te ch n iq u es.   T h e  p r e v io u s ly   id en tifie d   s em an tic  g ap   u n d er s co r es  th e   u r g en c y   o f   ad o p tin g   L L M s .   Un lik e  tr ad itio n al  ML   o r   DL   ap p r o a ch es,  L L Ms  ar e  tr ain e d   o n   m ass iv e  co r p o r a   o f   s o u r ce   co d e  an d   i n ter n et  te x t,   wh ich   en d o ws  th em   with   d ee p   co n tex tu al  an d   s em an tic   u n d er s tan d in g .   R ath er   th an   m er ely   m atch in g   s tatis t ical  p atter n s ,   L L Ms  ar e  ca p ab le  o f   “r ea d i n g ”  SQL  q u er ies  an d   d ete r m in in g   wh et h er   th e  u n d er l y in g   lo g ic  is   m alicio u s ,   ev en   wh en   th e  s y n tax   h as  b ee n   m a n ip u la ted   th r o u g h   s o p h is ticated   o b f u s ca tio n   tech n iq u es  [ 1 7 ] .   Ho wev e r ,   d ep l o y in g   l ar g e - s ca le  L L Ms  s u ch   as  G PT - 4   o r   lar g e  lan g u ag e  m o d el  Me ta  ar tific ial  in tellig en ce   ( L L aM A)   7 0 B   f o r   r ea l - tim e  i n tr u s io n   d etec tio n   is   g en er ally   im p r ac tical  d u e   to   h ig h   laten c y   an d   s u b s tan tial o p er atio n al  co s ts   [ 1 8 ] .   As  an   in n o v ativ e   s o lu tio n ,   L L aM A   3 . 2   1 B   em er g es  as   a  g am e - ch an g er   in   t h e  ca te g o r y   o f   s m all   lan g u ag e  m o d els   ( SLM s ) .   W ith   o n ly   o n e  b illi o n   p a r am ete r s ,   th is   m o d el  is   s p ec if ically   d esig n ed   f o r   h ig h   Evaluation Warning : The document was created with Spire.PDF for Python.
T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l           E n h a n cin g   S QL in jectio n   d ete ctio n   a cc u r a cy   w ith   fin e - tu n in g   LL a Ma   3 . 2   1 B   u s in g   …   ( Dia s h   F ir d a u s )   1599   ef f icien cy ,   m ak in g   it  lig h tweig h t  en o u g h   to   r u n   o n   e d g e   d ev ices  s u ch   as  R asp b er r y   Pi  o r   r eso u r ce - co n s tr ain e d   s er v er s ,   wh ile  s till   in h er itin g   th e  ar ch itectu r al  in tellig en ce   o f   lar g er   L L aM A  m o d els  [ 1 9 ] .   T o   f u r th er   o p tim ize   p er f o r m an ce   with o u t  o v er b u r d en i n g   co m p u tatio n al  r eso u r ce s ,   lo w - r an k   ad ap tatio n   ( L o R A)   is   em p lo y e d   as a   k ey   co m p o n en t in   th is   s tu d y .   Fu ll f in e - tu n in g   o f   L L M s   ty p ically   r eq u ir es   s u b s tan tial  m em o r y   an d   c o m p u tatio n al  o v er h ea d ,   wh ile  al s o   in tr o d u cin g   th e   r is k   o f   ca tast r o p h ic  f o r g ettin g ,   wh er e  th e  m o d el  lo s es  its   p r ev io u s ly   lear n ed   g en er al  k n o wled g e.   L o R A   ad d r ess es  th ese  lim itatio n s   b y   u p d atin g   o n ly   a   s m all  s u b s et  o f   p ar am ete r s   th r o u g h   lo w - r an k   m at r ix   d ec o m p o s itio n ,   r ed u cin g   m em o r y   r eq u ir em e n ts   b y   u p   to   6 0 – 7 0 % a n d   s ig n if ican tly   ac ce ler ati n g   th e  tr ain i n g   p r o ce s s   [ 2 0 ] .   B y   lev er ag in g   th ese  a d v an tag es,  th e  co m b in atio n   o f   L L aM A  3 . 2 – 1 B   an d   L o R A  en a b les  ef f icien t   an d   co n tex t - awa r e  an aly s is   o f   u s er   in p u t,  allo win g   s ec u r ity   s y s tem s   to   d etec t  S QL i   attac k s   with   lo w  laten cy   wh ile  m ain tain in g   h i g h   ac cu r a cy .   I n   a d d itio n ,   th e  m o d el  p r o v id es  co n tex tu al  e x p lan atio n s   th at  s u p p o r t  d ig ital  f o r en s ic  an aly s is ,   m ak in g   it  s u itab le  f o r   p r ac tical  d ep lo y m en t  in   m o d er n   web   s ec u r ity   en v ir o n m en ts .   Acc o r d in g ly ,   th is   s tu d y   aim s   to   d ev elo p   an   in tellig e n t,  ef f i cien t,  an d   co n tex t - awa r e  SQLi   d etec tio n   s y s tem   th at  ad d r ess es  th e  lim i tatio n s   o f   ex is tin g   ap p r o ac h es.  Alth o u g h   p r ev io u s   s tu d ies  h av e  r ep o r ted   p r o m is in g   r esu lts   u s in g   co n v en tio n al  ML   an d   DL   ap p r o ac h es  f o r   SQLi   d etec tio n ,   m an y   o f   th ese   m eth o d s   p r im ar ily   f o cu s   o n   lear n in g   s tatis tical  p atter n s   an d   o f ten   s tr u g g le  to   ca p tu r e   th e   co n tex t u al  s em a n tics   o f   o b f u s ca ted   attac k   p ay lo a d s .   Mo r eo v er ,   e x is tin g   s tu d ies  r ar ely   in v esti g ate  th e  u s e  o f   lig h tweig h t   L L M s   co m b in ed   with   p ar am eter - ef f icien t  f in e - tu n in g   tech n iq u es  f o r   SQLi   d etec tio n .   T h er e f o r e,   th e  n o v elty   o f   t h is   s tu d y   lies   in   th e   in teg r atio n   o f   L L aM A   3 . 2 – 1 B   an d   L o R A  to   d ev elo p   a  co n tex t - awa r e  SQLi   d etec tio n   f r am ewo r k   th at  b alan ce s   s em an tic  u n d er s tan d in g ,   co m p u tatio n al  ef f icien cy ,   an d   p r ac tical  d ep lo y   a b ilit y .   Fu r th er m o r e ,   th is   wo r k   ex ten d s   b e y o n d   attac k   class if icatio n   b y   in co r p o r at in g   co n tex t - awa r e  d ig ital  f o r en s ic  r ep o r tin g   to   s u p p o r t   p o s t - in cid e n t  in v esti g atio n   an d   e x p lain ab le   cy b er s ec u r ity   a n aly s is .   T h e   m ain   c o n tr ib u tio n s   o f   th is   s tu d y   ar e  as  f o llo ws :  ( i)   t h e  d e v elo p m en t  o f   a   co n tex t - awa r e  SQLi   d etec tio n   m o d el  b ased   o n   L L aM A  3 . 2 – 1 B   with   L o R A  f in e - tu n in g ;  ( ii)  t h e  im p lem en tatio n   o f   a  lig h t weig h t  d ep lo y m e n t  s tr ateg y   s u itab le  f o r   ed g e  a n d   r eso u r ce - co n s tr ain ed   e n v ir o n m en ts   th r o u g h   p ar am eter - ef f i cien t  ad ap tatio n ;   an d   ( iii)  t h e   in teg r atio n   o f   r ea l - tim e  SQLi   d etec tio n   with   co n tex t - awa r e  d i g ital  f o r en s ic   r ep o r tin g   to   s u p p o r t  ex p lai n ab le  cy b er s ec u r ity   o p er atio n s   an d   p o s t - in cid en t a n aly s is .       2.   M E T H O D    Fig u r e   1   illu s tr ates  th e  a r ch it ec tu r e  o f   th e   SQLi   d etec tio n   m o d el ,   d ep ictin g   th e   wo r k f lo w  f r o m   th e   u s er   s u b m itti n g   in p u t  th r o u g h   th e  ap p licatio n   p r o g r am m in g   in ter f ac e   ( API )   g atew ay   to   it s   p r o ce s s in g   with in   th e  web   ap p licatio n .   T h e  ar c h itectu r e  p o s itio n s   th e  d etec t io n   s y s tem   as  an   ad d itio n al  s ec u r ity   lay er   th at   an aly ze s   in co m in g   u s er   in p u t  b ef o r e  it is   ex ec u te d   b y   th e  d at ab ase.           Fig u r e  1 .   SQLi   d etec tio n   ar ch i tectu r e       On   th e  clien t  s id e,   u s er s   ac ce s s   th e   web   ap p licatio n   th r o u g h   a  b r o wser .   W h en   th e  web s ite  is   lo ad ed ,   u s er s   s u b m it  r eq u ests   in   th e  f o r m   o f   u s er   in p u t  ( e. g . ,   f o r m   i n p u ts   o r   q u er y   s tr in g s )   v ia  an   API .   Su b s eq u en tly ,   th e  ed g e   d etec tio n   s y s tem   p er f o r m s   p r ep r o ce s s in g   an d   to k e n izatio n   o n   th e   in co m in g   u s er   in p u ts   b ef o r e   th ey   ar e  p r o ce s s ed   b y   th e  L L aM A  3 . 2 – 1 B   m o d el,   wh ich   h as  b ee n   f in e - tu n e d   u s in g   th e  L o R A   m eth o d .   T h e  m o d el   an aly ze s   th e  u s er   in p u t  to   d ete r m in e  wh eth er   it  co n tain s   SQLi   p atter n s .   I f   th e  i n p u t  is   id e n tifie d   as  m alicio u s ,   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   TEL KOM NI KA   T elec o m m u n   C o m p u t E l  C o n tr o l ,   Vo l.  24 ,   No .   5 ,  Octo b e r   20 26 :  1 5 9 7 - 1 6 1 0   1600   th e  r eq u est  is   b lo ck ed ,   an d   th e  s y s tem   g en er ates  a   n o tific atio n   in d icatin g   a  d etec ted   SQLi   attem p t.   C o n v er s ely ,   if   th e  in p u t  is   class if ied   as  b en ig n ,   ac ce s s   to   th e  d atab ase  is   g r an ted ,   a n d   t h e  web   ap p licatio n   o p er ates  n o r m ally .   Fig u r e   2   illu s tr ates  th e  r esear c h   m et h o d o lo g y   em p lo y ed   in   th is   s tu d y .   T h e  r esear ch   p r o ce s s   b eg in s   with   d ata   co lle ctio n   f r o m   Ka g g le  a n d   p r o ce e d s   th r o u g h   s ev er al  s tag es,  cu l m in atin g   in   th e   f in al   p h ase  o f   m o d el  ev al u atio n .           Fig u r e  2 .   R esear ch   m eth o d       Ph ase  I   ( d ata  p r ep ar atio n ):   th e  d ata  p r ep ar ati o n   p h ase  aim s   to   estab lis h   a   d ataset  f o u n d atio n   th at  is   r elev an t  to   th e   r esear ch   p r o b lem .   T h is   p h ase  b e g in s   with   d ata  c o llectio n ,   f o cu s in g   o n   th e  c y b er s ec u r ity   d o m ain ,   p ar ticu lar ly   SQLi   at tack s .   T h e  co llected   d ataset  in clu d es  a  wid e  r an g e  o f   u s er   in p u t  p atter n s ,   en co m p ass in g   b o th   b en ig n   a n d   m alicio u s   in p u ts ,   to   r e p r e s en t  r ea l - wo r ld   attac k   s ce n a r i o s   en co u n te r ed   b y   m o d er n   web   ap p licatio n s .   B y   ex p licitly   ce n ter in g   SQLi   as  th e  p r im ar y   th r ea t,  t h is   p h ase  clea r ly   d ef in es  th e   p r o b lem   s co p e  an d   th r ea t m o d el  th at  will b e  lear n ed   b y   th e  l an g u ag e   m o d el  i n   s u b s eq u e n t  s tag es.   Ph ase  I I   ( d ata  p r e - p r o ce s s in g ):   th e  d ata  p r e - p r o ce s s in g   p h ase  is   r esp o n s ib le  f o r   tr an s f o r m in g   r aw   d ata  in to   a  f o r m at  s u itab le  f o r   m o d el  tr ain in g .   T h e  co llected   d ataset  is   lo ad ed   in to   th e  p r o c ess in g   en v ir o n m en t   an d   co n v er ted   f r o m   a  d ataf r a m e  f o r m at  in to   a  Hu g g in g   F ac e  d ataset  to   en s u r e  co m p atib ilit y   with   m o d er n   tr ain in g   p ip elin es.  T h e  d ataset  is   th en   s p lit  in to   tr ain in g   an d   v alid atio n   s ets  to   en ab le  f air   ev alu atio n   an d   p r ev en t   o v e r f itti n g .   T h is   s ep a r atio n   also   s u p p o r ts   p er f o r m a n ce   m o n ito r in g   d u r in g   tr ain i n g ,   en s u r in g   th at  th e   m o d el  m ain tain s   s tr o n g   g en e r aliza tio n   ca p ab ilit ies o n   p r e v io u s ly   u n s ee n   d ata.     Ph ase  I I I   ( m o d elin g   a n d   o p tim izatio n ):   t h e  m o d elin g   an d   o p tim izatio n   p h ase  f o c u s es  o n   ef f icien tly   b u ild in g   a n d   a d ap tin g   th e  lan g u ag e  m o d el.   T h e  b ase  m o d e l  u s ed   in   th is   s tu d y   is   L L aM A  3 . 2   with   1   b illi o n   p ar am eter s ,   wh ich   is   o p tim iz ed   u s in g   4 - b it  q u an tizatio n   ( NF4 )   to   r ed u ce   m em o r y   u s ag e  an d   co m p u tatio n al   o v er h ea d .   Fin e - tu n i n g   is   p er f o r m ed   u s in g   th e  L o R A  m eth o d ,   allo win g   th e  m o d el  to   b e  a d ap ted   to   th e  SQLi   d etec tio n   d o m ai n   with o u t  u p d atin g   all  m o d el  p ar am eter s .   T h is   ap p r o ac h   r esu lts   in   a  r el ativ ely   lig h tweig h t  lan g u ag e  m o d el  with   s tr o n g   d o m ain - s p ec if ic  ca p a b ilit ies wh ile  m ain tain in g   r eso u r ce   ef f ici en cy .     Ph ase  I V  ( m o d el   ev alu atio n ):   m o d el  e v alu atio n   aim s   to   ass ess   th e  p er f o r m a n ce   a n d   ef f ec ti v en ess   o f   th e  tr ain ed   m o d el.   I n   th is   s ta g e,   th e  m o d el  is   ev alu ated   u s in g   a  d ed icate d   ev alu atio n   d a taset  to   m ea s u r e  its   ab ilit y   to   ac cu r ately   d etec t a n d   h an d le  SQLi   ca s es.  Per f o r m an ce   is   as s ess ed   u s in g   r elev an t e v alu atio n   m etr ics,  in clu d in g   ac cu r ac y ,   p r e cisi o n ,   r ec all,   an d   F1 - s co r e,   to   e n s u r e  th at  th e  m o d el  n o t  o n ly   p er f o r m s   well  o n   tr ain in g   d ata  b u t  also   g en er a lizes  ef f ec tiv ely   to   u n s ee n   d ata.   T h e  ev alu atio n   r esu lts   p r o v id e  a  b asis   f o r   d eter m in in g   t h e  m o d el ’ s   s u itab ilit y   f o r   d ep lo y m en t in   r e al - wo r ld   ap p licatio n   s ce n ar io s .     2 . 1 .     Da t a   p re pa ra t i o n   T h e  d ataset  u tili ze d   in   th is   s tu d y   was  o b tain ed   f r o m   t h e  SQL - I n jectio n - E x ten d   r ep o s ito r y   o n   Kag g le   [ 2 1 ] .   T o   p r o v id e  a n   o v er v ie w  o f   th e   d ata  u s ed   f o r   m o d el  tr ain in g   an d   ev alu atio n ,   T ab le  1   p r esen ts   r ep r esen tativ e  ex a m p les  o f   m alicio u s   SQLi   p ay lo ad s   a n d   b en ig n   u s er   in p u ts .   T h e   m alici o u s   s am p les  in clu d e   v ar io u s   SQLi   tech n iq u es  s u ch   as  tim e - b ased   attac k s ,   UNI ON - b ased   attac k s ,   an d   d atab ase  f u n ctio n   ex p lo itatio n ,   wh er ea s   th e  b en i g n   s am p les  co n s is t  o f   n o r m al  u s er - g en er ate d   tex t  co m m o n ly   s u b m itted   th r o u g h   web   ap p licatio n s .   T h is   d iv er s ity   en ab les  th e  m o d el  to   lear n   co n tex tu al  d if f er en ce s   b etw ee n   m alicio u s   an d   non - m alicio u s   in p u ts .   Af ter   th e  d ata  p r ep ar atio n   s tag e,   th e  d ataset  was  tr an s f o r m ed   in to   an   in s tr u ctio n - b ased   f o r m at  s u itab le  f o r   s u p er v is ed   f in e - tu n in g   o f   LLM s .     Evaluation Warning : The document was created with Spire.PDF for Python.
T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l           E n h a n cin g   S QL in jectio n   d ete ctio n   a cc u r a cy   w ith   fin e - tu n in g   LL a Ma   3 . 2   1 B   u s in g   …   ( Dia s h   F ir d a u s )   1601   T ab le  1 .   Sam p le  o f   SQLi   d ata s et   No   S e n t e n c e   La b e l   1   “ o r   p g _ s l e e p ( _ TI M E_ )   --   1   2   sel e c t   *   f r o m  u sers   w h e r e   i d   =   ‘ 1 ’   o r   @ @ 1   =   1   u n i o n   s e l e c t   1 ,   v e r s i o n ( )   --   1 ’   1   3   O n e   o f   t h e   o t h e r   r e v i e w e r s  …  a f t e r   w a t c h i n g   j u s t   1   O z   e p i s o d e   y o u ’ l l   b e   h o o k e d   . . .   0   4   P e t t e r   M a t t e i ’ s …   st u n n i n g   f i l m   t o   w a t c h   . . .   0       I n   ter m s   o f   d ata  d is tr ib u tio n ,   t h e  d ataset  co n tain s   5 7 , 3 1 0   m a licio u s   s en ten ce s   ( L ab el  =  1 )   a n d   5 2 , 2 0 8   b en ig n   s en ten ce s   ( L ab el  =   0 ) .   T h is   r elativ ely   b alan ce d   d is tr i b u tio n   s u p p o r ts   r o b u s t  tr ain in g   an d   ev alu atio n   o f   tex t  class if icatio n   m o d els  f o r   au to m atic  SQLi   d etec tio n   in   d atab ase  s ec u r ity   r esear c h .   Alt h o u g h   th e   d ataset  is   d er iv ed   f r o m   Kag g le,   it  is   f o r m u lated   as  a  u s er   in p u t  class i f icatio n   task ,   wh er e  m alicio u s   s am p les  r ep r esen t  SQLi   p ay lo ad s   an d   b en ig n   s am p les  r ep r esen t  g en er al  u s er   in p u t  tex t  s u b m itted   th r o u g h   web   f o r m s .   T h is   ap p r o ac h   r e f lects  r ea l - wo r ld   s ce n ar io s   in   wh ic h   SQLi   att ac k s   ar e  em b ed d e d   with in   u s er - p r o v id e d   i n p u t.   Ho wev er ,   alth o u g h   t h e  b en i g n   s am p les  r ep r esen t  g e n er al  u s er - g en er ated   te x t,  th ey   m ay   n o t  f u lly   ca p tu r e  th e   d iv er s ity   an d   co m p lex ity   o f   r ea lis tic  web   ap p licatio n   in p u ts ,   s u ch   as  lo g in   cr ed en tials ,   u n if o r m   r eso u r c e   lo ca to r   ( UR L )   p ar am eter s ,   A PI  r eq u ests ,   an d   f o r m   s u b m i s s io n s .   Pre p r o ce s s in g   was  ap p lied   to   in tr o d u ce   ad v er s ar ial  v ar iatio n s   s u ch   as  o b f u s ca tio n   an d   en co d in g   to   s im u late  r ea lis tic  attac k   p atter n s .   T h er ef o r e,   f u tu r e   wo r k   will  f o cu s   o n   v alid atin g   th e   p r o p o s ed   ap p r o ac h   u s in g   r ea l - wo r ld   d atasets ,   in clu d i n g   W AF  lo g s ,   we b   s er v er   lo g s ,   an d   s ec u r ity   in f o r m atio n   an d   ev e n t  m an ag em e n t   ( SIE M )   d ata  s o u r ce s ,   to   f u r t h er   im p r o v e  m o d el  r o b u s tn ess   an d   g e n er aliza b ilit y .     2 . 2 .     P re pro ce s s ing   T h e  p r ep r o ce s s in g   p ip elin e  is   d esig n ed   to   s y s tem atica lly   tr an s f o r m   th e  r aw  d ataset  in to   a  s tr u ctu r ed   f o r m at  s u itab le   f o r   in s tr u ctio n - b ased   lear n in g .   First,  ( i )   d a ta  lo ad in g   is   p er f o r m e d   b y   im p o r tin g   th e   d ataset   f r o m   a  co m m a - s ep ar ated   v alu es   ( C SV )   f ile  an d   co n v er tin g   it  in to   a   Pan d as  d ata f r am e  f o r   e f f icien t  p r o ce s s in g .   Nex t,  ( ii )   d ata  ty p e  s tan d ar d iz atio n   is   ap p lied   b y   co n v er tin g   th e  s en ten ce   an d   lab el  co lu m n s   in to   s tr in g   d ata   ty p es  to   en s u r e  c o n s is ten cy   an d   p r ev en t  ty p e - r elate d   e r r o r s   d u r in g   tr ain in g .   Su b s eq u en tly ,   ( iii )   lab el   id en tific atio n   is   co n d u cte d   b y   ex tr ac tin g   u n i q u e  class   lab el s   d ir ec tly   f r o m   th e  d ataset  to   m ain tain   f lex i b ilit y   f o r   p o ten tial  e x ten s io n s   to   m u lti - class   clas s if icatio n   task s .   T h e  d ataset  is   th e n   d i v id ed   in to   ( iv )   d ata  s p lits   in to   tr ain in g   a n d   ev alu atio n   s u b s et s   u s in g   an   8 0 :2 0   r atio ,   with   a   f ix ed   r an d o m _ s tate   =   4 2   to   en s u r e  r ep r o d u cib ilit y   wh ile  p r eser v in g   class   d is tr ib u tio n .   T o   s u p p o r t  in s tr u ctio n - b ased   lear n in g ,   ( v )   p r o m p t  co n s tr u ctio n   is   ca r r ie d   o u t  b y   tr a n s f o r m in g   ea ch   d ata   in s tan ce   in to   a  s tr u ctu r ed   f o r m at  co n s is tin g   o f   task   in s tr u ctio n s ,   lab el  o p tio n s ,   in p u t  tex t,   an d   th e  co r r esp o n d in g   o u tp u t  lab el.   Fu r th er m o r e,   ( vi )   t o k en izatio n   is   ap p lied   u s in g   th e  to k e n izer   ass o ciate d   with   th e  L L aM A   3 . 2 – 1 B   m o d el,   wh e r e  tex t   in p u ts   ar e  co n v er ted   i n to   to k en   I Ds  with   ap p r o p r iat e   p ad d in g   an d   tr u n ca tio n   to   en s u r e  u n if o r m   s eq u en ce   len g t h .   T h is   is   f o llo wed   b y   ( v ii )   s p ec ial  to k en   h an d lin g ,   wh er e  p ad d i n g   an d   en d - of - s e q u en ce   ( E OS)   to k en s   ar e  in co r p o r ated   t o   m ain tain   p r o p e r   s eq u en ce   b o u n d ar ies.   F in ally ,   ( v iii )   ev alu atio n   d ata  p r ep ar atio n   is   p er f o r m e d   b y   g en er atin g   u n la b eled   p r o m p ts   f r o m   th e  ev alu atio n   d ataset  to   s u p p o r t  i n f er en ce   a n d   p er f o r m a n ce   test in g .   T h r o u g h   th is   p ip eli n e,   th e  o r ig in al   tab u lar   d ataset  is   ef f ec tiv ely   tr an s f o r m ed   in to   a  m o d el - r ea d y   f o r m at  s u itab le  f o r   s u p er v is ed   f in e - tu n in g   o f   LLM s .   I n   th is   tr an s f o r m atio n ,   ea ch   s am p le   is   r ef o r m u lated   as  a n   in s tr u ct io n - f o llo win g   class if icatio n   t ask   co n s is tin g   o f   a   p r o m p t,   in p u t  tex t,  a n d   t h e  c o r r esp o n d in g   lab el.   T a b le  2   p r esen ts   r ep r esen tativ e  ex am p l es  o f   th e  c o n v e r ted   d ataset  f o r m at  u s ed   d u r in g   m o d el  tr ain in g .       T ab le  2 .   C o n v er s io n   o f   d ataf r a m e  in to   h u g g in g   f ace  d ataset   No   Te x t   1   C l a s si f y   t h e   f o l l o w i n g   i n p u t   i n t o   o n e   o f   t h e s e   l a b e l s:   [ ‘ 0 ’ ,   ‘ 1 ’ ]   I n p u t :   “ o r   p g _ s l e e p   ( TI M E)   --   A n sw e r   w i t h   o n l y   o n e   o f   t h e   l a b e l s  a b o v e .   L a b e l :   1   5   C l a s si f y   t h e   f o l l o w i n g   i n p u t   i n t o   o n e   o f   t h e s e   l a b e l s:   [ ‘ 0 ’ ,   ‘ 1 ’ ]   I n p u t :   s e l e c t   *   f r o m  u sers   w h e r e   i d   =   ‘ 1 ’   o r   @ @ 1   =   1   u n i o n   se l e c t   1 ,   v e r si o n ( )   --   ‘   A n sw e r   w i t h   o n l y   o n e   o f   t h e   l a b e l s  a b o v e .   L a b e l :   1   6   C l a s si f y   t h e   f o l l o w i n g   i n p u t   i n t o   o n e   o f   t h e s e   l a b e l s:   [ ‘ 0 ’ ,   ‘ 1 ’ ]   I n p u t :   O n e   o f   t h e   o t h e r   r e v i e w e r s   …  w a t c h i n g   j u s t   1   O z   e p i s o d e   y o u ’ l l   b e   h o o k e d . . .   A n sw e r   w i t h   o n l y   o n e   o f   t h e   l a b e l s  a b o v e .   L a b e l :   0   10   C l a s si f y   t h e   f o l l o w i n g   i n p u t   i n t o   o n e   o f   t h e s e   l a b e l s:   [ ‘ 0 ’ ,   ‘ 1 ’ ]   I n p u t :   P e t e r   M a t t e i ’ s   …   i s a   v i s u a l l y   s t u n n i n g   f i l m   t o   w a t c h   ...   A n sw e r   w i t h   o n l y   o n e   o f   t h e   l a b e l s  a b o v e .   L a b e l :   0     Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   TEL KOM NI KA   T elec o m m u n   C o m p u t E l  C o n tr o l ,   Vo l.  24 ,   No .   5 ,  Octo b e r   20 26 :  1 5 9 7 - 1 6 1 0   1602   As  s h o wn   in   T ab le  2 ,   th e  d ataset  co n s is t s   o f   tex t  s am p les  th at  h av e  b ee n   tr an s f o r m ed   in to   an   in s tr u ctio n - b ased   f o r m at  f o r   S QL i   d etec tio n .   E ac h   d ata  in s tan ce   in clu d es  a  clea r   class if ic atio n   in s tr u ctio n ,   a   p r ed ef in e d   s et  o f   la b els  [ 0 ,   1 ] ,   a n d   an   in p u t   th at  r ep r es en ts   u s er - p r o v id e d   tex t   s u b m itted   th r o u g h   web   ap p licatio n   in ter f ac es.  T h ese   in p u ts   v a r y   b etwe en   p o ten ti ally   m alicio u s   SQLi   p ay lo a d s   an d   b e n ig n   u s er   in p u ts .   T h e  m alicio u s   s am p l es  ex h ib it  co m m o n   SQLi   p a tter n s   s u ch   as  tim e - b ased   att ac k s ,   u n io n - b ased   q u er ies,  an d   s y s tem   f u n ctio n   ex p lo itatio n .   I n   co n tr ast,  th e  b en ig n   s am p les  r ep r esen t  g en er al  u s er   in p u t,   in clu d in g   n at u r al  lan g u ag e  t ex t  co m m o n l y   f o u n d   in   web   f o r m s   s u ch   as  s ea r ch   q u er i es,  co m m en ts ,   an d   d escr ip tiv e  in p u ts .   T h is   f o r m u latio n   r ef lects  r ea l - wo r ld   s ce n ar io s   wh er e   SQLi   attac k s   ar e  em b ed d ed   with in   u s er - p r o v id ed   in p u t  r ath er   t h a n   is o lated   SQL  q u er ies.  B y   co m b in in g   s tr u ctu r ed   SQL  p ay lo ad s   with   g en er al  u s er   in p u t,  t h e  m o d el  is   tr ain ed   to   d is tin g u is h   m alicio u s   p atter n s   f r o m   n o r m al  in p u t   b eh av io r   b ased   o n   co n tex tu al  u n d er s tan d in g .   B y   f r am in g   th e  task   as  an   in s tr u ctio n - f o llo win g   p r o b lem ,   th e  d ataset  b ec o m es   s u itab le  f o r   s u p er v is ed   f i n e - t u n in g   o f   LLM s ,   en ab lin g   r o b u s t  ev alu atio n   o f   SQLi   d etec tio n   ac r o s s   d iv er s e   in p u t p atter n s .     2 . 3 .    M o delin g   a nd   o ptim iza t io n   I n   th is   s tu d y ,   th e  L L aM A  3 . 2 – 1 B   m o d el  was  em p lo y e d   as  th e  b ase  lan g u ag e  m o d el  f o r   s u p er v is ed   f in e - tu n in g .   T h e  m o d el  an d   to k en izer   wer e  lo ad ed   u s in g   th e   Hu g g in g   Face   T r an s f o r m er s   lib r ar y .   T o   r e d u ce   m em o r y   c o n s u m p tio n   an d   e n ab le  ef f icien t  tr ain in g   o n   lim ited   h ar d war e,   NF4   was  ap p lied   u s in g   th e   B its An d B y tes  co n f ig u r atio n   with   NF4   q u an tizatio n   an d   f lo at1 6   co m p u tatio n .   T h e  m o d el  was  au to m atica lly   d is tr ib u ted   ac r o s s   av ailab le  d ev ices  u s in g     _  = “  ” .   Ad d itio n ally ,   th e  ca ch e  m ec h an is m   was  d is ab led   to   s u p p o r t  tr ain i n g   s tab ilit y ,   an d   th e   to k e n izer   p a d d in g   to k e n   was  alig n ed   wit h   th e   E OS   to k e n   to   en s u r e  p r o p er   s eq u en ce   h an d l in g   d u r in g   tr ain in g .   T h is   co n f ig u r atio n   allo ws  ef f icien t  f i n e - tu n in g   o f   an   LLM   wh ile  m ain tain in g   r ea s o n ab le  co m p u tatio n al  r eq u ir e m en ts   T h e  co r e  o f   th is   s y s tem   is   th e  L L aM A   3 . 2 – 1 B   m o d el,   o p tim ized   u s in g   NF4   to   en s u r e  co m p u tatio n al   ef f icien cy   o n   lim ited   h ar d wa r e  r eso u r ce s .   T h e  d etailed   en v ir o n m e n t  an d   m o d el  s etu p   ar e  s u m m ar ized   in   T ab le  3 .   T h is   co n f ig u r atio n   allo ws  th e  d ep lo y m en t  o f   a  SL M   ar ch itectu r e  with   a  s ig n if ican tly   r ed u ce d   m em o r y   f o o t p r in t.       T ab le  3 .   E n v ir o n m en t a n d   m o d el  co n f ig u r atio n   No   C o m p o n e n t   C o n f i g u r a t i o n   1   B a se   m o d e l   LLa M A   3 . 2 – 1 B   ( M e t a - LLa M A   /   L La M A   - 3 . 2 - 1 B )   2   M o d e l   t y p e   C a u sa l   l a n g u a g e   mo d e l   3   Li b r a r y   H u g g i n g   f a c e   t r a n sf o r m e r s   4   Q u a n t i z a t i o n   m e t h o d   N F 4   ( B i t sA n d B y t e s)   5   Q u a n t i z a t i o n   t y p e   N F 4   6   D o u b l e   q u a n t i z a t i o n   D i sab l e d   7   C o m p u t e   d a t a   t y p e   F l o a t 1 6   8   D e v i c e   ma p p i n g   A u t o ma t i c   (   _    =   “ ” )   9   C a c h e   u s a g e   D i sab l e d   (  _  ℎ   =     )   10   P r e t r a i n i n g   t e n so r   p a r a l l e l i sm   1   11   To k e n i z e r   A u t o T o k e n i z e r   12   P a d d i n g   t o k e n   EO S   t o k e n   13   F r a mew o r k   P y T o r c h       T ab le  3   s u m m ar izes  th e  en v ir o n m en t  an d   m o d el  c o n f ig u r at io n   u s ed   in   th is   s tu d y .   T h e  b ase  m o d el  em p lo y ed   is   L L aM A   3 . 2 – 1 B ,   wh ich   is   a  ca u s al  lan g u ag e  m o d el  ac ce s s ed   th r o u g h   th e  Hu g g in g   Face   T r an s f o r m e r s   lib r ar y .   T o   im p r o v e  m em o r y   ef f icien cy   an d   en ab le  tr ain in g   o n   lim ited   co m p u tatio n al  r eso u r ce s ,   th e  m o d el  was  lo ad ed   u s in g   NF4   with   th e  B i ts An d B y tes   f r am ewo r k .   T h e  NF4   q u a n tizatio n   ty p e  an d   f lo at1 6   co m p u tatio n   wer e  s elec ted   to   b alan ce   p er f o r m an ce   an d   n u m er ical  s tab ilit y ,   wh ile  d o u b l e  q u an tizatio n   was  d is ab led   to   s im p lify   th e  q u a n tizatio n   p r o ce s s .   T h e  m o d el   was  au to m atica lly   d is tr ib u te d   ac r o s s   av ailab le  h ar d war e  u s in g   an   au to m atic  d ev ice  m ap p in g   s tr ateg y .   C ac h e  u s ag e  was  d is ab led   to   s u p p o r t  s tab le  tr ain in g   b eh av io r ,   an d   th e   p r etr ain in g   ten s o r   p ar allelis m   p a r am e ter   was  s et  to   o n e.   Fo r   te x t  p r o ce s s in g ,   th e   Au to T o k en ize r   was  u s ed ,   wi th   th e  p a d d in g   to k en   alig n e d   to   th e   E OS   to k e n   to   en s u r e  co n s is ten t  in p u t  h an d lin g .   Ov er all,   t h e  co n f ig u r atio n   p r esen ted   in   t h is   T ab le   3   en ab les  ef f icien t  f in e - t u n in g   o f   an   LLM   wh ile   m ain tain in g   m a n ag ea b le  c o m p u tatio n al  r eq u i r em en ts .   Fig u r e  3   illu s tr ates  th e  ar ch ite ctu r e  o f   L o R A .   T o   ad ap t  t h e  p r e - tr ain ed   lan g u a g e  m o d el  to   th e  SQLi   d etec tio n   task ,   th is   s tu d y   em p lo y ed   L o R A ,   a   p ar am eter - ef f icien t  f in e - t u n in g   tech n i q u e  d esig n ed   to   r e d u ce   co m p u tatio n al  o v er h ea d .   I n s tead   o f   u p d atin g   th e  en tire   s et  o f   m o d el  p ar am eter s ,   L o R A  in tr o d u ce s   tr ain a b le   lo w - r an k   m atr ices  in to   s elec ted   lay er s   wh ile  p r eser v in g   th e  o r ig in al  p r e - tr ain e d   weig h t s .   T h is   m ec h an is m   Evaluation Warning : The document was created with Spire.PDF for Python.
T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l           E n h a n cin g   S QL in jectio n   d ete ctio n   a cc u r a cy   w ith   fin e - tu n in g   LL a Ma   3 . 2   1 B   u s in g   …   ( Dia s h   F ir d a u s )   1603   s ig n if ican tly   d ec r ea s es m em o r y   co n s u m p tio n   an d   tr ai n in g   co s ts   wh ile  m ain tain in g   th e  m o d el ’ s   ab ilit y   to   lear n   d o m ain - s p ec if ic  k n o wled g e.   C o n s eq u en tly ,   L o R A  o f f er s   an   ef f ec tiv e  s o lu tio n   f o r   d e p lo y in g   LLM s   in   en v ir o n m en ts   with   lim ited   co m p u tatio n al  r eso u r ce s .           Fig u r e  3 .   Ar c h itectu r e  o f   L o R A  [ 2 2 ]       L o R A  en ab les  p ar am eter - e f f ic ien t  f in e - tu n i n g   b y   in jectin g   tr ain ab le  lo w - r an k   m atr ices  in t o   s elec ted   lay er s   o f   th e  b ase  lan g u a g e  m o d el  wh ile  k ee p in g   th e   o r ig i n al  m o d el  weig h ts   f r o ze n .   I n   th is   s tu d y ,   L o R A  is   co n f ig u r ed   with   a  r a n k   = 64   an d   a  s ca lin g   f ac to r   = 16 ,   as  s u m m a r ized   in   T ab le  4 .   I n   a d d itio n ,   th e  o v er all  tr ain in g   c o n f ig u r atio n ,   in clu d in g   lear n in g   r ate,   b atch   s ize,   o p tim izer ,   an d   t r ain in g   s tr ateg y ,   is   p r esen ted   in   T ab le  5   to   e n s u r e  clar ity   an d   r ep r o d u cib ilit y .   T h is   ap p r o ac h   m in im izes  th e   r is k   o f   ca tast r o p h ic  f o r g ettin g   a n d   ac ce ler ates  t h e  tr ain in g   p r o ce s s .   Fu r th er m o r e,   co m p ar ativ e  s tu d ies  c o n f ir m   th at  L o R A  s ig n if ican tly   r ed u ce s   co m p u ta tio n al  o v e r h ea d   co m p ar ed   to   f u ll  f in e - t u n in g ,   m ak i n g   it   an   id ea l  s tr ateg y   f o r   r eso u r ce - co n s tr ain ed   cy b e r s ec u r ity   d ep lo y m en ts .   T h is   ef f ici en cy   is   cr u cial  wh en   p r o ce s s in g   lar g e - s ca le  th r ea t  d atasets   in   r ea l - tim e  en v ir o n m en ts   [ 2 3 ] .       T ab le  4 .   L o R A  co n f ig u r atio n   f o r   f in e - t u n in g   No   P a r a me t e r   V a l u e   D e scri p t i o n   1   F i n e - t u n i n g   m e t h o d   Lo R A   P a r a me t e r - e f f i c i e n t   f i n e - t u n i n g   a p p r o a c h   2   Ta sk   t y p e   C a u sa l   l a n g u a g e   mo d e l i n g   M o d e l   p r e d i c t s   n e x t   t o k e n   a u t o r e g r e ss i v e l y   3   R a n k   ( )   64   D i me n si o n   o f   l o w - r a n k   m a t r i c e s   4   Lo R A   a l p h a   16   S c a l i n g   f a c t o r   f o r   L o R A   u p d a t e s   5   Bias   N o n e   N o   b i a s   p a r a m e t e r s   w e r e   t r a i n e d   6   Ta r g e t   m o d u l e s   S e l e c t e d   mo d e l   l a y e r s   M o d u l e s a d a p t e d   u si n g   L o R A   7   Tr a i n a b l e   p a r a m e t e r s   Lo R A   l a y e r s o n l y   B a se   m o d e l   w e i g h t s fr o z e n   8   P a r a me t e r - e f f i c i e n t   f i n e - t u n i n g   ( P EFT )   H u g g i n g   F a c e   P EFT   U sed   f o r   L o R A   i m p l e me n t a t i o n       T ab le  5 .   T r ai n in g   h y p e r p ar am eter s   No   P a r a me t e r   V a l u e   1   Ep o c h s   1   2   Le a r n i n g   r a t e   2 × 1 0 ⁻ ⁴   3   P e r - d e v i c e   b a t c h   s i z e   1   4   G r a d i e n t   a c c u m u l a t i o n   8   5   Ef f e c t i v e   b a t c h   s i z e   8   6   O p t i mi z e r   P a g e d   A d a m W   ( 3 2 - b i t )   7   W e i g h t   d e c a y   0 . 0 0 1   8   LR   s c h e d u l e r   C o s i n e   9   W a r mu p   r a t i o   0 . 0 3   10   M a x   g r a d i e n t   n o r m   0 . 3   11   G r a d i e n t   c h e c k p o i n t i n g   En a b l e d   12   P r e c i s i o n   F P 1 6   13   Ev a l u a t i o n   s t r a t e g y   S t e p s (e v e r y   5 0   st e p s)       Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   TEL KOM NI KA   T elec o m m u n   C o m p u t E l  C o n tr o l ,   Vo l.  24 ,   No .   5 ,  Octo b e r   20 26 :  1 5 9 7 - 1 6 1 0   1604   T ab le  4   p r esen ts   th e  co n f ig u r atio n   o f   th e  L o R A  m eth o d   u s ed   in   th is   s tu d y .   T h e   T ab le  4  d etails  th e  k ey   h y p er p a r am eter s   th at  co n tr o l  h o w  L o R A  ad ap ts   th e  b ase  lan g u ag e  m o d el,   in cl u d in g   th e  r a n k ,   s ca lin g   f ac to r ,   a n d   d r o p o u t  r ate.   T h ese  s ettin g s   d eter m in e  t h e  ca p ac ity   an d   s tab ilit y   o f   th e  ad a p tatio n   wh ile  k ee p in g   th e  n u m b er   o f   tr ain ab le  p ar a m eter s   lo w.   B y   ap p ly in g   L o R A   o n ly   to   s elec ted   tar g et  m o d u le s   an d   f r ee zin g   th e  o r ig in al  m o d el  weig h ts ,   th e  f in e - tu n in g   p r o ce s s   b ec o m es  m o r e  ef f icie n t  in   ter m s   o f   m em o r y   u s ag e  an d   tr ain in g   tim e,   m a k in g   it su itab le  f o r   L L M  tr ai n in g   o n   lim ited   co m p u tatio n al  r eso u r ce s .   T ab le  5   p r esen ts   th e  m ain   tr ain in g   h y p e r p ar am eter s   u s ed   in   th e  f in e - tu n in g   p r o c ess .   T h ese   p ar am eter s   d ef in e  th e  o p tim i za tio n   s tr ateg y ,   tr ain in g   d u r a tio n ,   an d   m em o r y   m an a g em e n t  s ettin g s   ap p lied   d u r in g   m o d el  tr ain in g .   T h e  T ab le   5   s h o ws  th at  th e  m o d el  w as  tr ain ed   f o r   a  s in g le  ep o ch   u s in g   a  lear n in g   r ate   o f   2 ×1 0 ⁻⁴.   A  s in g le  ep o ch   wa s   s elec ted   b ec au s e  p r elim in ar y   ex p er im e n ts   s h o wed   co n v e r g en ce   o f   e v alu atio n   lo s s   with o u t  ad d itio n al  p e r f o r m an ce   g ai n s   f r o m   lo n g e r   tr a in in g ,   wh ile  also   r e d u cin g   co m p u tatio n al  co s ts .   Gr ad ien t  ac cu m u latio n   an d   ch ec k p o i n tin g   wer e  em p lo y e d   to   im p r o v e  tr ain in g   ef f icien cy ,   wh ile  a  co s in e   lear n in g   r ate  s ch e d u ler   with   w ar m u p   was u s ed   to   s tab ilize  th e  o p tim izatio n   p r o ce s s .     2 . 4 .     M o del  ev a lua t i o n m et ri cs   T o   a s s e s s   t h e  p e r f o r m a n c e   o f   t h e   p r o p o s e d   m o d e l ,   w e   e m p l o y e d   a   c o n f u s i o n   m a t r i x   a n d   d e r i v e d   s t a n d a r d   c l ass i f i c at i o n   m e t r ic s :   a cc u r a c y ,   p r e c is i o n ,   r e ca l l ,   a n d   F 1 - s c o r e .   T h es e   m e t r i c s   p r o v i d e   a   c o m p r e h e n s i v e   v i ew   o f   t h e   m o d e l ’ s   a b i l it y   t o   m i n i m i ze   b o t h   f a l s e  p o s it i v e s   ( b e n i g n   q u e r i es   f l a g g e d   a s   a tt a c k s )   a n d   f a l s e   n e g a ti v e s   ( at t a c k s   b y p a s s i n g   d e t e c t i o n ) .   T h e   e v al u a ti o n   m e t r i c s   a r e   c a l c u l a t e d   u s i n g   ( 1 )   t o   ( 4 )   [ 2 4 ] :     A cc u r a cy =  +   +  +  +      ( 1 )     P r ec is io n =   +    ( 2 )     R ec a ll =   +      ( 3 )     1 - S co r e = 2 × ( P r e c is ion × R e c all ) P r e c is ion + R e c all     ( 4 )     T h e  p r im ar y   p er f o r m a n ce   in d icato r s — ac cu r ac y ,   p r ec is io n ,   r ec all,   an d   F1 - s co r e — ar e  c o m p u ted   to   m ea s u r e  th e  m o d el ’ s   o v e r all  p er f o r m an ce .   W ith in   th e  co n f u s io n   m atr ix ,   T P  an d   T N  d en o te  p o s itiv e  an d   n eg ativ e  s am p les  th at  ar e  class if ied   co r r ec tly ,   wh er ea s   FP   an d   FN  r ef er   to   in s tan ce s   in   wh ich   th e  s y s tem   p r o d u ce s   in co r r ec t  p r ed ictio n s .   T h e  m ath em atica l  d ef in itio n s   o f   ea ch   m etr ic  ar e  p r o v i d ed   in   ( 1 ) – ( 4 ) .       3.   RE SU L T S AN D  D I SCU SS I O N   I n   t h i s   s t u d y ,   t h e   e x p e r i m e n ts   w e r e   c o n d u c t e d   u s i n g   a   b en c h m a r k   d a t a s e t   d e r i v e d   f r o m   K a g g l e ,   d e s i g n e d   f o r   SQ L i   d et e c ti o n .   T h e   d a t a s et   c o n s i s t s   o f   b o t h   m a l ic i o u s   S Q L i   i n p u t s   a n d   b e n i g n   te x t   s a m p le s ,   w h i c h   w e r e   u s e d   t o   t r a i n   a n d   e v a l u a te   t h e   p r o p o s e d   m o d e l .   M o d e l   t r a i n i n g   w as   p e r f o r m e d   u s i n g   th e   L L a M A   3 . 2 – 1 B   a r c h i t e c t u r e   wi t h   t h e   t r a i n i n g   c o n f i g u r a t i o n   d e s c r i b e d   i n   T a b l e   4 .   T h e   t r a i n i n g   a n d   e v a l u a t i o n   p r o c e s s es   w e r e  m o n i t o r e d   u s i n g   l o s s   v a l u e s ,   wh e r e   t h e   t r ai n i n g   l o s s   i s   p r es e n te d   i n   F i g u r e   4 ,   a n d   t h e   e v al u a t io n   l o s s   i s   s h o w n   i n   F i g u r e   5 .   T h e   r es u l ts   d is c u s s e d   i n   t h is   s ec t i o n   h i g h li g h t   t h e   l ea r n i n g   b e h a v i o r   o f   t h e   m o d e l   an d   i t s   e f f ec t i v e n es s   i n   d i s ti n g u i s h i n g   b e t we e n   m a l ic i o u s   a n d   n o n - m a l i c i o u s   i n p u t s .           Fig u r e  4 .   T r ain in g   l o s s   p r o g r e s s io n   o v er   g lo b al  s tep s   Evaluation Warning : The document was created with Spire.PDF for Python.
T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l           E n h a n cin g   S QL in jectio n   d ete ctio n   a cc u r a cy   w ith   fin e - tu n in g   LL a Ma   3 . 2   1 B   u s in g   …   ( Dia s h   F ir d a u s )   1605       Fig u r e  5 .   E v alu atio n   l o s s   p r o g r ess io n   o v er   g l o b al  s tep s       Fig u r e  4   illu s tr ates  th e  tr en d   o f   tr ain i n g   lo s s   th r o u g h o u t   th e  f in e - t u n in g   p r o ce s s   ac r o s s   g lo b al  tr ain in g   s tep s .   Var iatio n s   in   t h e  lo s s   v alu es  ar e  o b s er v ed   d u r in g   tr ain in g ,   wh ich   is   ex p ec ted   wh en   s to ch asti c  o p tim izatio n ,   s m all  b atch   s izes,  an d   g r ad ien t  ac c u m u latio n   ar e  em p lo y e d .   Desp ite  th e s e  f lu ctu atio n s ,   th e   o v er all  lo s s   r em ain s   with in   a  s tab le  r an g e,   in d icatin g   t h at  th e  o p tim izatio n   p r o ce s s   p r o ce ed s   in   a  co n tr o lle d   m an n er .   T h e  h ig h est  tr ain in g   lo s s   v alu e  o f   5 . 1 3 9 1   was  r ec o r d ed   at  g lo b al  s tep   2   d u r in g   th e  in itial  ad ap tatio n   s tag e  o f   th e  m o d el.   As  tr ain in g   p r o g r ess ed ,   th e  lo s s   g en er al ly   d ec lin ed   an d   ex h ib ite d   a  m o r e  s tab le  p atter n .   T h e  m in im u m   lo s s   v alu e  o f   0 . 4   was  ac h iev ed   at  g lo b al  s tep   7 6 4 3 ,   s u g g esti n g   ef f ec tiv e  o p tim izatio n   d u r in g   f in e - tu n in g .   Ov er all,   th e  d ec r ea s in g   tr en d   in   tr ain i n g   lo s s   d em o n s tr ates  th e  m o d el ’ s   ca p ab ilit y   to   lear n   r elev an t  r ep r esen tatio n s   f r o m   th e  d ataset  with o u t  ex h ib itin g   s ig n s   o f   d iv er g e n ce   o r   u n s t ab le  b eh av i o r .   T h is   o b s er v atio n   is   co n s is ten t  with   th e  ch ar ac ter is tics   o f   L o R A - b ased   f in e - tu n in g   p e r f o r m ed   u s in g   a  lim ited   n u m b er   o f   e p o ch s   an d   a  r elati v ely   s m all  ef f ec tiv e  b atc h   s ize.   C o m p lem en tin g   th e  tr ai n in g   lo s s ,  Fig u r e  5   p r esen ts   th e   ev alu atio n   lo s s   o n   th e   v ali d atio n   s et.     Fig u r e  5   p r esen ts   t h e  ev al u atio n   lo s s   tr en d   o v er   g lo b al  tr ain in g   s tep s .   At   th e  ea r ly   s ta g e  o f   tr ain i n g ,   th e   ev alu atio n   lo s s   s h o ws  a  r elativ ely   h ig h   v alu e,   r ef lectin g   th e   m o d el ’ s   lim ited   g en e r aliza tio n   ca p ab ilit y   b e f o r e   s u f f icien t  lear n in g   h as  tak en   p lace .   As  tr ain in g   p r o g r ess es,  th e  ev alu atio n   lo s s   d ec r ea s es  s tead ily ,   in d icatin g   im p r o v e d   m o d el  p e r f o r m an c e  o n   th e  ev alu atio n   d ataset.   B ased   o n   th e  o b s er v ed   r esu lts ,   th e  m ax im u m   ev alu atio n   lo s s   o f   3 . 3 1 2 4   o cc u r s   at  g lo b al  s tep   5 0 ,   wh ich   co r r esp o n d s   to   th e  in itial  p h a s e  o f   tr ain in g .   T h e   ev alu atio n   lo s s   co n tin u es  to   d ec lin e  an d   r ea c h es  its   m in im u m   v al u e  o f   2 . 6 6 4 0   at  g lo b al  s tep   1 0 , 8 0 0 ,   s u g g esti n g   th at   th e  m o d el  ac h i ev es  its   b est  g en er aliza tio n   p e r f o r m a n ce   to war d   th e   en d   o f   t h e  tr ain in g   p r o ce s s .   Ov er all,   th e  co n s is ten t  r ed u cti o n   an d   s tab ilizatio n   o f   th e  e v alu atio n   lo s s   in d icate   th at  t h e  m o d el  s u cc ess f u lly   lear n s   r elev an t  p atter n s   f r o m   th e  tr ain in g   d ata  with o u t   ex h ib itin g   s ig n s   o f   o v er f itti n g .   T h is   b eh a v io r   d em o n s tr ates  th at  th e  ap p lied   tr ain in g   co n f i g u r atio n   an d   L o R A - b ased   f in e - tu n in g   s tr ateg y   ef f ec tiv ely   s u p p o r t   s tab le  g en er aliza tio n   o n   u n s ee n   d ata.   B ased   o n   th e  ev alu atio n   lo s s   an aly s is ,   th e  m o d el  d em o n s tr ates  s tab le  an d   co n s is ten t  g en er aliza tio n   p er f o r m an ce   o n   th e   ev alu atio n   d ataset.   T o   f u r th er   ass ess   th e  class if icatio n   p er f o r m an ce   i n   t er m s   o f   p r e d ictio n   o u tco m es,  th e  ev al u atio n   is   co n tin u ed   u s in g   a  co n f u s io n   m atr ix ,   wh ich   p r o v id es  a  d etail ed   v iew  o f   tr u e  an d   f alse p r ed ictio n s   ac r o s s   class es.  T h e  r esu lts   o f   th e  c o n f u s io n   m atr ix   ar e  p r esen ted   in   Fig u r e  6 .           Fig u r e  6 .   C o n f u s io n   m atr i x   o f   th e  f in e - tu n ed   L L aM A   3 . 2   m o d el   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   TEL KOM NI KA   T elec o m m u n   C o m p u t E l  C o n tr o l ,   Vo l.  24 ,   No .   5 ,  Octo b e r   20 26 :  1 5 9 7 - 1 6 1 0   1606   Fig u r e  6   p r o v id es   a  d etailed   o v e r v iew  o f   t h e  class if icatio n   o u tco m es  g en er ated   b y   th e   p r o p o s e d   m o d el  o n   th e  ev al u atio n   d atas et.   T h e  co n f u s io n   m at r ix   in d i ca tes  th at  1 0 , 3 2 6   b en i g n   s am p les  wer e  co r r ec tly   id en tifie d   as  n o n - m alicio u s   ( t r u e  n e g ativ es /TN ) ,   wh ile  1 1 , 5 5 8   SQLi   s am p les  wer e  ac cu r ately   class if ied   as   m alicio u s   ( tr u e  p o s itiv es /TP ) .   Misclas s if icatio n   ca s es  wer e   lim ited ,   co n s is tin g   o f   f o u r   f alse  p o s itiv es  an d   s ix teen   f alse  n eg ativ es.  T h ese  f in d in g s   d em o n s tr ate  th e  m o d el ’ s   s tr o n g   ca p a b ilit y   to   d i f f er en tiate  b etwe en   leg itima te  u s er   in p u ts   an d   SQLi   attem p ts .   Fu r th er m o r e,   th e   r elativ ely   lo w  n u m b er   o f   f alse  alar m s   s u g g ests   th at  th e  p r o p o s ed   ap p r o ac h   ca n   ef f ec tiv ely   m in im ize   u n n ec ess ar y   b lo c k in g   o f   b en i g n   r e q u ests   wh ile  m ain tain in g   h ig h   s en s itiv ity   t o war d   m alicio u s   p atter n s .   Ov er all,   th e   co n f u s io n   m atr ix   co n f ir m s   th e   r eliab ilit y   an d   r o b u s tn ess   o f   th e  p r o p o s ed   f r am ewo r k   f o r   SQLi   d etec ti o n   [ 2 5 ] .   T ab le  6   p r esen ts   a  b en ch m ar k   co m p ar is o n   b etwe en   th e  p r o p o s ed   L L aM A   3 . 2 – L o R A  m o d el  an d   v ar io u s   tr a d itio n al  ML   an d   D L   b aselin es.   T h e   R F  m o d el  ac h iev es  an   ac c u r ac y   o f   9 7 . 4 8 % ,   with   a  p r ec is io n   o f   9 8 . 7 5 %,  a   r ec all  o f   9 6 . 4 9 %,  an d   an   F1 - s co r e  o f   9 7 . 6 1 %,  i n d icatin g   s tr o n g   an d   b alan ce d   p er f o r m an ce .   T h e   XGBo o s t  m o d el  r ec o r d s   an   a cc u r ac y   o f   9 6 . 9 6 %,  p r ec is io n   o f   9 9 . 3 7 %,  r ec all  o f   9 4 . 8 9 %,  an d   an   F1 - s co r e  o f   9 7 . 0 8 %,  s h o win g   h ig h   p r ec i s io n   b u t  s lig h tly   lo wer   r ec all.   Similar ly ,   th e  DT   m o d el  ac h iev es  9 6 . 6 1 %   ac cu r ac y ,   9 9 . 0 6 %  p r ec is io n ,   9 4 . 5 4 %   r ec all,   a n d   a n   F1 - s co r e  o f   9 6 . 7 5 %.   Am o n g   DL   ap p r o ac h es,   th e  C NN   m o d el  attain s   an   ac c u r ac y   o f   9 7 . 8 4 %,  p r ec is io n   o f   9 9 . 5 2 %,  r ec all  o f   9 6 . 4 2 %,  an d   an   F1 - s co r e  o f   9 7 . 9 4 %,   d em o n s tr atin g   co m p etitiv e  p e r f o r m a n ce   co m p a r ed   to   tr ad iti o n al  ML   m o d els.  T h e  L STM   m o d el  s h o ws  lo wer   b u t  co n s is ten t  r esu lts ,   with   an   ac cu r ac y   o f   9 2 . 2 5 %,  p r ec is io n   o f   9 2 . 8 4 %,  r ec all  o f   9 2 . 6 0 %,  an d   an   F1 - s co r e  o f   9 2 . 7 2 %.   T h e   b aselin e  L L aM A   3 . 2 – 1 B   m o d el   with o u t   f in e - tu n in g   ac h iev es  a n   ac cu r ac y   o f   o n l y   5 0 . 2 1 %,  d esp ite  a  h ig h   p r ec is io n   o f   9 9 . 2 6 %.  Ho wev er ,   its   r ec all  d r o p s   s ig n if ican tly   to   5 . 7 8 %,  r es u ltin g   in   a  lo w  F1 - s co r e  o f   1 0 . 9 3 %,  in d icatin g   p o o r   d etec tio n   ca p ab ilit y   with o u t  task - s p ec if ic  ad ap tatio n .   I n   co n tr ast,  th e  f in e - tu n ed   L L aM A  3 . 2 – 1 B   m o d e l  u s in g   L o R A  ac h iev es  th e  b est  o v er all  p er f o r m an ce ,   wi th   an   ac cu r ac y   o f   9 9 . 9 1 %,  p r ec is io n   o f   9 9 . 9 6 %,  r ec all  o f   9 9 . 8 6 %,  an d   a n   F1 - s co r e  o f   9 9 . 9 1 %.  T h ese  r e s u lts   co n f ir m   th at  L o R A - b ased   f in e - tu n i n g   s u b s t an tially   im p r o v es th e   ef f ec tiv e n ess   o f   LLM s   f o r   SQLi   d etec t io n .         T ab le  6 .   C o m p a r is o n   o f   m o d el   p er f o r m an ce   a g ain s t b aselin es   No   M o d e l   A c c u r a c y   P r e c i s i o n   R e c a l l   F1 - s c o r e   1   RF   9 7 . 4 8 %   9 8 . 7 5 %   9 6 . 4 9 %   9 7 . 6 1 %   2   X G B o o st   9 6 . 9 6 %   9 9 . 3 7 %   9 4 . 8 9 %   9 7 . 0 8 %   3   DT   9 6 . 6 1 %   9 9 . 0 6 %   9 4 . 5 4 %   9 6 . 7 5 %   4   C N N   9 7 . 8 4 %   9 9 . 5 2 %   9 6 . 4 2 %   9 7 . 9 4 %   5   LSTM   9 2 . 2 5 %   9 2 . 8 4 %   9 2 . 6 0 %   9 2 . 7 2 %   6   LLa M a   3 . 2   1B   5 0 . 2 1 %   9 9 . 2 6 %   5 . 7 8 %   1 0 . 9 3 %   7   F i n e   t u n i n g   LL a M a   3 . 2   1B   ( Lo R a )   9 9 . 9 1 %   9 9 . 9 6 %   9 9 . 8 6 %   9 9 . 9 1 %       I n   ad d itio n   t o   th e  ex p e r im en t al  ev alu atio n ,   th e  p r o p o s ed   m o d el  h as  b ee n   im p lem en ted   in   a  web - b ased   ap p licatio n ,   as  illu s tr at ed   in   Fig u r e  1 .   T h e  web - b ase d   s y s tem   allo ws  u s er s   to   s u b m it  SQL  q u er ies  o r   tex tu al  in p u ts   an d   r ec ei v e  r ea l - tim e  class if icatio n   r esu lts   in d icatin g   wh eth er   th e   in p u t  is   m alicio u s   o r   b en ig n .   T h is   im p lem en tatio n   d em o n s tr ates  th at  th e  f in e - tu n ed   m o d el  ca n   b e   ef f ec tiv ely   in teg r ated   in to   p r ac tical  s ec u r ity   s y s tem s ,   s u ch   as  W AF s   o r   d atab ase  s ec u r ity   m o n ito r in g   p latf o r m s .   B ased   o n   Fig u r e  1 ,   th e   s y s tem   ar ch itectu r e  co n f ir m s   th e  f ea s ib ilit y   o f   d ep lo y in g   t h e  p r o p o s ed   ap p r o ac h   in   r ea l - wo r ld   en v ir o n m e n ts   b ey o n d   o f f lin e  e x p er im e n tatio n .   Fig u r e  7   p r esen ts   ex a m p les  o f   th e   s y s tem ’ s   r ea l - tim e  d etec tio n   ca p ab ilit y   u s in g   b o th   m alicio u s   an d   b en ig n   in p u ts .   T h e  m alicio u s   ex am p le  co n s is ts   o f   a  lo g in   r eq u est  co n tain in g   th e  SQLi   p ay lo ad   ` ’   OR   1 =1   -- ` ,   wh er ea s   th e  b en ig n   ex am p le  co n s is ts   o f   a  f ilm   r ev iew  s u b m itted   as  o r d in ar y   u s er - g en er ated   tex t.  T h e   r esu lts   d em o n s tr ate  t h at  th e   p r o p o s ed   s y s tem   is   ca p ab le  o f   ac cu r ately   d is tin g u is h in g   m alicio u s   SQLi   attem p ts   f r o m   leg itima te  u s er   i n p u ts   in   p r a ctica l d ep lo y m en t  s ce n ar io s .   As  a  r esu lt,  th e  s y s tem   d is p la y s   a  n o tific atio n   in d icatin g   th at  th e  u s er   is   attem p tin g   a  B o o lean - b ased   SQLi   attac k ,   an d   ac ce s s   to   t h e  s y s tem   is   d en ied .   Fu r th er m o r e,   f o r   d ig ital  f o r en s ic  p u r p o s es,  th e  m o d el   p r o v id es a   co n te x tu al  ex p lan at io n   id en tify in g   th e  d etec ted   att ac k   alo n g   with   r ec o m m en d e d   m itig atio n   ac tio n s .   T h e  o u tp u t  o f   th is   d ig ital  f o r en s ic  an aly s is   ca n   b e  o b s er v e d   in   Fig u r e  8 .   T h is   ca p ab ilit y   s u p p o r ts   n o t  o n ly   r ea l - tim e  attac k   p r ev en tio n   b u t  also   p o s t - in cid e n t  in v esti g a tio n   b y   ass is tin g   ad m in is tr ato r s   in   u n d er s tan d in g   th e  attac k   ch ar ac ter is tics   an d   a p p r o p r iate  r esp o n s e  m ea s u r es.   Fig u r e  8   p r esen ts   th e  d ig ital  f o r en s ic  r ep o r t  g e n er ated   b y   th e  p r o p o s ed   s y s tem   f o r   d ete cted   SQLi   ev en ts .   T h e   r ep o r t  r ec o r d s   d etailed   in f o r m atio n   f o r   ea ch   d etec ted   attac k ,   in clu d i n g   t h e   tim estam p ,   s o u r ce   in ter n et  p r o to c o l  ( IP )   ad d r e s s ,   u s er   ag en t,   tar g et  f ield ,   d etec ted   p ay l o ad ,   attac k   t y p e,   r ec o m m e n d ed   m itig atio n ,   an d   s y s tem   ac tio n .   T h e  r esu lts   s h o w  th at  th e  s y s tem   is   ab le  to   ac cu r ately   id e n tify   v ar io u s   ty p es  o f   SQLi   attac k s ,   s u ch   as   B o o lean - b ased ,   T im e - b ased ,   UNI ON - b ased ,   an d   Gen e r ic  SQ L i   p atter n s .   E ac h   m alicio u s   p ay lo ad   is   clea r ly   h ig h lig h ted ,   allo win g   s ec u r ity   a n aly s ts   to   q u ick ly   u n d er s tan d   th e  s tr u ctu r e  o f   th e   Evaluation Warning : The document was created with Spire.PDF for Python.