TL;DR
ReCAST is a novel two-stage distillation framework designed to protect SMS risk classifiers against sophisticated text obfuscation techniques (like character splitting or phonetic substitutions). By teaching a smaller student model to implicitly internalize a massive LLM teacher's de-obfuscation skills during training, ReCAST achieves high classification accuracy and risk recall at production-level speeds without needing an explicit text restoration step at inference time.
What Problem Does This Paper Address?
Industrial SMS risk detection systems must process massive streams of messages under strict latency and cost constraints. To evade these systems, malicious actors use creative, language-specific obfuscation strategies—such as breaking Chinese characters into visual sub-components, inserting random symbols, or using digit homophones. While these messages remain easily readable to human recipients, they successfully break standard keyword matchers and cost-conscious production classifiers.
While large language models (LLMs) excel at decoding these adversarial tricks and restoring text to its canonical form, deploying a trillion-parameter model to evaluate every incoming SMS in real time is financially and computationally impossible. The authors address a critical engineering challenge: How do we transfer the robust de-obfuscation capabilities of giant LLMs into lightweight, deployable classifiers without sacrificing real-time serving efficiency?
Methods
The authors introduce ReCAST (Restoration-aware Cascaded Stage-wise Training), a framework that utilizes a unified, task-conditioned prompt interface to train a student model in two distinct phases:
- Stage 1: Restoration-oriented Distillation: The student model (Qwen3.5-9B) is exposed to obfuscated text and tasked with generating a dense, structured JSON output containing the obfuscated spans, the type of obfuscation used, the fully restored text, and the risk label. This dense supervision is generated offline by a powerful teacher model (DeepSeek-V4-Pro, a 1.6T parameter Mixture-of-Experts model).
- Stage 2: Classification-oriented Training: The model transitions to the final production task—predicting only the downstream risk label. Crucially, to prevent the student from forgetting the de-obfuscation mechanics learned in Stage 1, the authors implement a lightweight replay strategy, mixing in 10% of the structured restoration examples alongside 90% direct classification examples.
At Inference Time, the model operates in a single pass. It takes the raw, obfuscated SMS and directly outputs the risk category without explicitly generating the restored text or calling the teacher model, preserving production-level throughput.
Datasets
- Training Set: 30K category-balanced examples built via a human-in-the-loop pipeline. Clean base messages were generated by an LLM, obfuscated using a taxonomy of 11 single/mixed strategies, and enriched with hard examples mined from misclassified instances.
- Evaluation Sets: A validation set of 500 messages and a test set of 1,000 real-world production SMS messages. To ensure rigorous evaluation, these sets were entirely manually annotated by human experts and balanced across four categories: fraud, gambling, pornography, and benign.
Key Insights and Ideas
- Implicit vs. Explicit Restoration: Traditional approaches to obfuscation rely on a two-stage pipeline: first normalize the text, then classify it. This doubles inference latency and risks propagating restoration errors. ReCAST proves that a model can internalize restoration logic during training, using it as implicit decision evidence during a single-pass classification.
- Dense Supervision Beats Pure Data Volume: Simply exposing a model to more data (standard data augmentation) yields sub-optimal robustness. Forcing the model to learn where and how a text is obfuscated provides the structural grounding necessary to combat evolving adversarial mutations.
- Task-Conditioned Prompting as a Regularizer: Using a unified prompt interface across both stages allows the training process to seamlessly blend multi-task rehearsal data, mitigating catastrophic forgetting during downstream fine-tuning.
Key Results
Evaluated against several same-backbone baselines on the real-world Chinese SMS test set, ReCAST demonstrated a superior balance of safety and speed:
- Classification Performance: ReCAST achieved 86.6% Accuracy and 89.5% Risk Recall, outperforming the direct classification baseline (Direct-CLS) by 10.8 and 10.3 percentage points, respectively. It also clawed back roughly 94% of the performance of the non-deployable 1.6T teacher model.
- Serving Efficiency: ReCAST maintained an average latency of 0.71 seconds under a heavy concurrent workload (256 requests), which is nearly identical to the direct classifier (0.67s). By comparison, the explicit two-stage pipeline baseline (Pipeline-CLS) doubled the average latency to 1.42s.
Limitations and Future Work
The authors note that their evaluation was restricted to Chinese SMS using a 9B parameter student backbone. Future work will investigate if these robustness gains translate to even smaller, more resource-constrained models (e.g., edge-deployable models) and other languages. Additionally, because the training data relies heavily on a single teacher model, it may inherit specific generation biases. Finally, the framework still needs validation under live production traffic to prove its resilience against real-time, shifting adversarial templates.
Summary updated