31 lines
2.7 KiB
Python
31 lines
2.7 KiB
Python
"""Fixed protocol, constants frozen before any new cross-layer measurements."""
|
|
from itertools import combinations
|
|
|
|
LAYERS=[3,7,11,15,19,23]
|
|
PAIRS=list(combinations(LAYERS,2))
|
|
TIERS={
|
|
'strict':{'output_error':.05,'output_cosine':.99,'js':.01,'js_p95':.05,'top5':.8,'value_error':.05,'value_cosine':.99},
|
|
'approximate':{'output_error':.20,'output_cosine':.98,'js':.05,'js_p95':.15,'top5':.6,'value_error':.20,'value_cosine':.98}}
|
|
PROTOCOL={'layers':LAYERS,'layer_pairs':PAIRS,'heads':8,'kv_heads':2,'head_dim':256,
|
|
'calibration_samples':['cal-zh-1','cal-zh-2','cal-en-1','cal-en-2'],
|
|
'validation_samples':['test-zh-1','test-zh-2','test-en-1','test-en-2'],
|
|
'fresh_test_file':'crossqkv/fresh_samples.json','fresh_test_count':4,'tokens_per_text':32,
|
|
'query_positions_for_primary_metrics':list(range(7,32)),
|
|
'candidate_types':['full_attention','qkv_head','qk_map','qk_head','v_group'],
|
|
'discrete_head_matching':'Exact 8-head minimum mean-JS bijection, two source-layer calibration input distributions; frozen before validation; P injection only',
|
|
'continuous_alignment':False,'training':False,'scale_fitting':False,'gpu':False,'cost_required':False,
|
|
'tiers':TIERS,'max_qk_head_output_candidates':32,'max_v_group_output_candidates':16,
|
|
'all_qk_map_output_candidates':30,'max_final_candidate':1,
|
|
'selection':'strict before approximate; type priority full_attention/qkv_head/qk_map/qk_head/v_group; then worst output error, JS, ID; no validation-driven fallback',
|
|
'head_output_activity_floor':'max(1e-6, 0.1 * within-layer median head RMS) for every calibration/validation/test text',
|
|
'fresh_test_run_only_if_frozen_candidate_passes_validation':True,
|
|
'network_interventions':'two same-input donor-function substitution directions; plus one earlier-to-later actual cached-state reuse test reported separately',
|
|
'network_quality':{'mean_token_nll_delta_max':.01,'per_text_p95_nll_delta_max':.05},
|
|
'retention':'all weights and caches retained until explicit user deletion request',
|
|
'seconds':7200,'controls':['identity','uniform causal P','seeded within-causal-row key shuffle','first-key ablation','self/recent3 mass','value Gram to input','value Gram of two seeded Gaussian projections'],
|
|
'positional_repeat_labels':{'sink_dominated':.90,'self_dominated':.90,'recent3_dominated':.90},
|
|
'limitations':['Old validation texts were used in prior experiments; four fresh texts are reserved for this new goal',
|
|
'Direct V-coordinate disagreement does not disprove V/O functional equivalence; centered value Gram CKA is diagnostic only',
|
|
'Arbitrary P-head assignment does not authorize arbitrary GQA KV-weight permutation',
|
|
'Short text-only pilot does not establish broad task equivalence or linear-attention reuse']}
|