Source-linked AI summary

Freeing the Law with LOCUS: A Local Ordinance Corpus for the United States

Denis Peskoff, Joe Barrow, Christopher Vu, Diag Davenport

arXiv:2606.19334v1cs.CLcs.CYcs.LG

TL;DR

Local ordinances remain a consequential layer of American law without systematic access. LOCUS assembles local codes and provides a county-harmonized access layer selecting the longer available county or largest-city code. Its analysis finds that code content differs by jurisdiction type and that ordinance topics follow a stable sequence within codes.

  • Problem

    Local ordinances govern many domains of everyday regulation, yet legal AI lacks systematic access to them.

    Source: §1 · p. 2
  • Method

    LOCUS assembles local codes and provides a county-harmonized layer that selects the longer available county or largest-city code with classifier metadata.

    Source: §4.5 · p. 6, §4.4 · p. 6
  • Results

    County codes contain substantially more zoning material while city codes contain more nuisance and public-order regulation, and ordinance topics follow a stable sequence within codes.

    Source: §6 · p. 9
  • Takeaways & Limitations

    Local-law models should preserve whether text comes from a municipal or county source because jurisdiction type is part of substantive representation.

    Source: §6 · p. 9

    The county-harmonized selection does not determine which rule controls a particular legal question, where layered sources and doctrines may matter.

    Source: §6 · pp. 8–9

Abstract

from arXiv · show

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

1 What it means to "free the law"

LOCUS addresses the lack of systematic access to local ordinances by providing a national corpus and county-harmonized access layer. Its first release makes local legal text searchable and comparable without claiming to determine which authority controls every legal question.

Why local ordinances matter

  • Local ordinances govern everyday domains including zoning, housing, permits, licensing, public health, noise, signs, and animal control, yet legal AI lacks systematic access to them.Residents, businesses, landlords, and local governments often need municipal or county law in addition to federal or state law.Source: §1 · p. 2

Legal authority and complexity

  • Local law layers state statutes, county and municipal ordinances, home-rule provisions, charters, preemption, and delegations, so useful legal AI must reason about jurisdiction and authority conflicts.Which rule controls may depend on the legal domain; systems need more than text retrieval.Source: §1 · p. 2

LOCUS representation

  • LOCUS records the most substantial available county or largest-municipality code for each U.S. county, using document length as a reproducible proxy rather than deciding controlling authority.The common geographic substrate can be connected to population, geographic, Census, and policy data.Source: §1 · p. 2

Access barriers

  • Although local law is public, it is fragmented across vendor platforms built for browsing, with no central jurisdiction registry or complete machine-readable index.Building a national corpus therefore requires discovering hosting locations, using platform-specific extraction workflows, validating artifacts, and harmonizing jurisdictions. Georgetown Law Library [2026] notes there is no single comprehensive collection of municipal codes.Source: §1 · p. 2

Scope and limitations

  • LOCUS defers full issue-specific hierarchy and conflict modeling to later releases and benchmark tasks because controlling authority is legally complex and future evaluations need uncontaminated settings.The first-release representation does not purport to determine which local authority governs every legal question.Source: §1 · p. 2

Research applications

  • LOCUS supports local-rule search and question answering, structured extraction, comparative policy analysis, and future benchmarks of jurisdictional reasoning and state-local or county-municipal overlap.Potential extracted fields include regulated activities, permits, fees, penalties, effective dates, and cross-references.Source: §1 · p. 3

2 Related Work

Existing legal NLP resources largely omit local ordinances, while access barriers have left local laws understudied. LOCUS aims to address this gap through large-scale standardization enabled by modern data-processing techniques.

Related Work

  • Neural-era legal corpora and all 162 LegalBench tasks omit local ordinances, despite earlier legal NLP corpus efforts.The cited corpora cover case law, opinions, and legal codes, while LegalBench draws heavily from contracts and merger agreements.Source: §2 · p. 3
  • Georgia v. Public.Resource.Org, Inc. held laws, statutes, and court decisions to be public domain for digital content [Supreme Court of the United States, 2020].Source: §2 · p. 3
  • Modern techniques make standardizing 9,239 one-thousand-page documents feasible, and LOCUS aims to resolve data-access barriers that have left local laws understudied.Source: §2 · p. 3

3 Properties of LOCUS

LOCUS provides a county-harmonized access layer and additional research data, alongside annotations describing the corpus’s contents and legal topics.

3.1 A County-Harmonized Access Layer

  • LOCUS selects each county’s most substantial available code from the county code or its largest municipality’s code, without claiming to resolve which law controls doctrinally.The layer is intended as a reproducible substrate for retrieval, comparison, and future state–county–municipal legal-reasoning benchmarks.Source: §3.1 · p. 3
  • 2,211,516 chunks make up the released corpus; most are substantive laws, mainly rules concerning buildings, business licensing, zoning, and nuisance.Roughly a third are categorized as “other” with near 90% precision; topics include government, employment, and animal regulation, which contributes to Alaska’s unusually large “other” share.Source: §3.1 · p. 3, Figure 3 · p. 4

