Improving and Assessing the Fidelity of Large Language Models Alignment to Online Communities (2025)

Abstract: Large language models (LLMs) have shown promise in representing individuals and communities, offering new ways to study complex social dynamics. However, effectively aligning LLMs with specific human groups and systematically assessing the fidelity of the alignment remains a challenge. This paper presents a robust framework for aligning LLMs with online communities via instruction-tuning and comprehensively evaluating alignment across various aspects of language, including authenticity, emotional tone, toxicity, and harm. We demonstrate the utility of our approach by applying it to online communities centered on dieting and body image. We administer an eating disorder psychometric test to the aligned LLMs to reveal unhealthy beliefs and successfully differentiate communities with varying levels of eating disorder risk. Our results highlight the potential of LLMs in automated moderation and broader applications in public health and social science research.

## introduction large language models (llms) have demonstrated an exceptional ability to generate nuanced responses to natural language prompts, suggesting their potential for creating high-fidelity proxies of people @xcite . digital representations of human groups (digital twins) are computational models that mimic collective behaviors, social interactions, and communication patterns in real-world communities @xcite . leveraging llms to build these representations offers powerful tools for studying human behavior, enhancing human-computer interactions, and moderating online spaces to foster prosociality and safety. to create such digital twins, researchers align llms to subgroups through steering-prompting the llm to mimic the target subgroup with its key characteristics @xcite . however, this approach does not fully resolve the misalignment between llms and the target subgroup. another method is finetuning base llms foot_1 , such as gpt-2, on data from specific subgroups @xcite . while this can produce models reflecting subgroup linguistic patterns, these finetuned models often lack the flexibility to follow diverse instructions, limiting their broader applicability. another key challenge in developing digital representations of human subgroups is evaluating the alignment between the llm and the target group. traditional methods compare the llm's responses to surveys with those of the target group @xcite , but this approach misses critical aspects of human expression like emotional reactions @xcite . additionally, surveys are not scalable due to their cost and time requirements, particularly for marginalized or hard-to-reach groups. in addition, mapping diverse online communities to clear demographic identities greatly complicates alignment evaluation. to address these challenges, we propose a framework for aligning llms with online communities on instructions that are created in a fully unsupervised manner. additionally, we introduce a comprehensive evaluation framework to assess alignment. this enables the creation of high-fidelity digital representations of online communities, paving the way for new research into human behavior @xcite , content moderation @xcite , public mental health @xcite , and social science @xcite . as one example, we can administer psychometric instruments to these digital replicas to identify at-risk communities prone to psychopathologies. specifically, our alignment method takes a corpus of social media posts (e.g., tweets) from an online community and creates a set of demonstrations (instruction-response pairs) based on the posts. in each demonstration, as shown in figure 1 , the instruction specifies the task (e.g., tweet generation) with the response being the exact tweet. we then finetune an llm on these demonstrations to align it with the community. to assess alignment, we generate a synthetic text corpus using the finetuned llm and compare it to the original posts along four key aspects: 1) authenticity, 2) emotional tone, 3) toxicity, and 4) harm. these dimensions capture the essential features of online social communication, ensuring the aligned llm accurately reflects the semantics, affect, and style of the target group's discourse. instruction: what would you tweet? response: most of the time the only thing i want in the whole world is to be skinny and lose weight figure 1 : an example of a demonstration from a proeating disorder community, where the response is a tweet from the community. to demonstrate our framework's utility, we analyze twitter discussions in diet and body image communities, where harmful body image attitudes persist. twitter's emphasis on user connection and lax content moderation allows communities to organically form and freely express their voice. while these communities can offer support and encouragement, they often promote unhealthy behaviors and normalize beliefs that put people at risk for developing eating disorders (eds). applying traditional psychometric instruments to screen individuals in those online spaces for eds is impractical and potentially unethical (see ethics @xcite . instead, we use our framework to align llms with these communities through automatically generated demonstrations and evaluate alignment to show that the finetuned llms outperform baseline llms in creating high-fidelity proxies of online communities. we then apply an ed screening questionnaire to community-aligned llms, revealing significant differences between communities: pro-anorexia communities show a high risk of unhealthy behaviors, while those critical of the diet culture exhibit the lowest risk. these findings highlight our framework's potential for automated moderation by distinguishing communities with varying levels of ed risk. our framework offers a scalable approach to modeling and analyzing online communities, with broad implications for understanding and mitigating harmful behaviors. by applying this method to diet and body image communities, we demonstrate its potential to contribute to public health and social science research, highlighting the value of llms in studying complex social dynamics. building on this foundation, researchers have explored various approaches to align llms with diverse human subgroups @xcite . while some have attempted prompt-based steering towards specific demographic groups @xcite @xcite , this approach has shown limitations in achieving true alignment, particularly with organicallyformed communities. more promising results have come from finetuning approaches: @xcite developed communitylm by finetuning gpt-2 models @xcite on politically divergent tweets, while @xcite extended this to examine broader community interactions. most recently, @xcite proposed using advanced llms to distill community knowledge into instruction-response pairs for finetuning, though this approach faces cost constraints. our study aims to advance this field by developing a framework that uses llms to create digital representations of online communities, specifically focusing on analyzing collective mental well-being. ## communities in online discussions we collect online conversations related to eds and identify organically-formed communities within the broader context of weight loss, dieting, and fitness discussions. ## aligning llms to communities there are n online communities {c 1 , c 2 , ...., c n } on a topic (e.g., eds), each characterized by their own beliefs and perspectives. members of a community c i produce a body of text d i (e.g., tweets) that reflects their collective opinions and behaviors. our objective is to align an llm f to each specific community c i by training it on the corresponding text corpus d i . the resulting model, f ′ i , should capture the community's unique collective mindset, enabling it to generate responses that authentically represent the community's voice. ## assessing alignment to assess how effectively a finetuned llm f ′ i aligns with its target community c i , we measure the model's ability to mimic the responses of community members. we first generate a synthetic corpus d f t i using f ′ i and compare it to the original text corpus d i from the community. the more closely d f t i resembles d i , the better aligned the llm is with the community. we evaluate the similarity between d f t i and d i across 1) authenticity, 2) emotional tone, 3) toxicity, and 4) harm. while not exhaustive, these aspects capture the essential features of online social communication. authenticity ensures that the aligned llm accurately reflects the meaning, content, and linguistic patterns of the target population's language and generates contextually appropriate responses. emotional tone captures the affective aspects of communication, helping to convey nuances that may not be evident from semantics alone. toxicity measures the model's ability to reflect hostility and aggression in the population's discourse. finally, recognizing that certain online conversations can negatively impact users, we compare the types and levels of harm in language across groups. although in this paper we focus on the domain of eds, we argue that our llm alignment framework is naturally generalizable to online communities in other domains. 3 ## conclusion we demonstrate that aligning llms to online communities helps create high-fidelity digital proxies, which can be queried to reveal the implicit mindsets of these communities. when applied to online diet and body image communities, the method uncovers communities with unhealthy body image and dieting beliefs that put their members at risk of eating disorders. this is important, as harmful communities that indoctrinate users into extreme ideologies @xcite or glorify eating disorders and self-harm @xcite often evade moderation by using coded language that is opaque to outsiders or obfuscate harmful content via coded language and misspellings @xcite @xcite . as social data are increasingly abundant, our method is generalizable to study various online communities in different fields and can assist online platforms in overcoming challenges to foster safe and supportive environments.