Abstract
Researchers from Zillow and the University at Buffalo have developed a specialized methodology to transform standard large language models (LLMs) into legally compliant real estate assistants. By fine-tuning a Llama-3-8B model on a curated synthetic dataset, they created a chatbot that matches or exceeds the performance of much larger models, such as GPT-4o, in safety and legal adherence. This work specifically addresses the challenge of avoiding discriminatory practices like "steering" and "redlining" while maintaining high conversational helpfulness.
Introduction
The real estate industry in the United States is governed by a complex web of regulations, most notably the Fair Housing Act and the Equal Credit Opportunity Act. These laws are designed to prevent discrimination, specifically prohibiting practices like steering—directing potential buyers toward or away from certain neighborhoods based on protected characteristics like race or religion—and redlining, which involves denying services based on a neighborhood's demographics.
As LLMs are increasingly integrated into real estate platforms as chatbots, they face the risk of "hallucinating" or reflecting biases present in their training data. A general-purpose model might innocently answer a user's request for "neighborhoods with a strong Christian community" by providing a list, but in doing so, it inadvertently violates fair housing laws. This paper addresses the critical gap between general AI capability and the rigorous legal compliance required for regulated industries.
Methodology
The authors propose a multi-stage pipeline to build a "compliance-aware" model. The process begins with Synthetic Data Generation, using GPT-4o as a "teacher" model to generate a three-part dataset: knowledge-intensive real estate Q&A, safety scenarios designed to trigger non-compliant behavior, and natural multi-turn dialogs.
To ensure the quality and diversity of this data, the team employed Semantic Pruning using embeddings to remove redundant instructions. The core of the model's adaptation lies in LoRA (Low-Rank Adaptation) Fine-Tuning applied to a Llama-3-8B-Instruct base. This approach allows for efficient behavioral updates without the prohibitive costs of full parameter fine-tuning.
As shown in the figure above, the compliant model is trained to acknowledge the legal constraints (e.g., the Fair Housing Act), propose an alternative general direction, and then provide a helpful, compliant response.
Evaluation and Results
The model's performance was evaluated using G-Eval, a framework that utilizes Chain-of-Thought prompting to score responses on criteria like helpfulness and safety. The researchers tested the model against several benchmarks, including a "First-time Home Buyers Benchmark" and a "Safety Benchmark" curated by legal experts.
The results demonstrate a significant "Small Model Advantage." The fine-tuned Llama-3-8B model achieved a "Helpfulness with Reference" score of 87.67, nearly matching GPT-4o’s 88.59. More impressively, in head-to-head safety benchmarks, the 8B model was preferred 86% of the time over the much larger Llama-3-70B. The model successfully navigated "trap" queries that frequently caused base models to provide non-compliant answers.
Discussion
Key insights from the study suggest that for regulated industries, "smaller and smarter" is a viable and often superior path. By including specific instructions on how to be helpful while remaining compliant, the authors avoided the common "lazy model" problem where safety alignment leads to over-refusal. Furthermore, the researchers found that compliance is a "long-tail" problem; even a small amount of high-quality safety data (25% of their safety split) was sufficient to significantly boost legal adherence without degrading general performance.
Conclusion
While the results are promising, the authors note several limitations. The current model relies on static training data and lacks real-time integration (e.g., via RAG) for dynamic information like mortgage rates. Additionally, the legal framework is strictly U.S.-based, and subtle latent biases may still persist. Future work will focus on expanding the model's geographic scope and integrating real-time data sources. The researchers have open-sourced their code, data, and model weights to foster the development of fairer AI systems in the real estate sector.
Summary updated