Embedded ethics at Harvard: Harvard: bringing ethical reasoning into the computer science curriculum.

Embedded EthiCS @ Harvard: bringing ethical reasoning into the computer science curriculum.
Course Modules / CS 287: Natural Language Processing

Repository of Open Source Course Modules


Course: CS 287: Natural Language Processing

Course Level: Graduate

Course Description: “Big data is everywhere. A fundamental goal across numerous modern businesses and sciences is to be able to utilize as many machines as possible, to consume as much information as possible and as fast as possible. The big challenge is how to turn data into useful knowledge. This is a moving target as both the underlying hardware and our ability to collect data evolve. In this class, we discuss how to design data systems, data structures, and algorithms for key data-driven areas, including relational systems, distributed systems, graph systems, noSQL, newSQL, machine learning, and neural networks. We see how they all rely on the same set of very basic concepts and we learn how to synthesize efficient solutions for any problem across these areas using those basic concepts. (Course description )"

Module Topic: Bias and Stereotypes in Word Embedding software

Module Author: Diana Acosta-Navas

Semesters Taught: Spring 2019


natural language processing CS
word embeddings CS
machine learning CS
bias phil
stereotypes phil
discrimination phil
allocative vs representational harm phil
statistical truth vs essentialist claims phil

Module Overview:

The module examines the relation between gender stereotypes and the biases encoded in word embeddings. Students discuss the ethical problems raised by encoding gender biases in word embeddings, including the perpetuation and amplification of stereotypes, the infliction of representational and allocative harm, and the solidification of prejudice. After discussing some pros and cons of debiasing algorithms, the final part of the module explores the moral concerns that this solution may raise. It focuses on the thought that bias often happens without our full awareness, hence debiasing and other technical solutions should be immersed in wide-ranging cultural transformations towards inclusion and equality.

Connection to Course Technical Material: In the lead-up to the module, the course covers word embedding techniques and their potential uses in processing natural language. In the module we examine a potential drawback of these techniques and the ethical problems raised by their employment, while also examining the advantages and disadvantages of alternative approaches. Specifically, the module invites students to weigh the technical advantages of word embeddings against their potential to propagate gender stereotypes by encoding biases rooted in our use of language. Students are provided with philosophical concepts that help them articulate whether taking advantage of the computing power offered by word embeddings justifies the kind of harm that may be inflicted when biases are perpetuated and solidified.


Module Goals:

  1. Introducing students to the concepts of bias, stereotypes, and discrimination.
  2. Discussing the existence of gender biases in word embedding software, and its correlation to gender stereotypes.
  3. Guiding students in thinking about the ethical problems raised by the presence of gender bias in word embedding software.
  4. Prompting students to consider the potential advantages of debiasing word embeddings, and its potential drawbacks.
  5. Using case-studies to train students to identify morally problematic aspects in the context of complex real-world scenarios.

Key Philosophical Questions:

  1. What are the distinctive features of stereotypes?
  2. What makes stereotypes morally problematic?
  3. Can individuals be harmed by the presence of stereotypes in language processing software?
  4. Can debiasing algorithms resolve the issue given that bias and stereotypes are present and widespread in our culture?


Key Philosophical Concepts:

  • Bias (explicit vs. implicit)
  • Stereotypes
  • Discrimination
  • Statistical truths vs essentialist claims
  • Prejudice
  • Representational vs. allocative harms


Class Agenda:

  1. Active learning exercise: identifying analogies that reflect gender stereotypes.
  2. Class discussion: what is a stereotype?
  3. Presentation on the findings of gender biases in word2vec.
  4. Small group discussion: what is wrong with allowing gender biases into word embeddings?
  5. Class wide-discussion about the moral issues raised by different kinds of bias.
  6. Discussion of debiasing techniques and their advantages and disadvantages.

Sample Class Activity:

At the beginning of the session, students are given a list of analogies that link professions to genders, including ballerina/dancer, hostess/bartender, vocalist/guitarist, among others. They are asked to mark those analogies that reflect gender stereotypes. When they finish, the lecturer polls students to find out how they responded to four analogies: one that is clearly stereotypical (homemaker/computer scientist), one that is not (Queen/King), and two that are debatable (Diva/Rockstar, and Interior Designer/Architect). The Embedded Ethics fellow then leads a discussion about the distinctive features of gender stereotypes, which serves as a starting point to discuss the ethical problems raised by gender biases in word embeddings.