Afrah Nazar / Research / Dementia diagnosis
With a classmate · 2025Dementia Classifier using Transformers’ Latent Representations
A classmate and I tested whether an AI model can detect dementia from a picture description.
- 0.88F1, Llama 3.1-8B, probed
- 0.55F1, the same model, prompted
- 0.83F1, best prior ML baseline, BERT
- 231transcripts, 71 held out for testing
The problem
By one estimate cited in the project, 59% of people with dementia are undiagnosed or unaware of their condition. Many older adults live alone, face real barriers getting to a clinic, and avoid testing because of stigma. The question we set out to answer: can a high-performance, secure, low-cost, and easily accessible screening tool be built from large language models?
Data
DementiaBank’s Pitt Corpus: recordings of the standard “Cookie Theft” picture-description task, transcribed to text. 105 transcripts from cognitively normal speakers and 126 from patients with dementia, split into 160 for training and 71 held out for testing.
Two approaches
Prompting. Six models (GPT-4o, Claude Sonnet 3.5, o1-preview, Claude Sonnet 3.7, Llama 3-8B, and Llama 3.1-8B) were instructed, as an expert in linguistics and neuropsychology, to weigh each transcript’s syntax, vocabulary, structure, narration, grammar, semantic discourse, stylistics, and pragmatics, and classify it.
Probing. The same transcripts were run through the two open-source Llama models, and the final-token representation was read out at two points in every layer (4,096 features per probe). A linear classifier (either distance-from-mean or logistic regression) was trained on each probe, the best probe was chosen on a validation set, and only then evaluated on the test set.
Results
The clearest result compares one model with itself. Prompted, Llama 3.1-8B managed an F1 of 0.55 and an accuracy of 0.61. When we probed the same model, it reached 0.88 and 0.87.
Across the whole field: prompting topped out at an F1 of 0.73 (o1-preview); GPT-4o scored 0.66 and Claude Sonnet 3.5 scored 0.72. Prompted, the open-source Llama models managed only 0.42 and 0.55. Probed, those same two models reached 0.87 and 0.88 with logistic regression, above the SVM, logistic-regression, and BERT baselines reported in prior work (0.78–0.83). More reasoning did not help: on Claude Sonnet 3.7, raising the thinking budget from 3K to 10K tokens lowered F1 from 0.61 to 0.55, and o1-mini (0.60) trailed o1-preview (0.73).
What it means
- Prompt-based classification falls short; text alone may miss subtle markers of cognitive decline.
- A transformer’s internal state carries a signal its own answer does not, and a linear classifier on top of it beat the traditional pipeline.
- Quality data is the bottleneck. Privacy makes dementia data scarce, and synthetic patient data is one way forward.
Limitations
Where it led
This project led to my clinical-trial probes a year later, and to my evaluation work at NeuralCare.