Skip to main content
Skip table of contents

Generating a Keeling Schedule

You can create a prospectively amended version of enacted legislation (a “Keeling Schedule”) using an AI-powered feature that analyses documents in Lawmaker and data from legislation.gov.uk.

The feature takes a Bill or an SI containing textual amendments that you have drafted in Lawmaker, and applies those amendments to an Act or another SI. The result is a new working version in your Lawmaker project containing the Act or SI with the amendments marked up.

At the moment this feature is only available to specific users who are helping us assess the feature further. If you’d like to try it out then please get in touch with us at lawmaker@nationalarchives.gov.uk.

Note that this is presently a beta feature and any outputs from it should be carefully checked as it may contain errors.

How to generate a Keeling Schedule

image-20250915-221144.png

  1. Select Generate Keeling Schedule from the Actions menu for the Bill or SI containing the amendments you want to apply.

  2. Select whether you want to apply the amendments to a document on legislation.gov.uk or the document already exists as another working version in the same project.

  3. For documents on legislation.gov.uk, enter the document URL. The easiest way to do this is to navigate in a browser to the legislation you are looking for on legislation.gov.uk, copy the web address (URL) from bar at the top of your browser and then paste it into the Document URL field.

  4. If you want to use a working version that already exists in the project (e.g. if you’ve already imported the enacted legislation from http://legislation.gov.uk), then select the working version you want from the dropdown menu. You’ll also need to enter the title of the Act or SI that is being amended - this is to help Lawmaker identify the relevant amendments that need to be applied.

  5. If you would also like a CSV file (which can be opened in Excel) containing details of each amendment that the Keeling Schedule service identifies then select the checkbox next to “Download a CSV file…”.

  6. Click Generate.

It may take a few minutes to generate the Keeling Schedule (or more if there are a large number of amendments). A notification message will show while the generation takes place showing the progress made. The task goes on in the background so you can do other things while you wait.

Once the Keeling Schedule is generated it will appear on the project tab as a new working version in a folder called Keeling Schedules. The working version will be given a descriptive label based on the title of the enacted legislation and the document containing the amendments.

Working with amendments in a Keeling Schedule

Amendments are applied to a Keeling Schedule using the same markup as Lawmaker uses for parliamentary amendments (when users draft an inline list of draft amendments or they use the Apply amendments feature - see Inline amendments and Applying Amendments ).

That means the amendments will show in the Editor in blue underline if they are insertions and red strike-through if they are deletions (substitutions will show as a combination of deletion and insertion). Each amendment will also show as a tile in the Inline amendments panel on the right.

image-20250916-112659.png

Each amendment that is made is given an ID in the form KSx and that ID is shown in the text and in the panel. Clicking on a tile will highlight the amendment in the Editor. Each tile in the panel includes information about the type and source of the amendment. You can use that panel to accept (✔️) or reject (✖️) individual amendments. You can also click Accept all to incorporate all changes into the document.

If any amendments have been identified but not successfully applied, then a comment will be added for each failed amendment in the Review panel on the right. For example:

image-20250916-113242.png

Generating a PDF of a Keeling Schedule

You can generate a PDF of the Keeling Schedule in the same way you generate a PDF of any other document - see Generating and viewing a PDF).

All amendments will show as tracked changes like they appear in the Editor. However the additional information you can see in the Inline Amendments panel will be transformed into footnotes at the bottom of the relevant page. The footnote marker will be the ID of the amendment in question (e.g. KS24).

Known issues

Here are some particular issues to look out for while using this beta feature to generate Keeling schedules. We hope to address these in future releases.

  1. The service doesn’t currently recognise amendments when an ‘alias’ is used for the name of the Act or SI being amended. So, for example, if amendments are made to “the 2024 Act” which is defined elsewhere to mean “the Finance Act 2024” then those amendments won’t be picked up. A workaround is to use find and replace to temporarily replace the alias with the full title of the Act so you can generate a Keeling Schedule.

  2. Where an amending provision renumbers the text of the target provision, as in this amendment from the Water (Special Measures) Act 2025, the service may not apply all the changes to the target document. This is because renumbering amendments such as these usually contain several overlapping changes. A future refinement to the Keeling Schedule service will group these changes and apply them together.

  3. The service will occasionally identify false-positive amendments in provisions which contain expressions like “power to amend” or “as amended from time to time”. This can lead to some parts of the target document being substituted incorrectly.

  4. Amendments which add or change the italic cross-headings between sections in Acts, or between Schedule paragraphs, are not always applied.

  5. Amendments which make changes to “the words after” a paragraph or sub-paragraph are not always applied. In Lawmaker terminology, these amendments target the “closing words” after a paragraph. A future refinement to the Keeling Schedule service should enable the application step to apply these amendments to the correct part of the XML.

  6. Where an amendment substitutes new sections, regulations, articles, or rules for two or more sections, regulations, articles, or rules, the new provisions may appear twice in the amended document (once after each of the existing provisions). The same issue can affect substituted provisions in Schedules.

  7. When applying amendments which specify changes the conjunction at the end of the line (or the conjunction at the end of the preceding line), those changes may not be applied. This tends to affect changes to the words “and” and “or” which appear at the end of paragraphs and sub-paragraphs.

  8. The service only works on English-language documents.

More about how the Keeling Schedule service works

This sections goes into a bit more detail about how Lawmaker generates Keeling Schedules and the role of generative AI (LLMs) in that process.

The Keeling Schedule service currently uses the GPT-4o model from OpenAI hosted in the Microsoft Azure cloud.

Here is a step-by-step guide to what is going on when a Keeling Schedule is produced:

Step 1

The document containing the amendments is roughly parsed to identify the provisions (sections/regulations and schedules) containing at least one amendment to the target enactment. This is done simply by searching for references to the title of the target enactment and the occurrence of “amending” language like “insert” or “omit” etc. Sometimes, particularly in SIs, one provision provides the context for other provisions which themselves then do not contain a reference to the target enactment (e.g. “Regulations 4 to 15 contain amendments to the Data Protection Act 1998.”) so there is special handling to account for that case.

This initial sift of provisions is done to reduce the amount of data that needs to get analysed by a LLM at the next stage (thus increasing speed and reducing costs).

Step 2

Each provision from step 1 is passed separately to the LLM to identify the specific amendments that it contains and key data about each amendment (e.g. the provision that is affected by the amendment). Before passing it to the LLM, we do some clean-up and simplification of the XML to increase the accuracy of the response. Although each provision is analysed separately, the analysis is done in parallel where possible to save time (i.e. the LLM will be analysing several provisions at the same time rather than purely sequentially).

Step 3

All of the data about the specific amendments from step 2 is gathered together and some algorithmic correction of that data is applied.

Step 4

Each amendment is applied to the target enactment. Depending on the type of amendment, there are different processes used to apply the amendment:

  • if the amendment is considered a “simple” insertion or deletion, e.g. it inserts a whole section or deletes a run of regulations, then the amendment is applied algorithmically to the target enactment by directly modifying it;

  • if the amendment is an “in each place” type amendment which makes a small change (insertion, deletion or substitution) repeatedly over one or more provisions, then again there is a specific algorithmic process (using pattern matching) to apply that amendment;

  • in any other case, the amendment and the target provision is passed to the LLM and it outputs an amended version of the provision which is reinserted into the target enactment.

Step 5

The amended document is cleaned up and editorial notes are added to all the amendments containing information about the source of the amendment (which appear in the Inline Amendments panel and as footnotes in the PDF).

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.