Module 15: LLMs for Patch Analysis

Use LLM-assisted workflows for patch triage, annotation support, and documentation in connectomics without outsourcing scientific judgment.

Stylized vector art: an EM patch beside chat bubbles of generated analysis.

Lesson Flow

Learn

Goals and Concepts

Start with the capability target and concept set for this module.

Practice

Studio Activity

Apply the ideas in a guided activity tied to realistic outputs.

Check

Assessment Rubric

Use the rubric to verify competency and identify improvement targets.

Interactive Lab

Practice in short loops: checkpoint quiz, microtask decision, and competency progress tracking.

LLM Verification Gate Checkpoint

Q1. An expert takes as long to adjudicate an LLM's EM patch description as to annotate the patch from scratch. What follows?

The comparison is drafting plus verification against doing the task directly, measured on your own team, and here the two sides are equal. Sampling the gate saves time only by letting unverified descriptions through, which is the failure the gate exists to prevent, and lowering the threshold does the same thing more openly. Patch descriptions can still serve as a search hint but never as an entry in an annotation table.

Q2. An LLM states a synapse count in a summary it drafted for you. What is the acceptance rule?

Fabricated quantities arrive in the same confident phrasing as correct ones, so plausibility checks and cross-model agreement both fail on exactly the cases that matter. This is the one gate with no threshold to tune, and it is cheap to run, which is why it should be stated as non-negotiable rather than decided case by case.

Q3. After the assistant ships, annotator disagreement with its suggestions falls steadily while model performance is flat. What is happening and what is the fix?

This failure is social rather than technical: a suggestion shown first becomes the anchor, and agreement rises without accuracy rising with it. That is why disagreement rate is worth tracking as a metric and why the countermeasure is an interface rule, not a prompt change. Version pinning is required anyway, but it does not explain a trend that tracks exposure rather than releases.

Pilot Design Microtask

You are piloting an LLM ranker against a heuristic that yields 40% true errors in the top 500. What must exist before any output is generated?

Progress Tracker

State is saved locally in your browser for this module.

0% complete

Capability target

Implement an LLM-assisted patch-analysis workflow with verification gates, confidence labeling, and explicit human override policies. Concretely: classify every output your workflow produces into named output classes, attach a verification method and a numeric acceptance threshold to each class before any output is used, measure whether the gate costs less than the task it replaces, and log model version, prompt, output, reviewer, and decision so a reader can reconstruct which claims a model touched.

Why this module matters

LLMs are genuinely useful for triage, drafting, and code assistance, and they fail in ways that are hard to notice precisely because the output is fluent. In connectomics the failures cluster in four places. Current models fabricate quantitative claims — synapse counts, cell counts, metric values — with the same confident phrasing they use for correct ones. They fabricate or misattribute citations. Vision-language models describe EM images plausibly and misidentify structures, calling an astrocytic process an axon or a tangentially cut spine neck a separate profile. And they recombine existing knowledge rather than generating new biological knowledge, so an LLM-produced “hypothesis” is a restatement of the literature, which is useful as a starting point and worthless as evidence.

The consequence is a governance problem, not a prompting problem. Gates, version logging, and override rules have to be defined per output class before use. Defined afterwards, they get defined around whatever the model already produced.

Concept set

1) Assistive, not autonomous

2) Verification-first design

3) The gate must cost less than the task it replaces

4) Auditability

5) Human override is unconditional

Output classes, gates, and what each gate costs

Fill this table for your own project before any LLM output is used. The thresholds below are starting positions.

Output class Verification gate Ship when What the gate costs
Code or query drafts Re-run with an explicit materialization version pin; compare against one maintained known-answer case Result matches the known-answer case exactly A few minutes per query, plus maintaining the known-answer case
Literature summaries Every citation’s DOI resolves and the claimed finding appears in the abstract or a named figure 100% of citations verified; no exceptions 2-5 minutes per citation, scaling with reference count
EM patch descriptions Expert adjudication against the image Only as a search hint; never written into an annotation table Expert time roughly equal to annotating the patch — the gate costs as much as the task
Queue triage or ranking Precision at k on a labeled holdout, against the current heuristic Beats the existing heuristic by a margin you set in advance A labeled holdout that must be refreshed as the segmentation changes
Protocol or SOP drafts Team calibration on 10 real cases Two reviewers independently reach the same decision on all 10 One calibration session per revision
Quantitative claims Recompute from the data Never — the recomputed number is the claim Cheap, and must be non-negotiable

Worked example: reviewing one day of LLM output

The numbers below are illustrative — they show how the gates behave, not measurements from a specific system.

Output 1, a CAVEclient query. You asked for all synapses onto a given neuron. The generated code runs without error and returns 1,240 rows, which is plausible. The gate for code is: re-run with an explicit version pin. Doing so against materialization version 943 returns 1,197 rows. The 43-row difference is not a bug — it is proofreading that happened between version 943 and the live state the unpinned query silently used. The generated code was correct and unreproducible, which is the harder failure to see, and it is the specific failure this gate exists to catch. Recovery: pin the version, re-run, record 1,197 with the version number, and add the version argument to the prompt template so the next draft includes it.

