Clearing Service rulebooks are complex and lengthy documents. In this article I investigate how to improve prompts to compare two rulebooks.
Background
In Capital Markets, all Clearing Service providers such as ICE or LCH, publish rulebooks that specify in immense details the rules they operate by. These documents are generally public and are important documents for member firms to understand the detailed rules of the clearing service.
However given their size, complexity and legal language (as need to be precise), such documents are difficult to read and understand.
In a recent article, I compared the rulebooks for ICE Clear Credit and LCH CDSClear for Credit Derivatives, available on the ICE Website and LSEG Website – which are PDF documents of 431 pages and 285 pages respectively.
My goal in today’s blog is to try and improve the prompts that help me compare and understand the differences in these two rulebooks, so not quite prompt engineering, but a step in that direction.
Let’s Start
I first uploaded both rulebook pdf documents into my Google Gemini window, with 2.5 Pro (preview) selected and entered a prompt to process these.

In my recent comparison blog, I started with the following:
Assume I work for a clearing member firm, which has membership of ICE Clear Credit and I am familiar with much of the content of the ICE rulebook, my firm is now considering becoming a member of LCH SA CDS Clearing, so I need to become familiar with this new rulebook and in particular with differences in this rulebook that are likely to be material for my firm. First let’s start with membership rules and membership criteria, can you detail the differences that are important and likely to be material for me to consider and why?
So let’s keep that goal but rather than charge head-along into it, with the Q&A of my prior blog, what if we craft a more considered prompt?
One that has language for who we are, the task we want to accomplish, steps or a plan to do the task and what structure of response we want.
Crafting a Prompt
After some thinking and a scan of the two documents, I came up with the below.
Perspective
You are a subject matter expert in clearing and work for a firm that is a clearing member of ICE Clear Credit. Your firm is now considering becoming a clearing member of LCH CDS Clear.
Task
Your task is to identify differences between the rulebooks of ICE and LCH, meaning the specific rules that are materially different in concept or practice, so that you can raise and discuss these with a working group in your firm.
Notes
Both rulebooks have chapters on Definitions and Interpretation, you should use these to build an understanding of what definitions correspond to each other in the two rulebooks.
In the ICE Clear Credit document each rule has an explicit reference e.g. Rule 613(b) or Rule 801(b), while in the LCH CDS Clear document each rule is known as an article and has an explicit reference e.g. Article 1.2.1.1 or Article 4.3.3.4
Plan/Steps
For every ICE Clear Credit rule, find the equivalent LCH CDS Clear rule(s) and determine if it is different, not in language but in concept or practice.
Not every ICE Clear Credit rule will have an LCH CDS Clear equivalent, so if one cannot be found, state that there is no easily identifiable equivalent.
Next, check for any LCH CDSClear rules that you cannot find an equivalent in ICE Clear Credit.
Response
Your response should be formatted into 3 distinct tables
First table to show each ICE Clear Credit rule, reference and short description, the LCH rule reference, if found, or the statement no equivalent found and a determination of different or the same in concept or practice.
A second table showing LCH CDS Clear rules that you cannot find an equivalent.
A third table, showing a mapping of definitions between the two rulebooks.
So quite long with sections for Perspective, Task, Notes, Plans/Steps and Response.
This took 20 to 30 minutes of my time, so involved a fair bit of thought and crafting on my part.
Asking Gemini to Improve
Next rather than enter this directly, I tried asking Gemini
Before that I need your help crafting a prompt to do what I want. Assume you are an experienced prompt engineer, take my uploaded Crafting a Prompt doc and improve this to best achieve the task.
As expected the new prompt was much more detailed, as copied into a Google Doc it was almost 5 pages with the following sections heading:
- Overview and Objective
- Input Documents
- Core Task
- Systematic Comparison (ICE Rulebook as Base)
- Evaluation of Differences
- Handling Rules without Direct Equivalents (ICE Base)
- Identifying Unique LCH Rules
- Key Areas of Focus
- Definition Mapping
- Output Requirements
You can read the full improved prompt here.
I read it carefully and like the fact it is detailed and also contains examples of the tables.
Having the full text, also gives me the opportunity to review and edit the prompt, which I considered but decided against for now.
So I simply entered
Ok, please now run this improved prompt

Oh dear, I should have expected that “rule-by-rule comparison for every single rule, including all sub-rules, across both documents to the depth requested would be an exceptionally large undertaking, likely exceeding the practical limits of a single response”.
The Result
Still all is not lost, as Gemini decided to proceed by “Primarily comparing initial chapters related to Interpretation, Membership, Clearing of Contracts, and high-level aspects of Risk Management (Margin, Default Funds) from the ICE Rulebook and their LCH SA counterparts”.
And then output 3 tables, at the end of which it stated:

So clearly states that this is a starting point, (as it’s analysis primarily cover the first 4 chapters in the ICE document (69 pages out of 431) and suggests deeper dives into specific chapters.
Table 1 is very long, so I will simply link to the full Google Sheets here.
It shows a table with 20 rules evaluated, 101-102, 201-212, 301-314, of which it determines that 12 are the same, 1 is different in explicitness and 7 different, with an explanation of material differences.
Table 2, is short enough to display below:

Complete Table 2 GSheets here.
Table 3, the Definition Mapping is interesting, I show a few rows below, while the complete GSheets is here.

I will leave you to judge the quality of the results yourself.
At first reading, they look very helpful to me.
Next, to progress my task, I should take up Gemini on its suggestions and proceed to consider Chapter 4 and 8 in ICE with their LCH equivalents.
But while the mind is willing the flesh is weak.
So will end todays, blog there.
To be picked up on another day.
(I still have time for the working group meeting deadline 🙂 )
Before we end, a few learnings.
Learnings
For complex tasks, careful crafting of a prompt is important.
Write this out with as much detail as you can.
Consider perspective, the task, notes, plan steps, structure of the response.
Next ask the LLM to improve your prompt.
The results are detailed and impressive.
For large tasks, you will hit practical response size limits.
These tasks will need to be tackled in chunks.


Leave a Reply