Stanford RegLab logo
Section Intro

Hidden in Plain Text

In cities across the United States, plainly discriminatory laws sit untouched. Occasionally they surface and shock residents. But the country's municipal codes run to millions of words, more than any reader could finish in decades. Comprehensive review, one scholar writes, is “practically impossible.” Scale hides the law.

With millions of local laws across the United States, the reason many discriminatory provisions persist is mundane: no one looked.

We developed an LLM-assisted research pipeline which now makes systematic review feasible, surfacing thousands of suspect discriminatory provisions still on-the-books.


01

About

9,623 municipalities Explore →

We find laws spanning the decades, from early 1900s morality ordinances targeting “lewd women” to today's well-publicized anti-drag laws. We find cities restricting non-citizens from a strikingly miscellaneous set of trades: operating go-cart tracks, bowling alleys, taxi or limousine services, bus or tow truck companies, casinos, pawnshops, used car dealerships, hotels, bars, arcades, dance halls, cabarets, massage parlors, jewelry shops, tattoo studios, boarding houses, and private investigator agencies. We find slurs and demeaning language, and ordinances reflecting a shameful history like those licensing “freak” and “minstrel” shows.

We categorize these into their recurring patterns: citizenship and alienage restrictions, gendered roles and benefits, retirement discrimination, racial classifications, voting exclusions, language-based discrimination, disability and medical-condition discrimination, sexuality and gender-expression discrimination, and offensive language.

We also surfaced laws where the equal protection analysis is more contested: laws criminalizing people based on socioeconomic or perceived social status, and zoning restrictions on residences serving people with disabilities or medical conditions. Our search also incidentally turned up laws that appear to raise First Amendment concerns.

We hope this survey helps local governments identify and revisit provisions that may no longer reflect their communities' values or current law. We have included these laws in our provision explorer to browse.

02

Provisions Explorer

Open Full Explorer

Current query

Page 1 of 1
Loading provisions…
03

Method Overview

A six-step pipeline turns millions of code sections into candidates for review.

Step 01
Corpus Assembly
Collected municipal codes across 9,623 jurisdictions, covering roughly 75% of the U.S. population and approximately 9 million legal sections.
Step 02
Semantic Screening
A large language model (LLM) selects laws that reference any of eight protected categories.
Step 03
Differential Treatment
The LLM flags provisions that assign distinct rules or treatment based on those protected categories.
Step 04
Cluster by Treatment
The LLM produces reasoning about the differential treatment; we embed and cluster that reasoning to identify patterns. The authors then remove clusters of laws unlikely to be discriminatory, such as disability accommodations.
Step 05
Discriminatory Attributes
An LLM classifies each law by five attributes which help human reviewers rule out plausible reasons why a law might be permissible.
Step 06
Soft Legality Rating
Using two prompting strategies, we assign laws a rating (high, medium, low) which we use to prioritize review. We then conduct a human review of the results.