There are hundreds of artificial intelligence (AI) tools available to lawyers to use, dozens of which are specific to the legal industry, but what does that even mean? How can an AI tool, in particular a generative AI (GenAI) tool, be legal-specific? When questioning your legal AI vendors on things such as training data, confidentiality, and security, you are also going to want to ask whether their tool utilizes retrieval augmented generation (RAG). RAG is a game-changer for lawyers using AI tools because it allows GenAI results to be more precise and reliable.
Understanding RAG
RAG refers to the process by which a GenAI tool draws from a specific, predetermined source of truth when responding to prompts. These sources of truth can be databases containing case law, contracts, statutes, and other legal-specific documents. The concept of RAG isn’t entirely new. Even before the term became known, savvy legal professionals were providing generic AI tools with examples of preferred briefs or contracts to guide the output. It was a basic form of RAG, restricting the AI’s source of truth to specific examples. Think about creating a chart of responsibilities and deadlines from a franchise disclosure document. With RAG, you could feed that document to an AI tool and have it extract and organize that information in minutes—a task that would take hours to do manually.
Why do OpenAI’s ChatGPT and other GenAI tools hallucinate case law (i.e., respond to prompts with citations to cases that do not exist)? Because they are not using RAG, nor were they designed for that purpose. To understand RAG, it’s helpful to first grasp how GenAI functions. These large language models (LLMs), such as ChatGPT and Anthropic’s Claude, operate similarly to a neural network, mirroring the human mind’s processes. At their core, these models predict the most logical next word in a sequence, whether in writing or verbal communication, based on patterns and probabilities derived from their training data. This prediction mechanism allows GenAI to generate coherent and contextually appropriate responses. They’re trained on vast amounts of data, synthesizing information much like we do. Like humans, they typically don’t have perfect recall of everything they’ve been trained on.
The Limitations of General AI Models
For general purposes, this broad knowledge base can be incredibly useful. But for lawyers performing substantive legal tasks—not so much. We’ve all heard about the incidents where attorneys cited non-existent cases after relying on AI-generated responses. That’s exactly the kind of situation RAG helps prevent. RAG does not guarantee prevention, mind you, but in this author’s experience, it comes close. By restricting the AI’s source of truth to specific, relevant documents or databases, we can significantly enhance the accuracy of AI-generated outputs. Many legal AI tools are already implementing RAG. They’re connecting to databases of case law, statutes, and other legal resources. This ensures that the GenAI tool’s responses are not grounded only in generalized knowledge that might be outdated or inaccurate. Instead, the output is grounded in actual legal precedents, current laws, or actual legal documents.