Detecting anomalies in privacy-sensitive text under federated learning requires robustness against model poisoning and computational efficiency. This study presents an integrated framework combining an early-exit RoBERTa classifier ( \(\hbox {E}^{2}\) -RoBERTa) with a robust federated layered aggregation strategy (RFLA). \(\hbox {E}^{2}\) -RoBERTa incorporates multi-stage exits and a spatio-temporal convolutional–LSTM fusion module to reduce inference cost while maintaining high detection accuracy. RFLA enhances server-side resilience by filtering and reweighting client updates through dimensionality reduction, density clustering, fallback adjustment, and Mahalanobis-based weighting. Experiments on four public datasets demonstrate consistent performance gains: E2-RoBERTa attains \(F_1=0.96\) on SMS data, and RFLA maintains higher accuracy and \(F_1\) than Krum, Trimmed Mean, and Median under 20–50% malicious clients. The early-exit mechanism further reduces average inference time by about 17%. Overall, the framework achieves a balanced trade-off among privacy preservation, robustness, and efficiency, supporting practical deployment for privacy-text anomaly detection in federated settings.