Abstract
Personality detection from social media posts is a complex task hindered by context fragmentation and the semantic sparsity of personality labels. Traditional models often fail to capture the long-range dependencies of a user's persona or the rich psychological nuances of traits like MBTI categories. This paper introduces the LLM-Enhanced Text Mapping Model (ETM), a hybrid framework that utilizes the dual capabilities of Large Language Models (LLMs). ETM employs Llama 3 to generate high-dimensional user embeddings and GPT-4 to produce detailed semantic descriptions of personality labels. Through a contrastive learning framework, the model aligns user representations with these psychological profiles. Experimental results on the Kaggle and Pandora datasets demonstrate that ETM achieves state-of-the-art performance, highlighting the efficacy of LLMs as feature enhancers in classification tasks.
Introduction
Personality detection aims to map a user's collection of social media posts to specific traits, such as the sixteen Myers-Briggs Type Indicator (MBTI) categories. Despite its potential for personalized services and psychological research, the task faces two primary challenges. First, context fragmentation occurs because users typically produce numerous short posts over time. Standard encoders like BERT struggle to process these long, multi-document sequences, often losing the overarching persona. Second, label sparsity refers to the traditional treatment of personality labels as simple numerical IDs, which ignores the rich semantic and psychological meaning inherent in categories like "INTJ" or "ENFP."
While Large Language Models (LLMs) possess extensive world knowledge, direct prompting for personality detection often yields suboptimal results compared to fine-tuned specialized models. The ETM model addresses this by using LLMs to enhance the feature space rather than acting as standalone classifiers.
Methodology
The ETM model introduces a "dual-capability" architecture designed to bridge the gap between raw text and psychological traits.
1. Enhanced User Vectors (Embedding Capability)
To overcome context fragmentation, ETM utilizes a lightweight LLM, Llama 3-8B, to process concatenated user posts. While individual posts are encoded using BERT, the LLM captures long-range thematic consistency. Embeddings are extracted from the final layers (specifically the last five) of Llama 3 and fused with BERT features through a cross-attention mechanism. This process creates a "user vector" that represents a more holistic view of the individual's persona.
2. Enhanced Label Mapping (Generation Capability)
To address label sparsity, the researchers leveraged GPT-4 to generate comprehensive descriptions for each of the sixteen MBTI types. These descriptions cover formal definitions, thematic tendencies, and expression modes. By transforming abstract labels into detailed psychological profiles, the model gains a semantically rich target for alignment.
3. Contrastive Learning Framework
The model employs a contrastive learning objective to align the user vectors with their corresponding GPT-4 generated label descriptions. The objective is to maximize the agreement between a user's vector and their true personality profile while minimizing agreement with non-target profiles. This forces the model to learn the underlying semantic relationships between writing style and personality traits.
Experimental Setup
The ETM model was evaluated on two benchmark datasets:
- Kaggle (MBTI): 8,600+ entries from PersonalityCafe, each containing a user's MBTI type and 50 recent posts.
- Pandora: A larger Reddit dataset with 9,067 users and self-reported MBTI types.
The primary metric used was Macro-F1, which provides a balanced assessment across the often-imbalanced personality classes.
Results and Discussion
ETM achieved state-of-the-art (SOTA) performance on both benchmarks:
- Kaggle: A Macro-F1 of 77.79%, representing a nearly 8% improvement over the previous best model (TAE).
- Pandora: A Macro-F1 of 65.77%, significantly outperforming BERTmean (56.52%) and graph-based methods like TrigNet (58.98%).
Ablation studies confirmed the importance of the dual-capability approach. Removing the LLM-based user representation led to an 8.5% performance drop, while removing the GPT-4 label interpretations resulted in a 6.97% decrease. These findings suggest that both high-dimensional context and semantic label mapping are critical for accurate detection.
Conclusion
The ETM model demonstrates that the most effective use of LLMs in personality detection is as feature enhancers within a traditional classification framework. By leveraging the embedding capabilities of Llama 3 and the generation capabilities of GPT-4, the model successfully captures the nuances of human personality from social media text. Future work will explore the integration of Knowledge Graphs to further refine the model's understanding of emotional subtext and psychological theory.
Summary updated