Abstract
Artificial intelligence-based language generators are now a part of mostpeople's lives. However, by default, they tend to generate "average" languagewithout reflecting the ways in which people differ. Here, we propose alightweight modification to the standard language model transformerarchitecture - "PsychAdapter" - that uses empirically derived trait-languagepatterns to generate natural language for specified personality, demographic,and mental health characteristics (with or without prompting). We appliedPsychAdapters to modify OpenAI's GPT-2, Google's Gemma, and Meta's Llama 3 andfound generated text to reflect the desired traits. For example, expert ratersevaluated PsychAdapter's generated text output and found it matched intendedtrait levels with 87.3% average accuracy for Big Five personalities, and 96.7%for depression and life satisfaction. PsychAdapter is a novel method tointroduce psychological behavior patterns into language models at thefoundation level, independent of prompting, by influencing every transformerlayer. This approach can create chatbots with specific personality profiles,clinical training tools that mirror language associated with psychologicalconditionals, and machine translations that match an authors reading oreducation level without taking up LLM context windows. PsychAdapter also allowsfor the exploration psychological constructs through natural languageexpression, extending the natural language processing toolkit to study humanpsychology.