aien-train
AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished.
Brought by drakestapleton
aien-train / native / neuralese / sensitivity.wl
| 1 | (* Independent exploratory sensitivity aggregation; not the frozen primary endpoint. *) |
| 2 | data=Map[ToExpression,ImportString[__DATA__,"RawJSON"],{2}]; |
| 3 | fromBits[n_Integer] := Module[{sgn,e,m},sgn=If[BitAnd[BitShiftRight[n,63],1]==1,-1,1]; e=BitAnd[BitShiftRight[n,52],2047]; m=BitAnd[n,2^52-1]; If[e==0,sgn m 2^-1074,sgn (2^52+m) 2^(e-1075)]]; |
| 4 | truth[r_]:=Reverse[IntegerDigits[r[[4]],2,4]]; |
| 5 | probs[r_]:=N[fromBits/@r[[10;;13]],18]; |
| 6 | correct[r_]:=r[[21]]==0 && (Boole[#>=1/2]&/@probs[r])===truth[r]; |
| 7 | part[r_]:=If[r[[2]]==0 || EvenQ[Total[truth[r]]],"train","heldout"]; |
| 8 | mode[r_]:=If[5<=r[[5]]<=12,"eight-noise-corners",r[[5]]]; |
| 9 | key[r_]:=Join[r[[1;;3]],{mode[r],part[r]}]; |
| 10 | summary[g_]:=Module[{bycase,accepted,distinct},bycase=GatherBy[g,#[[4]]&]; accepted=Select[g,#[[21]]==0&]; distinct=Length[DeleteDuplicates[#[[All,7;;9]]]]&/@GatherBy[g,#[[5]]&]; |
| 11 | {key[First[g]],Length[bycase],Count[(And@@(correct/@#))&/@bycase,True],Count[(Or@@Map[Function[r,r[[18]]==1],#])&/@bycase,True],Count[(Or@@Map[Function[r,r[[21]]!=0],#])&/@bycase,True],If[Length[accepted]==0,Null,Max[Flatten[Abs[(probs[#]-truth[#])&/@accepted]]]],Min[distinct]}]; |
| 12 | ExportString[<|"status"->"PASS","scope"->"EXERCISED exploratory sensitivity; eight fixed sign corners, not random corruption distribution","columns"->{"key","cases","worstCornerExact","casesAnyAbstain","casesAnyRefusal","maxFeatureErrorAmongAcceptedFrames","minimumDistinctMessagesPerCorner"},"metrics"->(summary/@GatherBy[data,key])|>,"RawJSON","Compact"->True] |