Skip to content

Add one-step distilled specialist reference - #19

Merged
epi13 merged 1 commit into
mainfrom
feat/one-step-distilled-specialist
Aug 30, 2026
Merged

Add one-step distilled specialist reference#19
epi13 merged 1 commit into
mainfrom
feat/one-step-distilled-specialist

Conversation

@epi13

@epi13 epi13 commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • adds the first executable MNEL one-step distilled specialist reference for forge.evidence-relevance
  • records teacher observations, verified/retained distillation targets, lineage-bound artifacts, strict schemas, calibration, abstention, and explicit recurrent-teacher fallback
  • includes distilled and no-distillation control artifacts plus deterministic reference-study metrics
  • keeps the implementation in MNEL Python/reference runtime; no mncs-language, compiler, syntax, profile, backend, or stdlib changes

Validation

  • PYTHONPATH=src pytest -q --ignore=tests/test_mncs_reconstruction.py --ignore=tests/test_mncs_training.py — 110 passed
  • PYTHONPATH=src ruff check src/mnel/one_step_specialist.py tests/test_one_step_specialist.py src/mnel/__init__.py — passed
  • JSON schema validation and artifact reload — passed
  • Joern baseline/post snapshot, comparison, and validation — ok: true

Notes

  • full-suite execution remains limited by the pre-existing mncs reconstruction subprocess hanging before collecting tests; those language/compiler tests were intentionally excluded per scope
  • merge is intentionally left manual

@epi13
epi13 merged commit d944877 into main Aug 30, 2026
8 checks passed
@epi13
epi13 deleted the feat/one-step-distilled-specialist branch August 30, 2026 19:51

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba583990ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1886 to +1889
student, calibration = calibrate_one_step_student(
train_one_step_student(dataset, distilled=True),
_study_holdout_rows()[:4],
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Separate calibration from held-out evaluation

The first four rows labeled as held out are used—with their expected labels—to tune both students' confidence and distance thresholds, and then those same rows are included in _evaluate_reference as four of the six held-out examples. Because these thresholds determine abstention, the reported correctness, coverage, abstention, and disagreement measurements are test-set-contaminated; use a distinct calibration split or exclude these rows from the held-out metrics.

Useful? React with 👍 / 👎.

Comment on lines +1040 to +1043
if (
not isinstance(architecture, dict)
or architecture.get("kind") != "tiny-affine-tanh"
or architecture.get("learned_forward_passes") != 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject contradictory architecture metadata

When an artifact is accepted through OneStepStudentModel.load, only kind and learned_forward_passes are checked in the nested architecture object. An artifact can therefore declare input_dimensions: 999, an incompatible hidden/output width, altered context semantics, or extra architecture fields and still load after its outer artifact digest is recomputed; the later model-identity check does not catch this because to_dict() reconstructs and thereby discards the supplied architecture metadata. Validate the complete architecture shape declared by the strict schema before accepting the artifact.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant