PULLMAN, Wash. - Navigating the complexity of statutory legal code often requires hours of tedious cross-referencing, but a new artificial intelligence tool developed at Washington State University could make searching state laws as simple as asking a plain question.
Researchers in WSU's Complex Social Interactions (CSI) Lab have released a specialized open-source AI retrieval model designed specifically for the Revised Code of Washington (RCW) - the compilation of all current laws in the state. Built upon Google's EmbeddingGemma 2 architecture, the model bridges the semantic gap between how people naturally ask questions and the dense, formal legalese of state statutes, making it faster and simpler for elected officials, agency workers, legal professionals and the public to explore state laws.

"Making the law more accessible is one of several important pathways towards a more just legal system," said David Makin, the principal investigator of the CSI Lab.
Unlike conventional search engines that rely on exact keyword matching, the WSU model translates everyday language into dense mathematical representations, known as embeddings. This allows the system to comprehend legal concepts, statutory intents, and hypothetical scenarios.
In benchmark evaluations, the fine-tuned model achieved an 87.9% accuracy rate in finding the exact governing Washington statute within its top 10 search results.
"Legal text is notoriously rigid, while human queries are expressive and varied," said Shlok Tomar, lead AI engineer on the project. "Whether an officer in the field needs to quickly identify a governing statute/policy during an incident, or a city planner asks whether a proposed local rule on short-term rentals or electric scooters conflicts with state regulations, conventional keyword engines often miss the connection because the wording doesn't match word-for-word. Our model looks past the surface-level terminology, understanding the core legal intent and mapping it directly to the governing statute."
The model was trained on a dataset of more than 450,000 synthetic legal query-and-passage pairs - AI-generated examples matching a plain-language question with the exact law that answers it, spanning over 500 statutory categories derived from the RCW.
To train the model efficiently, the researchers utilized Low-Rank Adaptation (LoRA), a parameter-efficient fine-tuning technique that drastically reduces computational overhead. The research team also developed a compressed, 4-bit quantized version (GGUF format), allowing the system to run on standard phones and laptops.
The primary goal of the model is to power retrieval-augmented generation (RAG) pipelines-the backend architecture behind modern AI legal assistants. Potential applications include helping city and county officials verify whether proposed local ordinances conflict with established state laws, as well as field-use tools that allow law enforcement officers to quickly look up relevant statutes based on situational scenarios.
It can also automate compliance checks for state agencies, accelerate draft reviews for legal professionals, and empower the public to better understand state law.
"We wanted to ensure this technology wasn't locked behind proprietary corporate walls," Tomar said. "By publishing both full-precision and lightweight edge-device versions open-source, researchers, civic technologists, and local governments across Washington can build accessible tools on top of it."
The research team emphasized that while the tool dramatically accelerates legal research and information retrieval, it is designed to aid - not replace - human legal counsel and decision-making.
Both the full 16-bit and quantized models are publicly available for download on Hugging Face through the CSI Lab repository.