I wonder if some kind of compiler/linter is possible for legal text. Like, "Warning: this comma is subject to ambiguous interpretation." But natural languages are poor candidates to use for composing unambiguous text, and any artificial language that you have to learn would be a problem, since it's critical that law is comprehensible to those it governs. On the other hand, it may be possible to construct a legal DSL that is more clear to the layman than the predominant legal jargon, and can be parsed into an S-expression.
And if we can dream about unambiguous law, we can dream bigger, about a compiler or linter that could extract more conceptual flaws, like "Warning: this law would facially violate the First Amendment", or "this law creates an incentive structure that may cancel its intentions."
This is probably too sci-fi to happen in my lifetime, but if I'm lucky maybe I'll live to see computer generated Friend of the Court briefs. We may be on the road to that with computer assisted analysis of historical language corpora to help determine original meanings.
Deontic modal logic is used by academics to try and formalize legal & moral statements.
There's also this programming language for codfying legislature: https://catala-lang.org
and this startup working on computational law: https://legalese.com/
I suspect legal jargon exists for the same reason programming languages exist: it is functionally impossible to be sufficiently precise in idiomatic vernacular. Too many things require precise and clear shared definitions. What is real property? What is a security? What is intent? What is a class? What is an object? What is memory? How do you even begin to function when you can't define these precisely?
With this in mind, a person could make a reasonable case that legal language is already a DSL implemented in a natural language.
I lead the Common Form project, which maintains https://www.npmjs.com/package/commonform-lint among other tools. Mostly, this handles "linting" structural aspects of legal terms, such as making sure that every special term invoked gets defined, every section referenced actually exists, and so on. But we've also been able to include some very rote stylistic checks, such as alerts about archaisms, legalisms, and needlessly wordy phrases. Even just this has proved an amazing boon in day to day practice. Akin to having real-time syntax checking in a code editor.
Computers excel at the rote and structural. They really suck at substantive analysis, even with all the recent ML work I've seen...except where the substance in or out is rote or structural. You can probably get a model to read back effective dates or share prices out of a bucket of PDFs. First Amendment analysis? Is it going to predict Supreme Court cases for us, too?
The hard work in law is nearly always pattern matching---What law applies to this situation? Does the definition cover this case, given its language and purpose?---rather than calculating a bunch of deductive implications from neatly coded factual situations. A lot of the fights in law are about how to code the situation, because of how the law applies from there.
"For the lawyer, each word in a formal legal document has (or should have) a purpose: it has been chosen instead of other words, and also instead of no words at all."
I know people who can engage in free-form conversation in this manner. Not to say like a lawyer, but where there are no words missing, no words incorrect, and no words superflous. I've marvelled at that ability and find that style of speaking mesmerizing.
The great physicist Paul Dirac was renowned for his extremely thoughtful manner of speech, and would drive people crazy with long silences before he responded to any question put to him. Here he is in his later years: https://www.youtube.com/watch?v=NNBsqmH7xOQ
Is this why punctuation in legal text is often said to be so horrible? By repute, legal English ignores most except the period and for obvious reasons the question mark. I believe comma, semicolon and like are deprecated unless their intent is absolutely clear.
I wonder if most lawyers' use of doublets and triplets [1] in contracts these day are the equivalent of copying and pasting from someone else's Stack Overflow code.
If you could put this into an ontological solver format, like Cyc or protege ( https://protege.stanford.edu/ ) then create a couple dozen translations of real laws into the format, you could turn gpt-3 loose on the entire set of United States federal, state, and local laws and regulations. Then propose a question to the solver using your model whereby a person can successfully sue or acquire property according to the letter of the law.
There are probably hundreds of obscure unintended consequences of laws not intended to have the effects they do in practice.
Figure out contract law and parse website TOS and EULAs for violations and you could probably make some money.
The biggest benefit of such a system, though, would be for actual legislators, so they could run simulations of proposals to get a sense of consequences in practice. Simulation and summarization could be very powerful.
LOL. I just did eight years in jail because someone drafting a statute accidently switched an "and" and an "or" and it wasn't noticed for several years.
Not yet. I want to. Things are still ongoing. If you have any questions, feel free to email me on my address in my profile and I'll do my best to answer them.
Construing even the most black and white contracts involve the application of normative principles which cannot be understood or emulated by a computer.
This is not true. Large language models have cracked the "multiple degrees of semantic relation" problem. I'd put money on gpt-3 being able to handle any particular problem you put forward, with the caveat being that multiple passes and diligent work with prompt construction will be needed more often than not (a single pass naive zero-shot might occasionally succeed, but a generalized sequence of passes can solve almost any problem class you care to define.)
I don't agree and have real doubt that what you say is good enough for real world use.
I hear the similar claims from people who think AI is good enough for sentencing people, it's absolutely not, like contractual construction it's a process where human values are at the forefront. You can't throw law and facts at it and expect a sensible result.
Contract as code might have beguiling simplicity but really intractable complexity. At the heart of it is the issues caused by the challenging concept of fairness which is distinctly and exclusively human.
Whew. What does it mean to gave an AI that can solve any problem, as long as you play around with your prompt long enough until the result is correct? Also, GPT-3 has this temperature setting. As long as that is a set to zero, each time you run, you’ll get a different result, even with exactly the same inputs.
I suppose I should just take the coders-make-better-drafters line, because it's good for me. But frankly, little of this post said much that I could discern, and a lot of the rest sat wrong. Especially the unstated assumption that there is some all-encompassing metric of drafting goodness along which coder-lawyers can be "some of the best". The quality metric is client outcome, which is contextual. Not any abstract or inherent quality of lawyerly workmanship.
There are some areas where concepts from programming help. But in my experience, mostly with structural aspects, like drafting conventions---defined terms, cross-referencing, enumeration/tabulation---rather than with substantive rules about how to interpret legal texts. Apart from that, it's mostly been a matter of acculturation. Coders are good at writing for, and explaining to, other coders.
In the same way, I think mathematicians and logicians and linguists and finance people also make "some of the best" drafters---all dual-class builds are special, and none of them is. Because those disciplines also boast powerful tools, vocabularies, and tribal affiliations. Conversely, all these confident professionals running around with power tools and strong style preferences prove that much more liable to hammer-sees-nails syndrome, outside their native domains.
As for the interpretation rules---the "canons of construction"---I don't understand the rule against surplusage as the author does. At least in the US decisions I've read, that's about not interpreting language in ways that make some of its words meaningless. Not that every word has "precise" meaning. Spoiler Alert: They don't. They can't. It's natural language. About the real world.
As for "stress-testing", a lot of that happens within the legislative, regulatory, and litigation processes. Sure, some bills get rammed through in poor form for political or procedural reasons. But a good many bill trackers reveal initial drafts by lawyers working in affected constituencies, then amendments addressing unforeseen consequences and edge cases, as the bill gets shopped around. Codifications show new bills amending old to make still more tweaks.
When regulatory bodies make the rules, we have notice-and-comment, to which the public is even more explicitly invited. Very often, legislatures include bits in important new laws that require regulators to follow up with new rules, to fill out specifics. There are various reasons for this, but one is avoiding blowback from constituents who weren't involved and didn't mention how the law might hurt them during the legislative process. One of the functions of lawyers for all these potentially affected parties is to analyze hypothetical effects, instead of just waiting to see how things play out in practice.
Once law or reg does hit the books, we have cases in the courts, with limited power to interpret and adjust over time. Where a law seems busted beyond their powers to mend, judges can and do publish opinions that say, in essence, "This seems wrong, but I have to rule this way, because that's what the law says. If this isn't what the legislature wanted, they should really change the law, because I can't." Happens all the time.
I'm a coder turned contract lawyer turned coder again. People often ask me why I switched from law back to software.
My answer: The meat of the job is basically the same thing. You spend a lot of time writing things in highly precise pseudo-English where syntax errors can get you in trouble.
The biggest difference is that with software, you spend a lot less time arguing what the code does. You just run the damn thing and observe the output. With law, that requires a multi-year journey through the court system.
Exactly. They say there are two kinds of jobs. One is where your success depends on your work winning the approval of other people. Those who work in such professions are prone to depression. The other kind of job is where your success depends on objective criteria. You either achieve the goal or you don‘t. People in those professions are much happier.
Any recommendations for software tools to aid legal drafting. Most lawyers I see are using just Word or LibreOffice. And they don't know how to use these well. (E.g., they don't use page breaks and keep inserting and adjusting newlines to have a section begin on the next page.)
It took less than 30 years from the first crude rockets to us humans landing on the moon. Now how long is it going to take us from the first programming languages to making our legal system „machine readable“?
I find it quite ridiculous that we still expect humans - judges and lawyers - to research legal codes and case law in order to figure out the applicable rules. This is something that computers should be doing. So we can focus on the higher level decisions, i.e. extending the rules, or arguing over the interpretation of the facts of the case.
It‘s staggering how much time we‘re wasting researching legal questions whose answers are not only already „out there“, but are probably being researched over and over again each week by legal professionals across the country, because a human, unlike a computer, cannot possibly keep all of those rules in memory at the same time.
31 comments
[ 2.8 ms ] story [ 86.7 ms ] threadAnd if we can dream about unambiguous law, we can dream bigger, about a compiler or linter that could extract more conceptual flaws, like "Warning: this law would facially violate the First Amendment", or "this law creates an incentive structure that may cancel its intentions."
This is probably too sci-fi to happen in my lifetime, but if I'm lucky maybe I'll live to see computer generated Friend of the Court briefs. We may be on the road to that with computer assisted analysis of historical language corpora to help determine original meanings.
With this in mind, a person could make a reasonable case that legal language is already a DSL implemented in a natural language.
Computers excel at the rote and structural. They really suck at substantive analysis, even with all the recent ML work I've seen...except where the substance in or out is rote or structural. You can probably get a model to read back effective dates or share prices out of a bucket of PDFs. First Amendment analysis? Is it going to predict Supreme Court cases for us, too?
The hard work in law is nearly always pattern matching---What law applies to this situation? Does the definition cover this case, given its language and purpose?---rather than calculating a bunch of deductive implications from neatly coded factual situations. A lot of the fights in law are about how to code the situation, because of how the law applies from there.
I know people who can engage in free-form conversation in this manner. Not to say like a lawyer, but where there are no words missing, no words incorrect, and no words superflous. I've marvelled at that ability and find that style of speaking mesmerizing.
[1] https://en.wikipedia.org/wiki/Legal_doublet
Source: I am a lawyer and a coder.
There are probably hundreds of obscure unintended consequences of laws not intended to have the effects they do in practice.
Figure out contract law and parse website TOS and EULAs for violations and you could probably make some money.
The biggest benefit of such a system, though, would be for actual legislators, so they could run simulations of proposals to get a sense of consequences in practice. Simulation and summarization could be very powerful.
Question: is there a bug for the assignment of party_not_at_fault? Would you want party2 to be selected if the condition is true?
Other languages I've used have the first part be the true branch, and the other the false branch.
I hear the similar claims from people who think AI is good enough for sentencing people, it's absolutely not, like contractual construction it's a process where human values are at the forefront. You can't throw law and facts at it and expect a sensible result.
Contract as code might have beguiling simplicity but really intractable complexity. At the heart of it is the issues caused by the challenging concept of fairness which is distinctly and exclusively human.
There are some areas where concepts from programming help. But in my experience, mostly with structural aspects, like drafting conventions---defined terms, cross-referencing, enumeration/tabulation---rather than with substantive rules about how to interpret legal texts. Apart from that, it's mostly been a matter of acculturation. Coders are good at writing for, and explaining to, other coders.
In the same way, I think mathematicians and logicians and linguists and finance people also make "some of the best" drafters---all dual-class builds are special, and none of them is. Because those disciplines also boast powerful tools, vocabularies, and tribal affiliations. Conversely, all these confident professionals running around with power tools and strong style preferences prove that much more liable to hammer-sees-nails syndrome, outside their native domains.
As for the interpretation rules---the "canons of construction"---I don't understand the rule against surplusage as the author does. At least in the US decisions I've read, that's about not interpreting language in ways that make some of its words meaningless. Not that every word has "precise" meaning. Spoiler Alert: They don't. They can't. It's natural language. About the real world.
As for "stress-testing", a lot of that happens within the legislative, regulatory, and litigation processes. Sure, some bills get rammed through in poor form for political or procedural reasons. But a good many bill trackers reveal initial drafts by lawyers working in affected constituencies, then amendments addressing unforeseen consequences and edge cases, as the bill gets shopped around. Codifications show new bills amending old to make still more tweaks.
When regulatory bodies make the rules, we have notice-and-comment, to which the public is even more explicitly invited. Very often, legislatures include bits in important new laws that require regulators to follow up with new rules, to fill out specifics. There are various reasons for this, but one is avoiding blowback from constituents who weren't involved and didn't mention how the law might hurt them during the legislative process. One of the functions of lawyers for all these potentially affected parties is to analyze hypothetical effects, instead of just waiting to see how things play out in practice.
Once law or reg does hit the books, we have cases in the courts, with limited power to interpret and adjust over time. Where a law seems busted beyond their powers to mend, judges can and do publish opinions that say, in essence, "This seems wrong, but I have to rule this way, because that's what the law says. If this isn't what the legislature wanted, they should really change the law, because I can't." Happens all the time.
My answer: The meat of the job is basically the same thing. You spend a lot of time writing things in highly precise pseudo-English where syntax errors can get you in trouble.
The biggest difference is that with software, you spend a lot less time arguing what the code does. You just run the damn thing and observe the output. With law, that requires a multi-year journey through the court system.
(I forgot the source.)
I find it quite ridiculous that we still expect humans - judges and lawyers - to research legal codes and case law in order to figure out the applicable rules. This is something that computers should be doing. So we can focus on the higher level decisions, i.e. extending the rules, or arguing over the interpretation of the facts of the case.
It‘s staggering how much time we‘re wasting researching legal questions whose answers are not only already „out there“, but are probably being researched over and over again each week by legal professionals across the country, because a human, unlike a computer, cannot possibly keep all of those rules in memory at the same time.