import%20marimo%0A%0A__generated_with%20%3D%20%220.23.9%22%0Aapp%20%3D%20marimo.App(%0A%20%20%20%20width%3D%22medium%22%2C%0A%20%20%20%20app_title%3D%22Experiment%202.9.3%3A%20why%20anchoring%20fails%20%E2%80%94%20timing%2C%20attribution%2C%20and%20a%20schedule%20fix%22%2C%0A%20%20%20%20css_file%3D%22..%2F..%2Freport.css%22%2C%0A%20%20%20%20auto_download%3D%5B%22html%22%5D%2C%0A)%0A%0Awith%20app.setup(hide_code%3DTrue)%3A%0A%20%20%20%20import%20io%0A%0A%20%20%20%20import%20marimo%20as%20mo%20%20%23%20noqa%3A%20F401%0A%20%20%20%20import%20matplotlib.patheffects%20as%20pe%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%20%20%20%20import%20numpy%20as%20np%0A%20%20%20%20from%20matplotlib.colors%20import%20LinearSegmentedColormap%0A%0A%20%20%20%20from%20sca.colorcube%20import%20TRAJ_STRIDE%2C%20classify%2C%20load_results%2C%20make_dopesheet%0A%20%20%20%20from%20mini.reports%20import%20report_bundle%2C%20use_publisher%0A%20%20%20%20from%20mini.temporal%20import%20Dopesheet%2C%20Timeline%2C%20realize_timeline%0A%20%20%20%20from%20mini.vis%20import%20light_dark%2C%20themed%0A%0A%20%20%20%20use_publisher(report_bundle(__file__))%0A%0A%20%20%20%20%23%20Store%20refs%20published%20by%20experiment.py%20(kept%20in%20sync%20by%20hand).%0A%20%20%20%20METRICS_REF%20%3D%20%22reports%2Fex-2.9.3%2Fmetrics%22%0A%20%20%20%20TRAJS_REF%20%3D%20%22reports%2Fex-2.9.3%2Ftrajectories%22%0A%0A%20%20%20%20PEAK_LRS%20%3D%20(0.10%2C%200.07%2C%200.05%2C%200.03)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%20Experiment%202.9.3%3A%20why%20anchoring%20fails%20%E2%80%94%20timing%2C%20attribution%2C%20and%20a%20schedule%20fix%0A%0A%20%20%20%20%5BEx-2.9.2%5D(..%2Fex-2.9.2%2Freport.py)%20identified%20two%20components%20to%20the%20variance%0A%20%20%20%20in%20our%20ablation%20scores.%20The%20redistribution%20was%20fixed%3A%20fallback%20control%0A%20%20%20%20gives%20the%20intervention%20a%20response%20we%20design%20ahead%20of%20time.%20The%20other%20part%0A%20%20%20%20stayed%20open%3A%20On%20some%20seeds%20the%20concept%20never%20landed%20cleanly%20on%20its%20axis.%0A%0A%20%20%20%20Our%20guess%20was%20that%20the%20regularizer%20schedule%20is%20incompatible%20with%20some%0A%20%20%20%20initializations%3A%20some%20starting%20weights%20simply%20cannot%20be%20anchored%20by%20this%0A%20%20%20%20schedule.%20If%20that%20were%20true%2C%20the%20remedy%20would%20be%20a%20schedule%20search%20per%20seed%0A%20%20%20%20or%20per%20init%2C%20which%20is%20expensive%20and%20gets%20worse%20as%20models%20grow.%0A%0A%20%20%20%20This%20experiment%20tests%20that%2C%20and%20it%20doesn't%20hold%20up.%20There%20are%20three%20arms%2C%0A%20%20%20%20all%20built%20on%20ex-2.9.1's%20small%20color%20autoencoder.%0A%0A%20%20%20%20-%20Trajectories%3A%20retrain%20ex-2.9.2's%20base%20arm%20(the%20same%2032%20seeds)%2C%20recording%0A%20%20%20%20%20%20anchor%20progress%2C%20leakage%2C%20and%20reconstruction%20error%20at%20every%20step.%20When%20do%0A%20%20%20%20%20%20failures%20happen%2C%20relative%20to%20the%20schedule%3F%0A%20%20%20%20-%20Attribution%3A%20separate%20the%20two%20sources%20of%20randomness%2C%20the%20model%20init%20and%0A%20%20%20%20%20%20the%20batch%2Flabel%20stream%20(16%20inits%20%C3%97%208%20streams%2C%20including%20the%20two%20inits%0A%20%20%20%20%20%20whose%20earlier%20runs%20failed%20badly).%20A%20failure%20that%20comes%20from%20the%20init%0A%20%20%20%20%20%20should%20repeat%20all%20along%20that%20init's%20row%2C%20while%20a%20failure%20that%20comes%20from%0A%20%20%20%20%20%20the%20data%20ordering%20should%20scatter.%0A%20%20%20%20-%20Schedule%20sweep%3A%20peak%20LR%20%7B0.10%2C%200.07%2C%200.05%2C%200.03%7D%20%C3%97%20regularizer%20anneal%0A%20%20%20%20%20%20%7Bon%2C%20off%7D%2C%2032%20seeds%20per%20cell%2C%20trained%20with%20the%20fallback%20term%20and%20scored%20by%0A%20%20%20%20%20%20the%20%60redirect%60%20intervention%20(ex-2.9.2's%20recipe%2C%20so%20the%20score%20reflects%0A%20%20%20%20%20%20anchoring%20quality).%0A%0A%20%20%20%20The%20experiment%20is%20%5B%60experiment.py%60%5D(.%2Fexperiment.py)%3A%0A%0A%20%20%20%20%60%60%60bash%0A%20%20%20%20bin%2Fmini%20run%20docs%2Fm1%2Fex-2.9.3%2Fexperiment.py%20--app%20modal%20--max-containers%2016%0A%20%20%20%20%60%60%60%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20loaded%20%3D%20load_results(METRICS_REF%2C%20TRAJS_REF)%0A%20%20%20%20return%20(loaded%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(loaded)%3A%0A%20%20%20%20mo.stop(%0A%20%20%20%20%20%20%20%20loaded%20is%20None%2C%0A%20%20%20%20%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22No%20results%20yet%20%E2%80%94%20run%20the%20experiment%20(it%20publishes%20metrics%20to%20the%20store%20on%20completion)%3A%5Cn%5Cn%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%60%60%60bash%5Cnbin%2Fmini%20run%20docs%2Fm1%2Fex-2.9.3%2Fexperiment.py%20--app%20modal%20--max-containers%2016%5Cn%60%60%60%22%0A%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20)%0A%20%20%20%20metrics%2C%20trajs%20%3D%20loaded%0A%0A%20%20%20%20def%20arm(name%3A%20str)%20-%3E%20list%5Bdict%5D%3A%0A%20%20%20%20%20%20%20%20return%20%5Br%20for%20r%20in%20metrics%20if%20r%5B%22arm%22%5D%20%3D%3D%20name%5D%0A%0A%20%20%20%20def%20traj(r%3A%20dict%2C%20key%3A%20str)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20return%20trajs%5Bf%22%7Br%5B'run'%5D%3A03d%7D_%7Bkey%7D%22%5D%0A%0A%20%20%20%20def%20sweep_cell(peak_lr%3A%20float%2C%20anneal%3A%20bool)%20-%3E%20list%5Bdict%5D%3A%0A%20%20%20%20%20%20%20%20return%20%5Br%20for%20r%20in%20arm(%22sweep%22)%20if%20r%5B%22peak_lr%22%5D%20%3D%3D%20peak_lr%20and%20r%5B%22anneal%22%5D%20%3D%3D%20anneal%5D%0A%0A%20%20%20%20steps%20%3D%20np.arange(len(traj(arm(%22trajectories%22)%5B0%5D%2C%20%22z0_red%22)))%20*%20TRAJ_STRIDE%0A%20%20%20%20return%20arm%2C%20steps%2C%20sweep_cell%2C%20traj%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(arm)%3A%0A%20%20%20%20_t%20%3D%20arm(%22trajectories%22)%0A%20%20%20%20_bad%20%3D%20%5Br%20for%20r%20in%20_t%20if%20classify(r)%20!%3D%20%22clean%22%5D%0A%20%20%20%20_cat%20%3D%20%5Br%20for%20r%20in%20_bad%20if%20classify(r)%20%3D%3D%20%22catastrophic%22%5D%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20%7Blen(arm(%22trajectories%22))%20%2B%20len(arm(%22attribution%22))%20%2B%20len(arm(%22sweep%22))%7D%0A%20%20%20%20runs%20completed.%20The%20trajectory%20arm%20reproduces%20ex-2.9.2's%20base%20arm%3A%0A%20%20%20%20%7Blen(_bad)%7D%20of%20%7Blen(_t)%7D%20runs%20end%20unhealthy.%20%7Blen(_cat)%7D%20of%20them%20failed%0A%20%20%20%20catastrophically%2C%20meaning%20the%20anchor%20was%20lost%20or%20reconstruction%20collapsed%2C%0A%20%20%20%20and%20%7Blen(_bad)%20-%20len(_cat)%7D%20finished%20with%20non-red%20colors%20leaking%20onto%20the%0A%20%20%20%20anchored%20axis.%20The%20per-step%20traces%20show%20that%20every%20failing%20run%20anchored%0A%20%20%20%20successfully%20first%2C%20then%20broke%20during%20the%20high-LR%20plateau.%20The%20attribution%0A%20%20%20%20arm%20confirms%20the%20failures%20are%20not%20a%20property%20of%20the%20initialization%2C%20and%20the%0A%20%20%20%20sweep%20finds%20a%20plain%20schedule%20fix%3A%20halve%20the%20LR%20peak%20and%20keep%20the%20anneal.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20When%20failures%20happen%0A%0A%20%20%20%20Each%20line%20below%20is%20one%20seed's%20training%20run%20under%20the%20original%20schedule.%20The%0A%20%20%20%20top%20panel%20tracks%20anchor%20progress%3A%20z%E2%82%80%20of%20pure%20red%2C%20which%20reaches%201%20when%20*red*%0A%20%20%20%20sits%20exactly%20on%20its%20anchor.%20The%20middle%20panel%20tracks%20leakage%2C%20the%20mean%20%7Cz%E2%82%80%7C%0A%20%20%20%20over%20colors%20that%20are%20clearly%20not%20red.%20The%20bottom%20panel%20is%20the%20schedule%0A%20%20%20%20itself%3A%20the%20learning%20rate%20ramps%20to%20its%200.1%20peak%20at%20step%20750%20and%20holds%20there%2C%0A%20%20%20%20while%20the%20regularizer%20weights%20anneal%20to%20zero%20by%20step%201425.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(arm%2C%20steps%2C%20traj)%3A%0A%20%20%20%20_t%20%3D%20arm(%22trajectories%22)%0A%20%20%20%20_bad%20%3D%20sorted((r%20for%20r%20in%20_t%20if%20classify(r)%20!%3D%20%22clean%22)%2C%20key%3Dlambda%20r%3A%20r%5B%22seed%22%5D)%0A%20%20%20%20_label%20%3D%20%7B%0A%20%20%20%20%20%20%20%20r%5B%22seed%22%5D%3A%20f%22seed%20%7Br%5B'seed'%5D%7D%20%E2%80%94%20%22%0A%20%20%20%20%20%20%20%20%2B%20(%22anchor%20lost%22%20if%20r%5B%22val_anchor%22%5D%20%3E%200.3%20else%20%22recon%20collapse%22%20if%20r%5B%22val_recon%22%5D%20%3E%200.01%20else%20%22leak%22)%0A%20%20%20%20%20%20%20%20for%20r%20in%20_bad%0A%20%20%20%20%7D%0A%20%20%20%20_hist%20%3D%20realize_timeline(Timeline(Dopesheet.from_csv(io.StringIO(make_dopesheet(0.10%2C%20anneal%3DTrue)))))%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22trajectories%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3Df%22%22%22%0A%20%20%20%20%20%20%20%20Three%20charts%20stacked%20on%20a%20shared%20step%20axis%20from%200%20to%201500.%20Top%3A%20anchor%20progress%2C%20the%0A%20%20%20%20%20%20%20%20z0%20of%20pure%20red%2C%20for%20all%2032%20seeds.%20Every%20line%2C%20including%20the%20%7Blen(_bad)%7D%20failures%20drawn%0A%20%20%20%20%20%20%20%20in%20color%2C%20climbs%20from%20near%200%20to%20about%201%20by%20step%20750.%20After%20that%20the%20gray%20healthy%20lines%0A%20%20%20%20%20%20%20%20hold%20at%201%20while%20the%20colored%20ones%20diverge.%20Seeds%2022%20and%208%20dip%20briefly%20as%20the%20learning%0A%20%20%20%20%20%20%20%20rate%20reaches%20its%20peak%2C%20and%20both%20recover%20on%20this%20metric%2C%20though%20seed%2022's%20reconstruction%0A%20%20%20%20%20%20%20%20does%20not.%20Seed%2015%20breaks%20away%20to%20about%200.65%20from%20step%20900%2C%20and%20seed%2027%20falls%20to%20about%0A%20%20%20%20%20%20%20%200.4%20after%20step%201100.%20Middle%3A%20leakage%20for%20the%20same%20runs.%20Healthy%20lines%20settle%20near%200.05%0A%20%20%20%20%20%20%20%20while%20the%20failures%20climb%20to%200.1%20to%200.6%20in%20the%20same%20late%20window.%20Bottom%3A%20the%20schedule%2C%0A%20%20%20%20%20%20%20%20with%20the%20learning%20rate%20ramping%20to%200.1%20at%20step%20750%20and%20holding%2C%20and%20the%20regularizer%0A%20%20%20%20%20%20%20%20weights%20annealing%20to%20zero%20by%20step%201425.%20A%20shaded%20band%20marks%20the%20high-LR%20plateau%2C%20where%0A%20%20%20%20%20%20%20%20every%20failure%20occurs.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20fig%2C%20axes%20%3D%20plt.subplots(3%2C%201%2C%20figsize%3D(9.5%2C%207.5)%2C%20sharex%3DTrue%2C%20height_ratios%3D%5B3%2C%202%2C%201.6%5D)%0A%20%20%20%20%20%20%20%20gray%20%3D%20light_dark(%22%239aa5b155%22%2C%20%22%236b768655%22)%0A%20%20%20%20%20%20%20%20hues%20%3D%20%5B%22%23d55e00%22%2C%20%22%230072b2%22%2C%20%22%23009e73%22%2C%20%22%23cc79a7%22%2C%20%22%23e69f00%22%5D%0A%20%20%20%20%20%20%20%20for%20ax%2C%20key%20in%20zip(axes%5B%3A2%5D%2C%20(%22z0_red%22%2C%20%22leak%22)%2C%20strict%3DFalse)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20r%20in%20_t%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20classify(r)%20%3D%3D%20%22clean%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(steps%2C%20traj(r%2C%20key)%2C%20color%3Dgray%2C%20lw%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20hue%2C%20r%20in%20zip(hues%2C%20_bad%2C%20strict%3DTrue)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(steps%2C%20traj(r%2C%20key)%2C%20color%3Dhue%2C%20lw%3D1.6%2C%20label%3D_label%5Br%5B%22seed%22%5D%5D)%0A%20%20%20%20%20%20%20%20axes%5B0%5D.set(ylabel%3D%22z%E2%82%80(pure%20red)%22%2C%20ylim%3D(-1.05%2C%201.05))%0A%20%20%20%20%20%20%20%20axes%5B0%5D.legend(loc%3D%22lower%20left%22%2C%20fontsize%3D8%2C%20ncols%3D2)%0A%20%20%20%20%20%20%20%20axes%5B1%5D.set(ylabel%3D%22leak%20(mean%20%7Cz%E2%82%80%7C%2C%20non-red)%22%2C%20ylim%3D(0%2C%200.7))%0A%20%20%20%20%20%20%20%20ax%20%3D%20axes%5B2%5D%0A%20%20%20%20%20%20%20%20ax.plot(_hist.index%2C%20_hist%5B%22lr%22%5D%2C%20color%3Dlight_dark(%22%231a5f8a%22%2C%20%22%236ab0d4%22)%2C%20lw%3D2%2C%20label%3D%22lr%22)%0A%20%20%20%20%20%20%20%20ax2%20%3D%20ax.twinx()%0A%20%20%20%20%20%20%20%20for%20name%2C%20ls%20in%20((%22anchor%22%2C%20%22--%22)%2C%20(%22anti-anchor%22%2C%20%22-.%22)%2C%20(%22anti-subspace%22%2C%20%22%3A%22))%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ax2.plot(_hist.index%2C%20_hist%5Bname%5D%2C%20color%3Dlight_dark(%22%23555%22%2C%20%22%23aaa%22)%2C%20ls%3Dls%2C%20lw%3D1.2%2C%20label%3Dname)%0A%20%20%20%20%20%20%20%20ax.set(xlabel%3D%22step%22%2C%20ylabel%3D%22lr%22%2C%20ylim%3D(0%2C%200.11))%0A%20%20%20%20%20%20%20%20ax2.set(ylabel%3D%22weight%22%2C%20ylim%3D(0%2C%200.27))%0A%20%20%20%20%20%20%20%20lines%20%3D%20ax.get_lines()%20%2B%20ax2.get_lines()%0A%20%20%20%20%20%20%20%20ax.legend(lines%2C%20%5Bln.get_label()%20for%20ln%20in%20lines%5D%2C%20loc%3D%22upper%20left%22%2C%20fontsize%3D8%2C%20ncols%3D2)%0A%20%20%20%20%20%20%20%20for%20ax%20in%20axes%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.axvspan(750%2C%201500%2C%20color%3Dlight_dark(%22%231a5f8a%22%2C%20%22%236ab0d4%22)%2C%20alpha%3D0.07%2C%20lw%3D0)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.grid(alpha%3D0.3)%0A%20%20%20%20%20%20%20%20axes%5B0%5D.set_title(%22Every%20failure%20anchors%20first%2C%20then%20breaks%20during%20the%20high-LR%20plateau%22)%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(arm%2C%20traj)%3A%0A%20%20%20%20_t%20%3D%20arm(%22trajectories%22)%0A%20%20%20%20_bad%20%3D%20%5Br%20for%20r%20in%20_t%20if%20classify(r)%20!%3D%20%22clean%22%5D%0A%0A%20%20%20%20def%20_timing(r)%3A%0A%20%20%20%20%20%20%20%20z%20%3D%20traj(r%2C%20%22z0_red%22)%0A%20%20%20%20%20%20%20%20hi%20%3D%20np.flatnonzero(z%20%3E%200.9)%0A%20%20%20%20%20%20%20%20drops%20%3D%20%5Bi%20for%20i%20in%20np.flatnonzero(z%20%3C%200.7)%20if%20len(hi)%20and%20i%20%3E%20hi%5B0%5D%5D%0A%20%20%20%20%20%20%20%20return%20hi%5B0%5D%20*%20TRAJ_STRIDE%20if%20len(hi)%20else%20None%2C%20drops%5B0%5D%20*%20TRAJ_STRIDE%20if%20drops%20else%20None%0A%0A%20%20%20%20_anchored%20%3D%20%5B_timing(r)%5B0%5D%20for%20r%20in%20_bad%5D%0A%20%20%20%20_drops%20%3D%20%5Bt%20for%20t%20in%20(_timing(r)%5B1%5D%20for%20r%20in%20_bad)%20if%20t%20is%20not%20None%5D%0A%20%20%20%20_w_anchor%20%3D%20realize_timeline(Timeline(Dopesheet.from_csv(io.StringIO(make_dopesheet(0.10%2C%20True)))))%5B%0A%20%20%20%20%20%20%20%20%22anchor%22%0A%20%20%20%20%5D.to_numpy()%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20All%20%7Blen(_bad)%7D%20failing%20runs%20reached%20z%E2%82%80(red)%20%3E%200.9%2C%20a%20clean%20anchor%2C%20between%20steps%0A%20%20%20%20%7Bmin(_anchored)%7D%20and%20%7Bmax(_anchored)%7D%2C%20right%20as%20the%20LR%20approaches%20its%20peak.%20The%20%7Blen(_drops)%7D%0A%20%20%20%20that%20later%20lost%20it%20did%20so%20between%20steps%20%7Bmin(_drops)%7D%20and%20%7Bmax(_drops)%7D.%20Seeds%2022%20and%208%20slip%0A%20%20%20%20the%20moment%20the%20LR%20tops%20out%2C%20and%20reconstruction%20collapses%20outright%20on%2022.%20Seeds%2015%20and%2027%20slip%0A%20%20%20%20only%20once%20the%20anchor%20weight%20has%20annealed%20low%3A%20by%20step%20%7Bmax(_drops)%7D%20it%20is%0A%20%20%20%20%7Bfloat(_w_anchor%5Bmin(max(_drops)%2C%20len(_w_anchor)%20-%201)%5D)%3A.3f%7D%2C%20too%20weak%20to%20pull%20red%20back.%0A%0A%20%20%20%20So%20the%20anchored%20solution%20seems%20to%20be%20metastable%20at%20this%20learning%20rate.%20The%20regularizers%20hold%0A%20%20%20%20it%20in%20place%20while%20they%20are%20on%2C%20and%20the%20timed%20anneal%20removes%20that%20hold%20while%20the%20optimizer%20is%0A%20%20%20%20still%20hot.%20Nothing%20about%20these%20seeds%20stopped%20them%20from%20anchoring%3B%20they%20were%20unlucky%20during%20the%0A%20%20%20%20plateau.%20If%20that%20is%20right%2C%20whether%20a%20run%20fails%20should%20follow%20the%20randomness%20of%20training%20rather%0A%20%20%20%20than%20the%20initialization%2C%20which%20we%20test%20below.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Init%20versus%20data%20stream%0A%0A%20%20%20%20The%20attribution%20arm%20retrains%2016%20inits%20%C3%97%208%20batch%2Flabel%20streams%20under%20the%0A%20%20%20%20original%20schedule.%20If%20failures%20come%20from%20the%20init%2C%20the%20two%20inits%20whose%0A%20%20%20%20earlier%20runs%20failed%20catastrophically%20(22%20and%2027)%20should%20fail%20again.%20If%20they%0A%20%20%20%20come%20from%20the%20luck%20of%20training%2C%20they%20should%20scatter%20across%20the%20grid%20instead.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(arm)%3A%0A%20%20%20%20_att%20%3D%20arm(%22attribution%22)%0A%20%20%20%20_inits%20%3D%20sorted(%7Br%5B%22seed%22%5D%20for%20r%20in%20_att%7D%2C%20key%3Dlambda%20s%3A%20(s%20%3E%3D%2014%2C%20s))%0A%20%20%20%20_streams%20%3D%20sorted(%7Br%5B%22stream%22%5D%20for%20r%20in%20_att%7D)%0A%20%20%20%20_leak%20%3D%20np.zeros((len(_inits)%2C%20len(_streams)))%0A%20%20%20%20_fail%20%3D%20np.zeros_like(_leak%2C%20dtype%3Dbool)%0A%20%20%20%20for%20_r%20in%20_att%3A%0A%20%20%20%20%20%20%20%20_i%2C%20_j%20%3D%20_inits.index(_r%5B%22seed%22%5D)%2C%20_streams.index(_r%5B%22stream%22%5D)%0A%20%20%20%20%20%20%20%20_leak%5B_i%2C%20_j%5D%20%3D%20_r%5B%22leak%22%5D%0A%20%20%20%20%20%20%20%20_fail%5B_i%2C%20_j%5D%20%3D%20classify(_r)%20!%3D%20%22clean%22%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22attribution%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3Df%22%22%22%0A%20%20%20%20%20%20%20%20Heatmap%20of%20final%20leakage%20over%20a%2016-by-8%20grid.%20Model%20inits%20run%20down%20the%20rows%20(0%20through%0A%20%20%20%20%20%20%20%2013%2C%20then%20the%20two%20earlier%20catastrophic%20inits%2022%20and%2027)%2C%20and%20batch%2Flabel%20streams%20run%0A%20%20%20%20%20%20%20%20across%20the%20columns.%20Most%20cells%20are%20pale%2C%20with%20leak%20around%20%7Bnp.median(_leak)%3A.2f%7D.%20The%0A%20%20%20%20%20%20%20%20%7Bint(_fail.sum())%7D%20failed%20cells%20are%20marked%20with%20crosses%20and%20scatter%20across%20the%20grid%3A%20no%0A%20%20%20%20%20%20%20%20row%20has%20more%20than%20%7Bint(_fail.sum(1).max())%7D%20of%208%2C%20and%20the%20rows%20for%20inits%2022%20and%2027%20are%0A%20%20%20%20%20%20%20%20entirely%20clean.%20The%20darkest%20cell%20is%20init%201%20under%20stream%201%2C%20with%20leak%20%7B_leak.max()%3A.2f%7D.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20fig%2C%20ax%20%3D%20plt.subplots(figsize%3D(6.5%2C%206)%2C%20layout%3D%22constrained%22)%0A%20%20%20%20%20%20%20%20_cmap%20%3D%20LinearSegmentedColormap.from_list(%22leak%22%2C%20light_dark(%5B%22%23eef3f7%22%2C%20%22%231a5f8a%22%5D%2C%20%5B%22%2320242a%22%2C%20%22%236ab0d4%22%5D))%0A%20%20%20%20%20%20%20%20im%20%3D%20ax.imshow(_leak%2C%20cmap%3D_cmap%2C%20vmin%3D0%2C%20vmax%3D0.35%2C%20aspect%3D%22auto%22)%0A%20%20%20%20%20%20%20%20for%20i%20in%20range(len(_inits))%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20j%20in%20range(len(_streams))%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20_fail%5Bi%2C%20j%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.text(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20j%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20i%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%C3%97%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ha%3D%22center%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20va%3D%22center%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20color%3Dlight_dark(%22%23d55e00%22%2C%20%22%23ffb000%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fontsize%3D13%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20path_effects%3D%5Bpe.withStroke(linewidth%3D2%2C%20foreground%3Dlight_dark(%22%23ffffff%22%2C%20%22%23000000%22))%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20ax.set_xticks(range(len(_streams))%2C%20%5Bstr(s)%20for%20s%20in%20_streams%5D)%0A%20%20%20%20%20%20%20%20ax.set_yticks(range(len(_inits))%2C%20%5Bstr(s)%20for%20s%20in%20_inits%5D)%0A%20%20%20%20%20%20%20%20ax.set(xlabel%3D%22batch%2Flabel%20stream%22%2C%20ylabel%3D%22model%20init%22)%0A%20%20%20%20%20%20%20%20fig.colorbar(im%2C%20ax%3Dax%2C%20label%3D%22final%20leak%20(mean%20%7Cz%E2%82%80%7C%2C%20non-red)%22%2C%20shrink%3D0.8)%0A%20%20%20%20%20%20%20%20ax.set_title(%22Failures%20(%C3%97)%20scatter%20across%20inits%20%E2%80%94%20including%2022%20and%2027%22)%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(arm)%3A%0A%20%20%20%20_att%20%3D%20arm(%22attribution%22)%0A%20%20%20%20_fails%20%3D%20%5Br%20for%20r%20in%20_att%20if%20classify(r)%20!%3D%20%22clean%22%5D%0A%20%20%20%20_cats%20%3D%20%5Br%20for%20r%20in%20_att%20if%20classify(r)%20%3D%3D%20%22catastrophic%22%5D%0A%20%20%20%20_by_init%2C%20_by_stream%20%3D%20%7B%7D%2C%20%7B%7D%0A%20%20%20%20for%20_r%20in%20_fails%3A%0A%20%20%20%20%20%20%20%20_by_init%5B_r%5B%22seed%22%5D%5D%20%3D%20_by_init.get(_r%5B%22seed%22%5D%2C%200)%20%2B%201%0A%20%20%20%20%20%20%20%20_by_stream%5B_r%5B%22stream%22%5D%5D%20%3D%20_by_stream.get(_r%5B%22stream%22%5D%2C%200)%20%2B%201%0A%20%20%20%20_n2227%20%3D%20sum(1%20for%20r%20in%20_fails%20if%20r%5B%22seed%22%5D%20in%20(22%2C%2027))%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20Inits%2022%20and%2027%2C%20catastrophic%20under%20their%20earlier%20streams%2C%20trained%20cleanly%20under%20**all%208%20fresh%0A%20%20%20%20streams**%20(%7B_n2227%7D%20failures%20between%20them).%20The%20%7Blen(_fails)%7D%20unhealthy%20runs%20(of%20128%3B%0A%20%20%20%20%7Blen(_cats)%7D%20catastrophic)%20instead%20scatter%20across%20%7Blen(_by_init)%7D%20different%20inits%2C%20none%20failing%0A%20%20%20%20more%20than%20%7Bmax(_by_init.values())%7D%20of%208%2C%20with%20mild%20clustering%20by%20stream%20(stream%206%20accounts%20for%0A%20%20%20%20%7B_by_stream.get(6%2C%200)%7D).%20So%20the%20incompatible-init%20hypothesis%20does%20not%20hold%3A%20the%20same%20init%0A%20%20%20%20succeeds%20or%20fails%20depending%20on%20which%20random%20batches%20and%20label%20draws%20it%20sees%20during%20the%20hot%0A%20%20%20%20phase.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Learning%20rate%20versus%20regularizer%20anneal%0A%0A%20%20%20%20At%20first%20the%20anneal%20looked%20responsible%2C%20since%20it%20removes%20the%20hold%20the%20anchor%0A%20%20%20%20term%20provides.%20But%20the%20sweep%20says%20otherwise%3A%20holding%20the%20regularizers%20on%20to%20the%0A%20%20%20%20end%20(%60anneal%20off%60)%20makes%20things%20worse%20at%20every%20peak%2C%20while%20halving%20the%20LR%0A%20%20%20%20peak%20removes%20the%20failures%20entirely.%20These%20runs%20train%20with%20the%20fallback%20term%0A%20%20%20%20and%20are%20scored%20by%20the%20redirect%20intervention%2C%20as%20in%20ex-2.9.2.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(sweep_cell)%3A%0A%20%20%20%20_cells%20%3D%20%5B(p%2C%20a)%20for%20p%20in%20PEAK_LRS%20for%20a%20in%20(True%2C%20False)%5D%0A%20%20%20%20_scores%20%3D%20%7Bc%3A%20np.array(%5Br%5B%22interventions%22%5D%5B%22redirect%22%5D%5B%22score%22%5D%20for%20r%20in%20sweep_cell(*c)%5D)%20for%20c%20in%20_cells%7D%0A%20%20%20%20_leaks%20%3D%20%7Bc%3A%20np.array(%5Br%5B%22leak%22%5D%20for%20r%20in%20sweep_cell(*c)%5D)%20for%20c%20in%20_cells%7D%0A%20%20%20%20_nbad%20%3D%20%7Bc%3A%20sum(classify(r)%20!%3D%20%22clean%22%20for%20r%20in%20sweep_cell(*c))%20for%20c%20in%20_cells%7D%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22sweep%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3Df%22%22%22%0A%20%20%20%20%20%20%20%20Two%20strip%20plots%20stacked%20over%20eight%20conditions%3A%20peak%20learning%20rates%200.10%2C%200.07%2C%200.05%2C%0A%20%20%20%20%20%20%20%20and%200.03%2C%20each%20with%20the%20regularizer%20anneal%20on%20(blue)%20or%20off%20(gray)%2C%2032%20seeds%20per%0A%20%20%20%20%20%20%20%20condition.%20Top%3A%20redirect%20selectivity%20scores.%20Medians%20hover%20around%200.87%20to%200.91%0A%20%20%20%20%20%20%20%20everywhere%2C%20but%200.03%20with%20anneal%20sits%20lower%20at%20%7Bnp.median(_scores%5B(0.03%2C%20True)%5D)%3A.2f%7D%2C%0A%20%20%20%20%20%20%20%20and%20one%20blue%20outlier%20at%200.10%20falls%20to%20%7B_scores%5B(0.10%2C%20True)%5D.min()%3A.2f%7D.%20Bottom%3A%20final%0A%20%20%20%20%20%20%20%20leakage%20on%20a%20log%20scale%2C%20with%20a%20dashed%20line%20at%20the%200.1%20degraded%20threshold.%20With%20the%0A%20%20%20%20%20%20%20%20anneal%20on%2C%20leak%20tightens%20as%20the%20peak%20drops%2C%20and%20at%200.05%20no%20seed%20crosses%20the%20line.%20With%0A%20%20%20%20%20%20%20%20the%20anneal%20off%2C%20every%20condition%20has%20a%20tail%20of%204%20to%208%20seeds%20above%20the%20line.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20fig%2C%20axes%20%3D%20plt.subplots(2%2C%201%2C%20figsize%3D(9.5%2C%206.5)%2C%20sharex%3DTrue%2C%20height_ratios%3D%5B2%2C%201.4%5D)%0A%20%20%20%20%20%20%20%20rng%20%3D%20np.random.default_rng(0)%0A%20%20%20%20%20%20%20%20colors%20%3D%20%7BTrue%3A%20light_dark(%22%231a5f8a%22%2C%20%22%236ab0d4%22)%2C%20False%3A%20light_dark(%22%239aa5b1%22%2C%20%22%236b7686%22)%7D%0A%20%20%20%20%20%20%20%20for%20ax%2C%20data%20in%20zip(axes%2C%20(_scores%2C%20_leaks)%2C%20strict%3DTrue)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20gi%2C%20(p%2C%20a)%20in%20enumerate(_cells)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20x0%20%3D%20gi%20%2B%20rng.uniform(-0.13%2C%200.13%2C%20len(data%5B(p%2C%20a)%5D))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.scatter(x0%2C%20data%5B(p%2C%20a)%5D%2C%20s%3D14%2C%20color%3Dcolors%5Ba%5D%2C%20alpha%3D0.75%2C%20lw%3D0)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(%5Bgi%20-%200.22%2C%20gi%20%2B%200.22%5D%2C%20%5Bnp.median(data%5B(p%2C%20a)%5D)%5D%20*%202%2C%20color%3Dcolors%5Ba%5D%2C%20lw%3D2)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.grid(alpha%3D0.3%2C%20axis%3D%22y%22)%0A%20%20%20%20%20%20%20%20axes%5B0%5D.set(ylabel%3D%22score%20(R%C2%B2%2C%20redirect)%22%2C%20ylim%3D(0%2C%201.02))%0A%20%20%20%20%20%20%20%20axes%5B1%5D.axhline(0.1%2C%20ls%3D%22--%22%2C%20lw%3D1%2C%20color%3Dlight_dark(%22%23000%22%2C%20%22%23fff%22)%2C%20alpha%3D0.5)%0A%20%20%20%20%20%20%20%20axes%5B1%5D.text(7.45%2C%200.1%2C%20%22degraded%22%2C%20va%3D%22bottom%22%2C%20ha%3D%22right%22%2C%20fontsize%3D8%2C%20alpha%3D0.8)%0A%20%20%20%20%20%20%20%20axes%5B1%5D.set(ylabel%3D%22final%20leak%22%2C%20yscale%3D%22log%22%2C%20xlabel%3D%22peak%20LR%20%C3%97%20anneal%22)%0A%20%20%20%20%20%20%20%20axes%5B1%5D.set_xticks(range(len(_cells))%2C%20%5Bf%22%7Bp%7D%5Cn%7B'anneal'%20if%20a%20else%20'hold'%7D%22%20for%20p%2C%20a%20in%20_cells%5D)%0A%20%20%20%20%20%20%20%20handles%20%3D%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20plt.Line2D(%5B%5D%2C%20%5B%5D%2C%20marker%3D%22o%22%2C%20ls%3D%22%22%2C%20color%3Dc%2C%20label%3Dlbl)%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20lbl%2C%20c%20in%20((%22anneal%20on%22%2C%20colors%5BTrue%5D)%2C%20(%22anneal%20off%20(hold)%22%2C%20colors%5BFalse%5D))%0A%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20axes%5B0%5D.legend(handles%3Dhandles%2C%20loc%3D%22lower%20left%22)%0A%20%20%20%20%20%20%20%20axes%5B0%5D.set_title(%22Redirect%20score%20and%20leakage%20across%20the%20schedule%20sweep%20(32%20seeds%20per%20cell)%22)%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(sweep_cell)%3A%0A%20%20%20%20_hot%2C%20_cool%20%3D%20sweep_cell(0.10%2C%20True)%2C%20sweep_cell(0.05%2C%20True)%0A%20%20%20%20_cold%20%3D%20sweep_cell(0.03%2C%20True)%0A%20%20%20%20_nbad%20%3D%20lambda%20rs%3A%20sum(classify(r)%20!%3D%20%22clean%22%20for%20r%20in%20rs)%20%20%23%20noqa%3A%20E731%0A%20%20%20%20_rd%20%3D%20lambda%20rs%3A%20np.array(%5Br%5B%22interventions%22%5D%5B%22redirect%22%5D%5B%22score%22%5D%20for%20r%20in%20rs%5D)%20%20%23%20noqa%3A%20E731%0A%20%20%20%20_rc%20%3D%20lambda%20rs%3A%20np.array(%5Br%5B%22val_recon%22%5D%20for%20r%20in%20rs%5D)%20%20%23%20noqa%3A%20E731%0A%20%20%20%20_hold_bad%20%3D%20sum(_nbad(sweep_cell(p%2C%20False))%20for%20p%20in%20PEAK_LRS)%0A%20%20%20%20_hold_rc%20%3D%20np.median(np.concatenate(%5B_rc(sweep_cell(p%2C%20False))%20for%20p%20in%20PEAK_LRS%5D))%0A%20%20%20%20_gamma%20%3D%20%5Br%20for%20r%20in%20_hot%20if%20r%5B%22interventions%22%5D%5B%22redirect%22%5D%5B%22red_pure%22%5D%20%3C%200.05%20and%20classify(r)%20%3D%3D%20%22clean%22%5D%0A%20%20%20%20_hot_ok%20%3D%20np.array(%5Br%5B%22interventions%22%5D%5B%22redirect%22%5D%5B%22score%22%5D%20for%20r%20in%20_hot%20if%20r%20not%20in%20_gamma%5D)%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20Three%20results%20come%20out%20of%20the%20sweep.%0A%0A%20%20%20%20First%2C%20peak%20LR%200.05%20with%20the%20anneal%20is%20the%20safe%20cell%3A%20%7B_nbad(_cool)%7D%2F32%20unhealthy%20runs%0A%20%20%20%20(0.10%20gives%20%7B_nbad(_hot)%7D%3B%200.07%20gives%20%7B_nbad(sweep_cell(0.07%2C%20True))%7D)%2C%20a%20median%20score%20of%0A%20%20%20%20%7Bnp.median(_rd(_cool))%3A.2f%7D%2C%20and%20reconstruction%20as%20good%20as%20the%20hot%20cell%20(median%0A%20%20%20%20%7Bnp.median(_rc(_cool))%3A.6f%7D%20versus%20%7Bnp.median(_rc(_hot))%3A.6f%7D).%20On%20the%20other%0A%20%20%20%20hand%2C%20at%200.03%20the%20model%20doesn't%20train%20properly%2C%20with%20%7B_nbad(_cold)%7D%20leaky%0A%20%20%20%20runs%20and%20a%20median%20score%20of%20%7Bnp.median(_rd(_cold))%3A.2f%7D.%0A%0A%20%20%20%20Second%2C%20the%20anneal%20should%20be%20kept.%20Holding%20the%20regularizers%20on%20lowers%20typical%20leak%20a%0A%20%20%20%20little%2C%20but%20it%20widens%20the%20tail%3A%20%7B_hold_bad%7D%20leaky%20runs%20across%20the%20four%20hold%20cells%20versus%0A%20%20%20%20%7Bsum(_nbad(sweep_cell(p%2C%20True))%20for%20p%20in%20PEAK_LRS)%7D%20with%20the%20anneal%2C%20because%20the%20live%20anchor%0A%20%20%20%20term%20keeps%20pulling%20pinkish-labeled%20samples%20onto%20the%20axis%20in%20unlucky%20runs.%20Holding%20on%20also%0A%20%20%20%20costs%20about%2010%C3%97%20in%20reconstruction%20(median%20%7B_hold_rc%3A.6f%7D%20versus%0A%20%20%20%20%7Bnp.median(np.concatenate(%5B_rc(sweep_cell(p%2C%20True))%20for%20p%20in%20PEAK_LRS%5D))%3A.6f%7D).%0A%0A%20%20%20%20Third%2C%20%CE%B3%20should%20be%20calibrated%20per%20model.%20The%20worst%20hot-cell%20score%20(%7B_rd(_hot).min()%3A.2f%7D%2C%20seed%0A%20%20%20%20%7Bmin(_hot%2C%20key%3Dlambda%20r%3A%20r%5B%22interventions%22%5D%5B%22redirect%22%5D%5B%22score%22%5D)%5B%22seed%22%5D%7D)%20anchored%0A%20%20%20%20cleanly%2C%20but%20the%20redirect's%20fixed%20%CE%B3%20%3D%201%20bias%20was%20too%20small%20to%20dominate%20that%20seed's%0A%20%20%20%20pre-norm%20scale%2C%20so%20%22deleted%22%20red%20passed%20through%20almost%20untouched%20(damage%20to%0A%20%20%20%20pure%20red%20%7Bmin(r%5B%22interventions%22%5D%5B%22redirect%22%5D%5B%22red_pure%22%5D%20for%20r%20in%20_hot)%3A.3f%7D).%0A%20%20%20%20Excluding%20it%2C%20the%20hot%20cell's%20floor%20is%20%7B_hot_ok.min()%3A.2f%7D.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(arm)%3A%0A%20%20%20%20_base%20%3D%20arm(%22trajectories%22)%20%2B%20arm(%22attribution%22)%0A%20%20%20%20_fb%20%3D%20arm(%22sweep%22)%0A%20%20%20%20_cat%20%3D%20lambda%20rs%3A%20sum(classify(r)%20%3D%3D%20%22catastrophic%22%20for%20r%20in%20rs)%20%20%23%20noqa%3A%20E731%0A%20%20%20%20_like%20%3D%20%5Br%20for%20r%20in%20_fb%20if%20r%5B%22peak_lr%22%5D%20%3D%3D%200.10%20and%20r%5B%22anneal%22%5D%5D%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20%23%23%20The%20fallback%20term%20looks%20like%20a%20stabilizer%0A%0A%20%20%20%20Catastrophic%20failures%20%E2%80%94%20meaning%20the%20anchor%20was%20lost%2C%20reconstruction%0A%20%20%20%20collapsed%2C%20or%20leak%20went%20beyond%200.3%20%E2%80%94%20occurred%20only%20in%20the%20fallback-free%0A%20%20%20%20arms%3A%20%7B_cat(_base)%7D%20of%20%7Blen(_base)%7D%20base-config%20runs%2C%20against%20**%7B_cat(_fb)%7D%0A%20%20%20%20of%20%7Blen(_fb)%7D**%20fallback-trained%20runs%20across%20all%20eight%20schedules%0A%20%20%20%20(%7B_cat(_like)%7D%20of%20%7Blen(_like)%7D%20in%20the%20like-for-like%20cell%2C%20the%20same%20schedule%0A%20%20%20%20as%20the%20base%20arms).%20Ex-2.9.2%20saw%20this%20pattern%20at%2032%20seeds%20and%20was%20careful%0A%20%20%20%20about%20reading%20much%20into%20it%2C%20since%20one%20extra%20loss%20term%20is%20hard%20to%20tell%20apart%0A%20%20%20%20from%20luck%20at%20that%20scale.%20At%20%7Blen(_fb)%7D%20runs%20the%20pattern%20has%20held%20without%0A%20%20%20%20exception.%0A%0A%20%20%20%20A%20mechanism%20seems%20plausible.%20The%20fallback%20term%20pins%20the%20decoder's%20output%20at%0A%20%20%20%20%E2%88%92e%E2%82%80%2C%20which%20flattens%20the%20loss%20landscape%20around%20the%20redirect%20direction%20and%20may%0A%20%20%20%20remove%20the%20direction%20along%20which%20the%20instability%20grows.%20Only%20the%0A%20%20%20%20like-for-like%20cell%20is%20a%20clean%20comparison%2C%20so%20the%20schedule%20confound%20prevents%0A%20%20%20%20this%20from%20being%20conclusive.%20Still%2C%20this%20is%20now%20the%20second%20experiment%20in%0A%20%20%20%20which%20fallback%20training%20produced%20zero%20catastrophes.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(arm%2C%20sweep_cell)%3A%0A%20%20%20%20_cool%20%3D%20sweep_cell(0.05%2C%20True)%0A%20%20%20%20_rd%20%3D%20np.array(%5Br%5B%22interventions%22%5D%5B%22redirect%22%5D%5B%22score%22%5D%20for%20r%20in%20_cool%5D)%0A%20%20%20%20_bad_t%20%3D%20%5Br%20for%20r%20in%20arm(%22trajectories%22)%20if%20classify(r)%20!%3D%20%22clean%22%5D%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20%23%23%20Conclusion%0A%0A%20%20%20%20The%20%22schedule%20incompatible%20with%20some%20seeds%22%20hypothesis%20does%20not%20hold%20up%0A%20%20%20%20under%20either%20test.%20Failures%20come%20late%3A%20every%20failing%20run%20anchored%20first%20and%0A%20%20%20%20broke%20only%20during%20the%200.1-LR%20plateau.%20And%20they%20follow%20the%20data%20stream%20rather%0A%20%20%20%20than%20the%20init%3A%20the%20earlier%20bad%20inits%20trained%20cleanly%20under%20fresh%20streams%2C%20and%0A%20%20%20%20the%20failures%20scatter.%20The%20anchored%20solution%20is%20metastable%20when%20the%20optimizer%0A%20%20%20%20is%20too%20hot%2C%20and%20whether%20a%20run%20stays%20clean%20comes%20down%20to%20the%20luck%20of%20the%20batch%0A%20%20%20%20stream.%0A%0A%20%20%20%20For%20M2%20defaults%3A%0A%0A%20%20%20%20-%20Reduce%20the%20LR.%20That%20cell%20had%200%2F32%20unhealthy%20runs%2C%20scores%20%7B_rd.min()%3A.2f%7D%0A%20%20%20%20%20%20to%20%7B_rd.max()%3A.2f%7D%20(median%20%7Bnp.median(_rd)%3A.2f%7D)%2C%20and%20reconstruction%20as%0A%20%20%20%20%20%20good%20as%20the%20hot%20schedule.%20Reducing%20it%20only%20during%20the%20anneal%20phase%20may%20be%0A%20%20%20%20%20%20enough.%0A%20%20%20%20-%20Keep%20the%20fallback%20term%2C%20both%20for%20its%20designed%20purpose%20(a%20predictable%0A%20%20%20%20%20%20intervention%20response)%20and%20for%20its%20apparent%20side%20effect%20of%20preventing%0A%20%20%20%20%20%20catastrophic%20training%20failures.%0A%20%20%20%20-%20Calibrate%20the%20redirect's%20%CE%B3%20against%20the%20model's%20pre-norm%20activation%20scale.%0A%20%20%20%20%20%20A%20fixed%20%CE%B3%20%3D%201%20silently%20no-ops%20on%20about%201%20run%20in%20250.%0A%20%20%20%20-%20Keep%20the%20cheap%20endpoint%20screening%20(leak%20%3C%200.1%2C%20anchor%20loss%2C%20recon).%20Even%0A%20%20%20%20%20%20the%20safe%20cell%20only%20bounds%20what%20we%20measured%2C%20and%20the%20failure%20mechanism%20is%0A%20%20%20%20%20%20chaotic.%0A%0A%20%20%20%20A%20tuned%20schedule%20fixes%20the%20symptom%20but%20still%20requires%20tuning.%0A%20%20%20%20%5BEx-2.9.4%5D(..%2Fex-2.9.4%2Freport.py)%20asks%20whether%20the%20weights%20can%20instead%0A%20%20%20%20respond%20to%20the%20training%20signals%20themselves%2C%20which%20would%20remove%20the%20timing%0A%20%20%20%20coupling%20altogether.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
7d5d48436dec42c50879f377804d0505