Skip to main content

Improving Legislative Drafting with Lex

Liam Wilkinson

Head of Applied AI, i.AI

15 August 2024

A mosaic of open books laid out next to and on top of each other

Lex is dedicated to enhancing the drafting and navigation of legislation within the UK government. By leveraging advanced AI technologies, this project aims to assist legal drafters, making their work more productive and accessible.

Currently in development by the UK Government’s Incubator for AI, Lex aims to significantly ease the legislative drafting process. This project is being built in close collaboration with the Ministry of Justice, the Government Legal Department and The National Archive. Lex will be able to support legislative teams by giving them a range of AI enhanced tools to easily navigate, explain and interrogate UK law. 

Drafting legislation requires meticulous attention to detail, extensive research, and careful revision to ensure clarity and consistency. In July alone, the King’s Speech laid out plans for 40 bills. Lex aims to safely and effectively streamline this intricate process, improving the tools available to legal drafters and making their time more productive.

The project name originates from the Latin word "lex," which means "law" or "statute", reflecting the program’s core objective to innovate within the legal domain.

Core Features

One of the standout features of Lex is its semantic search capability. Lex’s AI-powered search can quickly locate contextually relevant legislative materials in a way that traditional search methods are not able to do reliably. For example, when searching for terms like "Tax regulations on people who've recently arrived in the UK from abroad" Lex retrieves pertinent results far more effectively than conventional methods.

A screenshot of the Lex user interface, showing filters and settings on the left, and search results on the right.

The project also includes an AI-assisted drafting tool that generates explanatory notes for government bills swiftly and accurately. This tool aids in reducing the manual effort involved, allowing legislative teams to focus on more nuanced aspects of their work.

United Kingdom Internal Market Act 2020

Section 1

Purpose of Part 1

  1. This Part promotes the continued functioning of the internal market for goods in the United Kingdom by establishing the United Kingdom market access principles.
  2. The United Kingdom market access principles are—
    1. the mutual recognition principle for goods (see sections 2 to 4), and
    2. the non-discrimination principle for goods (see sections 5 to 9).
  3. Those principles have no direct legal effect except as provided by this Part.

Generated by Lex

Section 1: Purpose of Part 1

Section 1 outlines the purpose of Part 1 of the United Kingdom Internal Market Act 2020, which is to promote the continued functioning of the internal market for goods within the UK. This is achieved by establishing two key market access principles: the mutual recognition principle for goods (detailed in sections 2 to 4) and the non-discrimination principle for goods (detailed in sections 5 to 9). It specifies that these principles do not have direct legal effect except as stipulated within this Part of the Act.

Original Explanatory Note

Section 1: Purpose of the Act

This section sets out the purpose of Part 1 of the Act, which is to promote the continued functioning of the UK internal market for goods in the UK by establishing two new market access principles in UK law.

These principles are the mutual recognition principle for goods (set out in sections 2 to 4) and the non-discrimination principle for goods (set out in sections 5 to 9). Subsection (3) provides that these principles have no direct legal effect except as provided by Part 1 of the Act.

Understanding Legal Terminology

Lex is designed with a deep understanding of UK-specific legal terms. The project is developing open embedding models to ensure that the AI captures the nuances of legal language accurately, making the drafting process even more precise. Notably, these embedding models have been open-sourced to assist others in navigating legislation using AI, reflecting our commitment to fostering innovation and collaboration in the legal sector. https://huggingface.co/i-dot-ai/all-miniLM-L6-v2-UKPGA-6k-finetune

User Insights

User research sessions with the Office of the Parliamentary Counsel (OPC) revealed valuable insights into the drafting process. Users needed more advanced search functionalities and were eager for features like exact phrase searches and proximity-based keyword searches.

Lex addresses these core needs and more by offering an enhanced AI-assisted search that provides precise and contextually relevant results. The semantic search capability uncovers related legislative areas, while advanced filters and a user-friendly interface make navigation seamless.

Looking ahead, we’re excited about running additional user research interviews with more people working with legislation in the Civil Service. This will help us gather broader feedback and continue to refine and expand Lex to meet the diverse needs of all our users.

Looking to the Future: 

Lex is not just about modernising the current process but also about empowering legal drafters to perform their roles more effectively. By harnessing the potential of artificial intelligence, Lex promises to make the complex task of drafting legislation more streamlined and accessible. As the project progresses, we anticipate it will have a profound impact on public service delivery, helping create a more responsive and productive government. We’re currently in the early stages of adding users to our prototype tool as we expand our testing community. If you’re interested in supporting this work, please get in touch with the team at lex@cabinetoffice.gov.uk

Lex is poised to redefine the landscape of legislative drafting, enabling legal drafters to work with greater productivity and precision. Stay tuned for continued development and the transformative impact of Lex.