UserIdentifier: Implicit User Representations for Simple and Effective Personalized Sentiment Analysis

Fatemehsadat Mireshghallah, Vaishnavi Shrivastava, Milad Shokouhi, Taylor Berg-Kirkpatrick, Robert Sim, Dimitrios Dimitriadis

Abstract

Personalized sentiment analysis aims to capture individual linguistic nuances, such as sarcasm or idiosyncratic vocabulary, which global models often overlook. However, existing state-of-the-art methods typically require significant computational overhead, such as storing unique prefix vectors for every user. This paper introduces UserIdentifier, a simple yet effective data augmentation technique that achieves personalization by prepending a fixed, non-trainable string of random tokens to user inputs. By leveraging a single shared model and existing vocabulary embeddings, UserIdentifier outperforms complex baselines by up to 13% without adding any extra parameters.

Introduction

Sentiment analysis is inherently subjective. A phrase like "That is just great!" can be interpreted as genuine praise or biting sarcasm depending on the speaker. Standard global models fail to account for these user-specific quirks. While personalization methods like UserAdapter have shown promise, they introduce substantial engineering challenges, requiring the management of millions of user-specific parameters. UserIdentifier addresses this by treating personalization as a string-matching problem within a single shared transformer model.

Methodology

The core of the UserIdentifier approach is the assignment of a unique, fixed string—a User Identifier (UID)—to every user. Unlike Prefix Tuning, which learns continuous activation vectors, UserIdentifier prepends random tokens from the model's existing vocabulary directly to the input text.

Comparison of Prefix Tuning and the proposed UserIdentifier approach.

As shown in the figure above, the UID (e.g., "anka Sau") is prepended to the input text. During fine-tuning, the model learns to associate these specific token sequences with individual sentiment patterns. This "parameter-tying" strategy ensures that no new embeddings are created; instead, the model's existing capacity is repurposed to distinguish between users.

Experimental Setup

The researchers evaluated UserIdentifier on three major benchmarks: IMDB (movie reviews), Yelp (restaurant reviews), and Sentiment140 (Twitter data). They also tested a "Skewed" version of Sentiment140 designed to highlight heterogeneous sentiment patterns. The study explored various identifier types, finding that randomly sampled tokens outperformed usernames or numerical IDs. This is attributed to the high Hamming distance between random sequences in a large vocabulary, which minimizes collisions and aids user differentiation.

Results

UserIdentifier consistently outperformed both conventional global models and the previous state-of-the-art, UserAdapter. On the IMDB dataset, UserIdentifier achieved 52.5% accuracy, a significant improvement over UserAdapter's 46.2% and the conventional model's 45.1%.

Distribution of accuracy across users for IMDB (a) and Yelp (b) datasets, comparing the proposed random identifier method (Rand.All) against a conventional baseline (Conv.).

The performance gains are visible in the distribution of user accuracies. The "Rand.All" configuration (UserIdentifier) shifts the frequency distribution toward higher accuracy buckets compared to the conventional baseline. Furthermore, the method proved robust in Federated Learning settings and demonstrated "graceful failure"—reverting to standard global performance when encountering unseen users.

Discussion and Conclusion

UserIdentifier provides a parameter-free path to effective personalization. By using random tokens as "switches," a single model can learn to toggle between user-specific modes while benefiting from collaborative learning across the entire dataset. While future work is needed to explore the scaling limits of model capacity with millions of users and potential privacy implications, UserIdentifier represents a major step toward efficient, large-scale personalized NLP.

Summary updated

BibTeX
@inproceedings{mireshghallah2022useridentifier,
  author = {Fatemehsadat Mireshghallah and Vaishnavi Shrivastava and Milad Shokouhi and Taylor Berg-Kirkpatrick and Robert Sim and Dimitrios Dimitriadis},
  title = {{UserIdentifier: Implicit User Representations for Simple and Effective Personalized Sentiment Analysis}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.naacl-main.252},
}
Figure