Source-linked AI summary

In-Context Impersonation Reveals Large Language Models' Strengths and Biases

Leonard Salewski, Stephan Alaniz, Isabel Rio-Torto, Eric Schulz, Zeynep Akata

arXiv:2305.14930v2cs.AIcs.CLcs.LG

TL;DR

The paper investigates whether LLMs can take on different roles in context and how this changes their behavior across language and vision-language tasks. It prefixes prompts with social-identity or expertise personas and finds developmental, expertise-related, performance, and bias-related effects. The results show that in-context impersonation can reveal both model strengths and societal biases.

  • Problem

    The paper asks how in-context impersonation affects LLM behavior across language-based and downstream tasks.

  • Method

    The study prefixes prompts with persona instructions and evaluates pretrained LLMs in bandit, reasoning, and visual-classification tasks.

  • Results

    Across tasks, impersonation recovers human-like age-related exploration, improves domain-expert reasoning and visual descriptions, and reveals biases associated with social identities.

  • Takeaways & Limitations

    In-context impersonation can expose diverse LLM capabilities and biases through changes in task performance and generated descriptions.

  • Takeaways & Limitations

    The study examines single agents performing relatively limited tasks and cautions against exploiting impersonation biases for maximal performance.

Abstract

from arXiv · show

In everyday conversations, humans can take on different roles and adapt their vocabulary to their chosen roles. We explore whether LLMs can take on, that is impersonate, different roles when they generate text in-context. We ask LLMs to assume different personas before solving vision and language tasks. We do this by prefixing the prompt with a persona that is associated either with a social identity or domain expertise. In a multi-armed bandit task, we find that LLMs pretending to be children of different ages recover human-like developmental stages of exploration. In a language-based reasoning task, we find that LLMs impersonating domain experts perform better than LLMs impersonating non-domain experts. Finally, we test whether LLMs' impersonations are complementary to visual information when describing different categories. We find that impersonation can improve performance: an LLM prompted to be a bird expert describes birds better than one prompted to be a car expert. However, impersonation can also uncover LLMs' biases: an LLM prompted to be a man describes cars better than one prompted to be a woman. These findings demonstrate that LLMs are capable of taking on diverse roles and that this in-context impersonation can be used to uncover their hidden strengths and biases.

1 Introduction

The paper asks how in-context impersonation affects LLM behavior across language-based and downstream tasks. It introduces a persona-prefixing approach and reports developmental, expertise-related, and bias-related effects.

  • In-context learning is not fully understood, motivating study of how persona prompts affect LLM behavior in downstream tasks.
  • The method prefixes prompts with “If you were a {persona},” using personas linked to social identities or domain expertise.
  • LLMs impersonating children of different ages recover human-like developmental stages of exploration in a multi-armed bandit task.
  • Domain-expert impersonation outperforms non-domain-expert impersonation on language-based reasoning tasks.
  • In visual classification, impersonation improves descriptions while revealing social biases associated with age, gender, race, and expertise.

2 Related Work

Related work establishes in-context learning, role-taking, personality conditioning, social simulation, and bias reproduction as relevant foundations. Prior studies show that prompting can alter model behavior and that generated semantics may reflect human biases.

  • In-context learning improves task performance from task-relevant demonstrations without fine-tuning model weights.
  • Prompting supports both few-shot and zero-shot task solving by delivering task or scenario information as text.
  • Role-taking prompts can change generated behavior, including writing style, artistic output, personality profiles, and simulated survey responses.
  • LLM-generated semantics can reproduce biases present in training data, and persona prompting can exacerbate those biases.
  • LLMs can generate class descriptions that improve zero-shot visual classification when combined with CLIP scores.

3 In-context Impersonation Methodology

