Manipulating the Perceived Personality Traits of Language Models (2023)

Abstract: Psychology research has long explored aspects of human personality like extroversion, agreeableness and emotional stability, three of the personality traits that make up the ‘Big Five’. Categorizations like the ‘Big Five’ are commonly used to assess and diagnose personality types. In this work, we explore whether text generated from large language models exhibits consistency in it’s perceived ‘Big Five’ personality traits. For example, is a language model such as GPT2 likely to respond in a consistent way if asked to go out to a party? We also show that when exposed to different types of contexts (such as personality descriptions, or answers to diagnostic questions about personality traits), language models such as BERT and GPT2 consistently identify and mirror personality markers in those contexts. This behavior illustrates an ability to be manipulated in a predictable way (with correlations up to 0.84 between intended and realized changes in personality traits), and frames them as tools for controlling personas in applications such as dialog systems. We contribute two data-sets of personality descriptions of humans subjects.

## introduction with the meteoric rise of ai systems based on language models, there is an increasing need to understand the 'personalities' of these models. as communication with ai systems increases, so does the tendency to anthropomorphize them @xcite @xcite . thus, even though language models encode probability distributions over text and the tendency to assign cognitive abilities to them has been criticized @xcite , the way users perceive these systems can have significant consequences. if the perceived personality traits of these models can be better understood, their behavior can be tailored for specific applications. for instance, when suggesting email auto-completes, it may be figure 1 : the top frame (panel a) shows how a personality trait (here, openness to experience) might be expressed by a language model, and how the response can be modified by exposing the language model to a textual context. we use psychometric questionnaires to evaluate perceived personality traits (panel b), and show that they can be predictably manipulated with different types of contexts ( §5, §6). we also evaluate the text generated from these contextualized language models (panel c), and show that they reflect the same traits ( §7). language-based questionnaires have long been used in psychological assessments for measuring personality traits in humans @xcite . we apply the same principle to language models, and investigate the personality traits of these models through the text that they generate in response to such questions. as previously mentioned, we do not posit that these models have actual cognitive abilities, but are focused on exploring how their personality may be perceived through the lens of human psychology. since language models are subject to influence from the context they see (o'connor and andreas, 2021), we also explore how specific context could be used to manipulate the perceived personality of the models without controlling sources of bias or the models themselves (i.e., pretraining, parameter finetuning). figure 1 shows an example illustrating this approach. our analysis reveals that personality traits of language models are influenced by ambient context, and that this behavior can be manipulated in a highly predictable way. in general, we observe high correlations (median pearson correlation coefficients of up to 0.84 and 0.81 for bert and gpt2) between the expected and observed changes in personality traits across different contexts. the models' affinity to be affected by context positions them as potential tools for characterizing personality traits in humans. in further experiments, we find that, when using context from self-reported text descriptions of human subjects, language models can predict the subject's personality traits to a surprising degree (correlation up to 0.48 between predicted and actual human subject scores). we also confirm that the measured personality of a model reflects the personality seen in the text that the model generates. together, these results frame language models as tools for identifying personality traits and controlling personas in applications such as dialog systems. our contributions are: ## related work in recent years, research has looked at multiple forms of biases (i.e., racial, gender) in language models @xcite @xcite . however, the issue of measuring and controlling for biases in personas of language models is under-explored. a substantial body of research has explored the ways language models can be used to predict personality traits of humans. mehta et al. (2020) and christian et al. (2021) apply language models to such personality prediction tasks. similar to our methodology, argyle et al. (2022) contextualize large language models on a data-set of socio-economic back-stories to show that they model socio-cultural attitudes in broad human populations, and yang et al. (2021) develop a new model designed to better detect personalty in user based context, using question based answering. most relevant to our work are contemporaneous unpublished works by karra et al. (2022), miotto et al. (2022), and jiang et al. (2022), who also explore aspects of personality in the language models themselves. however, these works substantially diverge from our approach and, along with yang et al. (2021), do not attempt to characterize or manipulate the perceived personality of the models as we do. ## 'big five' preliminaries the 'big five' is a seminal grouping of personality traits in psychological trait theory @xcite , and remains the most widely used taxonomy of personality traits @xcite . these traits are: ## experiment design we experiment with two language models, bertbase @xcite and gpt2 (124m parameters) @xcite , to answer questions from a standard 50-item 'big five' personality assessment (ipip, 2022) foot_0 . each item consists of a statement beginning with the prefix "i" or "i am" (e.g., i am the life of the party). acceptable answers lie on a 5-point likert scale where the answer choices disagree, slightly disagree, neutral, slightly agree, and agree correspond to numerical scores of 1, 2, 3, 4, and 5, respectively. to make the questionnaire more conducive to answering by language models, items were modified to a sentence completion format. for instance, the item "i am the life of the party" was changed to "i am {blank} the life of the party", where the model is expected to select the answer choice that best fits the blank (see appendix b for a complete list of items and their corresponding traits). to avoid complexity due to variable number of tokens, the answer choices were modified to the adverbs never, rarely, sometimes, often, and always, corresponding to numerical scores 1, 2, 3, 4, and 5, respectively. it is noteworthy that in this framing, an imbalance in the number of occurrences of each answer choice in the pretraining data might cause natural biases toward certain answer choices. however, while this factor might affect the absolute scores of the models, this is unlikely to affect the consistent overall patterns of changes in scores that we observe in our experiments by incorporating different contexts. for assessment with bert, the answer choice with the highest probability in place of the masked blank token was selected as the response. for assessment with gpt2, the procedure was modified, since gpt2 is an autoregressive model, and hence not directly conducive to fill-in-the-blank tasks. in this case, the probability of the sentence with each candidate answer choice was evaluated, and the answer choice from the sentence with the highest probability was selected. finally, for each questionnaire (consisting of model responses to 50 questions), personality scores for each of the 'big five' personality traits were calculated according to a standard scoring procedure defined by the international personality item pool @xcite . specifically, each of the five personality traits is associated with ten questions in the questionnaire. the numerical values associated with the response for these items were entered into a formula for the trait in which the item was assigned, leading to an overall integer score for each trait. to interpret model scores, we estimated the distribution of 'big five' personality traits in the human population. for this, we used data from a large-scale survey of 'big five' personality scores in 1,015,000 individuals (open-psychometrics, 2018). in the following sections, we report model scores in percentile terms of these human population distributions. statistics for the human distributions and details of the ipip scoring procedure are included in appendix b. ## base model trait evaluation ## manipulating personality traits in this section, we explore manipulating the base personality traits of language models. our exploration focuses on using prefix contexts to influence the personas of language models. for example, if we include a context where the first person is seen to engage in extroverted behavior, the idea is that language models might pick up on such cues and modify their language generation (e.g., to generate language that also reflects extrovert behavior). we investigate using three types of context: ## effects on text generation while the previous sections strongly suggest that the perceived personality traits of language models can be influenced for fill-in-the-blank personality questionnaires, it is important to understand whether these influences also translate to text generated by these language models in downstream applications. to answer this question, we created 'text generation contexts' by concatenating each context/modifier pair from §6.1 with each of six neutrally framed prompts (e.g., "i am always the life of the party" + "when i talk to others, i...", see appendix f for complete list of prompts). for this experiment, gpt2 foot_3 was used to generate a 50 token text for each text generation context. example 3 (openness to experience) text generation context: i never have excellent ideas. others say that i ... generated text: am a fool. when i write my thoughts i try to find out where i am supposed to get an idea. that is why it is so hard for me to do all the ... we also quantitatively evaluate how well the personality traits in the generated texts matches corresponding text generation contexts. for this, each generated text is, itself, used as context for a big five assessment (as previously shown in figure 1 , panel c). we measure the pearson correlation between the resulting scores, x gen , and the scores for the context/item pair (x cm ) from §6.1 that were used in the corresponding text generation context. figure 6 gives the results from this analysis, and shows an overall pearson correlation of 0.49 between x gen and x cm . this suggests that the personality scores of the model, measured using the big five assessment, are a good indication of the personality that might be seen in text generated from the contextualized language models. ## conclusion we have presented a simple approach for measuring and controlling the perceived personality traits of language models. further, we show that such models can predict personality traits of human users, possibly enabling assessment in cases where participation is difficult to attain. future work can explore the use of alternate personality taxonomies. similarly, there is a large and growing variety of language models. it is unclear to what extent our findings generalize to other language models, particularly those with significantly more parameters @xcite . finally, the role that pretraining data plays on personality traits is an another important question for exploration.