FHFranziska Sofia Hafner

Franziska Sofia Hafner

*This is an algorithmically generated author record based on publicly available information.

Current Organizations / Institutes

The organizations/institutes from the scholar's latest article

Previous Organizations / Institutes

The organizations / institutes from the scholar's other articles in the past ten years


Franziska Sofia Hafner has a total of 17 co-authors. Here are the top co-authors by number of shared publications:


Latest Publications

  • Open Access

    Making a Name for Myself : On Academic Naming Policies and their Impact

    by A Pranav, Vagrant Gautam, Martin Mundt, Jordan Taylor, Arjun Subramonian, Franziska Sofia Hafner, Daniel Chechelnitsky, William Agnew, Anne Lauscher

  • Top Cited Papers
    Open Access

    Training language models to be warm can reduce accuracy and increase sycophancy

    by Lujain Ibrahim, Franziska Sofia Hafner, Luc Rocher

    Artificial intelligence developers are increasingly building language models with warm and friendly personas that millions of people now use for advice, therapy and companionship 1 . Here we show how this can create a significant trade-off: optimizing language models for warmth can undermine their performance, especially when users express vulnerability. We conducted controlled experiments on five different language models, training them to produce warmer responses, then evaluating them on consequential tasks. Warm models showed substantially higher error rates (+10 to +30 percentage points) than their original counterparts, promoting conspiracy theories, providing inaccurate factual information and offering incorrect medical advice. They were also significantly more likely to validate incorrect user beliefs, particularly when user messages expressed feelings of sadness. Importantly, these effects were consistent across different model architectures, and occurred despite preserved performance on standard tests, revealing systematic risks that standard testing practices may fail to detect. Our findings suggest that training artificial intelligence systems to be warm may come at a cost to accuracy, and that warmth and accuracy may not be independent by default. As these systems are deployed at an unprecedented scale and take on intimate roles in people’s lives, this trade-off warrants attention from developers, policymakers and users alike.


  • Open Access

    Training language models to be warm and empathetic makes them less reliable and more sycophantic

    by Lujain Ibrahim, Franziska Sofia Hafner, Luc Rocher

    Artificial intelligence (AI) developers are increasingly building language models with warm and empathetic personas that millions of people now use for advice, therapy, and companionship. Here, we show how this creates a significant trade-off: optimizing language models for warmth undermines their reliability, especially when users express vulnerability. We conducted controlled experiments on five language models of varying sizes and architectures, training them to produce warmer, more empathetic responses, then evaluating them on safety-critical tasks. Warm models showed substantially higher error rates (+10 to +30 percentage points) than their original counterparts, promoting conspiracy theories, providing incorrect factual information, and offering problematic medical advice. They were also significantly more likely to validate incorrect user beliefs, particularly when user messages expressed sadness. Importantly, these effects were consistent across different model architectures, and occurred despite preserved performance on standard benchmarks, revealing systematic risks that current evaluation practices may fail to detect. As human-like AI systems are deployed at an unprecedented scale, our findings indicate a need to rethink how we develop and oversee these systems that are reshaping human relationships and social interaction.


  • Open Access

    ‘Slightly disappointing’ vs. ‘worst sh** ever’: tackling cultural differences in negative sentiment expressions in AI-based sentiment analysis

    by Franziska Sofia Hafner, Lena Hafner, Roberto Corizzo

    Advertisers, politicians, and social scientists alike have an interest in the current zeitgeist. With people expressing their sentiments in online comments, the Internet has become a great source for ‘reading’ the zeitgeist via artificial intelligence-based sentiment analysis (SA). At this, negative sentiments are of special concern. They can serve as early indicators for events that require action, such as dropping customer satisfaction, discontent amongst potential voters, or a threat of social unrest. However, due to cultural differences in how negative sentiments are expressed, conventional SA methods typically classify such texts with higher accuracy for some ethnicities compared to others. In this paper, we demonstrate this using a large real-world corpus of Google Maps reviews. Across eight ethnic groups, linguistic patterns vary more starkly in negative (1 star) reviews than in neutral (2–4 star) and positive (5 star) reviews. Consequently, ethnicity-blind SA methods ‘struggle’ to classify negative reviews correctly. To mitigate this problem, we propose a novel SA method, based on balanced training and subsequent ethnicity-conscious fine-tuning. Our approach is simultaneously able to mitigate bias and enhance overall model performance. Thus, we hope to contribute to a more equal appreciation of negative sentiments of ethnically diverse customer-, voter-, or research populations, and, consequently, a more nuanced approximation of the overall zeitgeist.


  • Open Access

    Mitigating social bias in sentiment classification via ethnicity-aware algorithmic design

    by Roberto Corizzo, Franziska Sofia Hafner

    Sentiment analysis tools are frequently employed to analyze large amounts of natural language data gathered from social networks and generate valuable insights on public opinion. Research has discovered that these tools tend to be biased against some demographic groups, based on social attributes such as gender, age, and ethnicity. Sentiment classification works dealt with this issue by means of data balancing and algorithmic approaches. However, one crucial limitation of existing methods is the inability to tackle social bias while maintaining satisfactory model performance. In this paper, we aim to fill this gap by proposing a sentiment classification method that entails ethnicity-aware algorithmic design. Specifically, our method involves balanced training and a custom ethnicity-aware loss function that leverages ethnicity group information to foster a fair model optimization process. The proposed loss incentivizes the model to iteratively improve accuracy for currently underperforming demographic or social groups, therefore simultaneously decreasing social bias and boosting overall performance. Our extensive qualitative and quantitative experimental evaluation involving a large corpus of user reviews demonstrated the effectiveness of the proposed method, also when compared to popular baselines for sentiment classification.


  • Open Access

    Artificial Intelligence (AI) Reveals Ethnic Disparities in Cataract Detection and Treatment

    by Christoph Palme, Franziska Sofia Hafner, Lena Hafner, Theodor Peter Peifer, Anna Lena Huber, Bernhard Steger

    Introduction The aim of this work is to identify patients at risk of limited access to healthcare through artificial intelligence using a name-ethnicity classifier (NEC) analyzing the clinical stage of cataract at diagnosis and preoperative visual acuity. Methods This retrospective, cross-sectional study includes patients seen in the cataract clinic of a tertiary care hospital between September 2017 and February 2020 with subsequent cataract surgery in at least one eye. We analyzed 4971 patients and 8542 eyes undergoing surgery. Results The NEC identified 360 patients with names classified as ‘non-German’ compared to 4611 classified as ‘German’. Advanced cataract (7 vs. 5%; p = 0.025) was significantly associated with group ‘non-German’. Mean best-corrected visual acuity in group ‘non-German’ was 0.464 ± 0.406 (LogMAR), and in group ‘German’ was 0.420 ± 0.334 (p = 0.009). This difference remained significant after exclusion of patients with non-lenticular ocular comorbidities. Surgical time and intraoperative complications did not differ between the groups. Retrobulbar or general anesthesia was chosen significantly more frequently over topical anesthesia in group ‘non-German’ compared to group ‘German’ (24 vs. 18% respectively; p < 0.001). Conclusions This study shows that artificial intelligence is able to uncover health disparities between people with German compared to non-German names using NECs. Patients with non-German names, possibly facing various social barriers to healthcare access such as language barriers, have more advanced cataracts and worse visual acuity upon presentation. Artificial intelligence may prove useful for healthcare providers to discover and counteract such inequalities and establish tailored preventive measures to decrease morbidity in vulnerable population subgroups.


  • Open Access

    Equal accuracy for Andrew and Abubakar—detecting and mitigating bias in name-ethnicity classification algorithms

    by Lena Hafner, Theodor Peter Peifer, Franziska Sofia Hafner

    Uncovering the world’s ethnic inequalities is hampered by a lack of ethnicity-annotated datasets. Name-ethnicity classifiers (NECs) can help, as they are able to infer people’s ethnicities from their names. However, since the latest generation of NECs rely on machine learning and artificial intelligence (AI), they may suffer from the same racist and sexist biases found in many AIs. Therefore, this paper offers an algorithmic fairness audit of three NECs. It finds that the UK-Census-trained EthnicityEstimator displays large accuracy biases with regards to ethnicity, but relatively less among gender and age groups. In contrast, the Twitter-trained NamePrism and the Wikipedia-trained Ethnicolr are more balanced among ethnicity, but less among gender and age. We relate these biases to global power structures manifested in naming conventions and NECs’ input distribution of names. To improve on the uncovered biases, we program a novel NEC, N2E, using fairness-aware AI techniques. We make N2E freely available at www.name-to-ethnicity.com.