Improving clinical reliability of LLM reasoning for depression assessment via structured generation and GRPO Authors: Eliseo Bao, Anxo Perez, Javier Parapar Published: 2026 ABSTRACT AbstractObjectiveDigital mental health screening is increasingly explored through the use of AI systems. Yet, most models provide limited insight into how predictions are derived, restricting clinical trust and patient-centered adoption. We investigate whether Large Language Models (LLMs) can generate structured DSM-5-aligned rationales for depression assessment when trained with Group Relative Policy Optimization (GRPO), a reinforcement learning method that encourages outputs aligned with DSM-5 diagnostic criteria.MethodsWe fine-tuned LLMs (1B–27B parameters) on the ReDSM5 dataset, covering 1,484 Reddit posts annotated by a licensed psychologist for DSM-5 depressive symptoms and accompanied by expert rationales. We compared standard Supervised Fine-Tuning (SFT) with GRPO-based optimization using a composite reward integrating symptom classification accuracy and the quality of generated reasoning judged against clinical rationales.ResultsGRPO consistently improved symptom detection over SFT, with relative gains exceeding 10% for mid-sized models and weighted F1 scores above 0.60. Models trained to generate structured DSM-5-aligned rationales exhibited additional performance boosts (0.09–0.39 F1), particularly for complex symptoms requiring complex contextual interpretation. Qualitative analysis shows that GRPO encourages models to reference symptom-relevant evidence rather than relying on superficial cues.ConclusionsGRPO enables LLMs to produce clinically grounded explanations while improving classification accuracy, representing a promising direction for interpretable AI in social media-based mental health screening, with potential to support patient-centered applications pending clinical validation.Keywords: mental health, depression, social media, DSM-5, reasoning, explainability Introduction Depressive disorder affects approximately 3.8% of the global population, impacting social, academic and occupational functioning and constituting a major contributor to global disability.1,2 Despite the existence of effective treatments, more than 75% of individuals in low and middle-income countries receive no care due to limited resources in mentalh health services, and persistent stigma surrounding mental health.3,4 These structural limitations highlight the urgent need for scalable, accessible tools that support early detection of the disease. Social media platforms, used by the 63.9% of the global population, 5 has emerged as a natural environment where individuals openly share emotional experiences, distress and day-to-day struggles. Prior research demonstrates that linguistic patterns in online self-disclosures can reveal early signs of depression and other mental health conditions.6–8 When combined with advances in Natural Language Processing (NLP) and Machine Learning (ML), these signals offer an opportunity to develop automated screening tools that identify individuals at risk and enable timely interventions.9,10 However, for such tools to be clinically viable, they must be transparent, trustworthy and grounded in established diagnostic logic. Traditional deep learning systems behave as black boxes, producing predictions without demonstrating how conclusions are reached.11,12 This opacity conflicts with clinical practice, where interpretable reasoning is essential for auditability, risk management and patient-centered decision-making. Although many models leverage clinical instruments such as the Beck Depression Inventory-II (BDI-II) 13 or PHQ-9 14 to improve their interpretability, 15 systems often still rely on hidden shortcuts or superficial correlations. A more robust solution is to align model reasoning with the Diagnostic and Statistical Manual of Mental Disorders (DSM-5), 16 the primary framework that clinicians use to evaluate depressive symptoms. To this end, we leverage the ReDSM5 corpus, 17 which contains sentence-level symptom annotations and expert explanations for nine DSM-5 depressive symptoms. This resource enables training models that go beyond pattern recognition and instead learn to justify decisions using clinically meaningful logic. Yet, standard supervised fine-tuning rarely yields reasoning that generalizes beyond training examples. To address this limitation, we apply Group Relative Policy Optimization (GRPO), 18 a reinforcement learning algorithm that compares multiple candidate responses produced by the model and rewards outputs that better align with expert-defined criteria. To do so, GRPO generates alternative symptom interpretations, evaluates them against expert clinical rationales and iteratively refines the model to prefer outputs that demonstrate both accurate classification and DSM-5-aligned reasoning. GRPO thus encourages LLMs to refine both classification outcomes and the explanatory reasoning behind them, pushing models toward more structured, clinically plausible diagnostic reasoning. This work is situated within the broader digital transformation of healthcare, where AI systems are increasingly expected not only to automate tasks but also to facilitate patient-centered care, enhance clinical decision-support and strengthen human–AI collaboration. We make three primary contributions: (i) Clinically grounded training alignment of LLMs. We adapt LLMs to DSM-5 depressive symptom assessment using expert-annotated rationales from the ReDSM5 dataset, enabling structured mapping between free-text disclosures and diagnostic categories. (ii) Reasoning-oriented optimization: We adapt GRPO to mental health assessment, enabling models to compare candidate symptom evaluations and iteratively refine reasoning toward greater clinical consistency; and (iii) Evaluation of reasoning quality. Beyond standard classification metrics, we assess how well generated explanations correspond to expert-provided rationales, offering a novel evaluation dimension relevant for clinical decision support. Related work Social media is increasingly used to study mental health conditions such as depression, offering broad population coverage and access to self-expression at scale. 19 Following early evidence that language in social platforms can predict clinically diagnosed depression, 20 many works have explored computational detection from user-generated text.21–24 Early systems relied on hand-crafted linguistic features (e.g., lexicons and LIWC-style signals)25,26 with traditional classifiers, 27 later replaced by neural models that better capture contextual patterns.24,28 However, much of this literature frames depression as a binary label with weak supervision, providing limited insight into which symptoms are present. This limits clinical utility and interpretability, 29 harms generalization across populations, 30 and does not support patient-centered personalization via symptom profiles. To improve clinical relevance, recent work grounds detection in established assessment frameworks, using symptoms from PHQ-9, 14 BDI-II 13 and DSM-5 as explicit modeling targets. Pérez et al. 28 incorporated BDI-II scores into a text classification pipeline, while Nguyen et al. 15 constrained predictions to the PHQ-9 symptom criteria to improve out-of-domain generalization. Overall, symptom-grounded modeling can maintain competitive performance while improving interpretability and alignment with diagnostic practice,15,28,31 and several studies report benefits from explicitly modeling DSM/PHQ symptom patterns.32–34 This trend is enabled by newer datasets with symptom-level annotations, including PsySym, 34 BDI-Sen 35 and ReDSM5, 17 which map textual evidence to specific symptom categories rather than only binary labels as in earlier resources. 36 Explainability is increasingly viewed as essential for mental-health decision support: models should provide reasoning that clinicians can inspect rather than opaque predictions.11,12,37 Prior work has explored techniques for generating interpretable explanations. Some approaches train models to highlight keywords or phrases (e.g., hopelessness, fatigue) that influenced decisions,11,34,35 while others generate natural-language rationales intended to mimic clinician thought processes. 38 With LLMs, chain-of-thought prompting can yield step-by-step assessments and richer justifications31,38–40; this paradigm has also been extended to structured generation in other domains, combining CoT with reinforcement learning to improve both output quality and interpretability. 41 Yet fluent explanations are not necessarily faithful: LLM rationales may diverge from ground-truth evidence or clinical logic,42,43 and performance and consistency can be sensitive to prompts and context.44–46 Ensuring that generated reasoning remains clinically grounded therefore remains an open challenge motivating methods that explicitly optimize for faithful explanations. In this work, we align model inference tightly with DSM symptom-based criteria to improve validity, transparency and potential clinical usefulness. Building upon the ReDSM5 dataset, 17 which provides expert labels and rationales for each DSM-5 depression symptom, we train models to produce both symptom-specific verdicts and corresponding clinical reasoning. We leverage GRPO, 18 a reinforcement learning method that optimizes model behavior by comparing multiple candidate outputs, to encourage the LLM to favor explanations that align with expert DSM-guided rationales. By combining DSM-5-grounded supervision with GRPO-based reasoning optimization, our approach aims to reduce the gap between computational methods and clinical diagnostic reasoning. Materials and methods Dataset In our study, we use the ReDSM5 collection 17 for all experiments. This dataset contains 1,484 Reddit posts annotated at the sentence level for nine DSM-5 depression symptoms: depressed mood, anhedonia, appetite change, sleep issues, psychomotor changes, fatigue, worthlessness, cognitive issues and suicidal thoughts. ReDSM5 was constructed through a multi-stage workflow involving four health professionals. First, three clinicians were responsible for identifying and selecting evidence-bearing sentences from the posts, i.e., sentences containing signs potentially related to depressive symptomatology. Then, a licensed psychologist assigned the final DSM-5 symptom labels and produced a short clinical explanation linking each selected sentence to the corresponding diagnostic criterion. Thus, for each sentence judged to express one of these symptoms, the dataset provides (i) a DSM-5 symptom label and (ii) a concise rationale grounded in the textual evidence and DSM-5 criteria. Moreover, the dataset preserves the full post context from which each annotated sentence was extracted, allowing models to access not only the local sentence but also the broader narrative in which it appears. Posts without any symptom annotation are treated as negatives. We apply an 80/20 train/test split at the post level with random seed 42, resulting in 1,187 training posts and 297 test posts. Table 1 shows the main statistics of the collection. Table 1.Main statistics of the ReDSM5 collection.StatisticValueStatisticValueStatisticValue# Posts1, 484Avg. symptoms/post1.39# Negatives392Avg. words/post294.77Min. words/post2Max. words/post6, 990 Main statistics of the ReDSM5 collection. To illustrate the structure of the annotations, we show three example sentences together with their DSM-5 symptom label and expert explanation in Appendix C. In all cases, the full post from which the sentence was extracted is also available in the dataset as additional context (Sentences are paraphrased for anonymity purposes). Methodology Throughout this paper, the term reasoning is used in four distinct senses that we define here for clarity. First, structured rationale generation refers to the inference-time process by which a model produces a QUOTE → MAP → JUSTIFY explanation before emitting a verdict, understood as a structured generation capability and not a claim about internal cognitive processes. Second, DSM-5-aligned rationale refers to the textual content of the reasoning JSON field, whether produced by the model or provided by the expert annotator as a gold reference. Third, rationale-guided training effect refers to the classification gain produced by training models to generate rationales alongside verdicts; we show this consistently improves symptom detection across all model sizes and discuss the underlying mechanism in Structured Rationale Generation Improves Classification. Fourth, automated rationale evaluation refers to the quality assessment performed by an LLM-as-judge, which is an automated proxy and not a substitute for human clinical validation. We formulate DSM-5 symptom assessment as a structured generation task: given a full Reddit post, the model must output a JSON object with two fields, reasoning and verdict. The reasoning field contains a short clinician-style explanation that follows a QUOTE → MAP → JUSTIFY logic: • QUOTE, where the model extracts snippets that explicitly describe the writer’s own symptoms. • QUOTE, where the model extracts snippets that explicitly describe the writer’s own symptoms. • MAP, where each snippet is linked to exactly one DSM-5 depression symptom tag from the allowed set (e.g., sleep issues or anhedonia). • MAP, where each snippet is linked to exactly one DSM-5 depression symptom tag from the allowed set (e.g., sleep issues or anhedonia). • JUSTIFY, where the model provides a brief, clinical justification explaining why the quoted text satisfies that symptom, explicitly addressing negations, uncertainty and any mentioned duration without speculating about unstated causes or severity. • JUSTIFY, where the model provides a brief, clinical justification explaining why the quoted text satisfies that symptom, explicitly addressing negations, uncertainty and any mentioned duration without speculating about unstated causes or severity. The verdict field is a de-duplicated list of all symptom tags judged to be explicitly and present in the post. All prompts share the same system role, which defines the model as a mental-health text reviewer and enumerates the allowed symptom tags, and a user message that includes (i) detailed classification instructions and (ii) the full post text as context (see Appendix B for full details) (All training and inference materials are available in the GitHub repository: https://github.com/IRLab-UDC/grpo-dsm5/). To address this task, we adopt a two-stage training procedure to align LLM outputs with DSM-5 criteria. First, we perform Supervised Fine-Tuning (SFT) on the ReDSM5 training split to teach the model the target format and symptom detection patterns. Each training instance consists of a Reddit post paired with an expert-validated JSON response containing the gold reasoning (derived from clinician explanations, edited into the QUOTE–MAP–JUSTIFY style) and the verdict (set of DSM-5 symptom labels present in the post). We fine-tune several LLMs (1B–27B parameters) using parameter-efficient LoRA adapters applied to attention and MLP projection layers. This stage yields models that reliably emit well-formed JSON and approximate clinician labels but are not yet explicitly optimized for DSM-5-aligned rationale generation. Second, we refine the SFT models using Group Relative Policy Optimization (GRPO). 18 GRPO is a reinforcement learning algorithm that compares multiple candidate outputs per prompt and updates the policy based on their relative quality. Starting from the SFT checkpoint, we use GRPO to generate K = 4 candidate JSON responses for each training prompt using nucleus sampling. For each candidate, we compute a composite reward that combines (1) verdict accuracy and (2) reasoning similarity. Verdict accuracy is measured using the Jaccard similarity between the predicted and gold sets of symptom tags. 47 Let Y^ be the set of predicted tags and Y the gold tag set; the Jaccard index is: If the model outputs no valid tags, we assign a small negative penalty instead of a zero score to discourage empty verdicts. Reasoning similarity is computed as a normalized Levenshtein similarity between the generated reasoning field and the expert rationale. 48 We preprocess both texts, compute the Levenshtein edit distance dlev(r^,r) , and rescale it into [0, 1]: where r^ is the generated DSM-5-aligned rationale and r the expert rationale. Missing or malformed rationales incur a negative penalty. The total reward is the sum of both components, clipped to [−1, 3] for stability. GRPO then updates the policy to increase the likelihood of higher-reward completions relative to lower-reward ones, encouraging the model to converge toward DSM-5-consistent rationale generation. We acknowledge that Levenshtein similarity captures surface-form overlap and does not directly measure semantic or clinical faithfulness. This is mitigated in two ways: first, the verdict component of the composite reward is based on Jaccard similarity over discrete symptom tags, which is entirely independent of surface form and anchors the reward in clinical accuracy; second, the LLM-as-judge evaluation provides a post-hoc semantic check against criteria that go beyond lexical overlap, including clinical accuracy in identifying DSM-5 symptoms, proper mapping of textual evidence to symptom categories and overall quality of clinical judgment. In our experiments, we instantiate two GRPO configurations: (i) SFT+GRPO (verdict), where the reward is based solely on verdict accuracy, and (ii) SFT+GRPO (reason+verdict), where both verdict and reasoning rewards are active. Both configurations start from the same SFT checkpoint, allowing us to isolate the effect of explicitly optimizing for clinically grounded DSM-5-aligned rationale generation. Inference modes We assess all models in two inference conditions that reflect different scenarios. First, the No Reasoning mode, where models are prompted to return only the predicted DSM-5 symptom tags as a structured JSON verdict field (see Appendix A for the full prompt). This corresponds to a lightweight classification setting where the system behaves as a multi-label symptom detector without exposing its internal reasoning. In the Reasoning mode, models generate both a step-by-step clinical rationale and a verdict (see Appendix B for the full prompt). This condition reflects a decision-support scenario in which mental health practitioners can inspect and potentially contest the model’s explanations before acting on its suggestions. In our experiments with LLMs (base zero-shot model, SFT model, and both GRPO variants), we run inference under both modes using the same system prompt and DSM-5 tag set, changing only the instructions regarding whether reasoning should be included. This allows us to isolate the impact of reasoning generation on symptom classification performance and to compare models that are explicitly optimized for reasoning and verdicts (SFT+GRPO (reason+verdict)) against those optimized only for verdicts (SFT+GRPO (verdict)). Evaluation We evaluate classification performance using weighted F1 as the primary metric, which accounts for class frequency by weighting each symptom category proportionally to its presence in the test set. This provides a balanced assessment that reflects both per-symptom performance and the distribution of symptoms in real social media data. All evaluations are performed on the held-out test split of ReDSM5. Experiments and results We conduct three main experiments to perform our analysis. First, we compare zero-shot performance across multiple LLM families and sizes to identify the most promising base model architecture. Second, we apply our two-stage fine-tuning procedure (SFT followed by GRPO) to the selected model family, comparing GRPO configurations to assess the impact of reasoning-based rewards. Third, we analyze error patterns to understand how models misclassify symptoms and identify opportunities for improvement. Experimental settings We experiment with multiple LLMs spanning parameter sizes from 1B to 27B, all trained and evaluated on the ReDSM5 split described before. For the SFT stage, we apply LoRA adapters of rank 8 to attention and MLP projection layers. Inputs are truncated or padded to a maximum sequence length of 4,096 tokens. We train with a learning rate of 2 × 10−4, an effective batch size of 8 (2 samples per device with 4 gradient accumulation steps), and 200 optimization steps. For the GRPO stage, we initialize from the corresponding SFT checkpoint for each model. We use vLLM for generation and obtain K = 4 candidate completions per prompt via nucleus sampling with min_p = 0.1 and top_p = 1.0, stopping at the end-of-sequence token. GRPO training uses a learning rate of 5 × 10−6, per-device batch size of 1, and a maximum of 500 optimization steps. We set the maximum prompt length to 8,192 tokens and the maximum completion length to 4,096 tokens to ensure that the full post context and the structured JSON response fit within the context window. Weight decay is set to 0.01, with a warmup ratio of 0.1 and a linear learning-rate schedule using the adamw_8bit optimizer. Experiment 1: Zero-shot model family comparison In this initial experiment, we establish performance baselines by evaluating several state-of-the-art open LLMs on the ReDSM5 test split in a zero-shot setting. Models are prompted to classify Reddit posts into the nine DSM-5 depression symptoms using the structured JSON format described in Methodology. We assess performance in two inference modes: No Reasoning (verdict, i.e., only symptom classification) and Reasoning (clinical rationale plus verdict). Table 2 presents weighted F1 scores across model families (0.6B-32B parameters). In the No Reasoning mode (i.e., we do not instruct the models to explain the symptom classification), we can see that larger models generally outperform smaller ones: DeepSeek R1 32B reaches 0.362, Gemma 3 27B achieves 0.435, while most models below 4B parameters remain below 0.25. When we enable the Reasoning mode, performance improves substantially across almost all model families and sizes. Mid to large-scale models consistently exceed 0.50 weighted F1: Gemma 3 27B reaches 0.613 (+0.178 vs. No Reasoning), Llama 3.1 8B achieves 0.576 (+0.368), and Qwen3 14B attains 0.566 (+0.392). Even some smaller models benefit from reasoning generation (e.g., Qwen3 0.6B improves from 0.143 to 0.316), suggesting that prompting models to articulate clinical rationales can also improve their underlying symptom decisions. Table 2.Weighted F1 scores for depression symptom detection on ReDSM5 test set across multiple model families evaluated zero-shot. This comparison informs the selection of the most promising model family for subsequent fine-tuning. Models are tested in two inference modes: No reasoning (verdict only) and reasoning (clinical rationale plus verdict).​Inference modeModel familySizeNo reasoningReasoning gemma 3 1B0.2120.3044B0.1990.47612B0.4290.56227B0.4350.613 qwen3 0.6B0.1430.3164B0.1230.5508B0.1560.48714B0.1740.566 llama 3.1 8B0.2080.576 llama 3.2 1B0.2480.2633B0.2160.483 deepseek r1 1.5B0.2020.3368B0.1800.43014B0.1330.44532B0.3620.608 phi-3 3.8B0.2540.40914B0.2660.527 Weighted F1 scores for depression symptom detection on ReDSM5 test set across multiple model families evaluated zero-shot. This comparison informs the selection of the most promising model family for subsequent fine-tuning. Models are tested in two inference modes: No reasoning (verdict only) and reasoning (clinical rationale plus verdict). Based on these results, we select the Gemma 3 family for subsequent fine-tuning experiments. Gemma 3 models show the strongest zero-shot performance across sizes in the Reasoning mode, display consistent gains when reasoning is generated, and are available at multiple parameter scales. This makes them a suitable test bed for investigating how SFT and GRPO affect both classification accuracy and the quality of DSM-5-aligned rationales. Experiment 2: Fine-tuning with SFT and GRPO In our second experiment, we apply our two-stage fine-tuning pipeline to the Gemma 3 family across four parameter scales (1B, 4B, 12B, 27B). All models are first finetuned with Supervised Fine-Tuning (SFT) to learn the required JSON output structure and to internalize symptom detection patterns from ReDSM5. We then refine the SFT checkpoints with GRPO under two reward designs: SFT+GRPO (verdict), which optimizes only the multi-label symptom prediction, and SFT+GRPO (reason+verdict), which assigns equal weight to verdict accuracy and reasoning similarity. Results in Table 3 show that SFT substantially benefits smaller models in the Reasoning inference mode, where structured explanations are required. For Gemma 3 1B, weighted F1 improves from 0.304 (Base, see Table 2) to 0.416 (SFT). Adding GRPO yields mixed effects depending on the reward: SFT+GRPO (verdict) further increases performance to 0.460, whereas SFT+GRPO (reason+verdict) reaches 0.412. A similar pattern appears at 4B: SFT improves Reasoning-mode F1 from 0.476 to 0.519, and SFT+GRPO (verdict) achieves the best result at 0.575, while SFT+GRPO (reason+verdict) reaches 0.536. These gains suggest that reinforcement learning targeted at symptom accuracy can strengthen the final verdicts when models are prompted to externalize their clinical rationale. Table 3.Weighted F1 scores for depression symptom detection on ReDSM5 test set for fine-tuned Gemma 3 models, selected based on base model performance (Table 2). Results compare supervised fine-tuning (SFT) against GRPO configurations optimizing for verdict accuracy only (verdict) or both verdict and reasoning quality (reason+verdict). Models are evaluated in two inference modes: No reasoning (verdict only) and reasoning (clinical rationale plus verdict).​Inference modeModel familySizeFine-tuningNo reasoningReasoning gemma 3 1B Base 0.212 0.304 SFT0.2120.416SFT+GRPO (verdict)0.1820.460SFT+GRPO (reason+verdict)0.2370.4124B Base 0.199 0.476 SFT0.2680.519SFT+GRPO (verdict)0.2730.575SFT+GRPO (reason+verdict)0.2980.53612B Base 0.429 0.562 SFT0.2720.597SFT+GRPO (verdict)0.3230.460SFT+GRPO (reason+verdict)0.4210.59027B Base 0.435 0.613 SFT0.4290.598SFT+GRPO (verdict)0.3840.548SFT+GRPO (reason+verdict)0.4240.590 Weighted F1 scores for depression symptom detection on ReDSM5 test set for fine-tuned Gemma 3 models, selected based on base model performance (Table 2). Results compare supervised fine-tuning (SFT) against GRPO configurations optimizing for verdict accuracy only (verdict) or both verdict and reasoning quality (reason+verdict). Models are evaluated in two inference modes: No reasoning (verdict only) and reasoning (clinical rationale plus verdict). In contrast, for larger models the effect of GRPO is less consistent. At 12B and 27B, SFT does not reliably outperform the Base model in No Reasoning mode (e.g., 12B drops from 0.429 to 0.272). GRPO partially mitigates this degradation when reasoning is included in the reward: SFT+GRPO (reason+verdict) recovers No-Reasoning performance to 0.421 (12B) and 0.424 (27B), close to the corresponding Base scores (0.429 and 0.435). To examine how these aggregate improvements distribute across individual symptoms, Table 4 shows per-symptom F1 scores for Gemma 3 12B across four model configurations: Base (zero-shot), Reasoning (zero-shot with reasoning), SFT, and SFT+GRPO (reason+verdict). Baseline difficulty varies substantially: Psychomotor (0.000 F1), Cognitive Issues (0.235) and Fatigue (0.242) prove most challenging to detect, while Worthlessness (0.579), Depressed Mood (0.494) and Sleep Issues (0.421) are relatively easier. The low performance for Psychomotor should be interpreted in light of its extreme scarcity in the dataset (only 5 training instances), making it a low-resource symptom rather than representative of the overall system behavior. From this perspective, the aggregate weighted F1 is more informative for method performance. Even so, the full pipeline still improves Psychomotor from 0.000 to 0.222 F1, indicating that the proposed training strategy can recover useful signal even under severe data scarcity. Reasoning generation provides the largest gains for initially difficult symptoms: Fatigue improves by +0.321 (0.242 to 0.563), Cognitive Issues by +0.150 (0.235 to 0.385) and Suicidal Thoughts by +0.201 (0.379 to 0.580). SFT further improves performance, increasing average F1 from 0.479 to 0.562. GRPO achieves 0.532 average F1, maintaining most SFT improvements while showing different per-symptom trade-offs. Overall, the weighted average remains substantially above the zero-shot baseline (0.589 vs. 0.429), indicating that the method is more effective at modeling depressive symptom patterns at the aggregate level than at the level of any single low-frequency symptom in isolation. Table 4.Per-symptom performance across model configurations: Base (zero-shot), Reasoning (zero-shot with reasoning), SFT, and SFT+GRPO (reason+verdict). For each configuration, the F1 subcolumn reports the per-symptom F1 score, while the Pref. subcolumn reports the percentage of cases in which an LLM-as-judge preferred the reasoning from that configuration when the given symptom was involved. Symptoms are ordered by baseline difficulty (Base F1). All results are from the Gemma 3 12B model.​+Reasoning+SFT+GRPOΔ TotalSymptomBaseF1Pref. %F1Pref. %F1Pref. %(5) Psychomotor0.0000.00026.70.36426.70.22246.7+0.222(12) Cognitive Issues0.2350.23538.90.50027.80.52433.3+0.289(24) Fatigue0.2420.24227.80.63823.60.63548.6+0.393(11) Appetite Change0.2690.26939.40.52627.30.38133.3+0.112(27) Anhedonia0.3400.34035.80.57128.40.52435.8+0.184(21) Suicidal Thoughts0.3790.37941.30.50023.80.61834.9+0.239(22) Sleep Issues0.4210.42128.80.73736.40.65534.8+0.233(67) Depressed Mood0.4940.49429.90.61630.80.58939.3+0.095(67) Worthlessness0.5790.57926.90.60336.80.64336.3+0.065 Raw Average 0.3290.32932.80.56229.10.53238.1+0.204 Weighted Average 0.4290.42931.10.59731.00.58937.9+0.160 Per-symptom performance across model configurations: Base (zero-shot), Reasoning (zero-shot with reasoning), SFT, and SFT+GRPO (reason+verdict). For each configuration, the F1 subcolumn reports the per-symptom F1 score, while the Pref. subcolumn reports the percentage of cases in which an LLM-as-judge preferred the reasoning from that configuration when the given symptom was involved. Symptoms are ordered by baseline difficulty (Base F1). All results are from the Gemma 3 12B model. The total gains from baseline remain uneven: Fatigue sees the largest improvement (+0.393, reaching 0.635 F1), followed by Cognitive Issues (+0.289) and Suicidal Thoughts (+0.239), while Worthlessness (+0.065) and Depressed Mood (+0.095) show more modest gains. Although classification F1 captures symptom detection accuracy, it does not reveal whether models identify symptoms for clinically appropriate reasons. This distinction is critical for realistic clinical use: a system that correctly detects symptom patterns based on spurious textual correlations may still fail to provide trustworthy explanations that clinicians can validate, undermining its value as a pre-screening or decision-support tool. In our setting, the goal is not autonomous diagnosis from a single symptom prediction, but symptom-informed screening in which multiple signals and their accompanying rationales can be reviewed by a professional. The case of Gemma 3 27B illustrates this tension: the Base model achieves higher classification F1 (0.613) than its SFT+GRPO (reason+verdict) variant (0.590), yet manual inspection reveals that the fine-tuned model produces clinical reasoning more aligned with expert rationales. To systematically assess this qualitative difference, we conducted an automated rationale evaluation on the full test split comparing the DSM-5-aligned rationale quality of Gemma 3 27B Base versus Gemma 3 27B SFT+GRPO (reason+verdict), using an LLM-as-judge as a proxy measure, acknowledging this does not substitute for human clinical validation. We instructed Qwen3 30B to judge which model’s reasoning better aligned with the expert reference across four criteria: clinical accuracy in identifying DSM-5 symptoms, avoiding over-pathologization of normal emotions, proper mapping of textual evidence to symptom categories, and overall quality of clinical judgment (see Appendix D for the full evaluation protocol). Across 219 test instances, the judge preferred SFT+GRPO reasoning in 118 cases (53.9%) and Base model reasoning in 101 cases (46.1%). This preference for fine-tuned reasoning varies substantially by symptom type. As shown in the Pref. % columns of Table 4, the judge’s preference for GRPO-generated reasoning was strongest for initially difficult symptoms: Fatigue (48.6%), Psychomotor (46.7%), and Depressed Mood (39.3%). In contrast, for symptoms where models already achieved higher baseline F1 scores, such as Worthlessness (36.3%) and Anhedonia (35.8%), preference rates were more modest. Notably, the symptoms with the strongest GRPO preference correspond to those with higher training sample counts in ReDSM5, suggesting that reasoning quality improvements from reinforcement learning are particularly dependent on adequate symptom representation in the training data. This pattern indicates that extending the dataset to include more samples for underrepresented symptoms could yield further improvements in both reasoning quality and classification performance across the full symptom spectrum. Appendix C presents representative examples demonstrating that reasoning quality and classification performance do not always correlate. Human evaluation To complement the automated rationale evaluation, we conducted an additional human assessment of DSM-5-aligned rationale quality using Prolific (https://www.prolific.com), considering three annotators fluent in English. We evaluated the same 219 test instances used in the automated study. For each instance, annotators performed a blind pairwise A/B comparison: given the post text, the expert reference rationale, and two model-generated rationales (Base and SFT+GRPO, randomly assigned as A or B), they selected which rationale better aligned with the reference according to the same four criteria used in the automated evaluation. Majority voting across annotators preferred the SFT+GRPO rationale in 73.2% of cases, indicating a clear directional preference for the fine-tuned model over the base model. At the same time, inter-annotator agreement was low (Fleiss’ κ = 0.071), showing that annotators often disagreed on the better rationale for individual cases. The low agreement likely reflects the difficulty of the task, which requires comparing two generated rationales against an expert rationale while also interpreting a potentially lengthy and nuanced Reddit post. To further examine the robustness of this directional preference, we additionally employed an LLM-as-jury setting in which the same protocol was applied independently to three smaller LLMs (Qwen3-4B, Gemma 3-4B, and Phi-4-mini), with preferences aggregated by majority vote. The jury preferred SFT+GRPO rationales in 59.5% of cases, again favoring the fine-tuned model. Inter-model agreement was moderate but higher than that of the human panel (Fleiss’ κ = 0.230). Finally, combining human and LLM majority votes yielded an overall preference for SFT+GRPO in 60.5% of cases. Taken together, the original LLM-as-judge result (53.9%), the human evaluation (73.2%), the LLM-as-jury result (59.5%), and the combined majority vote (60.5%) all point in the same direction: GRPO training tends to produce rationales that are more aligned with the expert reference than those generated by the base model. Experiment 3: Error analysis and symptom confusion patterns To understand how models misclassify depression symptoms, we analyze the correspondence between gold standard annotations and model predictions. Figure 1 visualizes this relationship as a Sankey diagram, pairing each gold symptom label with its corresponding predicted outcome. Flows represent classification decisions: exact matches indicate correct predictions, cross-symptom flows represent confusion between symptom types, flows to UNPREDICTED capture false negatives and flows from GOLD_NONE represent false positives. Gold standard symptoms paired with model predictions on the ReDSM5 test set. Flow width represents frequency of each gold-predicted pairing. Straight flows indicate correct classifications, crossed flows show symptom confusion (e.g., gold anhedonia predicted as depressed mood), flows to UNPREDICTED represent missed symptoms and flows from GOLD_NONE indicate false positives. The diagram shows three key patterns. First, straight flows (gold label matching predicted label) are thickest for depressed mood and worthlessness, indicating high true positive rates. Second, flows to UNPREDICTED are thinner than straight flows, indicating correct detections outnumber false negatives. Third, cross-symptom flows cluster around specific pairs: depressed mood and anhedonia show bidirectional confusion; cognitive issues and worthlessness exhibit similar confusion patterns. False positive flows from GOLD_NONE distribute across multiple symptoms without concentration on specific categories. Classification outcome evolution We trace classification outcome evolution across four configurations: Base (zero-shot), Reasoning (zero-shot with reasoning generation), SFT (supervised fine-tuning) and SFT+GRPO (reinforcement learning with GRPO). Figure 2 tracks each (record, symptom) pair through these stages, showing transitions between classification states: true positive (TP), false positive (FP), false negative (FN) and true negative (TN). Evolution of classification outcomes for each (record, symptom) pair across four model configurations: Base (zero-shot), Reasoning (zero-shot with reasoning generation), SFT (supervised fine-tuning) and SFT+GRPO (combined fine-tuning with reinforcement learning). Flow width indicates the number of (record, symptom) pairs following each trajectory. Flows that maintain TP or TN status represent stable correct predictions. Upward flows (FN to TP, FP to TN) indicate improvements, while downward flows (TP to FN, TN to FP) represent performance degradation. The diagram reveals distinct optimization paths. Base to Reasoning shows the largest error correction: 273 FP cases transition to TN (improving precision), while 59 FN cases become TP (improving recall). Reasoning to SFT demonstrates a precision-focused shift: 251 FP to TN transitions reduce false positives substantially (from 306 to 85), but 76 TP to FN regressions indicate SFT over-regularizes, sacrificing recall. SFT to SFT+GRPO reverses this pattern: 80 FN to TP transitions recover missed symptoms, though 187 TN to FP transitions indicate GRPO increases false positive rate. TN flows remain the thickest across all stages (1136, 1379, 1443), confirming models maintain high specificity for negative cases throughout training. Discussion We interpret our experimental findings to understand how GRPO-based training enables clinically grounded symptom detection. Five key insights emerge: reasoning generation’s role in improving classification, GRPO’s advantages over supervised learning, a quantitative decomposition of gains across training stages, the interaction between model scale and fine-tuning benefit, and implications for clinical deployment. Structured Rationale Generation Improves Classification The consistent performance advantage of Reasoning mode across all model sizes and training strategies reveals a fundamental mechanism. This phenomenon aligns with chain-of-thought research in other domains, 39 where intermediate reasoning steps help models decompose complex problems into manageable components. In the clinical context, structured rationale generation appears to function as a form of self-supervision, though this remains an interpretive account rather than a directly verified mechanism. When a model articulates why a post exhibits anhedonia or sleep disturbance, it must attend to specific textual evidence and map that evidence to DSM-5 criteria. This structured generation process may act as a regularizer, constraining the model’s decision space to clinically plausible interpretations. Without rationale generation, models may rely on spurious lexical correlations rather than meaningful symptom indicators. The Base to Reasoning transition in Figure 2 demonstrates this: 59 FN cases become TP while 273 FP cases correct to TN, showing structured rationale generation improves both recall and precision. This dual improvement suggests structured rationale generation enables systematic evaluation of each DSM-5 criterion rather than snap judgments based on surface-level cues. t forces attention to specific textual evidence that verdict-only classification might overlook. Large TN flows (1136 maintained, 273 recovered from FP) indicate this improvement does not compromise specificity. Transfer effects further support the rationale-guided training hypothesis. Models trained with rationale generation perform better in verdict-only inference than models never exposed to rationale generation during training. This suggests rationale-guided training shapes internal representations that benefit classification even when rationales are not generated at deployment. This enables flexible deployment: full explanations for clinical decision support, verdict-only mode for large-scale screening. GRPO outperforms supervised fine-tuning GRPO’s group-based optimization strategy explains its superiority over SFT. By generating multiple candidate outputs per prompt and comparing their relative quality, GRPO enables the model to explore alternative symptom interpretations and converge on decisions that better satisfy the composite reward function (accurate verdict, high-quality reasoning and proper formatting). This process mirrors clinical decision-making more closely than standard supervised learning, where models simply imitate single expert annotations without considering alternative hypotheses. This comparative evaluation mechanism appears especially valuable for distinguishing overlapping depressive symptoms. The confusion patterns in Figure 1 between semantically related categories (depressed mood versus anhedonia, cognitive issues versus worthlessness) reflect symptoms that share linguistic markers: expressions of sadness overlap with loss of interest, self-critical language manifests in both cognitive difficulties and feelings of worthlessness. GRPO’s ability to evaluate multiple interpretations helps models learn finer-grained distinctions between these co-occurring symptoms that simple pattern matching cannot capture. The per-symptom analysis (Table 4) reveals heterogeneous improvement patterns across training configurations. Symptoms requiring deeper contextual understanding (Fatigue, Cognitive Issues) see the largest total gains (+0.393 and +0.289 respectively), while those with clearer lexical markers (Worthlessness, Depressed Mood) show more modest improvements (+0.065 and +0.095). SFT substantially improves over rationale generation baselines (average F1 increases from 0.479 to 0.562), demonstrating that supervised learning on expert annotations effectively teaches symptom detection patterns. GRPO achieves 0.532 F1, showing slight regression from SFT but maintaining strong performance. The Sankey diagram (Figure 2) explains this F1 difference: SFT optimizes for precision (85 FP, lowest across all configurations), while GRPO prioritizes recall (197 TP vs. SFT’s 145). The SFT to SFT+GRPO transition shows 80 FN → TP recoveries, demonstrating GRPO’s comparative evaluation successfully identifies missed symptoms, though at the cost of 187 TN → FP increases. This pattern suggests different optimization objectives: SFT minimizes false detections, while GRPO’s reward function balances classification with rationale quality, tolerating higher false positive rates to improve recall. The performance plateau at 12B+ parameters (where fine-tuning provides minimal or negative gains) suggests overfitting or domain mismatch. Larger models already encode sufficient world knowledge for DSM-5 symptom detection from extensive pretraining on web-scale corpora. Additional training on a relatively small specialized corpus (1,187 examples) may constrain this generalization capacity rather than enhance it. This pattern indicates that massive pretraining on diverse mental health discussions provides strong priors for symptom detection, making domain-specific fine-tuning less beneficial or potentially harmful for large models. Looking at Table 3, a particularly clear manifestation of this effect is the degradation in No-Reasoning performance after SFT for the 12B and 27B models (from 0.429 to 0.272 at 12B, and from 0.435 to 0.372 at 27B). We attribute this to two complementary mechanisms. First, the mismatch between the output distribution seen during training and the one required at inference. During SFT, models are optimized to generate structured JSON responses that include both reasoning and verdict fields. When inference is later constrained to No-Reasoning mode, this learned generation pattern is partially disrupted, which may reduce the quality of verdict-only outputs. Second, this effect appears more pronounced for larger models because their stronger zero-shot No-Reasoning performance leaves more room for degradation after specialization to the reasoning-aware format. The partial recovery after GRPO (0.421 at 12B and 0.424 at 27B) is consistent with this interpretation. Because GRPO evaluates multiple candidate outputs and reinforces them according to task reward rather than pure imitation of the training target, it may preserve greater flexibility in how the final verdict is produced. We therefore interpret the SFT degradation not as evidence that fine-tuning is ineffective, but as an indication that reasoning-aware supervision can introduce a trade-off between structured explanation generation and verdict-only inference. Analyzing performance gains: Rationale generation versus GRPO optimization To better understand the contribution of each stage, we decompose the performance gains using Gemma 3 12B in Reasoning mode as the reference configuration, since it provides results for all stages of the pipeline. As shown in Table 3, starting from the zero-shot Base model without rationale generation (weighted F1 = 0.429), enabling structured rationale generation at inference time increases performance to 0.562 (+0.133), which is the largest gain observed across the pipeline. This suggests that requiring the model to reason symptom evidence and justification already improves classification, even without additional task-specific training. SFT then provides a further improvement of +0.035 (from 0.562 to 0.597), indicating that supervised exposure to expert-annotated examples helps consolidate symptom detection patterns. By contrast, GRPO produces a small change in aggregate weighted F1 (−0.007, from 0.597 to 0.590) when using the reason+verdict reward. This limited net difference at the aggregate level is consistent with the trade-offs discussed above: GRPO does not optimize weighted F1 directly, but instead balances verdict accuracy with rationale quality, recovering additional true positives at the cost of some false positives. This decomposition suggests that rationale generation accounts for most of the observable improvement in classification performance, whereas GRPO contributes more subtly by reshaping the balance between prediction quality and explanation quality. In other words, the main effect of GRPO is not necessarily to increase weighted F1, but to encourage outputs that are more closely aligned with the expert-style rationales used in training and evaluation. These two components, should therefore be understood as complementary, with one contributing most strongly to aggregate classification gains and the other to the quality of the generated rationales. Model scale versus domain-specific training The interaction between model capacity and fine-tuning benefit reveals that model scale and domain-specific training serve as partial substitutes for clinical NLP tasks. The substantial improvements smaller models gain from fine-tuning contrast with large models’ strong zero-shot capabilities, which often match or exceed fine-tuned smaller models. This pattern reflects the nature of modern LLM pretraining. Large models encounter diverse mental health discussions during pretraining on web-scale corpora, developing implicit understanding of depression symptomatology. This broad exposure enables generalization to DSM-5 symptom detection from minimal prompting. Smaller models lack this extensive prior knowledge and require explicit exposure to clinician-annotated examples to achieve comparable performance. From a deployment perspective, this trade-off involves multiple considerations. Resource-constrained settings may benefit from smaller fine-tuned models that balance accuracy with computational cost. Applications requiring maximum performance without custom training pipelines could leverage large base models in zero-shot mode. However, explainability requirements favor fine-tuning: fine-tuned models learn to structure reasoning consistent with ReDSM5 annotation guidelines, producing outputs that closely mirror professional clinical assessments. Large zero-shot models generate fluent explanations but may not align as tightly with DSM-5 diagnostic logic, potentially reducing trustworthiness despite strong classification metrics. Clinical implications and deployment considerations These findings have direct relevance for AI-assisted mental health screening tools. The dual-mode inference capability enables flexible deployment across clinical workflows. In settings where professionals review flagged cases, structured rationale generation outputs provide transparency and enable validation. Clinicians can assess whether model-generated rationales reflect appropriate symptom identification or reveal reasoning errors suggesting false positives. This interpretability is essential for building trust and ensuring systems function as decision-support tools rather than opaque black boxes. Large-scale screening applications prioritizing throughput may benefit from No Reasoning mode. Our results show that models trained with rationale generation still perform better in verdict-only inference compared to models never exposed to rationale generation during training. This allows organizations to train once with full explainability and deploy in multiple configurations based on operational needs. However, critical limitations constrain immediate clinical adoption. First, our models are trained and evaluated on Reddit posts, which may not generalize to other platforms or clinical intake forms due to differences in language use, post length and user demographics. Second, the ReDSM5 corpus contains only 1,484 posts, a modest sample that may not capture full diversity of depressive symptom expression across populations. Third, and most importantly, these systems cannot replace professional diagnosis. Depression assessment requires consideration of symptom duration, functional impairment, medical history and contextual factors that isolated social media posts cannot capture. Our models should be viewed as screening tools that flag potential concerns for human follow-up, not as autonomous diagnostic instruments. Limitations and future directions Several limitations should be acknowledged. First, some configurations are still missing from Table 2, and completing these runs will clarify under which conditions GRPO is most effective. Moreover, results are reported from a single run per configuration; although the main trends are consistent across model sizes and settings, future work should quantify variance across seeds. Second, our study focuses on depression, and future work should test whether the same approach transfers to other disorders. Third, automated rationale evaluation relies on automatic proxies rather than formal clinical validation; although our added human evaluation supports the same overall directional finding, inter-annotator agreement was low (Fleiss’ κ = 0.071), highlighting the difficulty of pairwise rationale comparison. Fourth, we use fixed, equal weights for verdict and reasoning rewards; adaptive weighting conditioned on symptom type or input characteristics may yield better trade-offs. Fifth, the construction of ReDSM5 should be considered when interpreting the results. The dataset was created through a multi-stage workflow involving four health professionals. However, formal inter-annotator agreement for the final label and rationale assignment was not reported. Future work should complement the resource with independent multi-expert clinical validation. Finally, real-world use raises ethical and privacy concerns beyond accuracy, including consent, data use, and harms from false alarms or missed cases, requiring safeguards, transparency, and human oversight. Future work should expand model coverage, explore interactive multi-turn assessment, incorporate severity and longitudinal tracking, test cross-platform generalization, and adopt participatory design with clinicians and patients. Conclusion We demonstrate that Group Relative Policy Optimization enables LLMs to detect DSM-5 depression symptoms from social media while generating clinically aligned reasoning. Fine-tuning on the ReDSM5 dataset using GRPO yields consistent gains over supervised learning alone, with relative improvements exceeding 10% for mid-size models and weighted F1 scores above 0.60. Our work makes three contributions: (i) we align LLM outputs with DSM diagnostic criteria through expert-annotated training data providing sentence-level symptom labels; (ii) we adapt GRPO to mental health assessment, enabling models to compare candidate interpretations and refine reasoning toward clinical consistency; and (iii) we show that generating structured reasoning improves classification across all model scales while providing transparency for clinical validation. Important limitations constrain immediate clinical application: training data remain modest (1,484 posts) and Reddit-specific, requiring validation across platforms and populations. These systems should function as screening tools for human review, not autonomous diagnostic instruments. Extending GRPO-based training to additional mental health disorders, validating reasoning quality through clinical review studies and investigating cross-platform generalization represent critical next steps. Our results suggest that reinforcement learning methods like GRPO can bridge the gap between computational capabilities and clinical requirements, advancing explainable AI systems that mental health professionals can inspect, understand and trust. Acknowledgements The first author acknowledges the support of the Department of Education, Science, Universities, and Vocational Training of the Xunta de Galicia (grant ED481A-2024-079). All authors affiliated with IRLab and CITIC acknowledge funding from the Ministry of Science, Innovation and Universities of the Government of Spain (project PID2022-137061OB-C21, MCIN/AEI/10.13039/501100011033), as well as from the Department of Education, Science, Universities, and Vocational Training of the Xunta de Galicia (grant GRC ED431C 2025/49). CITIC, as a center accredited for excellence within the Galician University System and a member of the CIGUS Network, receives subsidies from the Department of Education, Science, Universities, and Vocational Training of the Xunta de Galicia. Additionally, it is co-financed by the EU through the FEDER Galicia 2021-27 operational program (Ref. ED431G 2023/01). Appendix A Figure 3 shows the prompt used for the No Reasoning inference mode: Prompt for the No Reasoning inference mode. Appendix B Figure 4 shows the prompt used for the Reasoning inference mode: Prompt for the Reasoning inference mode. Appendix C Figure 5 shows a comparison of clinical reasoning quality across three sample posts: Comparison of clinical reasoning quality across three sample posts. For each entry, the annotated sentence and corresponding DSM-5 depression symptom(s) are shown, followed by the gold annotation, base model output, and SFT+GRPO model output. Appendix D Figure 6 shows the prompt used to evaluate clinical reasoning quality: Prompt used to evaluate clinical reasoning quality. Footnotes Funding: The authors disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the Department of Education, Science, Universities, and Vocational Training of the Xunta de Galicia (grant ED481A-2024-079); by the Ministry of Science, Innovation and Universities of the Government of Spain (project PID2022-137061OB-C21, MCIN/AEI/10.13039/501100011033); by the Department of Education, Science, Universities, and Vocational Training of the Xunta de Galicia (grant GRC ED431C 2025/49); and by the Xunta de Galicia and the European Union through the FEDER Galicia 2021–2027 Operational Programme (Ref. ED431G 2023/01). The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article. ORCID iDs Eliseo Bao https://orcid.org/0009-0000-8457-1115 Anxo Perez https://orcid.org/0000-0002-0480-006X Javier Parapar https://orcid.org/0000-0002-5997-8252 Ethical considerations This study utilized publicly available, anonymized social media data from Reddit. The ReDSM5 dataset was collected and annotated in accordance with Reddit’s terms of service and data use policies. No personally identifiable information was collected or retained. The research protocol was reviewed and deemed exempt from full IRB review as it involved analysis of publicly available, de-identified text data with no direct interaction with human subjects. Consent to participate This study analyzed publicly available, anonymized social media posts without direct participant recruitment or interaction. Consent for publication All data used in this study were publicly available and anonymized. Data Availability Statement The ReDSM5 dataset used in this study is publicly available at https://huggingface.co/datasets/irlab-udc/redsm5. Code for model training and evaluation is available at https://github.com/IRLab-UDC/grpo-dsm5/. References Associated Data Data Availability Statement The ReDSM5 dataset used in this study is publicly available at https://huggingface.co/datasets/irlab-udc/redsm5. Code for model training and evaluation is available at https://github.com/IRLab-UDC/grpo-dsm5/.