The methodology prompts pretrained LLMs to impersonate social identities or expertise profiles, then evaluates generated responses in bandit, reasoning, and visual-classification tasks. The tasks use prompt-chained feedback, expert persona groupings, and answer-selection or description-generation procedures.

  • 3. In-context Impersonation Methodology: The methodology first queries an LLM with a persona prompt, then evaluates the resulting text in bandit, reasoning, and visual-classification tasks.
  • 3.1 Prompting and Querying the Large Language Model with Personas: In-context impersonation prefixes task contexts with “If you were a {persona}” and samples generated tokens from the prompted LLM.
  • 3.1 Prompting and Querying the Large Language Model with Personas: Personas cover ages 2, 4, 7, 13, and 20; expertise profiles; and gender or skin-color identities.
  • 3.2 Bandit Task Design: The bandit task gives an agent 10 trials with two arms, rewards sampled from normal arm distributions, and prior feedback supplied through prompt-chaining.
  • 3.2 Bandit Task Design: Bandit behavior is analyzed with a probit model whose value-difference and relative-uncertainty terms quantify exploitation and directed exploration.
  • 3.3 Reasoning Task Design: The reasoning task uses MMLU multiple-choice questions and compares task-expert, domain-expert, and non-domain-expert persona groups.
  • 3.3 Reasoning Task Design: Reasoning predictions select the answer option whose token receives the highest probability under the persona-conditioned prompt.

4 Experiments

The experiments test whether in-context personas alter LLM behavior across bandit learning, reasoning, and visual classification. Across tasks, age and expertise can improve performance or produce human-like behavior, while gender and race personas expose biases.

  • Experimental design: The study evaluates Vicuna-13B and, for visual classification, ChatGPT across two-armed bandit, MMLU reasoning, and zero-shot visual classification tasks.The pipeline prompts LLMs with varied impersonation personas and evaluates the generated responses or descriptions.
  • Age-based impersonation: Age-based personas produced human-like exploration development: older personas explored less and exploited more between ages 2–20.The regression estimates were β = −0.03 for exploration and β = 0.04 for exploitation, both p < .001.
  • Expertise-based impersonation: In MMLU, task experts performed best, domain experts outperformed non-domain experts, and the pattern held across all four domains.When tasks were near or below the random baseline, persona differences became less clear, especially for difficult calculation-heavy problems.
  • Visual classification: Across CLIP variants, increasing persona age improved bird and car classification, while expertise helped descriptions match the relevant dataset.Car-mechanic descriptions performed better for cars than ornithologist descriptions, and ornithologist descriptions were more useful for birds.
  • Visual classification: Visual classification also revealed social biases: black personas performed better for cars, white personas for birds, and women better for birds while men performed slightly better for cars.The reported race and gender effects varied across models, and ChatGPT generally showed larger effects than Vicuna-13B.
  • Visual classification: For ChatGPT, car-description accuracy rose from ∼4% with a 2-year-old persona to 54.9% with a 20-year-old persona.The age trend was observed for both ChatGPT and Vicuna-13B, with the progression particularly pronounced for ChatGPT on Stanford Cars.

5 Broader Impact

The paper highlights that in-context impersonation can improve performance while exposing biases with societal implications. It argues that systematic study can support awareness and future mitigation, while warning against exploiting biases for maximal performance.

  • In-context impersonation boosts performance but can also produce biases with potential societal consequences.The paper connects these effects to fraud, stereotypical content, fake trust, and training-data contamination.
  • Quantitative bias testing before model release is proposed as a way for providers to identify these effects.
  • The authors discourage prompts that exploit biases for maximal performance because they may reinforce societal biases and create unexpected side effects.
  • Studying impersonation biases is presented as a first step toward awareness and mitigation research.

6 Conclusion

The paper concludes that in-context impersonation changes LLM performance and reveals biases across bandit, reasoning, and vision-language tasks. It also identifies limited personas and relatively simple single-agent tasks as boundaries for the evidence.

  • In-context impersonation changes LLM performance and reveals biases across the evaluated tasks.
  • Impersonating children of different ages reproduced human-like developmental stages of exploration in a two-armed bandit task.
  • Domain-expert impersonation outperformed non-domain-expert impersonation in language reasoning tasks.
  • Vision-language impersonation both improved relative performance and recovered societal biases concerning age, gender, and race.
  • The study evaluates single agents on relatively simple tasks across a limited range of personas.
  • Future work should examine multiple LLMs, more personas, complex interactive tasks, and additional modalities such as video generation.

