Lion Cipher Lab

Do one malware-report extraction two ways - one giant prompt against a five-step prompt chain - and measure the compounding error that decides which one you should ship

Why it matters

Everyone who has put a language model near a real analyst workflow has had the same meeting. Somebody says the one big prompt is unreliable, somebody else says we should break it into steps, everyone nods, and the thing gets built. It is a good instinct and it is usually right - in this lab, decomposing one malware-report extraction into five steps took end-to-end accuracy from 0.330 to 0.763, more than doubling the rate at which a usable artefact comes out the other end. What almost nobody in that meeting does is the arithmetic, and the arithmetic is brutal. If five steps must each be right…

What you'll learn

Steps in this lab

  1. The frame: one task, two shapes, and the arithmetic that decides between them
  2. Open a terminal (yes, from zero) and check you have Python
  3. Build the corpus: 300 synthetic incident reports with a known right answer
  4. The extractor is a DETERMINISTIC STUB - read this before you paste it
  5. Baseline first: the monolith. One prompt, five fields, and a correlated failure
  6. Build the chain: five steps, four handoffs, and one deliberate poison route
  7. The arithmetic, and both ways it is wrong
  8. Sweep the chain length - one data point is an anecdote, the curve is the finding
  9. The mitigation that only partly works: a validation gate on every handoff
  10. When NOT to chain - and why this, not that
  11. The way a pro does it
  12. OPTIONAL appendix: swap the stub for a real local model

Open the full interactive lab →