BERT has a Moral Compass: Improvements of ethical and moral values of machines

Patrick Schramowski, Cigdem Turan, Sophie F. Jentzsch, Constantin A. Rothkopf, Kristian KerstingarXiv 2019

Abstract

This paper investigates whether Large Language Models (LLMs) like BERT implicitly acquire human ethical and moral values from their training data. Using the Moral Choice Machine (MCM) framework and Principal Component Analysis (PCA), the researchers identify a "moral dimension" within BERT's embedding space. The study demonstrates that BERT's internal representations of "right" and "wrong" align significantly with human social norms, outperforming previous models in context-aware moral reasoning.

Introduction

As AI systems take on autonomous roles—from self-driving cars to automated recruiters—they must navigate the "grey areas" of human ethics. While previous research has highlighted how AI models inherit human biases (like gender or racial stereotypes), this paper asks the inverse: Can these models also inherit our "moral compass"? Earlier work relied on simple word associations that lacked context. This study seeks to identify a robust, context-aware moral dimension in state-of-the-art models like BERT.

Methodology

The authors employ two primary techniques to probe the model's "conscience":

  1. The Moral Choice Machine (MCM): This framework calculates a "moral bias score" by comparing the cosine similarity of a question (e.g., "Should I [action]?") to two opposing answers ("Yes, I should" and "No, I should not").
  2. Moral Subspace Projection: Researchers applied Principal Component Analysis (PCA) to embeddings of "atomic actions" (verbs like murder, help, smile, steal). They discovered that the top principal component effectively functions as a "moral dimension."

Key Insights: Morality as a Primary Feature

Morality appears to be a primary structural feature in BERT. The top PCA component explains a massive portion of the variance in how the model perceives actions. Crucially, BERT demonstrates contextual intelligence; unlike older models that might flag the word "kill" as universally bad, BERT distinguishes between "killing time" (neutral/positive) and "killing people" (deeply negative).

BERT's moral dimension projecting "Dos" and "Don'ts" along a single axis.

Key Results

BERT’s moral bias scores showed a correlation of $r = 0.88$ with human-validated association tests (WEAT), significantly outperforming the older Universal Sentence Encoder (USE), which achieved $r = 0.73$.

Correlation between BERT's moral bias scores and human-validated WEAT values (r = 0.88).

The model successfully ranked complex social behaviors, viewing "becoming a good parent" as strongly positive and "lying to my wife" as strongly negative. However, it also reflects a "Cultural Mirror" effect, where geopolitical leanings in training data (e.g., Wikipedia) influence moral perceptions of different countries.

Conclusion and Future Work

While BERT captures a "deontological" rule-based morality, it remains limited by the static nature of its training data and lacks complex ethical reasoning like utilitarianism. Future directions include using these findings to "debias" models or creating interactive systems where humans can teach specific moral subspaces to AI through reinforcement.

Summary updated

BibTeX
@misc{schramowski2019bert,
  author = {Patrick Schramowski and Cigdem Turan and Sophie F. Jentzsch and Constantin A. Rothkopf and Kristian Kersting},
  title = {{BERT has a Moral Compass: Improvements of ethical and moral values of machines}},
  year = {2019},
  eprint = {1912.05238},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1912.05238},
}
Figure