Preparing your design workspace

Loading the problem and your latest saved attempt…

Design an Iterative Compound-LLM Defense Generator

Design a compound-LLM workflow that bootstraps, evaluates, critiques, and revises a candidate defense from supplied case and evidence inputs.

Problem statement

The system receives a supplied case-description PDF and evidence text and constructs an optimized legal defense. The reported implementation is a chain of model calls that bootstraps a candidate defense, evaluates the candidate, extracts feedback, and updates the result.

A sibling report describes the implementation context as a simple repository and Python notebook using a compound-LLM system.

Design the orchestration, data contracts, and failure behavior for this workflow. The source does not define the legal jurisdiction, defense format, optimization criteria, model provider, input sizes, traffic, or number of revision rounds.

Keep the evaluation policy opaque and configurable, introduce symbols instead of numeric scale, and do not invent legal-domain rules. For this exercise, treat the supplied inputs as immutable for one run and preserve every stage output within a single revision lineage; changed inputs start a distinct run.

Focus on system behavior and traceability rather than judging whether a defense is legally correct.

What to build

  1. A run accepts a supplied case-description PDF and evidence text as its immutable input bundle.
  2. The workflow invokes a model stage that bootstraps an initial candidate defense from the supplied inputs.
  3. The workflow evaluates a candidate and extracts structured feedback without embedding invented legal criteria in the orchestration layer.
  4. The workflow uses extracted feedback to produce a new candidate revision and returns a traceable terminal result.

At scale

  • Let R denote concurrent runs, P and E the bytes in the supplied PDF and evidence text, and K the configured maximum number of evaluation-update rounds; the source supplies no numeric values.
  • Let T-s denote the model input and output tokens consumed by stage s, and L-s its observed latency; capacity planning should use measured distributions rather than invented point targets.
  • The source does not define an optimization metric or stopping threshold. Treat the evaluation policy and stopping rule as versioned configuration supplied to the workflow, not as legal facts authored for this exercise.
  • Model calls are external, non-transactional operations that may return, fail, or become uncertain independently; the design must bound retries and duplicate effects without assuming a particular provider.