A new benchmark aims to make detection of prompt injection in retrieval-augmented generation (RAG) systems more reliably comparable. RAG-PIBench contains 4,876 contextual examples, with separate frozen training and validation splits and a protected test set.
The study compares four approaches: keyword-based detection, semantic references, TF-IDF methods, and transformer models. On the protected test set, DistilBERT records the best reported results, with an F1 score of 0.896 and a PR-AUC of 0.968. TF-IDF SVM and logistic regression remain competitive.
The researchers say the findings demonstrate the value of leakage-aware benchmark construction and strong, relatively simple sparse baselines. The results therefore highlight the importance of test design when comparing detection methods. The reported metrics alone, however, do not establish how well these methods perform in specific RAG applications.
The original paper provides further detail on the benchmark, its data splits, and the evaluation protocol: RAG-PIBench on arXiv.