Source-linked AI summary
Interpretable Symptom Vectors for Depression in a Large Language Model
Fangyi Zhu, Ajay Subramanian, Allison Constant, Camille Wang, Ravish Gupta, Corey J. Keller
TL;DR
Depression’s heterogeneous symptom profiles are poorly represented by single severity scores, and how LLMs encode these symptoms internally remains unclear. The study analyzes Gemma-3-27B-PT residual-stream activations with mechanistic interpretability methods, finding clinician-aligned symptom structure that separates most at layer 21 and supports a preliminary depressive-valence gate. The approach offers a mechanistic foundation for interpretable depression assessment, while clinical validity and broader generalization remain untested.
Problem
Depression has diverse symptom profiles, but standard scores compress this complexity and evidence is limited on whether LLM internal representations capture clinically validated symptom dimensions.
Method
The study analyzes Gemma-3-27B-PT residual-stream activations, selects layer 21 for symptom separability, and projects held-out text onto clinician-derived Symptom Vectors and a Depression Vector.
Results
Held-out naturalistic text preserved clinician-annotated rank ordering across mood, somatic, and suicidality axes, while layer-21 symptom groups were geometrically separable.
Takeaways & Limitations
The findings establish a decorrelated, clinician-aligned symptom signal readable directly from an unmodified model’s internal activations.
Takeaways & Limitations
Clinical validity, generalization across architectures and scales, and effects of preprocessing remain untested; the analysis also groups nine symptoms into three categories.
Abstract
from arXiv · showhide
Patients with depression present with diverse symptom profiles, yet clinical practice routinely reduces this variation to a single severity score. Large language models (LLMs) can potentially capture various symptoms and their severity from patient speech. However, how depressive symptoms are represented inside LLMs remains poorly understood, limiting clinical trust. To examine whether internal model activations match clinician judgment, we analyzed the residual stream of Gemma-3-27B-PT using mechanistic interpretability techniques. Recording activations across symptom descriptions drawn from validated clinical instruments, we found that symptom groups geometrically separated the most at layer 21 across multiple distance metrics. Using Semantic Projection, we then projected held-out naturalistic text onto Symptom Vectors constructed from these instruments. The resulting per-symptom coefficients preserved clinician-annotated rank ordering across mood, somatic, and suicidality axes. Furthermore, a single depression vector in Layer 21 separates held-out depressive from non-depressive text (AUC = 0.789), which can be used as an emotional valence gate that restricts symptom projection to depressive speech. These results reveal a decorrelated, clinician-aligned symptom signal readable directly from internal activations, offering a mechanistic foundation for interpretable depression-assessment tools.
1 Introduction
Depression has highly heterogeneous symptom profiles, while standard questionnaires compress this complexity into single scores. This study investigates whether LLM internals encode clinically meaningful, interpretable symptom-level signals.
- 3,703 patients in STAR*D meeting the same DSM-5 criteria produced 1,030 unique symptom profiles.
- Standard questionnaires prioritize brevity, collapsing rich symptom dimensions into a single score and overlooking symptoms important to patients.
- Existing LLM systems usually generate broad diagnostic labels or summed scores rather than symptom-level assessments.
- LLM-generated outputs may misrepresent depression, including underemphasized suicidality and overemphasized psychomotor symptoms relative to expert and self-report ratings.
- Depression symptom categories are geometrically separable in Gemma-3-27B-PT activations, with maximal separation at layer 21.
- Held-out naturalistic text projected onto clinician-derived Symptom Vectors preserves clinician-aligned symptom distinctions and supports a Depression Vector for depressive-versus-positive-affect separation.
2 Methods
The study builds and evaluates an activation-based pipeline using standardized clinical and naturalistic depression texts. It extracts residual-stream activations, selects an operating layer, constructs Symptom Vectors, and derives a Depression Vector.
- The pipeline extracts Gemma-3-27B-PT residual-stream activations, selects the most separable layer, projects held-out text onto Symptom Vectors, and contrasts depression and positive-affect centroids.
- The Core Clinical corpus contains symptom descriptions from six validated depression assessment instruments.
- 51 clinical excerpts were assigned to mood, somatic, or suicidality groups through independent psychiatrist review and consensus resolution.
- The held-out Naturalistic corpus combines first-person and clinical-narrative descriptions from Darkness Visible, the Handbook of Depression, and ReDSM5.
- Texts were rewritten into a standardized third-person register to reduce stylistic confounds, with edits reviewed and corrected by the authors.
- The analysis uses Google’s pre-trained Gemma-3-27B-PT rather than its instruction-tuned variant, because safety alignment could distort depression-symptom representations.
2.2 Per Residual Stream Layer Separability
The method compares residual-stream representations across layers using distance matrices and permutation-based tests. It selects layers where high PERMANOVA separation is not explained by unequal within-group dispersion.
- Residual-stream separability is evaluated across layers using eight distance-metric and normalization combinations.
- 2.2.1 Pairwise Distance Matrices: Pairwise distance matrices provide a common representation for metrics that are not directly comparable and allow PERMANOVA on variable-length residual streams.
- 2.2.1 Pairwise Distance Matrices: PERMANOVA’s pseudo-F compares between-group with within-group variation and is sensitive to differences in group centroid location.
- 2.2.2 PERMANOVA with the PERMDISP eligibility gate: PERMDISP identifies eligible layers where within-group dispersion is homogeneous, requiring P > 0.05 before interpreting pseudo-F as centroid separation.
- 2.2.3 Operating Layer selection: For each metric, the operating layer is the eligible layer with the highest PERMANOVA pseudo-F.
2.3 Semantic Projection for Symptom Identification
The method projects residual-stream representations onto clinician-derived symptom axes, correcting for correlations among mood, somatic, and suicidality vectors. This produces comparable, decorrelated coefficients for evaluating held-out text.
- Symptom Vector Construction: Symptom Vectors are class-centroid residual-stream activations constructed at the operating layer from clinical symptom descriptions.The three vectors represent mood, somatic, and suicidality categories in the model’s native activation geometry.
- Gram Matrix Construction: Near-collinear symptom axes make naive projection conflate contributions, so the method uses Gram-matrix geometry to characterize overlaps and conditioning.The Gram matrix contains pairwise vector inner products; near-singularity can amplify perturbations when inverted.
- Pseudoinverse of the Gram Matrix: The Moore–Penrose pseudoinverse replaces the ordinary inverse for stable coefficient recovery when the Gram matrix is ill-conditioned or singular.For invertible G, the pseudoinverse equals G^-1; it also handles exactly parallel basis vectors.
- Symptom Projection: Each passage is reduced from 5,376-dimensional residual-stream activations across its excerpt to three decorrelated symptom coefficients.The passage centroid c(x) is computed from operating-layer activations after excluding the initial <bos> token.
- Symptom Projection: The coefficients isolate each symptom axis, encode direction through their sign, and remain comparable across passages because they use a fixed basis and uniform projection.The pseudoinverse accounts for shared signal among correlated axes when estimating each axis’s unique contribution.
- Symptom Projection: Naturalistic projections serve as held-out external validation, while Core Clinical projections provide an in-sample consistency check.Each passage receives βmood, βsomatic, and βsuicidality in the same coordinate system.
2.4 Depressive and Positive Affect Distinction
The study constructs a depression representation from the three symptom vectors and contrasts it with positive affect using held-out text. Depression Scores are computed by cosine similarity and compared between depressive and non-depressive corpora.
- Control experiment: The control experiment tests whether projecting non-depressive text onto Symptom Vectors is meaningful by distinguishing depressive from non-depressive text.It constructs two opposite-valence centroids at the operating layer.
- Depression Vector: The Depression centroid averages the three Core Clinical Symptom Vectors, assigning equal weight to mood, somatic, and suicidality.This centroid is used to define the Depression Vector.
- Positive Affect centroid: The Positive Affect centroid is the token-weighted mean across the entire Positive Affect corpus, excluding the initial <bos> token.The weighting uses each text’s token count and the total token count across the corpus.
- Held-out evaluation: Held-out Naturalistic and HappyDB corpora, with 423 excerpts each, are reserved for testing rather than axis construction.The axes are constructed without including these corpora.
- Scoring and comparison: A Depression Score is the cosine similarity between an excerpt’s token-weighted centroid and the Depression Vector.Scores are compared between the held-out corpora using a one-sided Mann–Whitney U test.
3 Results
Symptom categories were most separable at layer 21, where projection onto decorrelated Symptom Vectors preserved clinician-aligned ordering in held-out naturalistic text. A Depression Vector also separated depressive from non-depressive text at the population level, although score distributions overlapped substantially.
- 3.1 Symptom categories are most separable at layer 21: Layer 21 was selected as the operating layer because all three raw distance metrics reached their eligible pseudo-F maxima there, with the largest eligible pseudo-F equal to 6.91.PERMDISP P-values at layer 21 were 0.43, 0.65, and 0.47, supporting interpretation as centroid displacement.
- 3.1 Symptom categories are most separable at layer 21: Later maxima for normalized and cosine metrics occurred around layers 35–40, but their weaker eligibility made layer 21 the more reliable operating point.At the later maxima, PERMDISP remained narrowly above the eligibility threshold, so dispersion contributed to separation.
- 3.2 Semantic Projection coefficients align with clinician ratings: In the held-out Naturalistic corpus, each clinician annotation group attained the highest coefficient on its matching mood, somatic, or suicidality axis.The preserved within-corpus rank ordering was the stated evidence that Symptom Vectors generalized beyond the clinical-instrument corpus.
- 3.2 Semantic Projection coefficients align with clinician ratings: Clinical and naturalistic passages sharing an annotation co-localized in the three-dimensional symptom subspace at layer 21.The projection used three decorrelated coefficients: βmood, βsomatic, and βsuicidality.
- 3.3 A single depression vector distinguishes depressive and non-depressive text: A Depression Vector separated held-out Naturalistic depressive excerpts from HappyDB happy-moment descriptions with AUC = 0.789.The comparison used 423 excerpts from each corpus, with P = 2.51 × 10^-48.
- 3.3 A single depression vector distinguishes depressive and non-depressive text: The Depression Score separated depressive from non-depressive text at the population level but was not a reliable per-excerpt classifier because held-out distributions overlapped substantially.Absolute cosine values spanned 0.18–0.25, and many HappyDB excerpts fell within the Naturalistic range.
4 Discussion
This study argues that depression symptoms are recoverable as clinician-aligned, interpretable signals from Gemma-3-27B-PT’s internal activations, addressing heterogeneity that standard scores compress. A layer-21 two-stage pipeline separates symptom categories, projects symptom profiles, and gates projections to depressive speech, while remaining preliminary for clinical use.
- Motivation: Depression’s clinical heterogeneity means patients with the same diagnosis can have widely divergent symptom profiles, while questionnaires often reduce this complexity to one severity score.The discussion frames symptom-level recovery as a response to this mismatch between diverse presentations and compressed measurement.
- Findings: Layer 21 showed the strongest geometric separation among mood/emotional/cognitive, somatic, and suicidality representations across three distance metrics.The reported pseudo-F statistics were 6.91, 6.49, and 2.83 for Centroid Euclidean, Energy, and Earth Mover’s distance, respectively; all PERMDISP P values were ≥0.43.
- Findings: Gram-pseudoinverse-corrected projections onto layer-21 Symptom Vectors produced decorrelated coefficients that preserved clinician-aligned rank ordering in held-out naturalistic narratives.The correction addresses strongly collinear symptom axes and enables excerpts from different sources to be scored on a common scale.
- Pipeline: A Depression Vector provides a preliminary valence gate that first identifies depressive text before symptom coefficients are interpreted.The gate addresses the caveat that Symptom Vectors were built from depressive text and are meaningful only for depressive speech.
- Implications: The approach extracts signals directly from an unmodified pre-trained model’s internal activations rather than relying on generated outputs.The discussion presents this as an interpretability benefit for clinical trust and as a basis for symptom-level analysis of patient language.
- Limitations: Clinical application remains out of scope because symptom groups were collapsed, only one model was tested, preprocessing may introduce bias, and clinical validity was not established.The authors specifically note the absence of validation against diagnostic outcomes, treatment response, or longitudinal trajectories.
- Future work: Future work should use larger clinical corpora, replicate localization across model families and scales, calibrate longitudinal severity, and test proposed electrophysiological and risk-detection links.These steps define the authors’ stated path toward broader and more clinically relevant evaluation.
- Conclusion: The clinician-aligned Symptom Vectors are presented as a generalizable template for extracting other clinical concepts from LLM internal representations.This conclusion extends the proposed methodology beyond depression symptom analysis.
Data availability
The project releases the rewritten Core Clinical corpus, Positive Affect corpus, layer-21 Symptom Vectors, and Gram-corrected projection pipeline, while withholding source-restricted corpora.
- The released materials include the third-person rewritten Core Clinical corpus, Positive Affect corpus, layer-21 Symptom Vectors, and Gram-corrected projection pipeline.
- Raw clinical instrument text and the ReDSM5 corpus are withheld because of copyright and license restrictions.
- Methods citations enable independent assembly of an equivalent corpus.
Code availability
The analysis code is available in Python through the project’s GitHub repository.
- All analyses were performed in Python, and the code is available on the project repository.The repository URL is https://github.com/PrecisionNeur oLab/Symptom-Vectors-for-Depression.
Ethics declarations
The study used secondary analysis of publicly available, de-identified datasets and was deemed exempt from IRB review.
- The study analyzed pre-existing, de-identified, publicly accessible data from HappyDB and ReDSM5.
- Because the research used only such datasets, it was deemed exempt from Institutional Review Board review.
GenAI usage disclosure
The manuscript discloses using generative AI for text preprocessing, figure creation, coding assistance, and language editing. Authors report that AI-written code was reviewed, tested, and verified.
- Claude Opus 4 was used to pre-process text samples, and Claude Design was used to create Figure 1.
- Generative AI tools assisted with coding, with all AI-written code reviewed, tested, and verified by the authors.
- Generative AI tools assisted manuscript editing, including proofreading, grammar correction, vocabulary improvement, and language polishing.
Supplementary Material
The supplementary material presents natural-language descriptions of depression symptoms organized by clinical instrument and grouped into mood, somatic, and suicidality dimensions. The entries cover affective, cognitive, behavioral, physiological, anxiety-related, and suicidal symptoms.
- The supplementary descriptions are organized by clinical assessment instrument and grouped into mood, somatic, and suicidality dimensions.Each entry corresponds to an item or item cluster from the source instrument.
- Mood symptoms: Mood-related descriptions include depressed or reported sadness, anhedonia, guilt, pessimism, reduced self-esteem, concentration difficulties, and diminished emotional response.They also include work and interest impairment, anxiety-related tension, and indecision.
- Somatic symptoms: Somatic descriptions cover appetite and weight changes, insomnia patterns, fatigue, psychomotor retardation or agitation, bodily anxiety, gastrointestinal symptoms, and genital symptoms.Specific entries include initial, middle, and delayed insomnia; weight loss; lassitude; and physical complaints.
- Suicidality: Suicidality descriptions range from thoughts that life is not worth living and wishes for death to suicidal ideas, gestures, plans, attempts, or other suicidal behavior.The material includes both recurring thoughts and overt suicidal actions.
- Somatic symptoms: Additional somatic entries describe retardation, agitation, somatic anxiety, gastrointestinal symptoms, general somatic symptoms, and genital symptoms.These descriptions include slowed thought and movement, restlessness, physical anxiety symptoms, appetite loss, heaviness, fatigue, reduced libido, and menstrual disturbances.
- Additional symptom descriptions: The supplementary material also distinguishes observed sadness, reported sadness, inner tension, concentration difficulties, inability to feel, pessimistic thoughts, reduced sleep, reduced appetite, and lassitude.These entries describe emotional, cognitive, and motivational manifestations alongside sleep and appetite changes.