If you ask a randomly selected lawyer, “What do you think about AI in the law?

The lawyer may respond along the lines of, “I don’t get it. I think it is over-hyped.

This sort of response is a common cry heard in a foggy landscape obscured by two different kinds of haze: on the one side, many lawyers do not fully understand the abilities and applications of AI, and on the other side, some vendors overstate their technological capability. This fog impedes the adoption of new and productive legal technology.

We have prepared this article as a gentle introduction to the role of AI in the law, with the aim to clear some of the fog from the vista.

AI: a conflation of definitions

One challenge when discussing artificial intelligence is that people mean different things by it. This terminological inconsistency confuses lawyers. Some examples of what people mean when they use the term “AI” include, in no particular order:

  • A machine that has attained true artificial general intelligence, or crossed the point at which the machine has become sentient (the singularity)
  • A “silver bullet” software package that will solve any and all problems for a business (some sort of super servant)
  • A specific approach to problem solving in computing science or data science (like “machine learning” or “deep learning”)

For the remainder of this article, I will use “artificial intelligence” in a broad sense, to mean any technology that mimics human intelligence (a version of the famous Turing Test definition, in which the acid test for machine intelligence is indistinguishability to a human from human intelligence), not in the narrow sense of computer algorithms that self-improve.

The lovely infographic below (Boston Consulting Group, 2016) surveys of the current applications of AI:

What is the “tech” behind LegalTech?

AI is already commonly used for many legal applications, like research, e-Discovery, predictive technology, due diligence, contract review and analytics.

Most LegalTech products claiming to use AI use some combination of:

  1. natural language processing” (techniques to analyse human languages);
  2. machine learning” (algorithms that improve based on interactions with a data set); and
  3. expert systems” (rules that emulate the decision-making process of human experts).

Each of these topics is a field in its own right. Rather than unpack these in detail, the remainder of this article will provide a bird’s eye view of applications of machine learning to the law.

Demystifying machine learning

It is useful to contrast machine learning to traditional programming. Traditionally, software is written by a human programmer to solve a particular task. The programmer’s job is to understand the task so clearly that they can write down the solution as a step-by-step recipe, known as an algorithm.

Machine learning is a different kind of programming. The end product of machine learning is the same as traditional programming: software that solves a specific problem. However, the division of labour between programmer and computer differs. Instead of the human coding a mechanical solution to a perfectly understood task, the human gives a precise definition of “success” for the task (the “objective”), and then specifies a flexible approach to achieve this success (an algorithm with adjustable parameters). The computer’s job is to achieve the objective by varying the parameters of the algorithm autonomously by reference to a corpus of data.

Here are three practical consequences of this definition of machine learning:

  1. You should have a clearly defined problem you want to solve.
  2. Even though there is no specific rule-based coding, you need to use a suitable algorithm.
  3. The quality and quantity of data fundamentally matter to the outcome.

Let’s illustrate using a food example:

  1. Before you start cooking, you have to decide why you are cooking – what is the problem you are trying to solve? How many people will be eating? Do you want to prepare something fast? Are you trying to impress your guests?
  2. What tools should you use to cook – what are the algorithms? What do you have in the kitchen? Is there an oven or a stovetop? Is there an off the shelf recipe you can use? Should you combine methods from a few different recipes?
  3. What ingredients do you have or do you need – what is your data? Do you need to prepare the ingredients beforehand? How expensive are the ingredients? Are you constrained by the ingredients that are available in the timeframe?

Using machine learning is like using any tool for problem solving. The first step is to define the problem – do you want to prepare peanut butter on toast, or sous vide Atlantic salmon steaks for 40 people? Only after we define the problem, can we then spend our time collecting data and designing the algorithms.

An example from corporate due diligence

An example of a machine learning algorithm is a classification algorithm, which takes some input data and labels it as belonging to one or more groups. The textbook example is a spam filter that sorts emails into spam or not-spam.

Here is a legal example: consider solving the problem of classifying contracts into those which have a “change of control” clause and those that do not.

(M&A lawyers may shudder from haunting memories of pulling all-nighters extracting change of control provisions from material contracts, but take a calming breath, I have good news. Improvements to artificial intelligence software means those days may be behind you.)

The following pseudo-code describes a traditional approach to this problem, in which the software cycles through a list of hard-coded, near-synonym keyword phrases:

This is inflexible, and the drawbacks are clear.  The hard coded function will find every contract which uses the pre-specified words, even if those words do not describe a change of control event. The function would also miss any contract which uses, for example, a restriction on transfer of shares or a restriction to changing the directors of a company.

In the world of traditional programming, once we identify these inadequacies, we would iterate by expanding the list of search terms and creating carve-outs to the list of search terms, and continue until we have an unwieldy function that still will not quite solve the problem.

In the world of machine learning, we would abandon the “ifs” and “thens”, and instead, we might code:

The above function is a toy example of a classification algorithm. It classifies a contract based on the likelihood of whether it contains a “change of control” clause (I am aware I have conveniently skipped over “how” the computer recognises the pattern, but that is not the purpose of this article).

Once we have decided to use the above framework, the next step is to set the rules to optimise the machine – what actions of the machine are rewarded and what actions of the machine are penalised? We may create an objective to minimise “loss” so that over time the algorithm finds more of the contracts that contain an offending change of control clause, and less of the contracts that do not contain an offending change of control clause.

At some point, we stop optimising or training an algorithm, and that fixed state becomes the “model”. The computer can then use the model to determine if a never-before-seen contract contains an offending change of control clause.

The important question

A common protest at this point is, “Hang on. Is that it? Does it really count as learning if a computer is only estimating an outcome based on patterns?

That is a great philosophical question you have asked.

Some people hold the opinion that a machine capable of only solving a narrow class of problems is not intelligent at all, but is only applying statistics.

And that is a fine opinion to hold!

For practitioners, the important thing is to recognise artificial intelligence is just another tool for problem solving, the question to ask should be – how well does the tool solve the problem which it is designed to solve?

With that assessment framework, my question would be – should we be pleased that a tool can accurately detect every contract which contains a “change of control” clause from a database of 10,000 documents in mere minutes?

Final thoughts

If you are ever confused when someone uses the word “AI”, try substituting the word “software” for “AI”, “machine learning”, “deep learning” or another similar buzzword, and then ask, “what does the software do?

Ultimately, the usefulness of any product or process, intelligent or otherwise, is determined by how well it solves a problem. The hype and confusion around “AI” have stolen the limelight from the important question – how well does the technology solve a real problem?

To continue our food analogy, even if we cannot cook the salmon from Le Bernardin, we can assess if it tastes good and whether we consider the meal as good value for money. Understanding the recipe and knowing the effort that went into cooking the salmon may elevate our appreciation for the meal, but the knowledge should not distract from the important questions as consumers of the food – Do you feel full? How good did it taste? Would you come back for another meal?

In this article, I have glossed over the technical aspects. I have not mentioned techniques in natural language processing, like word vectorisation, and I have barely written about different types of algorithms, like support vector machines, decision trees or neural networks. If you are interested in those topics or if you want to chat more deeply about artificial intelligence in the legal profession, send us an email. We would love to chat with you!

Leave a Reply