Integrating mental-RoBERTa and generative LLMs for phenotyping secondary insomnia: A multi-dimensional framework for etiology discovery

Citation

Abstract

Insomnia affects a significant portion of the global population, yet distinguishing between primary and secondary insomnia—where sleep disturbances stem from underlying medical, psychiatric, or environmental factors—remains critically underexplored in computational health research. This study presents a multi-stage computational framework for identifying and phenotyping secondary insomnia from naturalistic Reddit discussions. A clinically validated dataset of 600 posts was developed, with linguistic validation confirming that secondary insomnia posts contain significantly more biomedical terminology than primary insomnia posts. Mental- RoBERTa, a domain-adapted transformer, was employed (after the initial integration of RoBERTa-Base) for identifying cases, which outperformed both traditional baselines and large language models. The trained model identified over 3,400 high confidence secondary insomnia cases from 5,000 unlabeled posts. A hybrid pipeline combining Llama-3 clinical summarization with BERTopic unsupervised clustering discovered 10 distinct etiological categories, revealing gastroesophageal reflux disease, menopausal factors, and benzodiazepine withdrawal as predominant drivers. Zero-shot emotion profiling revealed distinct psychological phenotypes across different triggers, with benzodiazepine withdrawal exhibiting the highest perplexity and environmental factors showing the greatest frustration. This framework enables the first large-scale computational characterization of secondary insomnia drivers and their psychological burdens, providing actionable insights for precision intervention design and population health surveillance in digital mental health systems.

Description

This thesis is submitted in partial fulfillment of the requirements for the degree of Bachelor of Science in Computer Science and Engineering, 2026.
Cataloged from PDF version of thesis.
Includes bibliographical references (pages 38-40).

Publisher Link

Type

Thesis

Creative Commons license

Attribution-NonCommercial-NoDerivatives 4.0 International

Except where otherwise noted, this item's license is described as

Attribution-NonCommercial-NoDerivatives 4.0 International