Skip to content
Session 03 / 08· Direct the machine

Thinking Like a Computer I — Decomposition & Pattern Recognition

The first two pillars of computational thinking, taught as prompt-craft: break the task down, and learn what the machine is actually good at.

90 minutes60 taught + 30 hands-onDirect the machineLive experimentYour laptop · hands-on

The hook

How do you eat an elephant? The same way you brief a junior or spot the issues in a fact pattern — one piece at a time. The people who get gold from an AI instead of garbage are doing exactly that, deliberately, and it is a skill you already half-possess.

What you'll be able to do

  • Decompose a large, ambiguous task into sub-tasks a model can execute reliably — and recognise that issue-spotting and IRAC already are decomposition.
  • Use staged prompting so output can be checked piece by piece rather than swallowed whole.
  • State what a model is systematically good and bad at, and explain why in terms of the mechanism from Session 2.
  • Teach a model by example — few-shot prompting — the prompt-craft analogue of reasoning from precedent.

On the syllabus

  • Decomposition: breaking a large, ambiguous task into sub-tasks a model can execute reliably
  • Multi-step and staged prompting, with every stage as a checkpoint
  • Pattern recognition applied to the tool: what a model is systematically good and bad at, and why
  • Pattern recognition applied to the task: precedent-analogy as pattern matching
  • Few-shot prompting and teaching a model by example

In short

Session 3 introduces the first two pillars of computational thinking as directly transferable prompt-craft. Decomposition: a vague, monolithic request invites padding and invention, while a decomposed, staged sequence produces output you can verify one piece at a time. Pattern recognition: knowing what the machine is reliably strong at — reshaping text it has been given — and reliably weak at — supplying any fact it was never given — and then supplying the pattern you want through worked examples rather than descriptions. Both are skills a law student already practises under other names; the hour makes the bridge explicit, and the hands-on half hour starts the Legal Prompt Portfolio.

Why it matters for using AI well

A good prompt is clear thinking, externalised. Decompose before you prompt, stage the work so every step is a checkpoint, and show the model the pattern you want rather than describing it — and a chatbot stops being a slot machine and becomes a tool whose output you can actually check.

What they leave with

The skill

Decompose before you prompt, stage the work into checkpoints, and show the model the pattern instead of describing it.

The insight

Prompt quality is not a property of the words; it is a property of how clearly you had already broken down the problem.

The moment they remember

The decomposition face-off. The same legal task runs twice on the projector: once as a lazy one-line request, and once as the sequence the room itself has just built. The gap between the two outputs is not subtle, and the better one is theirs — they wrote it, in public, in four minutes. Students arrive expecting to be taught tricks for talking to a machine and leave having discovered that the leverage was in their own analysis all along.

In this session

  • 01

    Decomposition is issue-spotting: breaking a messy fact pattern into discrete, ordered questions is exactly what decomposition asks of a program. A prompt that does the same — “first list the issues; then, for issue one, identify the governing rule…” — produces output you can check link by link.

  • 02

    Staged prompting: the single biggest improvement most people can make is to stop asking for the finished product. Ask for the plan, correct the plan, then ask for each part. Every stage is a checkpoint the model has to pass, and every checkpoint is a place you can intervene before an error compounds.

  • 03

    Pattern recognition, applied to the tool: from Session 2's mechanism it follows that a model is strong wherever it reshapes text it has been given — summarise, restructure, translate register, compare — and weak wherever it must supply what it was never given: citations, figures, recent events, arithmetic, counting. Learning that pattern tells you where to lean on it and where to verify hardest.

  • 04

    Pattern recognition, applied to the task: reasoning by analogy from precedent — matching this case to the line of authority it resembles — is pattern recognition by another name. You already do this; the move is to do it consciously, and to use it to choose the prompt.

  • 05

    Few-shot prompting: supply two or three exemplars of the clause, argument or format you want and the model matches the pattern. It is teaching by example, the way a senior hands a junior a precedent bundle — and far more reliable than describing the shape in words.

  • 06

    Wing's claim that computational thinking is a fundamental skill for everyone (CACM, 2006), and Papert's Mindstorms, ground the pillars as general habits of mind — which is precisely why a lawyer, writing no code at all, can wield them.

The four-step mirror