Supplementary Materials: In-Context Impersonation Reveals Large Language Models’ Strengths and Biases

The supplementary materials document experimental details, prompt construction, reproduction resources, and additional results and limitations for the impersonation study.

  • The supplement provides experimental details, additional bandit and expertise results, vision-language details, and a limitations discussion.
  • The authors provide code for reproducing the results through their public GitHub repository.
  • A meta-prompt generated five grammatical variations of the original “If you were a {persona}” impersonation prompt.

A.2 Compute and Reproduction

The reproduction setup used GPUs and sequential execution for Vicuna, ChatGPT vision experiments, bandit games, reasoning tasks, and vision-language classification.

  • Vicuna-13B experiments used a single Nvidia A100-40GB GPU, while ChatGPT vision experiments used Nvidia 2080ti 11GB GPUs for CLIP models.
  • The bandit experiment ran 12k games sequentially and required approximately 3.5 hours per persona.
  • Running all 57 Vicuna-13B reasoning tasks and personas sequentially required about 12 hours for one prompt variation.
  • Generating descriptions and running CLIP classification required approximately one hour per persona and impersonation prompt.

B Bandit Task — Results for Llama 2

Rerunning the bandit experiments with Llama 2 produced the same conclusions as Vicuna-13B, with age-related reward effects in both models.

  • The Llama 2 bandit experiments reached the same conclusions as those obtained with Vicuna-13B.
  • β = 0.17 (p < .001) for Vicuna-13B and β = 0.26 (p < .001) for Llama 2 quantified the effect of age from 2–20 on reward.

C.1 Additional quantitative results for expertise-based impersonation

Additional MMLU analyses confirm an expertise ordering across domains, while prompt format and social-category prefixes affect absolute performance and persona comparisons.

  • Model and domain comparisons: ChatGPT consistently performs better than Vicuna-13B, while Humanities accuracy is consistently higher than STEM accuracy.
  • Expertise-based impersonation: For Vicuna-13B, departures from the expertise trend occur on tasks with accuracies near or below the random baseline for all personas.
  • Expertise-based impersonation: The non-domain expert is outperformed by the domain expert, who in turn is outperformed by the task expert across all four MMLU domains.
  • Prompt comparison: Using the official MMLU prompt preserves expertise-based impersonation trends and improves absolute accuracy values.
  • Social-category prefixes: Adding black, white, male, or female prefixes lowers expert-persona performance for both models relative to no prefix; Vicuna shows additional race and gender differences.

D.2 Additional visual datasets

Additional vision-language analyses extend the study across datasets, ages, bias groups, and VLMs, finding age-related complexity and performance changes alongside persistent persona-associated biases.

  • Additional visual datasets: Female-persona descriptions outperform male-persona descriptions across all three evaluated datasets, strengthening evidence of gender biases in Vicuna-13B.
  • Text complexity: Across language models and datasets, older personas produce descriptions requiring higher reading levels, from 4th to 9th grade on CUB and 3rd to approximately 10th grade on Stanford Cars.
  • LLM/VLM pairs: ChatGPT shows increasing fine-grained classification performance with persona age and expert descriptions perform roughly twice as well as non-expert descriptions across all VLMs.
  • Additional bias groups: Additional agender, non-binary, Indian, Asian, and Hispanic personas reveal further performance differences, with the latter race groups performing worse than white and black personas.
  • Google PaLM: Google PaLM outputs involving racial impersonation were blocked by a text classifier, preventing reliable evaluation of the underlying model.

E Limitations

The vision results depend on both the language model and the VLM, and proprietary-model results may be difficult or costly to reproduce.

  • Vision-dataset results fundamentally depend on the performance and biases of the VLM models, despite evaluation across multiple CLIP variants.
  • Results obtained with proprietary models such as ChatGPT may be hard or costly to reproduce because their training regime, data, and system prompts are unknown.
Loading 2305.14930v2…