SOFIA: a knowledge-infused prompt-based reasoning framework for anxiety screening in social media
Abstract
Linguistic-based anxiety screening has become a widely adopted approach for detecting anxiety in social media, with pre-trained language models (PLMs) now forming the state-of-the-art foundation for early mental health detection. However, most existing PLMs are not explicitly optimized for anxiety detection (AD), limiting their adaptability to fine-grained psycholinguistic cues. To address this gap, we introduce SOFIA (Anxious? SOFten-It-Out), a novel prompt-based reasoning framework that enhances PLM capability for binary AD without full fine-tuning. SOFIA integrates multiple prompt template strategies with a dual-end truncation method that preserves both initial contextual cues and concluding emotional markers, enabling richer and more stable representations of conversational anxiety signals. Additionally, a knowledge-enhanced verbalizer incorporates structured domain knowledge through soft, manual, and automatic verbalizers, improving reasoning within frozen PLMs. We evaluate SOFIA across three self-reported anxiety corpora, such as Guo, SMHD, and Kim, using multiple 100M−300M-parameter PLMs. Experimental results demonstrate consistent improvements over traditional baselines, including F1 score gains of 5.37%, 5.40%, and 7.92% for MentalBERT on the respective datasets when using soft templates of length 20 with knowledge base-driven verbalizers. These findings highlight SOFIA's effectiveness as a scalable, low-resource, and knowledge-informed framework for digital mental health screening applications.