3 ms·
I lead data and AI at a tech-enabled commercial insurance brokerage. We have been leveraging GPT-4 to build a deep contract analysis tool specifically for insur
by pwmiller_ai 3y ago
I lead data and AI at a tech-enabled commercial insurance brokerage. We have been leveraging GPT-4 to build a deep contract analysis tool specifically for insurance requirements. My teams at Google also built several LLM solutions to support Google's legal team, from patent classification to discovery support.
Language models are great at digesting legalese and analyzing what's going on. However, many legal applications involve around pretty important decisions that you don't want to get wrong ("am I contractually covered with my current insurance program?"). Because of that, we've built LLM products in the legal space with the following principles in mind:
- Human-in-the-loop tooling -- The product should be built around an expert using it whenever possible, so decision support as opposed to automation. You still see massive time savings with that in place
- Transparency / citations -- With a human-in-the-loop tool, you need mechanisms to build trust. Whether that's highlighting clauses in the document that the LLM referred to or explaining why a part of the analysis wasn't provided, citing your work is important
- Tuned for precision instead of recall -- False positives (and hallucinations) are especially bad in many of these legal use cases, so tuning the model or prompts for precision helps with mitigation.
- theptip 3y agoDo you have any pointers on how to get GPT-4 to do citations? Is a prompt like “quote back the passage you are citing” so you can locate and highlight the original? When you say “tuned for precision” is this your prompt engineering or are you actually fine-tuning GPT-4? Appreciate the insights.
- pwmiller_ai 3y agoFor RAG applications, starting simply with a reference to the most relevant chunk(s) is helpful in building transparency. A lot of our contract review task is a data extraction one (e.g. extract this type of insurance language and compare against your policy). As such, it's much easier to pinpoint the exact text from the source doc for citation. In our applications, currently, we are doing citations as a postprocessing task as opposed to as part of the prompt itself. Finding that feeding too many instructions to the LLM results in worse responses. We're not fine-tuning today. Instead, "tuning for precision" is done through prompt chains. A simple example would be returning "I don't know" early on if the document isn't a contract or doesn't have clear insurance requirements in it. We've had success with various guardrail prompts. The citation work we did at Google used model internals to highlight text (path integrated gradients). It's also easier to finetune for precision when you have control over the model itself.