Output 2, a patch description. A vision-language model describes a patch as “a myelinated axon with an adjacent astrocytic process.” The gate for image descriptions is expert adjudication. The expert calls the second profile a tangentially cut dendritic spine neck, not glia. Because one disagreement proves nothing, you run a 50-patch pilot: the model agrees with the expert on structure identity in 31 of 50 patches. That is far below any threshold at which a description could enter an annotation table. It is also not zero, so the model retains one legitimate use — surfacing patches that mention a feature you are searching for, with a human confirming each hit. Note what the pilot cost: the expert reviewed 50 patches, which is roughly what annotating 50 patches would have cost. That measurement is the argument for restricting this output class, and it is worth making once rather than assuming either way.

Output 3, a literature summary with four citations. The gate is that every DOI resolves and the claimed finding appears in the abstract or a named figure. Three check out. The fourth pairs real author names with a title that does not exist. Recovery: delete the citation, and record the event in the risk register — because the operative conclusion is about the class, not the instance. A model that fabricated one citation in four cannot be used to produce reference lists at all. It can still be used to locate candidate papers that you then verify, which is a different output class with a different gate.

What the day produced. Two usable outputs and one restricted class. The workflow’s value is not that the model was right; it is that each failure was caught by a gate defined in advance, at a cost you can state. Had the gates been written afterwards, the unpinned query would have looked like a success — it ran, and the number was plausible.

Core workflow

  1. Enumerate the candidate LLM tasks in your project and sort them into named output classes.
  2. For each class, write the verification method and a numeric acceptance threshold that can fail, before generating any output.
  3. Estimate, then measure, the cost of the gate against the cost of doing the task directly; drop any class where the gate costs more.
  4. Create prompt templates with an explicit output schema, and include the fields that gates depend on — for code, the version pin; for summaries, the citation list.
  5. Define the human override policy and the interface rule that prevents anchoring: independent human call recorded before the suggestion is shown.
  6. Pilot on a small set — 20 to 50 items per class — and log every failure with its cause.
  7. Set the logging fields: model name and version, prompt, raw output, verification result, reviewer, decision, timestamp.
  8. Refine prompts and thresholds from the pilot, then state in your methods which output classes were LLM-assisted.

Pre-class preparation

60-minute tutorial run-of-show

  1. 00:00-08:00 scope boundaries and failure examples. Show the unpinned-query failure first, because it is the one that looks like a success.
  2. 08:00-20:00 prompt template design, including the schema fields each gate depends on.
  3. 20:00-34:00 run sample outputs and score reliability against a known answer; record agreement counts rather than impressions.
  4. 34:00-46:00 define verification and override rules per output class, and estimate the cost of each gate.
  5. 46:00-56:00 produce governance checklist and risk register, with one class explicitly marked as not yet usable.
  6. 56:00-60:00 competency check: each learner states one output class they would refuse to gate, and why.

Studio activity

Scenario: Build an LLM-assisted triage helper for proofreading queues. Reviewers can inspect about 500 segments per week; the current heuristic ranks candidates by segment size and produces roughly 40% true errors in the top 500. Your team wants to know whether an LLM-assisted ranker, drawing on segment statistics and free-text QC notes, should replace it. You have a labeled holdout of 300 segments and one expert available for four hours.

Tasks

  1. Enumerate the output classes this helper will produce and name the one that carries the most risk.
  2. Write the verification gate and numeric acceptance threshold for each class, before generating any output.
  3. Estimate the cost of each gate and compare it with the cost of the task it replaces; mark any class where the gate loses.
  4. Design the pilot: how many items per class, who adjudicates, and what result would cause you to abandon the helper.
  5. Specify the logging schema and the human override policy, including the interface rule that prevents anchoring.
  6. Write the risk register: for each output class, the failure mode, its detection method, and the fallback if the gate fails.

Outputs

Assessment rubric

Practical LLM use cases in connectomics

Where LLMs add value today

| Use case | Example prompt | Verification method | |———-|—————|——————-| | Literature summarization | “Summarize the key findings of Dorkenwald et al. 2024 regarding cell-type diversity” | Cross-check against paper abstract and figures | | Code assistance | “Write a CAVEclient query to find all synapses onto neuron X at materialization version 943” | Run the code and verify output matches manual check | | EM patch description | “Describe the ultrastructural features visible in this EM image” (multimodal) | Expert annotator review of description accuracy | | Hypothesis brainstorming | “Given that reciprocal connections are 4× enriched, what functional hypotheses could explain this?” | Evaluate against literature; treat as starting points, not conclusions | | Protocol drafting | “Draft a proofreading SOP for merge error correction” | Expert review and team calibration before adoption |

Where LLMs fail or mislead

Governance framework

For any LLM-assisted workflow in a connectomics project:

  1. Define scope: Which tasks are LLM-assisted? Which require human-only decisions?
  2. Version control: Log the model name/version, prompt text, and output for every LLM interaction used in analysis.
  3. Verification gates: Every LLM output category has a defined verification method and acceptance threshold.
  4. Human override: Any LLM suggestion can be overridden by a human annotator without justification. The human decision is authoritative.
  5. Transparency: In publications, disclose any LLM assistance in methods section.

Common errors and how to recover

What this module does not cover

Content library references

Teaching resources

Quick practice prompt

For one LLM output type, define: acceptance threshold, verification method, and human override trigger.

Teaching Materials

Activity Worksheet

Learner worksheet aligned to the studio activity and rubric.

Open worksheet

Slide Source

Marp source file for editing and rendering.

course/decks/marp/modules/module15.marp.md

Related Content