
Audit persona briefs for essentializing language and caricature
Source:R/persona.R
persona_audit.RdRead persona briefs back as text and flag the ways synthetic personas fail representationally. Two layers:
Usage
persona_audit(p_or_set, .config = NULL, dimensions = NULL)
# S3 method for class 'persona_audit'
print(x, ...)Arguments
- p_or_set
A
persona_frame(), apersona_variants()result (persona_set), or a list ofpersona_frameobjects.- .config
Optional generative
LLMR::llm_config()for model scoring. WhenNULL(default), only the lexical layer runs and model scores areNA.- dimensions
Optional character vector naming the qualities to score (model layer); defaults to caricature, out-group homogeneity, and essentialism. Recorded in the judge prompt.
- x
A
persona_audit.- ...
Ignored.
Value
A tibble of class persona_audit, one row per persona, with columns
id, flag_lexical (any lexical hit), n_lexical_hits, caricature_score
(0–1 or NA), essentialism_score (0–1 or NA), and notes.
Details
Lexical (always, no model): each brief is scanned against a small built-in lexicon of essentializing and demographic-as-destiny patterns. A brief that says a demographic naturally or always thinks something is flagged.
Model (optional, when
.configis a generativeLLMR::llm_config()): each brief is scored on caricature and essentialism on a 0–1 scale viaLLMR::llm_judge(). Without a config these scores areNA.
The lexical layer is a screening pass, not a proof: a clean scan does not certify a brief is unbiased, and a hit may be a false positive in quoted speech. Treat the audit as evidence to read, alongside the briefs themselves.
Examples
set <- persona_variants(
persona_frame("A small-business owner.", source = "synthetic"),
vary = list(age = c("35", "60")))
persona_audit(set)
diagnostics(persona_audit(set))
if (FALSE) { # \dontrun{
cfg <- LLMR::llm_config("openai", "gpt-4o-mini")
persona_audit(set, .config = cfg) # adds model caricature scores
} # }