Small language model-augmented synthesis for application programming interface threat detection
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Security Radio. Generated commentary on the latest security and cryptography papers.
Nadia: We're looking at the paper: "Small language model-augmented synthesis for application programming interface threat detection".
Paper summary: Nadia: So to wrap up this paper, "Small language model-augmented synthesis for application programming interface threat detection," they successfully synthesized semantically meaningful API requests that keep the structural integrity of the requests while still introducing useful variability.
Elias: That variability is key because it allows the downstream anomaly detection module to learn more robust patterns from a smaller initial dataset. They did this by building a RoBERTa-based architecture to generate these samples, which are then used to train an anomaly detector on the extended set.
Priya: What does that mean in plain terms for someone listening? It means you can take those limited API samples and use AI to create slightly different versions of them that still look like real API calls but might represent different ways a threat could manifest, making your detection system tougher.
Nadia: Right, so the implication is that this technique provides a practical way to augment security datasets when large amounts of labeled data are unavailable or too hard to get. It shows how leveraging models like RoBERTa for synthesis can directly improve security performance on real traffic data.
Elias: The authors also noted that they found their custom model generated high-quality augmentations more efficiently than the larger RoBERTa Base model, even though they were trained on significantly smaller, domain-specific datasets.
Priya: That efficiency is a practical win because generating data can be computationally expensive. If you can do it faster with a smaller model, that makes the whole process more feasible for many teams.
Nadia: And while they showed strong performance gains, they also highlighted that improving coverage for less common attack patterns and balancing attack categories are things they need to work on in future research. That’s the honest assessment of the current state of this specific approach.
Conclusion: Nadia: So this paper is about using a smaller language model to help create synthetic API requests so we can better find threats in real web traffic datasets, right?
Elias: Yeah, it's titled "Small language model-augmented synthesis for application programming interface threat detection," and the authors are Udi Aharon and his team.
Priya: It’s interesting that they focus on making the requests semantically meaningful while keeping their structure intact.
Nadia: Exactly. They used RoBERTa to generate these synthetic samples, which then help train an anomaly detection module on a smaller set of real data.
Elias: And the big numbers they showed are pretty solid—a four point ninety-four percent increase on one dataset and over twenty point one percent on another.
Priya: But we have to look closely at what those numbers actually mean for the real world, especially regarding false alarms.
Nadia: That’s right, the results show that this augmentation mainly helps a classifier reduce false positives rather than just making it more sensitive overall on some datasets.
Elias: The authors did mention they found their custom model generated these high-quality samples quite efficiently compared to using the full RoBERTa Base model.
Priya: Efficiency is important because generating data takes time, so being able to do it faster with a smaller model makes the whole process more practical for security teams.
Nadia: True. The authors also flagged some areas they still need to improve, like making sure they cover more diverse attack patterns and balancing different types of threats during training.
Elias: Yeah, they pointed out that while the approach is stable across different settings when you tweak the confidence level, there’s definitely room for more coverage in their next steps.
Priya: So what this means for us right now is that we can use this technique to boost our detection performance without needing massive amounts of perfectly labeled data upfront.
Nadia: It suggests a way to get better results by augmenting the training data intelligently, not just by throwing more raw traffic at a model and hoping for the best.
Elias: And it shows that even smaller, task-specific language models can be very effective when they are fine-tuned for security semantics.
Priya: We'll need to keep an eye on how they handle those class imbalances in their next iteration, because that’s where a lot of real-world problems live.
Department of Computer and Software Engineering, Ariel University · Department of Industrial Engineering & Management, Ariel University · Ariel Cyber Innovation Center, Ariel University · Data Science and Artificial Intelligence Research Center, Ariel University
cs.CR
Submitted: 2024-05-18
Updated: 2026-12-01
Comments: 21 pages, 4 figures, 18 tables
Journal ref: Udi Aharon, Revital Marbel, Ran Dubin, Amit Dvir, Chen Hajaj, Engineering Applications of Artificial Intelligence, Volume 189, Part 1, 2027
DOI: 10.1016/j.engappai.2026.116850
Code: https://github.com/ArielCyber/GAN-API
License: http://creativecommons.org/licenses/by-nc-nd/4.0/
Importance score: 83/100
The gist: RoBERTa-Augmented Synthesis for Detecting Malicious API Requests introduces a GAN-inspired learning framework that extends limited API traffic datasets through targeted…
Key concepts
- RoBERTa
- RoBERTa is a powerful Transformer-based language model architecture used here because it excels at understanding the context and meaning within API requests. It serves as the backbone for generating synthetic data that mimics real, complex API calls.
- GAN-inspired Learning Framework
- The system uses a Generative Adversarial Network (GAN) concept where one part generates fake API requests, and another part tries to distinguish them from real ones. This adversarial process allows the model to create highly realistic synthetic data that is useful for training the final detector.
- Data Augmentation Strategy
- This involves a three-stage process: input masking, a generator network, and a discriminator network. The masking identifies tokens to replace based on frequency or semantic distance, while the generator creates new requests guided by these constraints to expand the original dataset.
Terminology
Summary
RoBERTa-Augmented Synthesis for Detecting Malicious API Requests introduces a GAN-inspired learning framework that extends limited API traffic datasets through targeted, domain-aware synthesis to enhance anomaly detection on public HTTP traffic datasets. p. 1 To
address this, we introduce a GAN-inspired learning framework that extends limited API traffic datasets
through targeted, domain-aware synthesis. Drawing on techniques from Natural Language Processing
(NLP), our approach leverages Transformer-based architectures, particularly RoBERTa, to enhance
the contextual representation of API requests and generate realistic synthetic samples aligned with
security-specific semantics. In addition, we apply our augmented data to various anomaly detection
models to evaluate its impact on classification performance. Our method achieves up to a 4. Our method achieves up to a 4. 94%
increase in F1 score on CSIC 2010 and up to 21. Drawing on techniques from Natural Language Processing
(NLP), our approach leverages Transformer-based architectures, particularly RoBERTa, to enhance
the contextual representation of API requests and generate realistic synthetic samples aligned with
security-specific semantics. We evaluate our framework on two benchmark datasets, CSIC 2010 and
ATRDF 2023, and compare it with a previous data augmentation technique to assess the importance
of domain-specific synthesis.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Framework Design
The proposed framework utilizes Transformers, specifically RoBERTa, to enhance the contextual representation of API requests and generate realistic synthetic samples aligned with security-specific semantics.<ref:2405.11258#pg6,Transformer architecture is the backbone of various state-of-the-art (SOTA) language models>. p. 5 The layered design of Transformers further enables the model to capture higher-level patterns
across longer spans of text, which is particularly effective for
modeling structured API requests. Transformer architecture is the backbone of various
state-of-the-art (SOTA) language models, including BERT
and RoBERTa Wolf, Debut, Sanh, Chaumond, Delangue,
Moi, Cistac, Rault, Louf, Funtowicz et al. Among the
various NLP tasks supported by MLM, the fill-mask task
allows a language model to infer and predict the masked
token in a sentence using the surrounding context Kesgin
and Amasyali (2023). The proposed framework (depicted in Figure 1) comprises two modules: a datastore generator designed to augment sparse datasets by synthesizing realistic API requests,
and a downstream anomaly detection module trained on the
extended dataset that includes both original and generated
samples. Among the
various NLP tasks supported by MLM, the fill-mask task
allows a language model to infer and predict the masked
token in a sentence using the surrounding context Kesgin
and Amasyali (2023). The proposed framework (depicted in Figure 1) comprises two modules: a datastore generator designed to augment sparse datasets by synthesizing realistic API requests,
and a downstream anomaly detection module trained on the
extended dataset that includes both original and generated
samples. The proposed framework (depicted in Figure 1) comprises two modules: a datastore generator designed to augment sparse datasets by synthesizing realistic API requests,
and a downstream anomaly detection module trained on the
extended dataset that includes both original and generated
samples. The first module leverages a RoBERTa-based architecture to generate realistic API requests from limited
data, using token masking guided by structural and semantic
constraints.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Data Augmentation Strategy
The datastore generator process consists of three sequential stages: Input Masking, Generator Network, and Discriminator Network.<ref:2405.11258#pg7>. The input masking step involves identifying tokens suitable for replacement based on frequency and semantic distance criteria. p. 5 The
process consists of three sequential stages: Input Masking,
Generator Network, and Discriminator Network. First, the
input masking step identifies tokens suitable for replacement
based on frequency and semantic distance criteria. 73, derived from the specified confidence level, to calculate a frequency threshold for each dataset. For CSIC 2010,
the threshold was set at 6,177.Where the paper says it
Where the paper says it
Model Training Signal
The generator is based on a Masked Language Modeling (MLM) built on the RoBERTa architecture.<ref:2405.11258#pg7,The proposed generator, as shown in Figure 1, step 1. p. 5 Token Masking Once the outlier token within an API request has been identified, we replace it with the < 𝑀𝐴𝑆𝐾 >
token and feed the modified request into RoBERTa to predict
the masked word, as shown in Figure 1, step 1. Generator
The proposed generator, as shown in Figure 1, step 1. Generator
The proposed generator, as shown in Figure 1, step 1. 2,
is based on a MLM built on the RoBERTa architecture. (2019), with an additional linear layer
to produce a probability distribution over the vocabulary
for each masked token. The generator uses the final hidden
state corresponding to the < 𝑀𝐴𝑆𝐾 > token and uses
the Softmax function to compute token probabilities across
the vocabulary, following standard language modeling practices. (2019), with an additional linear layer
to produce a probability distribution over the vocabulary
for each masked token. The generator uses the final hidden
state corresponding to the < 𝑀𝐴𝑆𝐾 > token and uses
the Softmax function to compute token probabilities across
the vocabulary, following standard language modeling practices. The generator uses the final hidden
state corresponding to the < 𝑀𝐴𝑆𝐾 > token and uses
the Softmax function to compute token probabilities across
the vocabulary, following standard language modeling practices. The loss function used to train the generator is CrossEntropy loss Ho and Wookey (2019), which is well-suited
for masked word prediction.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Performance Evaluation
The framework was evaluated on two benchmark datasets, CSIC 2010 and ATRDF 2023.<ref:2405.11258#pg8,We evaluate our framework on two benchmark datasets, CSIC 2010 and ATRDF 2023>. p. 1 Drawing on techniques from Natural Language Processing
(NLP), our approach leverages Transformer-based architectures, particularly RoBERTa, to enhance
the contextual representation of API requests and generate realistic synthetic samples aligned with
security-specific semantics. We evaluate our framework on two benchmark datasets, CSIC 2010 and
ATRDF 2023, and compare it with a previous data augmentation technique to assess the importance
of domain-specific synthesis. (2024) framework in terms of the semantic and
structural quality of the generated API requests, and (2) to
assess whether higher-quality augmentation contributes to
improved anomaly detection performance. As shown in Table 4, the custom-trained RoBERTa
generator achieved the highest scores across all three text
similarity metrics on both datasets, with a few exceptions. 51% in MoverScore, though BLEU was
slightly lower by -0. The difference is more pronounced
on ATRDF 2023, where the custom model achieved a
BERTScore improvement of +11.Where the paper says it
Where the paper says it
Where the paper says it
Comparative Analysis
The custom model outperformed GLASS-FODD by +5.74% in BERTScore and +2. p. 7 Figure 2: Example of a structured HTTP API request extracted
from the ATRDF 2023 dataset, showing the method indicating
the operation performed, the path identifying the requested
resource, and the headers providing metadata such as content
type, client identity, and session details. Evaluation Metrics
To evaluate the quality of data augmentation in the
generative stage, we use three complementary text generation evaluation metrics: BiLingual Evaluation Understudy (BLEU) Papineni, Roukos, Ward and Zhu (2002),
BERTScore Zhang, Kishore, Wu, Weinberger and Artzi
(2019), and MoverScore Zhao, Peyrard, Liu, Gao, Meyer
and Eger (2019). Drawing on techniques from Natural Language Processing
(NLP), our approach leverages Transformer-based architectures, particularly RoBERTa, to enhance
the contextual representation of API requests and generate realistic synthetic samples aligned with
security-specific semantics. We evaluate our framework on two benchmark datasets, CSIC 2010 and
ATRDF 2023, and compare it with a previous data augmentation technique to assess the importance
of domain-specific synthesis. This setup allows us to
isolate the contribution of the synthetic data to the final
classification outcome. On the CSIC 2010 dataset, the custom RoBERTa model
achieves an MCC of 95. Our method achieves up to a 4. 94%
increase in F1 score on CSIC 2010 and up to 21. Drawing on techniques from Natural Language Processing
(NLP), our approach leverages Transformer-based architectures, particularly RoBERTa, to enhance
the contextual representation of API requests and generate realistic synthetic samples aligned with
security-specific semantics. We evaluate our framework on two benchmark datasets, CSIC 2010 and
ATRDF 2023, and compare it with a previous data augmentation technique to assess the importance
of domain-specific synthesis. Recall remains consistently high
across all models at 99. 97%, indicating that augmentation
mainly improves the classifier’s ability to reduce false positives rather than increase detection sensitivity.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Conclusion and Future Work
The framework successfully synthesizes semantically meaningful API requests that preserve structural integrity while introducing useful variability.<ref:2405.11258#pg13>. Future work should explore generating multiple diverse augmentations per request to improve coverage for less common attack patterns. p. 1 Existing datasets often do not provide sufficient coverage of the
diverse API structures, parameter formats, and usage patterns encountered in real-world scenarios. As a result, models trained on these datasets often struggle to generalize and may fail to detect less
common or emerging attack vectors. Existing datasets often do not provide sufficient coverage of the
diverse API structures, parameter formats, and usage patterns encountered in real-world scenarios. As a result, models trained on these datasets often struggle to generalize and may fail to detect less
common or emerging attack vectors. We compare this model
to the pre-trained RoBERTa-Base model to evaluate the
impact of domain-specific language modeling. The evaluation involves measuring lexical similarity and semantic
alignment with the original inputs to gauge the quality of the
generated API requests. To support this classification, we introduce an
OOD score, derived from the probability vector produced
by the linear layer. While OOD detection typically refers
to identifying inputs that diverge from the training distribution Ren, Liu, Fertig, Snoek, Poplin, Depristo, Dillon
and Lakshminarayanan (2019), in our case, we use the
OOD score as an internal signal to assess the confidence
of the discriminator’s prediction. Furthermore, we apply our method to SOTA HTTP anomaly
detection techniques to evaluate its potential for enhancing
more advanced classifiers. Finally, to assess the sensitivity
of our generative process to the reserved token filtering
mechanism, we conducted an ablation study focused on the
confidence level parameter used to derive the frequency
threshold. Each
experiment was repeated five times, and we report the average score across all evaluation metrics. The custom-trained
RoBERTa model was configured with 6 transformer layers,
12 attention heads, a hidden size of 768, and a vocabulary
size of 52,000.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Ablation Study Insights
The ablation study showed that F1 score gains on CSIC 2010 rose from +0.729% at a confidence level of 97% to +1. p. 5 There are
several possible ways to define a threshold, including rulebased cutoffs, empirical tuning, or iterative adjustment of
𝑧-score values to find an optimal standard deviation Zhou,
Zhang, Liu, Shi, Wang and Yu (2021). In our work, we
adopt a statistically grounded method by deriving the 𝑧-
score directly from a predefined confidence level Simundic
et al. There are
several possible ways to define a threshold, including rulebased cutoffs, empirical tuning, or iterative adjustment of
𝑧-score values to find an optimal standard deviation Zhou,
Zhang, Liu, Shi, Wang and Yu (2021). In our work, we
adopt a statistically grounded method by deriving the 𝑧-
score directly from a predefined confidence level Simundic
et al. There are
several possible ways to define a threshold, including rulebased cutoffs, empirical tuning, or iterative adjustment of
𝑧-score values to find an optimal standard deviation Zhou,
Zhang, Liu, Shi, Wang and Yu (2021). In our work, we
adopt a statistically grounded method by deriving the 𝑧-
score directly from a predefined confidence level Simundic
et al. In comparison, the RoBERTa-Base model
shows a larger relative improvement in F1 score (+4. 94%),
while GLASS-FODD sees only a modest increase (+0. There are
several possible ways to define a threshold, including rulebased cutoffs, empirical tuning, or iterative adjustment of
𝑧-score values to find an optimal standard deviation Zhou,
Zhang, Liu, Shi, Wang and Yu (2021). In our work, we
adopt a statistically grounded method by deriving the 𝑧-
score directly from a predefined confidence level Simundic
et al. There are
several possible ways to define a threshold, including rulebased cutoffs, empirical tuning, or iterative adjustment of
𝑧-score values to find an optimal standard deviation Zhou,
Zhang, Liu, Shi, Wang and Yu (2021). In our work, we
adopt a statistically grounded method by deriving the 𝑧-
score directly from a predefined confidence level Simundic
et al. 51% in MoverScore, though BLEU was
slightly lower by -0. The difference is more pronounced
on ATRDF 2023, where the custom model achieved a
BERTScore improvement of +11. 51% in MoverScore, though BLEU was
slightly lower by -0. The difference is more pronounced
on ATRDF 2023, where the custom model achieved a
BERTScore improvement of +11. There are
several possible ways to define a threshold, including rulebased cutoffs, empirical tuning, or iterative adjustment of
𝑧-score values to find an optimal standard deviation Zhou,
Zhang, Liu, Shi, Wang and Yu (2021). In our work, we
adopt a statistically grounded method by deriving the 𝑧-
score directly from a predefined confidence level Simundic
et al. There are
several possible ways to define a threshold, including rulebased cutoffs, empirical tuning, or iterative adjustment of
𝑧-score values to find an optimal standard deviation Zhou,
Zhang, Liu, Shi, Wang and Yu (2021). In our work, we
adopt a statistically grounded method by deriving the 𝑧-
score directly from a predefined confidence level Simundic
et al. 10%), with the most substantial improvement observed
in Precision (+38. Recall remains consistently high
across all models at 99.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
SOTA Comparison
When applied to three SOTA HTTP anomaly detection methods, the inclusion of generated samples led to improved performance across all methods and datasets.<ref:2405.11258#pg12>. For Sec2vec, consistent gains were observed across all metrics. p. 9 Overall, the inclusion of generated samples led to improved performance across all methods and datasets. For
Sec2vec, we observed consistent gains across all metrics,
particularly in precision, with a smaller but stable increase in
F1 score and MCC. Overall, the inclusion of generated samples led to improved performance across all methods and datasets. For
Sec2vec, we observed consistent gains across all metrics,
particularly in precision, with a smaller but stable increase in
F1 score and MCC. Our method achieves up to a 4. 94%
increase in F1 score on CSIC 2010 and up to 21. country=’;SELECT%20*%20FROM
%20shippers%20–
’;SELECT * FROM shippers – Appends raw SQL code into a query
parameter to manipulate backend queries
and extract database records. For the anomaly detection task, we use four classification
metrics: Precision, Recall, F1 Score, and Matthews Correlation Coefficient (MCC). For
Sec2vec, we observed consistent gains across all metrics,
particularly in precision, with a smaller but stable increase in
F1 score and MCC. This suggests that the augmented samples contribute useful variation that reinforces the model’s
ability to distinguish subtle patterns in request structure. (2023), SWAF Jemal, Haddar, Cheikhrouhou and
Mahfoudhi (2022), and VLADEN Jagat, Sisodia and Singh
(2024). In this evaluation, we used only the custom-trained
RoBERTa variant as the GAN architecture for generating
augmented samples.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Evaluation Metrics
The quality of data augmentation in the generative stage was evaluated using three complementary text generation evaluation metrics: BLEU, BERTScore, and MoverScore.<ref:2405.11258#pg7> BLEU measures surface-level similarity by computing n-gram overlap between generated and reference sequences. p. 7 Evaluation Metrics
To evaluate the quality of data augmentation in the
generative stage, we use three complementary text generation evaluation metrics: BiLingual Evaluation Understudy (BLEU) Papineni, Roukos, Ward and Zhu (2002),
BERTScore Zhang, Kishore, Wu, Weinberger and Artzi
(2019), and MoverScore Zhao, Peyrard, Liu, Gao, Meyer
and Eger (2019). BLEU measures surface-level similarity by
computing n-gram overlap between generated and reference
sequences, making it effective for capturing exact lexical
matches. BLEU measures surface-level similarity by
computing n-gram overlap between generated and reference
sequences, making it effective for capturing exact lexical
matches. BERTScore computes semantic similarity using
contextualized token embeddings from pretrained language
models, making it well-suited for handling paraphrasing and
variations in word order. BERTScore computes semantic similarity using
contextualized token embeddings from pretrained language
models, making it well-suited for handling paraphrasing and
variations in word order. MoverScore extends this approach
by combining contextual embeddings with Earth Mover’s
Distance Rubner, Tomasi and Guibas (2000), which quantifies the minimum semantic effort required to transform one
sequence into another and thus measures how closely the
meaning of the generated text aligns with the reference. country=’;SELECT%20*%20FROM
%20shippers%20–
’;SELECT * FROM shippers – Appends raw SQL code into a query
parameter to manipulate backend queries
and extract database records. For the anomaly detection task, we use four classification
metrics: Precision, Recall, F1 Score, and Matthews Correlation Coefficient (MCC). F1 Score =
2 ⋅ Precision ⋅ Recall
Precision + Recall
MCC. Provides a balanced evaluation of classification
performance, even with class imbalance, using all four elements of the confusion matrix. F1 Score =
2 ⋅ Precision ⋅ Recall
Precision + Recall
MCC. Provides a balanced evaluation of classification
performance, even with class imbalance, using all four elements of the confusion matrix. These are defined as:
Precision. Quantifies the number of correctly predicted
positive instances out of all predicted positives. country=’;SELECT%20*%20FROM
%20shippers%20–
’;SELECT * FROM shippers – Appends raw SQL code into a query
parameter to manipulate backend queries
and extract database records. For the anomaly detection task, we use four classification
metrics: Precision, Recall, F1 Score, and Matthews Correlation Coefficient (MCC). These are defined as:
Precision. Quantifies the number of correctly predicted
positive instances out of all predicted positives. Precision =
𝑇 𝑃
𝑇 𝑃 + 𝐹 𝑃
Recall. Measures the proportion of actual positives correctly identified by the model. country=’;SELECT%20*%20FROM
%20shippers%20–
’;SELECT * FROM shippers – Appends raw SQL code into a query
parameter to manipulate backend queries
and extract database records. For the anomaly detection task, we use four classification
metrics: Precision, Recall, F1 Score, and Matthews Correlation Coefficient (MCC). Precision =
𝑇 𝑃
𝑇 𝑃 + 𝐹 𝑃
Recall. Measures the proportion of actual positives correctly identified by the model. Our method achieves up to a 4. 94%
increase in F1 score on CSIC 2010 and up to 21.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Data Set Details
The experiments were conducted on CSIC 2010 and ATRDF 2023 datasets.<ref:2405.11258#pg4> CSIC 2010 simulates HTTP traffic for an e-commerce web application with over 72,000 requests. p. 7 It simulates HTTP traffic for an e-commerce web application, where users interact with features such as product
searches, shopping carts, and registration forms. The dataset
includes over 72,000 web requests, comprising 36,000 normal requests and more than 25,000 attack instances. It reflects modern
API formats and includes a wide variety of payload-based
attacks, such as Directory Traversal (DT), Cookie Injection
(CI), LOG4J, Remote Code Execution (RCE), Log Forging
(LF), SQLi, and XSS, all labeled accordingly. The dataset is
structured into four distinct groups and comprises approximately 54,000 normal pairs and 78,000 abnormal pairs. (2025) for
studying API-level threat detection and classification. Although CSIC 2010 represents HTTP traffic and ATRDF
2023 is explicitly API-based, we treat both datasets as
HTTP-based API traffic, given that modern APIs rely on
the same underlying protocol and structural patterns Niswar,
Safruddin, Bustamin and Aswad (2024).Where the paper says it
Where the paper says it
Where the paper says it
Ablation Study Details
The ablation study systematically varied the confidence level used for token filtering to assess its impact on detection performance.<ref:2405.11258#pg6>. The study was performed using the custom-trained RoBERTa model by varying the confidence level from 97% to 99. p. 8 We begin by
analyzing the identification of reserved tokens during the
input masking phase. Next, we assess our method using
a custom-trained RoBERTa model, which we trained from
scratch on the experimental datasets. SWAF also showed improved performance, especially in
recall, while precision remained stable or showed slight
variation. These results indicate that the augmented samples
Aharon et al. Drawing on techniques from Natural Language Processing
(NLP), our approach leverages Transformer-based architectures, particularly RoBERTa, to enhance
the contextual representation of API requests and generate realistic synthetic samples aligned with
security-specific semantics. We evaluate our framework on two benchmark datasets, CSIC 2010 and
ATRDF 2023, and compare it with a previous data augmentation technique to assess the importance
of domain-specific synthesis. In comparison, the RoBERTa-Base model
shows a larger relative improvement in F1 score (+4. 94%),
while GLASS-FODD sees only a modest increase (+0. 10%), with the most substantial improvement observed
in Precision (+38. Recall remains consistently high
across all models at 99.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Efficiency Comparison
The custom-trained RoBERTa model generated high-quality augmentations more efficiently than the larger RoBERTa-Base model despite being trained on significantly smaller, domain-specific datasets.<ref:2405.11258#pg10>. The custom model averaged 0. p. 8 We begin by
analyzing the identification of reserved tokens during the
input masking phase. Next, we assess our method using
a custom-trained RoBERTa model, which we trained from
scratch on the experimental datasets. Meanwhile, domain-specific tokens such
as "tienda1" in CSIC 2010 and "check" in ATRDF 2023
highlighted differences between the two API environments. Baselines
In this experiment, we produced one augmented sample
for each input HTTP request in the training set. Next, we assess our method using
a custom-trained RoBERTa model, which we trained from
scratch on the experimental datasets. We compare this model
to the pre-trained RoBERTa-Base model to evaluate the
impact of domain-specific language modeling. Highlights
RoBERTa-Augmented Synthesis for Detecting Malicious API Requests
Udi Aharon, Revital Marbel, Ran Dubin, Amit Dvir, Chen Hajaj
• Framework inspired by Generative Adversarial Networks augments web API traffic data. • RoBERTa-based language model enhances the semantics of synthetic web request samples. Baselines
In this experiment, we produced one augmented sample
for each input HTTP request in the training set. To ensure
the quality of the synthetic data, only the generated samples
that passed the discriminator’s validation were retained. 10% on ATRDF 2023. The source codes of this
work are available at https://github. The source codes of this
work are available at https://github. com/ArielCyber/GAN-API. 10% on ATRDF 2023. The source codes of this
work are available at https://github.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
References
The paper cites numerous prior works covering web security, few-shot learning, and deep learning data augmentation techniques.<ref:2405.11258#pg3,Section 2 reviews prior work related to anomaly detection, fewshot learning, and deep learning techniques for data augmentation>. p. 2 The remainder of this paper is organized as follows. Section 2 reviews prior work related to anomaly detection, fewshot learning, and deep learning techniques for data augmentation. Transformer architecture is the backbone of various
state-of-the-art (SOTA) language models, including BERT
and RoBERTa Wolf, Debut, Sanh, Chaumond, Delangue,
Moi, Cistac, Rault, Louf, Funtowicz et al. RoBERTa
builds on the foundational BERT model, with some key
updates in the way it’s trained to enhance its performance in
language comprehension tasks. Few-shot
learning (FSL) is specifically designed to enable models to
learn effectively from small amounts of labeled data, making
it particularly useful for tasks such as anomaly detection Yu
and Bian (2020); Huang, Liu, Fung, An, He, Zhao, Yang and
Luan (2020); Lu and Liu (2023). On the other hand, Generative Adversarial Networks (GANs) are utilized to augment
limited datasets by generating realistic synthetic samples
before training Sun and He (2020); Saxena and Cao (2021);
Chavdarova and Fleuret (2018); Mohebbi Moghaddam, Boroomand, Jalali, Zareian, Daeijavad, Manshaei and Krunz
(2023). One line of work focuses on improving few-shot performance through discriminative representation learning. Iliyasu et al. In the context of network security, Ding et al. Ding,
Chen, Dong, Fu and Cui (2022) proposed a hybrid approach
combining K-Nearest Neighbors (KNN) for undersampling
with a GAN variant to oversample minority-class intrusion
data. In the context of network security, Ding et al. Ding,
Chen, Dong, Fu and Cui (2022) proposed a hybrid approach
combining K-Nearest Neighbors (KNN) for undersampling
with a GAN variant to oversample minority-class intrusion
data. Several methods have been introduced to address the
challenge of limited datasets in deep learning. Few-shot
learning (FSL) is specifically designed to enable models to
learn effectively from small amounts of labeled data, making
it particularly useful for tasks such as anomaly detection Yu
and Bian (2020); Huang, Liu, Fung, An, He, Zhao, Yang and
Luan (2020); Lu and Liu (2023). Web Security and Anomaly Detection
Extensive research has been conducted on detecting malicious behavior in web traffic, including attacks such as SQL
Injection (SQLi), and Cross-Site Scripting (XSS). While
early approaches often relied on rule-based or statistical
models, more recent work has adopted machine learning
and NLP techniques to analyze structured web requests and
detect anomalies. Web Security and Anomaly Detection
Extensive research has been conducted on detecting malicious behavior in web traffic, including attacks such as SQL
Injection (SQLi), and Cross-Site Scripting (XSS). While
early approaches often relied on rule-based or statistical
models, more recent work has adopted machine learning
and NLP techniques to analyze structured web requests and
detect anomalies. RoBERTa-Augmented Synthesis for Detecting Malicious API Requests
Udi Aharona,c,∗
, Revital Marbele
, Ran Dubina,c
, Amit Dvira,c,1 and Chen Hajajb,c,d
aDepartment of Computer and Software Engineering, Golan Heights 1, Ariel, 4077625, Israel
bDepartment of Industrial Engineering & Management, Ariel University, Golan Heights 1, Ariel, 4077625, Israel
cAriel Cyber Innovation Center, Ariel University, Golan Heights 1, Ariel, 4077625, Israel
dData Science and Artificial Intelligence Research Center, Ariel University, Golan Heights 1, Ariel, 4077625, Israel
eDepartment of Computer Science, Holon Institute of Technology (HIT), Golomb 52, Holon, 4077625, Israel
A R T I C L E I N F O
Keywords:
Data Augmentation
API Security
GAN-Inspired
NLP
A B S T R A C T
Web applications and APIs face constant threats from malicious actors seeking to exploit vulnerabilities for illicit gains. To defend against these threats, it is essential to have anomaly detection systems
that can identify a variety of malicious behaviors.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Author Information
Udi Aharon is currently pursuing a Ph.D. degree in Computer and Software Engineering at Ariel University, Israel. p. 1 RoBERTa-Augmented Synthesis for Detecting Malicious API Requests
Udi Aharona,c,∗
, Revital Marbele
, Ran Dubina,c
, Amit Dvira,c,1 and Chen Hajajb,c,d
aDepartment of Computer and Software Engineering, Golan Heights 1, Ariel, 4077625, Israel
bDepartment of Industrial Engineering & Management, Ariel University, Golan Heights 1, Ariel, 4077625, Israel
cAriel Cyber Innovation Center, Ariel University, Golan Heights 1, Ariel, 4077625, Israel
dData Science and Artificial Intelligence Research Center, Ariel University, Golan Heights 1, Ariel, 4077625, Israel
eDepartment of Computer Science, Holon Institute of Technology (HIT), Golomb 52, Holon, 4077625, Israel
A R T I C L E I N F O
Keywords:
Data Augmentation
API Security
GAN-Inspired
NLP
A B S T R A C T
Web applications and APIs face constant threats from malicious actors seeking to exploit vulnerabilities for illicit gains. To defend against these threats, it is essential to have anomaly detection systems
that can identify a variety of malicious behaviors. Highlights
RoBERTa-Augmented Synthesis for Detecting Malicious API Requests
Udi Aharon, Revital Marbel, Ran Dubin, Amit Dvir, Chen Hajaj
• Framework inspired by Generative Adversarial Networks augments web API traffic data. • RoBERTa-based language model enhances the semantics of synthetic web request samples.Where the paper says it
Where the paper says it
Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.
Improvements for AI systems
-
GAN-inspired framework for API attack detection can generate high-quality, diverse API requests from a limited dataset by treating structured API requests as language-like sequences and using token masking guided by structural and semantic constraints. This allows the system to augment sparse datasets, improving anomaly detection on public HTTP traffic datasets.
-
The system can leverage RoBERTa as both a generator guided by API-specific constraints and a discriminator trained in a self-supervised manner using Pseudo Labeling (PL) and Out Of Distribution (OOD) scoring to distinguish between normal and anomalous API requests. This dual role enhances the generation process while providing an internal signal to assess the confidence of the discriminator’s prediction.
-
A domain-specific token masking strategy based on semantic distance and statistical filtering ensures that generated API samples remain structurally valid and contextually relevant to the API domain, by identifying outlier tokens using cosine similarity against a sentence embedding. This step preserves
structural integrity
during data augmentation for security analysis. -
The anomaly detection module can be trained on an extended dataset that includes both original and generated samples, utilizing a byte-level BPE tokenizer trained from scratch on the unified dataset to produce a reliable tokenizer without introducing bias from excessive short or fragmented tokens. This ensures robust classification performance on API traffic.
-
The final classification task can be performed by training a Random Forest classifier where the anomaly detection threshold is dynamically defined as the 99th percentile of the model output probabilities over normal training data, aligning with
our setting, where tokenized API requests may contain sparse or noisy elements.
Abstract
Application Programming Interfaces (APIs) face constant threats from malicious actors seeking to exploit vulnerabilities for illicit gains. Effective anomaly detection depends on diverse, representative datasets that capture real-world API behaviors. However, existing datasets are often limited in scope, privacy-restricted, or lack the structural variability needed to train robust detection models. To address this challenge, we propose a Small Language Model (SLM)-augmented synthesis framework designed to expand limited API datasets with constraints intended to preserve request structure and contextual relevance. The proposed framework, referred to as SLM-API, leverages a compact Transformer-based model to replace selected tokens in benign and malicious requests, subject to structural restrictions and a separately trained discriminator consistency check. We evaluate our framework on two benchmark datasets, the Spanish National Research Council (CSIC) 2010 Hypertext Transfer Protocol (HTTP) dataset and the API Traffic Research Dataset Framework (ATRDF) 2023, and compare it with pretrained models, plain masked language models, DeepSeek generation, and a duplication control to assess controlled augmentation. In addition, we apply our augmented data to various anomaly detection models to evaluate its impact on classification performance. Our method achieves Random Forest F1 scores of 97.67% on CSIC 2010 and 91.24% on ATRDF 2023, improvements of 1.00 and 21.12 percentage points, respectively, over training without augmentation. Component ablations and endpoint-family holdout reveal the role of replacement restrictions and uneven transfer to excluded routes.
Sources
- Generating Sentences from a Continuous Space
- Adversarial Learning for Neural Dialogue Generation
- RoBERTa: A Robustly Optimized BERT Pretraining Approach
- DATE: Detecting Anomalies in Text via Self-Supervision of Transformers
- BERTScore: Evaluating Text Generation with BERT
- MoverScore: Text Generation Evaluating with Contextualized Embeddings and Earth Mover Distance
Related papers
- RustMizan: A Compilable, Contamination-Aware Benchmarking Framework for Rust Vulnerabilities
- Introducing the Generative Application Firewall (GAF)
- Opal: Private Memory for Personal AI
- Fuel as Identity: Authenticating Inter-Satellite Laser Links after Total Key Compromise
- Merkle Trees Minimize Verifier Complexity in the ROM
- VulCPE: Context-Aware Cybersecurity Vulnerability Retrieval and Management