LLM Roleplay: Simulating Human-Chatbot Interaction

Hovhannes Tamoyan, Hendrik Schuff, Iryna Gurevych

Abstract: The development of chatbots requires collecting a large number of human-chatbot dialogues to reflect the breadth of users' sociodemographic backgrounds and conversational goals. However, the resource requirements to conduct the respective user studies can be prohibitively high and often only allow for a narrow analysis of specific dialogue goals and participant demographics. In this paper, we propose LLM-Roleplay: a goal-oriented, persona-based method to automatically generate diverse multi-turn dialogues simulating human-chatbot interaction. LLM-Roleplay can be applied to generate dialogues with any type of chatbot and uses large language models (LLMs) to play the role of textually described personas. To validate our method we collect natural human-chatbot dialogues from different sociodemographic groups and conduct a human evaluation to compare real human-chatbot dialogues with our generated dialogues. We compare the abilities of state-of-the-art LLMs in embodying personas and holding a conversation and find that our method can simulate human-chatbot dialogues with a high indistinguishability rate.

Introduction

Building robust and inclusive chatbots requires vast amounts of high-quality dialogue data that reflect a wide array of user backgrounds and intents. Traditionally, obtaining this data involves recruiting human participants for user studies—a process that is notoriously slow, expensive, and difficult to scale. While synthetic data (AI-to-AI interaction) offers a potential solution, existing methods often fail to capture the nuances of human diversity, typically assuming a generic "average" user. This creates a representation gap, making it difficult to evaluate how chatbots perform for specific demographic groups, such as different age ranges, education levels, or non-native speakers.

The LLM-Roleplay Framework

To bridge this gap, we introduce LLM-Roleplay, a multi-turn simulation framework designed to generate diverse, goal-oriented dialogues. The framework consists of three primary components:

  1. The Persona ($P$): A detailed textual description of sociodemographic traits (e.g., age, race, gender identity, and education level).
  2. The Goal ($G$): A specific task or conversational objective the simulated user aims to achieve.
  3. The Interaction: An LLM is prompted to "embody" the persona and act as the Inquirer ($S_I$), while the target chatbot acts as the Responder ($S_R$).
Overview of the LLM-Roleplay framework, illustrating the persona and goal inputs for the Inquirer model.

A critical feature of our method is its robust failure handling. Because LLMs can occasionally "break character" or fail to follow formatting, we implemented specialized algorithms to detect and manage incoherence, self-replies, and stopping-criterion failures, ensuring the resulting dialogues remain structured and realistic.

Experimental Setup and Evaluation

We evaluated our framework using a combination of natural and simulated datasets. We collected 200 real dialogues from 20 human participants to serve as a ground-truth baseline. For simulation, we utilized four state-of-the-art LLMs as Inquirers: Llama-2-13B, Mixtral-8x7B, Vicuna-13b, and GPT-4. These models were tasked with 10 complex, multi-hop goals spanning domains like Mathematics, Coding, and General Knowledge.

Key Results and Insights

Our evaluation focused on the "indistinguishability" of the simulated dialogues—how well a human judge can tell the difference between a real human user and our AI Inquirer.

Human evaluation results showing confidence levels in distinguishing simulated dialogues from real human interactions across different models.

Model Performance and "Acting" Ability

Surprisingly, Mixtral-8x7B emerged as the most effective "actor," achieving an undetectability rate of 44%. Given that 50% represents perfect indistinguishability (where judges are essentially guessing), this result indicates that Mixtral's interactions are remarkably human-like. While GPT-4 demonstrated superior "stamina"—sustaining conversations for an average of 7.6 turns—its overly polished and helpful prose often served as a giveaway to human evaluators. In contrast, Mixtral's shorter, more direct prompts felt more authentic.

The Impact of Personas

Our ablation studies confirmed that sociodemographic personas are vital for linguistic diversity. Including specific traits like age, race, and education nearly doubled the lexical diversity (Type-Token Ratio) of the simulated users. This suggests that explicitly defining who the AI is playing forces the model to adopt more unique and varied linguistic patterns, moving beyond the generic "AI assistant" persona.

Discussion and Limitations

While LLM-Roleplay shows great promise for scaling chatbot evaluation, several challenges remain. First, while the language produced is diverse, it is unclear if the models authentically reflect the lived experiences or specific viewpoints of the personas they embody. Second, there is a risk that demographic prompting might trigger latent biases or stereotypes within the LLM; we utilized guard models to mitigate this, but continuous auditing is necessary. Finally, this study focused primarily on the style of interaction (indistinguishability) rather than the success of the underlying tasks (e.g., whether the math problem was solved correctly).

By providing an open-source implementation, we hope to empower researchers to stress-test conversational AI across the full spectrum of human diversity, making chatbot development more efficient and inclusive.

Summary updated

BibTeX
@misc{tamoyan2024llm,
  author = {Hovhannes Tamoyan and Hendrik Schuff and Iryna Gurevych},
  title = {{LLM Roleplay: Simulating Human-Chatbot Interaction}},
  year = {2024},
  eprint = {2407.03974},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.03974},
}
Figure