'use strict'; const $=s=>document.querySelector(s), $$=s=>[...document.querySelectorAll(s)]; const h=x=>String(x??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); const lang=()=>document.documentElement.lang==='en'?'en':'ja'; const tx=(ja,en)=>lang()==='ja'?ja:en; const fmt=(x,d=3)=>Number.isFinite(x)?x.toFixed(d):'—'; const display=x=>x===null||x===undefined||x===''?'—':typeof x==='object'?JSON.stringify(x):String(x); const num=x=>Number.isFinite(x)?x:null; let models=[],profiles=[],manifest={},sourceIndex={},sort='five',ascending=false,clearOnly=false,ready=false,current=null; const cohortNames={baby:['Baby同系列','Main Baby cohort'],'legacy-dense':['旧Baby・参考','Legacy Baby reference'],'baby-boundary':['旧Baby・境界条件','Legacy Baby boundaries'],'baby-original':['旧Baby・元設定','Legacy Baby original'],'baby-inference-only':['Baby・推論時介入','Baby inference intervention'],'baby-frozen-body-continuation':['Baby・本体凍結後の追加学習','Baby frozen-body continuation'],'legacy-aro20':['ARO20M','ARO20M'],'normal-joint':['通常データ・joint探索','Normal data / joint'],'normal-threshold':['通常データ・閾値探索','Normal data / threshold'],'normal-aro-extended':['通常データ・ARO延長','Normal data / ARO extension'],'normal-reader':['通常データ・Reader','Normal data / Reader']}; const trv=x=>lang()==='ja'?display(x):({'あり':'Yes','なし':'No','未確認':'Unverified','候補の平均・分散を帰還':'Candidate mean/variance feedback','候補記憶なし/処理差分→D':'No candidate memory; processing changes → D','単一出力':'Single output','枝別に混合':'Branch-specific mixture','最終層':'Last layer','採点済み':'Evaluated','ユーザー指定で停止・削除':'Cancelled / deleted'}[x]??display(x)); function title(m){return `${m.width??'?'}${tx('幅',' wide')} · FFN${m.ffn??'?'} · ${m.depth??'?'}${tx('層',' layers')}`} function memory(m){const a=m.architecture||{}; if(a.plastic_rank)return `F ${a.plastic_value_rank??a.plastic_rank}×${a.plastic_key_rank??a.plastic_rank}`;if(a.D_memories)return `D ${a.D_memories} × (${a.D_key??'?'}×${a.D_value??'?'})${a.C_memories?` + C ${a.C_memories}`:''}`; return ''} function tags(m){const p=m.parts||{},a=m.architecture||{};return [p.output?trv(p.output):'',p.reader&&p.reader!=='なし'?`Reader ${p.reader}`:'',p.received==='あり'?tx('受信ゲート','Receive gate'):'',p.ffn_add==='あり'?(p.bypass_condition==='negative_sigmoid'?tx('条件付きFFN加算','Conditional FFN addition'):tx('FFN加算','FFN addition')):'',memory(m)].filter(Boolean)} function applyLang(l){document.documentElement.lang=l;try{localStorage.setItem('research-language',l)}catch(e){}if(ready){populateCohorts();render();if(current)openModel(current,false)}} $$('[data-language]').forEach(b=>b.addEventListener('click',()=>applyLang(b.dataset.language))); const taskNames={blimp_filtered:'BLiMP',supplement_filtered:'Supplement',ewok_filtered:'EWoK',entity_tracking:'Entity',comps:'CoMPS',global_piqa_parallel:'PIQA parallel',global_piqa_nonparallel:'PIQA nonparallel'}; function populateCohorts(){const val=$('#cohort').value||'baby';$('#cohort').innerHTML=Object.keys(manifest.cohorts).map(k=>``).join('');$('#cohort').value=val;} function scoreCell(m,k){if(k==='clear'){const p=m.clear_peak;if(!p)return '—';return `${tx(String(p.rank??'—')+'位','Rank '+String(p.rank??'—'))} ${fmt(p.accuracy)}%${p.age}M · ${p.correct.toLocaleString()} / ${p.total.toLocaleString()}`}const p=m.peak[k];if(!Number.isFinite(p.score))return '—';return `${tx(String(p.rank??'—')+'位','Rank '+String(p.rank??'—'))} ${fmt(p.score)}${p.ages.join(' / ')}M`} function getSort(m){return sort==='clear'?num(m.clear_peak?.accuracy):sort==='five'||sort==='six'?num(m.peak[sort].score):num(m[sort]);} function render(){const q=$('#search').value.trim().toLowerCase();const exact=q.match(/^#(\d+)$/);const cohort=$('#cohort').value;let found=models.filter(m=>(clearOnly?!!m.clear_peak:m.cohort===cohort)&&(!q||(exact?m.number===+exact[1]:`${m.number} ${m.original_name} ${m.title} ${m.width} ${m.ffn} ${m.seed} ${JSON.stringify(m.parts)} ${JSON.stringify(m.architecture)}`.toLowerCase().includes(q))));found.sort((a,b)=>{let x=getSort(a),y=getSort(b);if(x===null&&y===null)return a.number-b.number;if(x===null)return 1;if(y===null)return -1;return (ascending?x-y:y-x)||a.number-b.number}); $('#model-rows').innerHTML=found.length?found.map(m=>`
| ${h(k)} | ${h(trv(v))} |
|---|
${h(JSON.stringify(v??{},null,2))}${h(m.id)}
${h(tx('固定IDは構造・設定・seedを識別します。最高点は採点した時点の中の最大値です。','The permanent ID identifies a configuration and seed. Peaks are maxima over the evaluated ages.'))}
`; if(m.condition_conflicts?.length)out+=`${tx('このモデルには設定記録の食い違いがあります。下の出典と記録を確認してください。','This record has configuration conflicts. Inspect the evidence and metadata below.')}
`; if(!m.present)out+=`${tx('停止・削除された実験の登録情報だけが残っています。得点・構成の未確認部分は補完していません。','Only the registry identity of a cancelled/deleted experiment remains. Missing scores and configuration fields have not been inferred.')}
`; out+=`${tx('Mは累積学習語数の百万単位。PIQA二集合の平均を1軸にしたものが6軸です。','M denotes millions of words of cumulative training exposure. Six axes treat the mean of the two PIQA sets as one axis.')}
`; out+=`| M | ${tx('5軸','Five')} | ${tx('6軸','Six')} | ${Object.values(taskNames).map(x=>`${x} | `).join('')}||||||
|---|---|---|---|---|---|---|---|---|---|
| ${pt.age} | ${fmt(pt.five)} | ${fmt(pt.six)} | ${Object.keys(taskNames).map(k=>`${fmt(pt.tasks[k],2)} | `).join('')}||||||
| ${tx('未採点','Not evaluated')} | |||||||||
| M | ${tx('正答率','Accuracy')} | ${tx('正答数 / 問題数','Correct / total')} | ${tx('選択肢の得点同点数','Answer-score ties')} |
|---|---|---|---|
| ${pt.age} | ${fmt(pt.accuracy)}% | ${pt.correct} / ${pt.total} | ${pt.ties??'—'} |
${tx('この問題集では未採点です。','Not evaluated on this bank.')}
`; out+=`${tx('実LRを名前付きparameter群で示します。3値はscheduleに沿った各段階です。WDの「—」は未記録で、0ではありません。','Named parameter groups show effective LRs. Triplets follow the recorded schedule phases. A missing WD is unknown, not zero.')}
`; out+=props([[tx('主要行列LR','Main matrix LR'),(m.main_lr||[]).map(x=>Number(x.toPrecision(7))).join(' → ')],[tx('基本LR(記録値)','Base LRs (recorded)'),profile.base_lrs],[tx('1更新の位置数(記録値)','Positions per update (recorded)'),profile.batch],[tx('系列長の巡回','Sequence-length cycle'),profile.sequence]]); if(profile.groups?.length)out+=`| ${tx('parameter群','Parameter group')} | LR | WD |
|---|---|---|
${h((g.label||'').slice(0,85))}${(g.label||'').length>85?'…':''} (${g.names?.length??'?'} tensors)${h((g.names||[]).join('\n'))} | ${h(Array.isArray(g.lr)?g.lr.map(x=>Number(x.toPrecision(7))).join(' → '):display(g.lr))} | ${h(display(g.wd))} |
${tx('全モデルJSON','Full model JSON')} · LR / WD JSON · ${tx('出典索引','Source index')}
`; $('#model-detail').innerHTML=out;if(!$('#model-dialog').open)$('#model-dialog').showModal();if(changeHash)history.replaceState(null,'',`#model-${n}`); } function hashModel(){const match=location.hash.match(/^#model-(\d+)$/);if(match&&ready)openModel(+match[1],false)} if($('#model-table')){ Promise.all(['models','profiles','manifest','sources'].map(n=>fetch(`data/${n}.json`).then(r=>{if(!r.ok)throw new Error(n);return r.json()}))).then(([m,p,ma,s])=>{models=m;profiles=p;manifest=ma;sourceIndex=s;ready=true;populateCohorts();render();hashModel()}).catch(e=>{$('#model-rows').innerHTML=`