Back Home 5 News 5 LLMs and law: tips, tricks and warnings about generative AI

LLMs and law: tips, tricks and warnings about generative AI

27 Jun 2024

| Author: David Harvey

Large language models, or LLMs, are a type of generative artificial intelligence.

They are artificial neural networks that can process natural language and generate text and comprise millions or billions of parameters that are learned from a large corpus of text data.

The network takes a sequence of words or tokens as input and outputs another sequence of words or tokens as the most likely continuation. The network can also condition the output on some context, such as a prompt, a query or a task.

Large language models are trained by using a technique called self-supervised learning, which means they learn from their own data without requiring any human annotations or labels.

The most common objective function for training large language models is called masked language modelling (MLM), which involves randomly masking some words or tokens in the input and asking the network to predict them. This way, the network learns to capture the syntactic and semantic relationships between words and tokens in the language.

Another common objective function is called next sentence prediction (NSP). This involves giving the network two sentences and asking it to predict whether they are consecutive or not. This way, the network learns to capture the coherence and structure of the text.

Large language models have many applications in natural language processing and beyond. Some of the most popular applications include:

  • generating fluent and coherent text;
  • completing incomplete text;
  • generating informative summaries of longer texts;
  • paraphrasing or translating text;
  • extracting specific information from texts;
  • providing answers to questions from texts; and
  • engaging in conversational dialogue via chatbots or virtual assistants such as Alexa or Siri.

LLMs have become available for general use. ChatGPT and Microsoft CoPilot are a couple of examples. LLMs are being deployed commercially, especially in areas such as law where language processing and developing information is a basic requirement. Lawyers must be careful with the use of LLMs. In December 2023, the judiciary published guidelines for the use of AI tools of which LLMs (also known as Generative AI) are one.

Chief Justice Dame Helen Winkelmann said, upon the release of the guidelines:

The use of new GenAI technology in the Aotearoa New Zealand legal context is increasing. These guidelines have been developed to help judicial officers, lawyers and non-lawyers appropriately use GenAI tools in court or tribunal proceedings.

GenAI chatbots are not a substitute for a qualified lawyer, but there is potential for GenAI – when used responsibly – to enhance access to justice by making legal knowledge and information more accessible to non-lawyers.

Justice Paul Radich, Chair of the judiciary’s AI Advisory Group who led development of the guidelines, said:

These guidelines offer practical advice in plain language on what GenAI is, the risks inherent in its use and situations in which its use may be appropriate or inappropriate. New Zealand is amongst the first to develop guidelines, although all jurisdictions are navigating the opportunities and challenges presented by GenAI technology.

One of the problems with LLMs is that of “hallucination”. There have been instances where LLMs have been used to develop submissions for a court where false, incorrect or non-existent citations of cases have been offered.


Fake law

The best-known of these cases is the highly publicised US District Court decision Mata v Avianca Case No. 22-cv-1461 (PKC) (S.D.N.Y), where lawyers submitted non-existent judicial opinions with fake quotes and citations created by the AI tool ChatGPT.

A similar case arose in England. Harber v Commissions for His Majesty’s Revenue and Customs [2023] UKFTT 1007 (TC) is the first reported UK decision to have found that cases cited by a litigant were not genuine judgments, but had been created by an AI system.

The case is a First-tier Tribunal Tax Chamber judgment, where a self-represented appellant taxpayer had provided the tribunal with the citations and summaries for nine First-tier Tribunal decisions which supported her position.

While these citations and summaries had “some traits that [were] superficially consistent with actual judicial decisions”, they were ultimately found not to be genuine case citations.

The tribunal made clear that citing invented judgments was not harmless, causing “the tribunal and HMRC to waste time and public money, and this reduces the resources available to progress the cases of other court users who are waiting for their appeals to be determined”. The tribunal highlighted other problems caused by citing hallucinated judgments, endorsing comments made in Mata v Avianca.

This highlights a difficulty with LLMs and GenerativeAI tools. As Jonas Andrulis, founder and Chief Executive Officer of Aleph Alpha, said in evidence before the House of Lords Communications and Digital Select Committee on 21 November 2023:

Based on our own research, we developed a method to visualise the patterns that the machine learned. They are not truth machines, which is also why they hallucinate, but they are pattern learners And later:

The method of training the systems to arrive at large language models has nothing to do with truth; it is just to learn patterns of language and complete writing according to learned patterns.

