Most domains have fuzzy quality criteria. "Good code" is subjective. "Good prose" depends on the reader. But biopharma documents are evaluated against published standards — ICH guidelines, FDA guidance, CFR regulations, pharmacopeial requirements. The loss function isn't implicit in a prompt. It's a 200-page PDF from the agency.
This means the persona can be unusually precise. You're not telling the AI to "improve" — you're telling it to align with ICH E6(R3), or 21 CFR Part 11, or the FDA's guidance on clinical study reports. The criteria are public, specific, and versioned.
The other advantage: biopharma already thinks iteratively. Protocols go through dozens of revisions. Regulatory submissions get reviewed, amended, resubmitted. SOPs are living documents. The industry already does gradient descent — it just does it manually, in Word, tracked changes piling up until the document is unreadable.
An IND application has a clinical protocol synopsis, investigator's brochure, CMC section, nonclinical summaries. Each is a text artifact refined against known criteria.
# .persona
You are a regulatory affairs specialist with deep knowledge
of FDA and ICH guidelines. You review regulatory documents
one improvement at a time. Focus on: compliance with relevant
guidance, completeness, internal consistency, precision of
language, and defensibility under agency review. Read .crumbs.
One change per round. DONE when submission-ready.
# .tools
ito
cat
grep
wc
🍞 12 times toast protocol-synopsis.md "improve — ICH E6(R3) compliance, completeness, no ambiguity"
a2f3b4c add primary endpoint definition — was referenced but never formally stated
b4d5e6f specify randomization method and allocation ratio in study design
c6e7f8a clarify inclusion criterion 4 — "significant" hepatic impairment undefined, add Child-Pugh threshold
d8f9a0b add stopping rules for interim analysis — protocol was silent on early termination
e0a1b2c cross-reference SAP for multiplicity adjustment — endpoint section implied no correction
f2b3c4d add rescue medication rules — concomitant meds section incomplete
a4c5d6e specify visit windows and acceptable deviations from schedule
b6d7e8f define analysis populations (ITT, mITT, PP, safety) — only ITT was mentioned
c8e9f0a add data monitoring committee charter reference
d0f1a2b clarify contraceptive requirements for WOCBP — duration post last dose missing
DONE after 10 rounds
Every gap it found is the kind of thing that generates an FDA information request — weeks of delay. The AI doesn't know what your molecule does. It knows what a complete protocol looks like.
CSRs follow ICH E3 structure. The format is rigid. The quality bar is high. Agencies read them word by word.
# .persona
You are a medical writer specializing in ICH E3 clinical
study reports. You ensure structural compliance, internal
consistency between tables and text, precise statistical
language, and completeness of safety reporting. One finding
per round. Read .crumbs. DONE when the CSR is audit-ready.
# .tools
ito
cat
grep
🍞 10 times toast csr-section12.md "review — ICH E3, internal consistency, statistical precision"
a1c2d3e text says n=142 completed, Table 14.1.1 shows n=139 — reconcile with disposition data
b3d4e5f efficacy summary uses "significant" without specifying alpha level or CI
c5e6f7a TEAE section missing severity grading methodology — add CTCAE version reference
d7f8a9b demographics table doesn't stratify by site — add per protocol requirement
e9a0b1c add narrative cross-references for SAEs in section 12.3
f1b2c3d responder analysis threshold stated as 50% in text, 30% in SAP — flag discrepancy
a3c4d5e concomitant medication coding dictionary not specified — add WHO-DD version
DONE after 7 rounds
The n=142 vs n=139 discrepancy — that's the kind of finding that surfaces in an audit, months after filing. Each round, toast reads the actual text, cross-checks internal references, and flags one inconsistency. The intent log is an audit trail.
SOPs are the backbone of GxP compliance. They're also where ambiguity hides — "ensure adequate documentation" means nothing without specifying what, where, and how.
# .persona
You are a GxP quality specialist. You review SOPs for
clarity, enforceability, and compliance with 21 CFR Parts
210/211 (GMP) or Part 11 (electronic records). Eliminate
ambiguity. Every instruction must be actionable by a trained
operator without interpretation. One improvement per round.
Read .crumbs. DONE when the SOP would survive an FDA inspection.
# .tools
ito
cat
wc
🍞 8 times toast sop-batch-record-review.md "tighten — actionable, unambiguous, 21 CFR 211 compliant"
a2d3e4f replace "check that temperature is appropriate" with "verify temperature is 20-25°C per spec RS-401"
b4e5f6a add step: "initial and date each completed section before proceeding to next"
c6f7a8b specify who reviews deviations — "Quality" is a department, not a role. Changed to "QA Manager or designee"
d8a9b0c add acceptance criteria for yield calculation — SOP says "calculate" but not "compare to"
e0b1c2d define "significant deviation" — was used three times without threshold or examples
f2c3d4e add reference to deviation SOP (SOP-QA-012) for out-of-spec results
a4d5e6f replace "as soon as possible" with "within 2 business days" for deviation reporting timeline
DONE after 7 rounds
FDA investigators love vague SOPs. They're easy to cite in 483s. Each round of gradient descent replaces one vagueness with one specificity. The operator who follows this SOP next won't have to guess.
Case narratives for serious adverse events need to be complete, chronologically coherent, and medically precise. MedDRA coded. Causality assessed. Reporter's verbatim preserved but integrated.
# .persona
You are a drug safety scientist. You review adverse event
case narratives for completeness, medical accuracy, proper
MedDRA terminology, chronological clarity, and CIOMS form
consistency. One improvement per round. Do not alter the
medical facts — only the precision, structure, and
completeness of the narrative. Read .crumbs. DONE when the
narrative is submission-ready.
# .tools
ito
cat
🍞 8 times toast ae-narrative-0347.md "improve — completeness, chronology, MedDRA precision"
a1e2f3a add time-to-onset calculation — event date and last dose date present but interval not stated
b3f4a5b reporter's verbatim "bad liver numbers" mapped to PT but LLT not specified — add preferred MedDRA coding
c5a6b7c dechallenge outcome missing — patient stopped drug but narrative doesn't state whether AE resolved
d7b8c9d add relevant medical history — concomitant hepatotoxic medication listed in source but absent from narrative
e9c0d1e rechallenge section says "N/A" — clarify whether rechallenge was not attempted vs not applicable
f1d2e3f causality assessment states "possible" but rationale references only temporal relationship — add biological plausibility
DONE after 6 rounds
A safety database with 10,000 cases and narratives that vary in quality is a liability. Run gradient descent across them with a consistent persona and you get uniform, defensible documentation.
Pharmaceutical patent claims are iteratively narrowed and strengthened. The loss function is prior art on one side and scope on the other.
# .persona
You are a patent analyst specializing in pharmaceutical
compositions and methods of treatment. You review claims
for definiteness, support in the specification, and
vulnerability to prior art. Tighten language. Close
loopholes. Strengthen dependent claims. Do not alter the
invention — only the precision of the claims. One change
per round. Read .crumbs. DONE when claims are tight.
# .tools
ito
cat
grep
🍞 8 times toast claims-draft.md "tighten — definiteness, prior art defense, claim scope"
a3d4e5f independent claim 1 uses "effective amount" without range — add "from about 10 mg to about 200 mg"
b5e6f7a add dependent claim narrowing to specific crystalline polymorph (Form II) — specification supports it
c7f8a9b method claim recites "treating" but preamble says "preventing" — reconcile
d9a0b1c composition claim doesn't specify excipients — add dependent claim for oral solid dosage form
e1b2c3d "pharmaceutically acceptable salt" should enumerate specific salts described in examples
f3c4d5e add dependent claim for combination therapy with standard of care — data in specification Table 4
DONE after 6 rounds
The AI doesn't replace patent counsel. It does the mechanical tightening that associates spend hours on — checking internal consistency, ensuring claims track the specification, flagging indefiniteness. The patent attorney reviews the trail.
Chemistry, Manufacturing, and Controls — the technical backbone of any drug application. Specifications, analytical methods, stability protocols, process descriptions. All text. All auditable.
# .persona
You are a CMC regulatory specialist. You review manufacturing
and controls documentation against ICH Q8/Q9/Q10 and relevant
FDA guidance. Ensure specifications are justified, analytical
methods are properly validated per ICH Q2, and process
descriptions are reproducible. One improvement per round.
Read .crumbs. DONE when the section is filing-ready.
# .tools
ito
cat
grep
🍞 8 times toast drug-substance-spec.md "review — ICH Q6A, justified limits, method references"
a2c3d4e assay specification states "98.0-102.0%" but no justification for range — add batch data reference
b4d5e6f impurity limit for Imp-A is 0.15% but ICH Q3A threshold is 0.10% for this daily dose — flag for toxicology qualification
c6e7f8a residual solvent section references ICH Q3C but doesn't list Class 2 solvents used in synthesis
d8f9a0b particle size specification missing — add D90 limit with reference to dissolution correlation
e0a1b2c analytical method for chiral purity references "in-house method" — add method number and validation reference
f2b3c4d stability indicating nature of assay method not demonstrated — add forced degradation study reference
DONE after 6 rounds
A single regulatory submission can contain hundreds of documents. The pattern scales because each document is independent — different file, different persona, same loop.
# Review an entire Module 2 (Common Technical Document)
for doc in module2/*.md; do
🍞 8 times toast "$doc" "review — CTD compliance, internal consistency"
done
# Harmonize terminology across documents
🍞 5 times toast glossary.md "check all module2/*.md — flag inconsistent term usage"
# Pre-submission QC
for doc in submission/*.md; do
🍞 3 times toast "$doc" "final check — cross-references, page numbers, table numbering"
done
The ito history across all documents becomes the review trail. When the regulatory affairs VP asks "who reviewed the nonclinical overview?" — the answer is in ito history, with intent, timestamps, and full reversibility.
Pharma is allergic to black boxes. Every decision needs a rationale. Every change needs a trail. The gradient descent pattern gives you both by default:
Every change logged with intent. Content-addressed. Immutable. SHA-256 hashed. Satisfies 21 CFR Part 11 principles for electronic records.
What the reviewer found, what it fixed, what's still open. A running commentary that any auditor can follow.
The review criteria, explicitly stated. Reproducible. Version-controlled. The same persona on the same document produces the same kind of review.
Compare this to the status quo: a Word document with 47 rounds of tracked changes, three conflicting comment threads, and a "final_FINAL_v3_JK_edits.docx" filename. The gradient descent approach gives you cleaner documents and a cleaner process.
The AI doesn't know your molecule. It doesn't know your patient population. It doesn't make clinical judgments or regulatory strategy decisions. It doesn't replace the medical monitor, the biostatistician, or the regulatory affairs lead.
What it does: the mechanical quality work. Checking internal consistency. Flagging missing sections. Tightening language against known standards. Catching the things that humans miss on the fifth read-through because they've been staring at the same document for three weeks.
The human reviews the trail. Accepts or reverts each change. Makes the judgment calls. The AI handles the rigor.
# .persona for your domain — pick one, tune it
You are a [regulatory affairs specialist | medical writer |
GxP quality specialist | drug safety scientist]. You review
[document type] against [specific guidance]. One improvement
per round. Read .crumbs. DONE when [quality threshold].
# .tools — keep it minimal
ito
cat
grep
wc
# Start with one document you know well
$ cd regulatory-submission && ito init
$ cp ~/drafts/protocol-v4.md .
# Pair mode first — see what it finds
$ toast
> review this protocol synopsis against ICH E6(R3)
# Then let it run
🍞 10 times toast protocol-v4.md "improve — ICH E6(R3), completeness, precision"
$ ito history
Read the trail. If it found things you missed, you have a new reviewer. If it didn't, tune the persona. The persona is the loss function — make it specific to your domain and your standards.
Biopharma has spent decades building explicit quality standards for its documents. That's exactly what makes gradient descent work — you need a clear definition of "better." The FDA already wrote yours.