Suggest–Edit–Commit
Treat model output that fills a record as an editable draft that only a person commits, and keep every edit as a measurement of where the model is wrong.
cd examples && pytest governance/test_suggest_edit_commit.pyWhat It Is
When a model fills in structured data for a person (a meal log from a photo, an expense from a receipt, ticket fields from an email, a CRM update from a call), its output becomes a draft, not a record. The person sees the draft in an editable form, corrects it, and commits. Nothing downstream reads drafts.
The second half of the pattern is what turns it from a UX choice into an engineering one. Every commit stores what the model suggested next to what the person kept. From that you get per-field acceptance rates and error sizes, a drift signal when they change, and labelled examples for evaluation and tuning, for free, from normal use.
The Problem It Solves
Vision and extraction models are useful and imprecise. Calorie estimates from a photo are typically off by a fifth or more, and receipt totals pick up the subtotal. Committing that output automatically fills your database with plausible errors that nobody reviews. Hiding the model behind a "confirm" button invites people to click through.
Meanwhile most teams have no idea how good the feature actually is in production. The evidence is there, in every correction users make, but it's thrown away.
How It Works
flowchart LR
I["Input: photo, receipt, email"] --> M["Model suggests field values"]
M --> D["Draft (not a record)"]
D --> U["Person edits in a form"]
U -->|"commit"| R["Record"]
U -->|"discard"| X["Nothing saved"]
R --> L["Per-field outcome:
accepted · edited · added · removed"]
L --> Q["Acceptance rate + numeric error per field
drift alerts · labelled pairs"]
- Keep drafts separate from records. A draft lives in its own table or state, and nothing downstream reads it. Only an explicit user action commits it, never a timeout or a default.
- Design the form for correction. Pre-fill the suggested values, make each field quick to change, and show uncertainty where the model can express it ("portion estimated").
- Diff on commit. For each field, record whether it was accepted unchanged, edited, added or removed, and keep the model's and the person's values side by side.
- Measure per field, per model version. Acceptance rate for categorical fields, and median relative error for numeric ones. "Food name accepted 91%, calories within 20% half the time" tells you where to invest.
- Watch for drift. A drop in a field's acceptance rate after a model or prompt change is the most direct quality signal you have.
- Export pairs as labels. (input, model output, human output) is exactly what an evaluation set and a fine-tuning set need. Respect the same privacy rules as the records themselves.
When to Use It
- The model fills structured data that a person owns and will rely on later.
- The person is present and has the context to correct it (it's their meal, their receipt, their customer).
- You want a quality metric that reflects real use, not just an offline benchmark.
When NOT to Use It
- High volume with no one to review. Back-office pipelines can't put a person on every item. Use Reversible Auto-Decision to automate the clear cases.
- Facts code can extract reliably. If a parser can read it, don't ask a person to check a model's guess. Use the Extract–Explain Split.
- Actions rather than records. Sending, paying or deleting needs approval before the action (Human-in-the-Loop), not an editable form after it.
Trade-offs
- It costs the user effort. Every draft asks for a review. If the model is usually right, make acceptance one tap. If it's usually wrong, the feature may not be worth shipping yet.
- Edits are biased labels. People fix what they notice and accept what looks plausible, so an "accepted" field isn't proven correct. Spot-check accepted values occasionally.
- Storing pairs is storing data. Model output and human corrections may be personal. Apply retention and consent rules to the pairs, not just the records.
Failure Modes
Auto-commit creeps in. Someone adds "save automatically after 10 seconds" to reduce friction, and unreviewed model guesses flow into records. Make the commit explicit, and test that drafts never reach downstream reads.
Acceptance as the only metric. Users learn to accept without reading, acceptance goes up and quality doesn't. Pair acceptance with numeric error and occasional audits.
Throwing away discards. A discarded draft is a strong signal (the suggestion was useless), but it leaves no record. Count discards per model version too.
Aggregate metrics hide the bad field. Overall acceptance is 85%, but calories are edited nine times in ten. Always report per field.
Implementation Example
A ledger with drafts separate from records, explicit commit and discard, per-field outcomes, acceptance rates, median relative error for numeric fields, a drift check across a model-version change, and labelled-pair export. The tests use a meal-logging flow where calorie estimates are typically 20% off and a new model version starts getting the food name wrong.
cd examples && pytest governance/test_suggest_edit_commit.py"""Suggest–Edit–Commit.
When a model fills in a form (a meal log from a photo, an expense from a
receipt, ticket fields from an email), its output is a draft. The person
edits it and then commits; nothing reaches the record until they do.
The edits are the most useful data the feature produces. Each commit stores
what the model said next to what the person kept, so you can measure, per
field, how often the model was accepted as-is and how far off it was, notice
when that changes, and export the pairs as labelled examples.
"""
from __future__ import annotations
import uuid
from dataclasses import dataclass, field
@dataclass
class Draft:
id: str
source: str # what the model looked at (an image id, the email text, ...)
suggested: dict[str, object]
model_version: str
@dataclass
class Committed:
draft_id: str
values: dict[str, object]
field_outcomes: dict[str, str] # field -> "accepted" | "edited" | "added" | "removed"
@dataclass
class Ledger:
drafts: dict[str, Draft] = field(default_factory=dict)
records: list[Committed] = field(default_factory=list)
pairs: list[dict] = field(default_factory=list) # (source, model output, human output) for evals and tuning
def suggest(self, source: str, suggested: dict, model_version: str) -> Draft:
draft = Draft(uuid.uuid4().hex[:8], source, dict(suggested), model_version)
self.drafts[draft.id] = draft # a draft is not a record: nothing downstream reads this
return draft
def commit(self, draft_id: str, final: dict) -> Committed:
"""Called only from an explicit user action, never on a timer or by default."""
draft = self.drafts.pop(draft_id)
outcomes = {}
for key in draft.suggested.keys() | final.keys():
if key not in final:
outcomes[key] = "removed"
elif key not in draft.suggested:
outcomes[key] = "added"
else:
outcomes[key] = "accepted" if final[key] == draft.suggested[key] else "edited"
record = Committed(draft_id, dict(final), outcomes)
self.records.append(record)
self.pairs.append({"source": draft.source, "model": draft.suggested, "human": dict(final),
"model_version": draft.model_version})
return record
def discard(self, draft_id: str) -> None:
self.drafts.pop(draft_id, None) # also a signal: count discards separately in production
# ---- what the edits tell you ----
def acceptance(self, last: int | None = None) -> dict[str, float]:
"""Share of commits where each field was kept exactly as suggested."""
window = self.records[-last:] if last else self.records
totals: dict[str, list[int]] = {}
for r in window:
for key, outcome in r.field_outcomes.items():
if outcome in ("accepted", "edited"):
t = totals.setdefault(key, [0, 0])
t[0] += outcome == "accepted"
t[1] += 1
return {k: ok / n for k, (ok, n) in sorted(totals.items())}
def numeric_error(self, key: str) -> float | None:
"""Median relative error of the model's numbers against what people kept."""
errors = sorted(
abs(p["model"][key] - p["human"][key]) / abs(p["human"][key])
for p in self.pairs
if isinstance(p["model"].get(key), (int, float)) and isinstance(p["human"].get(key), (int, float))
and p["human"][key]
)
return errors[len(errors) // 2] if errors else None
def drifted(self, key: str, baseline: int = 50, recent: int = 20, max_drop: float = 0.15) -> bool:
if len(self.records) < baseline + recent:
return False
older = Ledger(records=self.records[-(baseline + recent):-recent]).acceptance().get(key)
newer = self.acceptance(last=recent).get(key)
return older is not None and newer is not None and older - newer > max_dropTool Landscape
| Tool | Notes |
|---|---|
| Your own form and database | The draft/record split is a data-model decision; no special tool needed |
| Product analytics (PostHog, Amplitude) | Track accept, edit and discard events per field and model version |
| Labelling tools (Argilla, Label Studio) | Review sampled pairs and spot-check accepted values |
| Eval platforms (Braintrust, LangSmith, Langfuse) | Turn exported pairs into regression datasets |
Related Patterns
- Human-in-the-Loop approves actions before they happen. This pattern lets a person correct data before it's saved.
- Reversible Auto-Decision handles the same tension when there's no person to ask per item.
- Extract–Explain Split is the better choice when code can extract the facts.
- LLM-as-Judge can be calibrated against the human corrections this pattern collects.
Further Reading
- Guidelines for Human-AI Interaction, Amershi et al., CHI 2019. See especially "support efficient correction".
- People + AI Guidebook, Google PAIR
- Measuring GitHub Copilot's Impact on Productivity, Ziegler et al., CACM 2024. Acceptance rate as a quality signal.
Spotted something wrong or have a production story? Edit this page on GitHub.