TrustToken: A Framework for Evaluating Tokenizer Security and Robustness in NLP Pipelines

The growing reliance on tokenizers in NLP systems calls for robust security measures. TrustToken, a framework for evaluating tokenizer trustworthiness across eight key metrics, including SQL Injection Risk Score (SIRS) and XSS Vulnerability Score (XVS), is introduced in this study as a proposed measure. A custom dataset designed to expose vulnerabilities and test resilience against malformed inputs, perturbations, and boundary conditions assesses GPT-2, BERT, T5, and RoBERTa security posture. While T5 achieved the highest Trustworthiness Score (TWS) of 0.77, all other models failed SQL Injection and XSS tests. Despite firm handling of special characters and privacy safeguards, weaknesses in processing malformed inputs and boundary conditions were evident. Namely with GPT-2, BERT, and RoBERTa. These findings underscore the security risks of deploying tokenizers in real-world applications and emphasize the need for input sanitization and adversarial training. The TrustToken framework offers a systematic approach to evaluating and strengthening tokenizers, ensuring safer NLP deployments.

Authors

Institutions

Publication Details

Published
2025-05-05
DOI
https://doi.org/10.1109/cai64502.2025.00162
Primary Topic
Natural Language Processing Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

TrustToken: A Framework for Evaluating Tokenizer Security and Robustness in NLP Pipelines

Ahmad Patooghy, Tia Pope
Natural Language Processing Techniques
article

TrustToken: A Framework for Evaluating Tokenizer Security and Robustness in NLP Pipelines

Ahmad Patooghy, Tia Pope
article en

Abstract

The growing reliance on tokenizers in NLP systems calls for robust security measures. TrustToken, a framework for evaluating tokenizer trustworthiness across eight key metrics, including SQL Injection Risk Score (SIRS) and XSS Vulnerability Score (XVS), is introduced in this study as a proposed measure. A custom dataset designed to expose vulnerabilities and test resilience against malformed inputs, perturbations, and boundary conditions assesses GPT-2, BERT, T5, and RoBERTa security posture. While T5 achieved the highest Trustworthiness Score (TWS) of 0.77, all other models failed SQL Injection and XSS tests. Despite firm handling of special characters and privacy safeguards, weaknesses in processing malformed inputs and boundary conditions were evident. Namely with GPT-2, BERT, and RoBERTa. These findings underscore the security risks of deploying tokenizers in real-world applications and emphasize the need for input sanitization and adversarial training. The TrustToken framework offers a systematic approach to evaluating and strengthening tokenizers, ensuring safer NLP deployments.

North Carolina Agricultural and Technical State University (US), Systems Technology (United States) (US)
Openalex Percentile: Top 92%
Natural Language Processing Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.