Legal Prompting - Chain-of-thought e few-shot prompting nel legal
S01:E05

Legal Prompting - Chain-of-thought e few-shot prompting nel legal

Episode description

Two techniques change the way a model approaches a legal problem: chain-of-thought — the explicit request to lay out the logical steps before the conclusion — and few-shot prompting — providing two or three well-chosen examples to steer format and method of the answer.

In this episode we look at:

  • how to structure step-by-step reasoning with a concrete example on data transfers outside the EU (Chapter V GDPR, Schrems II);
  • how to pick few-shot examples without introducing bias;
  • how to combine the two techniques for the analysis of complex decisions;
  • the three limits to be aware of: context length, example bias, and plausibility that is not legal correctness;
  • why documenting prompt, examples and verification is already AI governance.

Chain-of-thought and few-shot are not tricks: they are the way we translate our legal method into instructions understandable to the model.

In the next episode we will apply these techniques to the analysis of contracts and clauses.


🎧 Also on Apple Podcasts, Spotify, Amazon Music, and Podcast Index.

🌐 nicfab.eu

Download transcript (.vtt)
0:00

Welcome to Legal Prompting, the podcast dedicated to legal methods in the age of artificial intelligence.

0:07

I'm Nicola Fabiano.

0:10

In the previous episode, we talked about RUG and its risks in the legal domain.

0:15

Today, we take a step forward.

0:18

We discuss two techniques that change how we interact with models,

0:24

chain of thought and few-shot prompting.

0:26

Let's start with the premise.

0:28

A model does not reason like a lawyer.

0:32

It produces plausible answers, not reasoned conclusions.

0:37

But we can steer its process with precise techniques.

0:41

Let's look at them one at a time.

0:43

Chain of thought is the explicit request to lay out the logical steps before the conclusion.

0:51

Instead of simply asking, is this clause valid, we ask,

0:55

examine the clause step by step,

0:59

identify the applicable provision,

1:01

verify the conditions,

1:03

assess the exceptions,

1:05

only then formulate the conclusion.

1:08

Let's take a concrete example.

1:10

We have a clause on data transfers outside the EU.

1:15

Instead of a blunt question, we structure the reasoning as follows.

1:19

First, identify the legal basis for the transfer under Chapter 5 of the GDPR.

1:27

Second, verify the safeguards adopted.

1:30

Third, consider the SHREMS 2 case law.

1:34

Fourth, conclude on compatibility.

1:37

The result changes right away.

1:39

The model makes the path explicit.

1:42

And this allows us to verify where the reasoning holds and where it slips.

1:47

It's the difference between a statement and an argument.

1:52

A warning, though.

1:54

Chain of thought does not guarantee that the reasoning is correct.

1:58

It only guarantees that it is made explicit.

2:02

The model can build coherent logical steps on flawed premises.

2:06

Our verification remains indispensable.

2:09

Let's move to few-shot prompting.

2:13

Here, we give the model examples of how we want it to answer

2:17

before posing the actual question.

2:20

Two, three, at most five well-chosen examples.

2:24

In the legal context, it works like this.

2:28

Do we want the model to analyze a decision of the supervisory authority

2:33

in accordance with a precise structure?

2:37

We show two or three analyses already done with that structure.

2:43

Then we submit the new decision.

2:46

The model tends to replicate the format.

2:49

The quality of the examples is everything.

2:53

Generic examples produce generic results.

2:57

Precise examples with the correct technical language

3:00

and the argumentative structure we need

3:03

produce much better aligned outputs.

3:07

It's instruction by demonstration, not by explanation.

3:12

The two techniques can be combined.

3:15

We can provide examples of chain of thought reasoning

3:18

already structured in a few-shot mode.

3:22

The model learns both the format and the method.

3:26

For analyzing complex decisions, it's often the most effective combination.

3:31

Let's move to the limits.

3:34

The first is the length of the context.

3:37

Every example takes space.

3:40

In long documents, we have to balance the number of examples

3:44

and the complexity of the text we analyze.

3:48

The second limit concerns bias.

3:51

If all our examples follow a certain interpretation,

3:55

the model will apply it even where it's not appropriate.

3:59

Examples shape reasoning, not just form.

4:04

Let's choose representative examples, not convenient ones.

4:08

The third limit is the most insidious.

4:12

Unexplicit reasoning looks more reliable,

4:15

but plausibility is not legal correctness.

4:19

A well-built argument on a non-existent rule

4:22

remains a hallucination, only more convincing.

4:26

A practical caution.

4:28

When we use these techniques for real legal work,

4:33

we document everything, the prompt, the examples,

4:37

the output, and our verification.

4:40

It is part of the governance of AI use,

4:43

and it will be increasingly relevant with the AI act.

4:47

One last thought.

4:49

Chain of thought and few-shot are not tricks.

4:53

They are the way we translate our legal method

4:56

into instructions understandable to the model.

5:00

The clearer our method, the better the techniques work.

5:04

In the next episode, we will apply these techniques

5:07

to the analysis of contracts and clauses.

5:11

We will see how to build effective checklists,

5:15

how to compare versions,

5:17

and which limits remain beyond the model's reach.

5:22

Thanks for listening.

5:23

If you find this podcast useful,

5:27

share it with colleagues interested in legal methods

5:30

in the age of AI.

5:33

We'll meet again in the next episode of Legal Prompting.