Run it on the class. Then on the machine.

An experiment on the room, the same effect explained in the model, a live demonstration on a real chatbot, and a named takeaway skill.

Decomposition face-off — vague vs. decomposed

On the class

The room is handed one big, messy legal task — advise on a landlord's claim against a departing tenant, say — and crowd-decomposes it into ordered sub-questions on screen.

In the model

A model handles a chain of small, clear sub-tasks far better than one vague request: the decomposed prompt yields output you can verify piece by piece, while the monolithic ask invites padding and invention.

Live chatbot

The presenter runs the same task twice — once as a one-line ask, once as the room's decomposed sequence — and puts the outputs side by side.

The skill

Decompose before you prompt. Break legal work into sub-tasks the model can actually do and you can actually check.

Will it get this right?

On the class

Before each of five quick tasks — summarise this paragraph, count the words in it, add up these figures, name the leading Indian case on a point, rewrite this clause in plain English — the room votes on whether the model will succeed.

In the model

The model's strengths and weaknesses are systematic rather than random: strong wherever it reshapes text it has been given, weak wherever it must supply a fact or a computation from nothing. Session 2's mechanism predicts the pattern in advance.

Live chatbot

The five tasks run live; the reveals sort themselves into the pattern, and the room's votes show where its intuitions about the machine were wrong.

The skill

Learn the pattern of what the tool is good and bad at, and lean on it only where it is strong.

Few-shot — teach it by example

On the class

Set a drafting task — an indemnity clause, say — and ask the room to predict which yields the better draft: a careful description of what the clause should do, or two example clauses in the house style.

In the model

Examples are a pattern the model copies. Supplying exemplars is the prompt analogue of reasoning by analogy from precedent, and it sharply improves the fit of drafting output.

Live chatbot

The presenter requests the clause with no example, then re-runs with two exemplars, and compares.

The skill

Show, don't just tell. Supply exemplar clauses, arguments, or formats when the output needs to match a known shape.

Hands-on · on your own laptop

Legal Prompt Portfolio I — decompose and pattern

The Legal Prompt Portfolio begins here. On your own laptop, build a decomposed, staged prompt sequence that produces a checkable issue list for a realistic research question; then draft a clause twice — once from a description, once from two exemplar clauses — and compare the fit. Record the prompt, the output, and what still needs verifying for each.

Run of show · 30 minutes

  1. 0–5 min — Choose a realistic research question in your own area, and write the one-line version of the ask you would previously have typed.
  2. 5–15 min — Build and run the staged sequence: issues first, then the governing rule for each, then the authorities that would need checking. Compare it against the one-line version.
  3. 15–25 min — Draft a clause twice: once from a description of what it should do, once from two exemplar clauses in a house style. Compare the fit.
  4. 25–30 min — For each output, mark in the margin every claim that would still need verifying before it could go anywhere near real work.

Deliverable

Two portfolio entries — the decomposed issue-list sequence and the few-shot clause pair — each with prompts, outputs, a short critique, and the unverified claims marked. Feeds the Legal Prompt Portfolio in the recommended assessment scheme.

Key sources & cases

  • Jeannette Wing, “Computational Thinking,” CACM 49(3) (2006)

    Source of the pillars and of the claim that computational thinking is a fundamental skill for everyone, not just computer scientists.

  • Seymour Papert, Mindstorms (1980)

    Computational thinking as a learnable habit of mind, not a programmer-only tool.

  • W. Daniel Hillis, The Pattern on the Stone

    A plain-language account of what computers actually do — the ground under “thinking like a computer”.

  • Legal-prompting practice notes

    Concrete legal prompt-engineering techniques: staged prompting, few-shot exemplars, issue lists.

Readings

  • Jeannette Wing, “Computational Thinking,” CACM 49(3) (2006)
  • Seymour Papert, Mindstorms (1980)
  • W. Daniel Hillis, The Pattern on the Stone
  • Legal-prompting practice notes (staged prompting; few-shot exemplars)

Next session

Session 04 / 08

Thinking Like a Computer II — Abstraction & Algorithm Design

Direct it precisely

Sixteen hours, one professional discipline.

Using AI well is not a knack — it is competence, candour and verification, practised until they are habits you could defend in court.