计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
random_layer_mapping【效率与协作】Sample and audit RAIL-KD random teacher-to-student intermediate layer mappings for bounded knowledge distillation experiments.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when implementing or checking the RAIL-KD layer-selection mechanism. It is appropriate for transformer distillation or proxy experiments that need to select m teacher intermediate layers from an n-layer teacher at each epoch and align them with m student layers. Do not use it for deterministic PKD/CKD mapping search or attention-over-all-layers methods.
teacher_layer_count: positive integer n.student_layer_count: positive integer m, with m <= n.seed and optional epoch: reproducibility controls.sort_indices: keep true for the paper-faithful monotonic alignment.m teacher layers.0..m-1 with the selected teacher indices.Run:
python scripts/rail_mapping.py --teacher-layers 12 --student-layers 6 --epochs 4 --seed 13
python -m pytest tests
The tests are standard-library compatible through the Distiller simple test runner.
The script only handles mapping selection and audit statistics. It does not compute hidden-state losses, logits KD, or optimizer updates. Indexing is zero-based; convert explicitly if a downstream framework reports one-based layer numbers.