Research digest: AI teacher single source, table provenance, and combiner refusal¶
- Date: 2026-09-04
- Scope: Aligning AI distillation pipelines with the fork default model (ADR-1168)
- Governing ADR: ADR-1173
- Status: Implemented and verified
1. Context and Problem Statement¶
When ADR-1168 established VMAF_DEFAULT_MODEL_VERSION in core/include/libvmaf/model.h (mirrored in tools/vmaf-tune/src/vmaftune/defaultmodel.py as DEFAULT_MODEL), it unified the CLI, MCP, and tuning surfaces. However, the ai/ subtree was left out: scripts/ci/check-default-model-single-source.sh included a blanket exemption ^ai/ in allow_re.
Consequently, multiple AI feature extraction and corpus preparation scripts continued to hardcode vmaf_v0.6.1. Furthermore, extracted feature tables (Parquet) recorded no teacher provenance on disk. This created two risks:
- Distilled models trained on newer datasets would inadvertently drift between
vmaf_v0.6.1andvmaf_v1.0.16_3d0h. - Multi-dataset combiners could silently merge tables scored with different teacher models, contaminating regression targets.
2. Architecture of the Resolution¶
2.1 Single-Source Resolver (ai/data/scores.py)¶
ai.data.scores.resolve_teacher_model() handles resolution with deterministic precedence:
- Explicit caller argument (
--vmaf-model,--model,model=) - Environment variable
$VMAF_MODEL_PATH(accepting a model file or version name; directory paths are ignored) - Single-source default imported from
vmaftune.defaultmodel.DEFAULT_MODEL
The returned ResolvedTeacherModel provides:
arg: Formatted CLI argument (e.g.version=vmaf_v1.0.16_3d0horpath=/path/to/model.json)name: Clean model identifier string (e.g.vmaf_v1.0.16_3d0hor stem)is_path: Boolean indicating whether a file path is usedresolved: Canonical resolved target
2.2 Row-Level Provenance and Combiner Refusal¶
Every feature extractor now writes a teacher_model string column on each row:
extract_full_features.pyextract_k150k_features.pybvi_dvc_to_full_features.pyextract_ugc_features.pykonvid_to_full_features.pykonvid_to_vmaf_pairs.pybvi_dvc_to_corpus_jsonl.py
combine_full_feature_parquets.py, train_vmaf_tiny_v5.py, and eval_loso_vmaf_tiny_v5.py enforce:
- Every input table must contain a
teacher_modelcolumn, or--assume-teacher <name>must be explicitly provided. - All rows within a table must share the same teacher model.
- All input tables must share the exact same teacher model.
If any mismatch is detected, processing fails fast with an explicit error.
2.3 Feature Space Alignment (adm3)¶
- Appended
"adm3"toFULL_FEATURESinai/data/feature_extractor.py(expanding from 22 to 23 features). - Appended
"adm3"toFEATURE_NAMESinai/scripts/extract_k150k_features.py. - Preserved the canonical-6
DEFAULT_FEATURES(adm2,vif_scale0..3,motion2) for student models intact.
2.4 CI Single-Source Gate¶
Removed ^ai/ from allow_re in scripts/ci/check-default-model-single-source.sh. Added test case 4b in scripts/ci/tests/test-default-model-single-source.sh asserting that any unapproved hardcoded default model literal in ai/scripts/ causes immediate gate failure.
3. Verification Evidence¶
- Single-Clip CPU Smoke:
- Running
scores.pyagainst golden test pairsrc01_hrc00_576x324.yuvandsrc01_hrc01_576x324.yuv:- Default teacher:
vmaf_v1.0.16_3d0h-> pooled VMAF82.816059 - Explicit override
--model vmaf_v0.6.1: -> pooled VMAF76.667831(matches Netflix golden)
- Default teacher:
- Combiner Refusal Unit Tests:
ai/tests/test_combine_full_feature_parquets.py: 8/8 passed, confirming refusal of mixed-teacher tables and legacy unprovenanced tables without--assume-teacher.- CI Gate Tests:
scripts/ci/tests/test-default-model-single-source.sh: 23/23 test cases passed.