3.2 Additional Data for Researchers

  • Researchers may access an additional 7,000 city and county documents through a signed release, similar to MIMIC [Johnson et al., 2016, 2023].The authors argue this release condition is necessary for future evaluation of local-law coverage by foundational models under current LLM ingestion policies [Dahl et al., 2024].Source: §3.2 · pp. 3–4

4 Constructing LOCUS

LOCUS combines large-scale ordinance collection, OCR, law classification, and county-level harmonization to create a machine-readable corpus and access layer.

4.1 Collecting the data

  • LOCUS collected 9,239 valid PDFs totaling approximately 80 GB using vendor-specific automation and manual collection for self-hosted or PDF-restricted codes.Targeted recovery addressed platform-specific failures including PDF assembly limits, filename collisions, hidden thresholds, crawl delays, anti-bot measures, and consolidated cities.Source: §4.1 · pp. 4–5

4.2 Identifying salient laws

  • LOCUS uses two-level zero-shot labeling to remove structural content and identify substantive chunks, with GPT-5.4-nano selected for large-scale annotation.For the 5.5% of annotations deemed most challenging, GPT-5.4 agreed with 64,977 of 108,889 predictions; structural content was removed from the release.Source: §4.2 · p. 5

4.3 OCR and Processing

  • LightOnOCR-2-1B converts ordinance page images to Markdown, which LOCUS stitches across pages, cleans, segments into laws, and classifies to omit structural-only segments.The pipeline processes roughly 7 million pages at about $0.30 per 1,000 pages.Source: §4.3 · pp. 5–6

4.4 Annotating the Law

  • LOCUS trains substantivity, function, and topic classifiers on 100,000 GPT-5.4-nano-annotated laws, using ModernBERT and splits of 80,000 training, 10,000 parameter-sweep, and 10,000 evaluation examples.LOCUS-v1 also derives a county-harmonized release pairing a representative local-law artifact for each covered county with classifier metadata.Source: §4.4 · p. 6

4.5 Creating a Harmonized Access Layer

  • 94% of the U.S. population is represented by LOCUS’s county access layer, which selects the longer available county or largest-city code for each county.Because this method omits second-order cities and people living outside the selected city, the access layer covers a smaller literal population than the full data.Source: §4.5 · p. 6

5 A Dimensional Analysis of Local Laws

LOCUS scores local ordinances along four continuous dimensions, enabling comparisons within and across bodies of law. Its scorers recover TrueSkill rankings, and nationwide analysis reveals geographic and textual patterns in opacity and paternalism.

5 A Dimensional Analysis of Local Laws

  • LOCUS annotates ordinances for enforcement discretion, opacity, paternalism, and problem salience, ranging from discretionary to non-discretionary, opaque to intelligible, paternalistic to externality oriented, and salient to unimportant.These dimensions concern officials’ judgment, ordinary people’s ability to know requirements, protection of actors versus others, and how important or urgent an issue is presented.Source: §5 · pp. 6–7

5.2 Analysis

  • A law barring minors under 16 from attending a festival without an adult scores highly paternalistic and intelligible, with neutral discretion and salience.Curfews are detected as paternalistic; headers containing “possession” and “alcoholic” associate with paternalism, while “definitions” and “variances” associate with opacity.Source: §5 · p. 7, §5.2 · p. 8

5 A Dimensional Analysis of Local Laws

  • The dimensions are treated as continuous axes for ordering and measuring laws, supporting analysis within a city and comparisons across bodies of law.The authors argue that accurate dimensional models can bring particular aspects of law into focus.Source: §5 · p. 7

5.1 Building LOCUS Scorers

  • For each dimension, ModernBERT-base regressors learn normalized TrueSkill scores derived from 10,000 sampled ordinances and 200,000 GPT-5.4-nano pairwise judgments, with each pair judged in both orders.The model predicts z-score-normalized TrueSkill values and is evaluated by Pearson correlation on a 1,000-ordinance test set per dimension.Source: §5.1 · pp. 7–8
  • Pearson correlations between trained BERT scores and TrueSkill values range from 0.82 to 0.94 across the four dimensions.The scores use 10,000 ordinances per dimension and 200,000 pairwise comparisons.Source: §5.1 · p. 8, Figure 6 · p. 8

5.2 Analysis

  • Counties are notably more opaque than cities, Florida is more than twice as opaque as any other state, and opacity and paternalism correlate weakly (Pearson r=0.11, n=2,211,516).Figure 5 illustrates nationwide variation in opacity and paternalism.Source: Figure 5 · p. 7, §5.2 · p. 8

6 Discussion, Limitations, and Future Work