As long as these shortcomings are understood, LLMs have helpful applications in legal practice. An example may be an improvement in the efficiency of legal tasks, especially in the realm of information analysis from cases and statutes.


The benefits

LLMs can automate routine tasks, thus reducing costs for legal services, and can provide accurate and consistent research and analysis results.

LLMs can process vast amounts of legal knowledge, making it more accessible to lawyers and can serve as useful tools in the decision-making process, analysing potential outcomes.

Language models can be leveraged to draft legal documents such as contracts, pleadings and submissions and can assist in conducting due diligence for transactions. They may be used in complex contracts and help identify key terms, clauses and potential issues.

It is important to note that while LLMs offer these benefits, they are not intended to replace human lawyers. They are tools that can augment and support legal professionals in their work. They should be used in conjunction with human expertise and judgment which remain essential in the practice of law.

Lawyers play a critical role in interpreting and applying legal principles, considering ethical considerations and providing personalised advice to clients.


Expect disruption

Although the advantages may seem enticing and attractive, LLMs will have a disruptive effect upon legal practice.

The duration of disruption is uncertain and can vary, depending on several factors.

The speed of adoption and integration of LLMs will influence the duration of the disruption. The pace of change will also have an impact. As LLMs become increasingly sophisticated and capable of performing complex legal tasks, the disruption may be more prolonged.

Ethical and regulatory considerations surrounding the use of LLMs in legal practice may also affect the duration of disruption. It may take time to establish guidelines and regulations that govern their use.

Another factor will be lawyers’ ability to adapt and evolve their skills in response to LLMs. Lawyers who can effectively leverage LLMs as tools to enhance their practice and complement their expertise may experience less disruption than those who struggle to adapt to the changing landscape.

The disruption caused by LLMs may not be a linear process. There may be periods of rapid change followed by periods of stabilisation as the legal profession adjusts to the new technology. It is challenging to predict the exact duration of disruption caused by LLMs in the legal profession. However, it is likely that their impact will continue to be felt for a significant period as the technology evolves, adoption increases and the legal profession adapts.


The future

Eventually, LLMs will push lawyers into highly specialised and nuanced roles. After fully mature LLMs arrive, lawyers will continue to play a central role in legal practice, but only in non-routine legal tasks. These tasks will primarily involve value judgments, such as developing precedent or its reversal, or the allocation of property and other scarce resources.

This new mix of lawyer-machine labour, where machines primarily carry out routine legal tasks and lawyers handle the non-routine, will give rise to a growing demand for lawyers who can exercise good judgment and empathise with the winners and losers of social change.

There will continue to be roles for lawyers working in tandem with LLMs.

LLMs may assist in providing legal research and analysis, but lawyers will use their expertise and experience to guide clients through complex legal issues, assess risks and develop effective legal strategies.

Lawyers will still be responsible for communicating with clients, understanding their needs and advocating on their behalf. LLMs may assist in drafting legal documents, but lawyers will ensure the documents accurately reflect the client’s goals and effectively present their arguments.

LLMs cannot replace the ethical judgment and decision-making required in legal practice. Lawyers will continue to uphold these responsibilities, ensuring that legal services are provided with integrity, confidentiality and competence.

LLMs may assist in analysing legal issues and providing potential outcomes, but lawyers will use their negotiation skills and legal knowledge to advocate for their clients’ interests and work towards favourable resolutions. Lawyers with specialised expertise in specific areas of law will still be in demand. LLMs may provide general legal knowledge, but lawyers with deep knowledge and experience in niche areas will be sought after for their specialised advice and representation.

LLMs may assist in researching and interpreting laws, but lawyers will provide guidance on how to apply the law to specific situations and mitigate legal risks. It is important to note that the arrival of fully mature LLMs may change the way lawyers work and the tasks they perform.

The exact roles of lawyers in legal practice will depend on the development and adoption of LLM technology, as well as the evolving needs of clients and the legal profession. But one thing is certain.

One of the realities of the digital paradigm is that of continuing disruptive change. There is no time to sit back because as LLMs develop and mature, yet another challenge will be looming over the horizon. ■


David Harvey is a retired District Court Judge and a member of Sangro Chambers

Subscribe to


The weekly online publication is full of journalistic articles written for those in the legal profession. With interviews, thought pieces, case notes and analysis of current legal events, LawNews is a key source of news and insights for anyone working within or alongside the legal field.

Sign in or
become a Member
to join the discussion.


Submit a Comment

Your email address will not be published. Required fields are marked *

Latest Articles