Repository navigation
Conversation
Revise the weak-supervision label pipeline paper per an implementation review, and add a design spec that code can be built from. Paper fixes (8 substantive): - Replace the "seed-fixed reproducibility" claim, which contradicted the cited run-to-run variance work, with replay from preserved raw responses - Separate consensus policies from agreement metrics; Cohen's kappa is a dataset-level chance-corrected statistic, not a per-sample decision function, and is limited to two raters - Add anchor-based monotonic calibration; rule/LLM/human confidences are not comparable on a shared scale - Stop emitting NULL consensus labels for disagreements, which removed only hard samples from training and biased the set; keep a soft label and declare inclusion in the dataset manifest instead - Introduce a random anchor set with a forced share of the review budget, so labeler accuracy and drift are not estimated from disagreement-only samples - Split verified labels into train and eval_holdout purposes to stop leakage between labeler evaluation and training - Identify drift cause from two signals (distribution shift plus anchor rescoring) instead of PSI alone - Move the agreement field from the candidate to the consensus schema, removing a circular dependency in the append-only layer Schema gaps closed: sample_id, label_task, target_ref, is_abstain, ontology_ver, run_id, split value columns, cost/latency, per-component LLM hashes, feature_snapshot_id, and consensus replay metadata. Structural additions: an operational definition of first-class labels, a four-tier mapping with raw responses in Bronze, labeler correlation adjustment, a dataset manifest, canonical hashing rules, and an evaluation plan that measures the value of retaining candidate labels. Design spec covers architecture, table schemas with DDL, replay procedure, fusion algorithm, calibration, review routing, drift detection, idempotency, storage economics, governance, module layout with interface contracts, test strategy, and an eight-stage roadmap. Documentation only; no Python is added, so the boilerplate check and test collection in this repository are unaffected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VDpZfU6Xrs9HAgSQU46mWW
Derives a server-side design from the label pipeline design proposal by first writing use cases and scenarios, then designing only what those cases require. 03-usecases.md - 16 use cases (UC-01..UC-16) with actors, triggers, and design refs - Detailed main/alternate/exception flows for the 8 cases where backend contracts diverge - 6 end-to-end scenarios (bootstrap, daily batch, drift, audit replay, labeler swap, parser change) - 22 edge cases (EC-01..EC-22) the backend must answer - Non-functional assumptions stated as assumptions, not constants 04-backend-design.md - Backend review of the proposal: 11 decisions left open (G1..G11), each mapped to the section that closes it - Control plane (Postgres) vs data plane (lake) split with rationale; 7 control tables - State machines for run and review task, including leases - REST contracts for run, fusion, review platform, dataset, registry, drift/lineage/replay - Idempotency keys, scope-key exclusive job locking, outbox for exactly-once lake writes - Error catalog, RBAC with three-layer holdout isolation, metrics - Case-to-mechanism traceability table and roadmap overlay on M1..M8 - Explicit non-goals to bound scope at the stated operating size Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VT1t6FEdipAhQbdU4HNYnP
Second pass over 03/04 against the design proposal and DDL. Eight
defects, three of them correctness bugs in the spec itself.
Leakage and bias (new G12-G14, EC-23-EC-25)
- Holdout-purpose L3 must not propagate to L2. Taking §12.4 literally
("L3 arrives, update to human_final") puts the evaluation baseline
into the training labels and breaks the §4.5 leakage contract.
Incremental fusion now reads v_l3_train only.
- Anchor review tasks are now blind: no candidates, no consensus in the
lease response. Showing the consensus turns anchor L3 into a
confirmation of L2, which is what calibration and labeler accuracy
are measured against.
- holdout_pct must be fixed per task at creation. It is deterministic,
but changing it reshuffles every past assignment.
Control plane bugs
- Lease SQL was invalid: Postgres rejects FOR UPDATE with window
functions. Rewritten as per-route locked CTEs.
- Same-reviewer exclusion only covered the disagreement route, while
double review lives on the anchor route.
- labeling_run natural key was globally unique, which permanently
blocked the corrective re-runs P1 mandates. Now partial on active
runs, with rerun_of/rerun_reason.
- review_task unique key covered completed rows, blocking re-review
after republish. Now partial on open states.
- Shard resume by cursor loses failures scattered before the cursor;
resume is the anti-join against L1 rows already loaded for the run.
Also: escalation creates a new task row instead of reverting state;
fusion lock scope moved to task level (migration touches two ontology
versions); per-job-type DB roles, since one worker process running all
job types under one account voids the holdout permission layer;
incremental fusion batched in a 5-minute window to stop l2_version
explosion; §14 collects the six changes that 02-design/DDL need; §N
references disambiguated between the two documents.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VT1t6FEdipAhQbdU4HNYnP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind documentation
What this PR does / why we need it
This PR adds comprehensive design documentation and implementation specifications for a label-as-first-class-citizen data pipeline system. The documentation includes:
Revised Research Paper (
00-paper-revised.md): Updated version of the original paper incorporating implementation feedback, with corrections to key claims about LLM reproducibility and clarifications on the replay vs. reproduce distinction.Implementation Design Specification (
02-design.md): Complete technical design covering:Use Cases and Scenarios (
03-usecases.md): 16 documented use cases with detailed flows covering:Backend Design Specification (
04-backend-design.md): Detailed control plane design including:DDL Specifications: Complete SQL schemas for:
Configuration Example (
config/pipeline.example.yaml): Concrete example showing how to configure labelers, policies, and runtime parameters.Revision Notes (
01-revision-notes.md): Detailed mapping of changes from initial paper to revised version, categorized by type (论证缺陷/스키마 누락/구조 보강/미해결).Design Principles Implemented
The design enforces six core principles:
Key Technical Contributions
Replay Mechanism: Preserves raw responses in Bronze layer to enable replay of parsing logic changes without re-invoking external APIs, addressing non-determinism in LLM labelers.
Anchor-Based Evaluation: Enforces random sample allocation for review to prevent selection bias in labeler evaluation and drift detection.
Leakage Prevention: Explicit separation of train/eval holdout purposes in L3 with deterministic hash-based assignment to prevent data leakage into training sets.
Unified Schema: Single structured schema spanning rule/LLM/human labelers with support for abstention, multiple target types (whole/span/bbox/cell), and ontology versioning.
Calibration Pipeline: Per-labeler confidence calibration using isotonic regression on anchor sets, with correlation-adjusted voting to handle model family dependencies.
Which issue(s) this PR fixes
This PR establishes the foundational design documentation for the label pipeline system. It is not tied to a specific issue but serves as the specification baseline for implementation.
Special notes for your reviewer
https://claude.ai/code/session_01VT1t6FEdipAhQbdU4HNYnP