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
TL;DR
Local ordinances lack systematic access as a national machine-readable resource. LOCUS constructs a reproducible county-harmonized access layer and shows that local law has jurisdiction-specific substance and recurring documentary structure.
Problem
Existing legal AI resources lack systematic access to local ordinances, despite their role in regulating everyday domains such as zoning, housing, licensing, and public health.
Method
LOCUS builds a county-harmonized access layer by selecting the longest available county or largest-municipality code for each county.
Results
County and city codes differ in substantive coverage, while local codes share a recurring documentary architecture in which topics follow a stable sequence.
Takeaways & Limitations
Local-law models and benchmarks should preserve jurisdiction type and code position because both encode substantive structure.
Takeaways & Limitations
LOCUS is an access layer rather than doctrine-sensitive legal analysis and does not determine which rule controls a particular legal question.
Abstract
from arXiv · showhide
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 practical absence of a comprehensive, machine-readable national corpus of local law by providing a large-scale corpus and county-harmonized access layer for U.S. local ordinances. Its transparent first-release design enables retrieval, structured extraction, and future reasoning benchmarks while deferring full hierarchy and conflict modeling.
- Legal complexity: Local law is a layered system in which state, county, and municipal authorities interact, making controlling authority domain-dependent and difficult to determine.A useful legal AI system must navigate more than text retrieval because local authority can depend on legal domain and interacting legal doctrines.
- LOCUS contribution: LOCUS-v1 provides a large-scale corpus and county-harmonized access layer for U.S. local ordinances.The corpus addresses local ordinances as a previously underrepresented layer of legal authority.
- LOCUS contribution: For each U.S. county, the first release records the most substantial available code from the county or its largest municipality, using document length as a reproducible coverage proxy.This simplification is transparent but does not decide which local authority controls every legal issue.
- Access problem: Local codes are public but fragmented across commercial platforms designed for in-browser reading rather than bulk research access, preventing a comprehensive national research corpus.The paper cites the absence of a single comprehensive source for all municipal codes as evidence of this access problem.
- Research applications: LOCUS supports retrieval and question answering, structured extraction of regulatory features, and future benchmarks for reasoning across multiple layers of law.The system targets activities, permits, fees, penalties, effective dates, and cross-references, while full issue-specific hierarchy and conflict modeling remain future work.
2 Related Work
Legal NLP has established corpora for case law, court decisions, and administrative materials, while internet-era legal access and modern language models have created new opportunities for large-scale legal data processing.
- Existing legal corpora: Legal NLP research already includes corpora such as ECHR and Pile of Law, alongside earlier legal corpora.The cited examples span neural-network-era and earlier efforts to create corpora for legal NLP.
- Access to law: The internet has reshaped historical challenges in accessing legal materials.The passage frames legal access as a longstanding challenge that has been partly transformed by the internet.
- Access to law: The 2020 Georgia v. Public.Resource.Org decision upheld that laws, statutes, and court decisions are public domain insofar as digital content is concerned.The ruling provides a legal foundation for treating digitized legal materials as publicly accessible resources.
- Modern legal data processing: Large language models and other modern techniques now enable intelligent data processing at unprecedented scale.The passage connects these techniques to the challenge of standardizing more than 9,239 one-thousand-page materials.
3 Properties of LOCUS
LOCUS provides a reproducible county-harmonized access layer and a publicly released corpus annotated by legal function, topic, and substance. Its processing pipeline OCRs and segments more than 9,000 PDFs, while the corpus contains 2,211,516 text chunks spanning major local-law categories.
- Harmonized access layer: LOCUS selects the most substantial available code between each county’s ordinance code and its largest municipality’s code, without claiming doctrinal legal control.The simplification supports reproducible retrieval, comparison, and future state–county–municipal legal-reasoning benchmarks.
- Corpus composition: 2,211,516 chunks of text are publicly released, with a majority judged substantive laws concerning rules or enforcement.Substantive laws primarily cover buildings, business licensing, zoning, and nuisance; roughly a third fall into other categories.
- Additional data: 7,000 additional documents from other cities and counties are collected for potential researcher access under a signed release.The release approach is motivated by future evaluation of local-law coverage by foundational models under current LLM ingestion policies.
- Processing pipeline: More than 9,000 PDFs totaling 7M pages are OCR’d into Markdown, cleaned, segmented into individual laws, and classified by function, topic, and substance.Each segment is also scored on four normative dimensions.
4 Constructing LOCUS
LOCUS constructs a large local-ordinance corpus by collecting codes across fragmented hosting systems, converting heterogeneous documents to Markdown with OCR, and post-processing and classifying extracted laws. Its county-harmonized access layer selects representative codes for covered counties using jurisdictional population and code length.
- Corpus collection: 9,239 valid PDFs totaling approximately ∼80 GB comprise the original raw corpus.The corpus construction spans municipal and county codes collected through browser automation, vendor-specific download logic, and manual collection for self-hosted or PDF-restricted codes.
- Document processing: OCR converts every page image to Markdown, enabling a unified pipeline for diverse born-digital, exported, and scanned ordinance formats.LightOnOCR-2-1B generates text in natural reading order, after which post-processing removes repeated artifacts, merges cross-page content, and segments laws by section and subsection headers.
- Law labeling: Three ModernBERT-based classifiers label each extracted law by substantivity, function, and topic, while omitting segments classified as purely structural.GPT-5.4-nano annotates 100,000 sampled laws; training uses 80,000 samples, parameter sweeps use 10,000, and evaluation uses a separate 10,000-instance subset.
- Scaling: Approximately $0.30 per 1,000 pages enables processing of the roughly 7M-page raw ordinance collection.The pipeline scales OCR through Modal and LightOnOCR-2-1B’s batch inference support.
- County harmonization: LOCUS-v1 records a representative local-law artifact and classifier metadata for each covered county in its county-harmonized release.For each U.S. county, the access-layer algorithm prefers an existing county code and city code, selecting the longer code when both exist; these codes represent 94% of the U.S. population.
5 A Dimensional Analysis of Local Laws
LOCUS-v1 annotates local ordinances along four continuous dimensions—enforcement discretion, opacity, paternalism, and problem salience—enabling within-jurisdiction and nationwide comparative analysis. ModernBERT scorers trained from pairwise LLM judgments closely reproduce TrueSkill rankings and reveal geographic and topical patterns in local law.
- Dimensions: LOCUS-v1 scores ordinances on enforcement discretion, opacity, paternalism, and problem salience as continuous dimensions rather than categorical labels.These axes measure officials’ selective judgment, public intelligibility, self-protection versus externality orientation, and perceived issue importance.
- Dimensions: A minor-attendance restriction is scored highly paternalistic and intelligible, with neutral discretion and salience.The example concerns minors under 16 attending a festival without an accompanying adult.
- Scoring models: 10,000 ordinances per dimension and 200,000 pairwise GPT-5.4-nano comparisons produce TrueSkill targets for ModernBERT regression scorers.Each ordinance is scored through reversed-order pairwise judgments, then split into training, validation, and test sets of 8,000, 1,000, and 1,000 ordinances.
- Nationwide analysis: Pearson r=0.11 on n=2,211,516 shows opacity and paternalism are only weakly correlated across sections.Nationwide analysis also finds counties more opaque than cities on average and Florida more than twice as opaque as any other state.
- Nationwide analysis: The evaluation helps identify patterns such as paternalistic curfews and associations between paternalistic laws and headers containing “possession” or “alcoholic.”Headers containing “definitions” and “variances” are associated with paternalistic laws in the reported analysis.
6 Discussion, Limitations, and Future Work
LOCUS-v1 is an access layer for retrieving and comparing local law, not a substitute for doctrine-sensitive analysis of which authority controls. Its findings reveal structured but institutionally variable local codes, motivating benchmarks that incorporate governmental layers, state context, overlapping sources, and legal control.
- Limitations: LOCUS-v1 selects the most substantial available county or largest-municipality code, enabling national search and comparison without determining which rule controls a particular legal question.Local authority may also depend on state statutes, home-rule provisions, county ordinances, municipal codes, charters, preemption doctrines, and issue-specific delegations.
- Findings: County codes contain substantially more zoning material, whereas city codes contain more nuisance and public-order regulation, reflecting a functional division of local authority.Counties more often regulate land, development, and unincorporated territory; cities more often regulate density, proximity, and everyday public order.
- Findings: Local codes exhibit a recurring documentary sequence from general provisions and governmental structure through business regulation, nuisance and public order, zoning, and building regulation.This stable ordering shows that local law has a common representational architecture rather than being an undifferentiated collection of rules.
- Limitations: In the Northeast, counties appear less zoning-heavy and more enforcement-oriented, limiting the reliability of simple national harmonization.This pattern is consistent with towns and municipalities retaining more primary land-use authority while counties perform administrative, health, or enforcement functions.
- Future Work: Future local-law benchmarks must identify the relevant governmental layer, distinguish city from county authority, incorporate state context, detect overlapping sources, and assess whether retrieved text controls.LOCUS-v1 supplies the text, metadata, and geographic substrate needed for these tasks, while broader access makes local law available for systematic computational analysis.
A Scoring Prompts
The scoring system elicits pairwise judgments from GPT-5.4-nano using one shared, axis-parameterized rubric and requires structured winner explanations. It evaluates local laws across problem salience, paternalism versus externality orientation, opacity/intelligibility, and enforcement discretion.
- Pairwise judgment template: GPT-5.4-nano compares pairs of local laws with a single shared template parameterized by an axis-specific rubric.The prompt asks which law has a greater degree of the selected axis.
- Pairwise judgment template: Each comparison must return winner A, B, or Tie plus a one-sentence explanation in JSON format.The required output contains winner and reasoning fields and permits only the specified JSON format.
- Scoring axes: The rubrics score problem salience, paternalism versus externality orientation, opacity/intelligibility, and enforcement discretion.These dimensions respectively address perceived issue gravity, self-protection versus public protection, comprehensibility of legal obligations, and dependence on official choice.
- Problem Salience: Problem salience rises with crisis-oriented framing, severity findings, or heightened penalties, whereas low-salience laws treat issues as routine or administrative.The rubric contrasts rhetorical emphasis on stakes with technical treatment lacking emphasis.
- Paternalism and Opacity: Paternalism targets self-regarding harms, externality orientation targets harms to third parties or the public, and opacity reflects how difficult obligations are for ordinary people to understand.Opaque laws use dense cross-references, jargon, undefined terms, or convoluted structures; intelligible laws use plain, self-contained language.
B Annotation Prompt
The annotation process uses gpt-5.4-nano for initial zero-shot classification, followed by a second gpt-5.4 pass for flagged annotations.
- gpt-5.4-nano performs the initial zero-shot classification.
- 5.5% of annotations are flagged for evaluation and receive a second pass from gpt-5.4.
Annotation Prompt
The annotation prompt classifies municipal and county legal text by primary legal function and requires a schema-conformant JSON response. It distinguishes substantive Rules and Enforcement from Context, Process, and Structural text, with a review stage that confirms, overrides, or freshly assigns classifications.
- First-pass classification: The task is to classify each text segment by its primary legal function.The prompt defines the task as classifying provided text by its primary legal function.
- First-pass classification: The allowed primary functions are Context, Rules, Process, Enforcement, and Structural.Context covers definitions, scope, or intent; Rules impose permissions, obligations, or prohibitions; Process covers administrative procedure, authority, or government structure; Enforcement covers penalties, violations, appeals, or exceptions; Structural covers non-substantive artifacts.
- Output constraints: is_substantive must be 1 only for Rules or Enforcement, and 0 for Context, Process, or Structural.When substantive, sub_category must use one of seven specified domains; otherwise sub_category must be null.
- Review stage: The reviewer confirms correct first-pass labels, overrides incorrect ones, or classifies missing or invalid outputs from scratch.The corresponding review_outcome values are confirm, override, and fresh.
- Review stage: Operative administrative workflows are Process, while non-operative artifacts and formatting noise are Structural.Process includes governance, delegation, appointments, elections, hearings, notice, applications, and permitting workflows; Structural excludes text that states operative requirements.