Denis Peskoff, Joe Barrow, Christopher Vu, Diag Davenport
6 min
Legal AI has historically focused on federal statutes, case law, and contracts, leaving the vast, fragmented, and often inaccessible body of local municipal and county ordinances largely unstudied. The authors seek to "free the law" by creating a standardized, machine-readable corpus that allows researchers to perform large-scale empirical analysis on the regulations that govern everyday life, such as zoning, housing, and business licensing.
To overcome the fragmentation of local codes across various vendor platforms, the authors developed a pipeline to collect, OCR, and clean over 9,000 municipal and county ordinance documents. They utilized a vision-language model (LightOnOCR-2-1B) to convert diverse PDF formats into structured Markdown. To make the data useful for research, they trained ModernBERT-based classifiers to categorize ordinances by function (e.g., rules, enforcement, structural) and topic (e.g., zoning, nuisance). Furthermore, they implemented a dimensional analysis framework using TrueSkill-based pairwise comparisons to score ordinances on four normative axes: opacity, paternalism, enforcement discretion, and problem salience.
The resulting LOCUS-v1 dataset provides a reproducible substrate for legal AI research, covering jurisdictions that represent 94% of the U.S. population. The authors demonstrate that their ModernBERT-based scorers can reliably predict normative dimensions of local law, enabling researchers to identify macro-trends—such as regional differences in how opaque or paternalistic local regulations are—that were previously impossible to quantify at this scale.
By transforming fragmented, human-browsing-oriented legal documents into a structured, searchable dataset, LOCUS enables a new class of empirical legal studies. It provides the necessary infrastructure for future work in legal retrieval, comparative policy analysis, and the evaluation of foundational models on complex, multi-layered legal reasoning tasks where state, county, and municipal authorities overlap.
Progress in legal AI increasingly depends on access to authoritative legal text at scale. Yet one of the most consequential layers of American law remains largely absent from existing machine-readable corpora: local ordinances. Local codes govern zoning, housing, business licensing, public health, noise, animal control, and many other domains of everyday regulation, but they are fragmented across vendor platforms designed for human browsing rather than bulk research access. We introduce LOCUS - the Local Ordinance Corpus for the United States - a comprehensive corpus and county-harmonized access layer for U.S. municipal and county ordinance codes. The raw corpus, available for release to researchers, represents nearly all publicly available municipal and county ordinance codes. The resulting raw corpus contains codes from 9,239 cities and counties. A smaller county-harmonized LOCUS access layer provides coverage for the largest 2,309 of 3,144 U.S. counties, accounting for a majority of the population. We use OCR to handle the myriad of document formats that have kept the law from being a public resource. We release the corpus with coverage metadata to support reproducibility, downstream legal AI research, and the incremental expansion of machine-readable access to local law. We train a collection of ModernBERT-based classifiers and scorers to facilitate analyzing U.S. local law among several dimensions, such as opacity and paternalism, that have not previously been studied at this scale. LOCUS-v1 and its derivative models are available at: https://huggingface.co/datasets/LocalLaws/LOCUS-v1
Sam: So instead of searching for specific words, you could theoretically ask the system to surface laws that are particularly hard for ordinary people to understand, or ones that are unusually restrictive.
Alex: Precisely. And because every law in the database gets scored the same way, you can now compare them. A researcher could ask whether rural counties tend to have more opaque zoning rules than urban ones, and actually get an answer.
Sam: But how do they know the computer isn't just guessing? Legal language is notoriously subtle.
Alex: That's a fair challenge. The scoring system is built on comparisons rather than absolute judgments. Instead of asking the model to rate a law from one to ten, they ask it a simpler question: between these two laws, which one is more opaque? They repeat that process thousands of times across different pairs. The system they use to tally those comparisons is called TrueSkill—originally developed to rank competitive video game players online. The logic is straightforward: if Law A consistently beats Law B in head-to-head comparisons, and Law B consistently beats Law C, you can build a reliable ranking without ever needing a perfect numerical score.
Sam: That's a clever way to sidestep the problem. It's not asking for an absolute number—it's asking for a relative judgment, which is much easier to get right.
Alex: Exactly. And once they have those rankings, they train a smaller, faster model to predict them. That smaller model can then score millions of laws cheaply and quickly—the paper reports costs well under a dollar per thousand pages.
Sam: So they've turned a mountain of unreadable PDFs into a structured, searchable database, at a cost that makes the whole project practical. That's a meaningful shift in what's possible.
Alex: It is. Before this, studying local law at a national scale meant either hiring large teams of research assistants or simply giving up. Now there's a consistent, automated way to measure and compare laws that were previously invisible to large-scale analysis.
Sam: But does this actually solve the legal problem? Laws aren't just text—they're about who has the power to enforce what.
Alex: That is a critical limitation the paper acknowledges directly. Having the text of a local law doesn't tell you whether that law is actually enforceable. There's a legal principle called preemption—when a state law and a local law conflict, the state law wins. So a city might have a rule on the books, but if the state has passed something that overrides it, that local rule is essentially a dead letter.
Sam: So LOCUS can tell you the law exists, but not whether it has any teeth.
Alex: Precisely. The paper is clear that LOCUS is infrastructure for retrieval, not a substitute for careful human legal analysis. It transforms local law into something structured and measurable—which is the necessary first step before any deeper reasoning can happen. Think of it as building the roads before you can navigate the city. The navigation still requires judgment that no database can replace.
Sam: It's a significant piece of work, then—not because it solves the problem of local law, but because it makes the problem visible in a way it simply wasn't before.
Alex: That's a good way to put it. And that visibility, at scale, is what opens the door for researchers, policymakers, and journalists to ask questions about local governance that were previously unanswerable. Thanks for listening to ResearchPod.