LOCUS makes local ordinances available for national-scale machine reading and comparison, revealing recurring codification structure alongside jurisdictional and regional variation. It is an access and research substrate—not a determination of controlling law—and supports future benchmarks for doctrine-sensitive legal reasoning.

  • LOCUS-v1 selects each county’s most substantial available county or largest-municipality code as an access-layer simplification, not a ruling on which law controls.State statutes, home-rule provisions, county and municipal ordinances, charters, preemption, and issue-specific delegations may all affect authority; LOCUS supports retrieval and comparison rather than doctrine-sensitive analysis.Source: §6 · pp. 8–9
  • County codes contain more zoning material while city codes contain more nuisance and public-order regulation, making jurisdiction type substantive metadata that models should preserve.The pattern is consistent with counties more often regulating land and unincorporated territory, while cities more often regulate density, proximity, and everyday public order.Source: §6 · p. 9
  • Local codes tend to follow a stable sequence from general provisions and government structure through business, nuisance and public-order, zoning, and building regulation.Retrieval, chunking, and benchmark designs that ignore code position may miss information embedded in codification structure.Source: §6 · p. 9
  • In the Northeast, counties appear less zoning-heavy and more enforcement-oriented, showing that the legal meaning of a county code varies across regions and states.A county-level substrate offers mutually exclusive, exhaustive national geography, but harmonization must make explicit what it preserves and abstracts away.Source: §6 · p. 9
  • Future local-law benchmarks should test identifying government layers, distinguishing city and county authority, incorporating state law, resolving overlapping sources, and determining whether a text controls.LOCUS-v1 supplies text, metadata, and a geographic substrate while separating corpus construction from future evaluation of legal reasoning.Source: §6 · p. 9
  • LOCUS makes local law observable as a structured national object, revealing recurring codification architecture, jurisdictional divisions, and regionally specific institutional variation.These structures matter for legal AI systems moving from retrieval toward reliable reasoning over public authority.Source: §6 · p. 9

A Scoring Prompts

The section describes a shared pairwise scoring prompt and four rubrics for evaluating local laws. The rubrics distinguish issue salience, paternalism versus externality orientation, opacity, and enforcement discretion.

Pairwise Comparison

  • GPT-5.4-nano compares two laws under an axis-specific rubric, selects A, B, or Tie, and gives a one-sentence explanation using a shared template.The prompt supplies each law’s header and text and requests JSON output.Source: A Scoring Prompts · pp. 11–12

Problem Salience

  • Problem salience measures whether a law frames its regulated issue as important, urgent, or threatening rather than routine or administrative.Charged language, severity-focused findings or preambles, and heightened penalties signal greater salience.Source: A Scoring Prompts · p. 12

Paternalism vs. Externality Orientation

  • Paternalism versus externality orientation distinguishes laws protecting regulated actors from themselves from laws addressing harms to third parties or the public.Paternalistic laws target mainly self-regarding risks; externality-oriented laws target conduct whose harms fall on others.Source: A Scoring Prompts · p. 12

Opacity / Intelligibility

  • Opacity measures how difficult it is for ordinary people to know legal requirements, with jargon, cross-references, undefined terms, and convoluted structure indicating greater opacity.Plain, self-contained language that laypeople can understand indicates low opacity.Source: A Scoring Prompts · p. 12

Enforcement Discretion

  • Enforcement discretion rises when broad exposure to enforcement combines with officials’ textual latitude, and falls when either factor removes meaningful opportunity for capricious action.The rubric reserves the floor for laws that do not act on private parties and the ceiling for laws exposing many citizens to freely choosing officials.Source: A Scoring Prompts · p. 12

B Annotation Prompt

LOCUS uses a two-pass process to classify local legal text by primary function, with a second review for annotations flagged in evaluation. The instructions distinguish substantive Rules and Enforcement from Context, Process, and non-operative Structural material.

  • Initial zero-shot classifications use gpt-5.4-nano, and a second gpt-5.4 pass reviews annotations flagged in evaluation (5.5%).Source: B Annotation Prompt · p. 13
  • The schema assigns one of five primary functions and marks text substantive only when its function is Rules or Enforcement.For substantive text, the permitted subcategories are Land use, Noise/Nuisance, Housing, Business licensing, Public space, Building/Safety, and Other.Source: B Annotation Prompt · p. 13
  • Reviewers confirm correct first-pass labels, override incorrect ones, or classify missing or invalid ones from scratch.Source: B Annotation Prompt · p. 13
  • Operative administrative and internal-governance procedures are Process, while Structural is reserved for non-operative artifacts and formatting noise.Examples include board composition, quorum, voting, hearings, notice, and permitting workflows versus headers, tables of contents, history notes, page markers, and cross-reference lists.Source: B Annotation Prompt · pp. 13–14
Loading 2606.19334v1…