CS 162: Natural Language Processing
Saadia Gabriel
Lecture 12:
Sequence Labeling Models & NLP Ethics
Announcements
Quiz #4
https://forms.gle/oEfMK74ZZcE3FFYL9
Recap: Sequence Tagging
Recap: HMM Prediction
Goals of This Lecture
Viterbi Algorithm
Viterbi Algorithm
Observations
Viterbi Algorithm
Viterbi Algorithm
Viterbi Algorithm
Viterbi Algorithm
k
Viterbi Algorithm
Viterbi Algorithm
Viterbi Algorithm
Viterbi Algorithm
Applications of HMMs
Learning HMM Parameters
Supervised Learning
But what if…
Recap:
Generative vs. Discriminative Models
Maximum Entropy Markov Models
(MEMMs)
Decomposition Based on Markov Assumption
Modeling Conditional Probability
Combining MEMMs with Transformers
This Generalizes to CRFs
Inference for MEMMs
Guess?
Inference for MEMMs
HMM vs. MEMM
The model is biased towards states with fewer transitions due to normalization for each state, regardless of the observed sequence
Conditional Random Fields (CRFs)
Let’s normalize globally instead of locally
Global partition function ensures we have valid probabilities (a function of the observation sequence and not the current state).
Computed using forward-backward algorithm with more dynamic programming
(J&M Appendix A)
Ethics of NLP
Types of Sampling Bias in Naturalistic Data
Effect on Downstream Tasks
African-American English tweets are considerably more likely to be misclassified as offensive compared to White-aligned tweets
- Sap, Card and Gabriel et al. (2019)
Socially Biased Representations
and Generations
Recall HW1
Sheng et al. (2019)
Factually Inaccurate or Toxic Generated Language
Jailbreaking
Courtesy of VentureBeat
Biased Objectives
Ongoing NLP debate: sometimes the problems we work on shouldn’t be solved with AI
IQ Prediction
Automatic Criminal Sentencing
Hofmann et al. (2024)
“Ethics is a study of what are good and bad ends to
pursue in life and what it is right and wrong to do in the
conduct of life.
It is therefore, above all, a practical discipline.
Its primary aim is to determine how one ought to live and
what actions one ought to do in the conduct of one’s life.”
Introduction to Ethics, John Deigh
Summary
Paper peer review typically includes an ethics review
Student Presentations