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.2%3A%20fallback%20control%20for%20deleting%20red%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%20json%0A%20%20%20%20import%20tempfile%0A%20%20%20%20from%20pathlib%20import%20Path%0A%0A%20%20%20%20import%20marimo%20as%20mo%20%20%23%20noqa%3A%20F401%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%20%20%20%20import%20numpy%20as%20np%0A%0A%20%20%20%20from%20sca.colorcube%20import%20plot_latent_disc%0A%20%20%20%20from%20mini.reports%20import%20report_bundle%2C%20use_publisher%0A%20%20%20%20from%20mini.store%20import%20project_store%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.2%2Fmetrics%22%0A%20%20%20%20EXEMPLAR_REFS%20%3D%20%7B%22base%22%3A%20%22reports%2Fex-2.9.2%2Fexemplar-base%22%2C%20%22fallback%22%3A%20%22reports%2Fex-2.9.2%2Fexemplar-fallback%22%7D%0A%20%20%20%20INTERVENTIONS%20%3D%20(%22zero%22%2C%20%22oa%22%2C%20%22oa-nontarget%22%2C%20%22reflect%22%2C%20%22redirect%22)%0A%20%20%20%20VARIANTS%20%3D%20(%22base%22%2C%20%22fallback%22)%0A%0A%20%20%20%20def%20load_results()%20-%3E%20tuple%5Blist%5Bdict%5D%2C%20dict%5Bstr%2C%20dict%5Bstr%2C%20np.ndarray%5D%5D%5D%20%7C%20None%3A%0A%20%20%20%20%20%20%20%20%22%22%22Resolve%20per-run%20metrics%20and%20the%20exemplar%20eval%20dumps%20from%20the%20store%2C%20or%20None%20if%20unpublished.%22%22%22%0A%20%20%20%20%20%20%20%20store%20%3D%20project_store()%0A%20%20%20%20%20%20%20%20arts%20%3D%20%7B%7D%0A%20%20%20%20%20%20%20%20for%20v%2C%20ref%20in%20EXEMPLAR_REFS.items()%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(art%20%3A%3D%20store.get_ref(ref))%20is%20None%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20None%0A%20%20%20%20%20%20%20%20%20%20%20%20arts%5Bv%5D%20%3D%20art%0A%20%20%20%20%20%20%20%20metrics_art%20%3D%20store.get_ref(METRICS_REF)%0A%20%20%20%20%20%20%20%20if%20metrics_art%20is%20None%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20None%0A%20%20%20%20%20%20%20%20with%20tempfile.TemporaryDirectory()%20as%20d%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20metrics%20%3D%20json.loads(store.get(metrics_art%2C%20Path(d)%20%2F%20%22metrics.json%22).read_text())%0A%20%20%20%20%20%20%20%20%20%20%20%20exemplars%20%3D%20%7B%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20v%2C%20art%20in%20arts.items()%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20with%20np.load(store.get(art%2C%20Path(d)%20%2F%20f%22%7Bv%7D.npz%22))%20as%20z%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exemplars%5Bv%5D%20%3D%20dict(z)%0A%20%20%20%20%20%20%20%20return%20metrics%2C%20exemplars%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.2%3A%20fallback%20control%20for%20deleting%20*red*%0A%0A%20%20%20%20%5BEx-2.9.1%5D(..%2Fex-2.9.1%2Freport.py)%20reproduced%20the%20main%20M1%20result%3A%20anchor%0A%20%20%20%20*red*%20to%20latent%20axis%200%2C%20zero%20the%20axis%2C%20and%20the%20reconstruction%20error%0A%20%20%20%20concentrates%20on%20red-like%20colors.%20It%20also%20reproduced%20the%20main%20weakness%3A%20the%0A%20%20%20%20outcome%20varies%20a%20lot%20with%20the%20random%20seed.%20The%20original%20study%20handled%20that%0A%20%20%20%20with%20a%2060-seed%20sweep%20and%20Pareto%20selection%2C%20but%20that%20won't%20scale%3A%20as%20models%0A%20%20%20%20grow%2C%20the%20chance%20that%20any%20given%20seed%20allows%20clean%20intervention%20may%20shrink.%0A%20%20%20%20So%20this%20experiment%20tries%20a%20different%20approach.%0A%0A%20%20%20%20The%20SCA%20paper%20suggests%20optimal%20ablation%0A%20%20%20%20(%5BLi%20%26%20Janson%202024%5D(https%3A%2F%2Farxiv.org%2Fabs%2F2409.09951))%20as%20a%20fix%3A%20replace%20the%0A%20%20%20%20removed%20component%20with%20an%20optimized%20constant.%20We%20test%20that%20and%20also%20a%0A%20%20%20%20training-time%20alternative%20we'll%20call%20%22fallback%20control%22.%20The%20plan%20is%20to%0A%20%20%20%20teach%20the%20decoder%2C%20during%20training%2C%20what%20to%20output%20once%20the%20concept%20has%20been%0A%20%20%20%20removed.%0A%0A%20%20%20%20%23%23%20Why%20weight%20ablation%20is%20noisy%0A%0A%20%20%20%20The%20bottleneck%20is%20unit-normalized%2C%20so%20zeroing%20an%20encoder%20axis%20renormalizes%0A%20%20%20%20whatever%20is%20left.%20For%20a%20red-like%20input%20the%20remainder%20is%20small%20and%20close%20to%0A%20%20%20%20random%2C%20just%20the%20residual%20geometry%20that%20this%20particular%20seed%20happened%20to%0A%20%20%20%20produce%2C%20so%20ablated%20red%20is%20decoded%20as%20some%20other%20arbitrary%20color.%20Li%20%26%0A%20%20%20%20Janson%20call%20this%20%22spoofing%22%3A%20the%20intervention%20removes%20the%20concept%20and%0A%20%20%20%20inserts%20a%20random%20claim%20about%20the%20input.%20Two%20seeds%20with%20identical%20anchoring%0A%20%20%20%20quality%20can%20then%20score%20very%20differently%2C%20purely%20on%20where%20red%20happens%20to%0A%20%20%20%20land.%0A%0A%20%20%20%20Optimal%20ablation%20measures%20importance%20while%20minimizing%20spoofing.%20It%20replaces%0A%20%20%20%20the%20removed%20component%20with%20the%20constant%20%24a%5E*%20%3D%20%5Carg%5Cmin_a%20%5Cmathbb%7BE%7D%5B%5Cmathcal%7BL%7D%5D%24%2C%0A%20%20%20%20the%20value%20that%20affects%20loss%20the%20least.%20But%20for%20concept%20removal%2C%20that%0A%20%20%20%20objective%20points%20the%20wrong%20way%3A%20the%20loss%20it%20minimizes%20includes%20the%20target's%0A%20%20%20%20own%20loss%2C%20so%20%24a%5E*%24%20gets%20pulled%20toward%20whatever%20constant%20best%20restores%20*red*.%0A%20%20%20%20We%20evaluate%20both%20the%20literal%20method%20(%60oa%60)%20and%20a%20removal-appropriate%20version%0A%20%20%20%20(%60oa-nontarget%60%2C%20which%20optimizes%20the%20constant%20over%20non-red%20colors%20only).%0A%0A%20%20%20%20Fallback%20control%20instead%20makes%20the%20post-removal%20behavior%0A%20%20%20%20a%20trained%20property.%20The%20anti-anchor%20regularizer%20already%20keeps%20the%20direction%0A%20%20%20%20%E2%88%92e%E2%82%80%20empty%2C%20so%20we%20add%20one%20decoder-only%20loss%20term%2C%20MSE(dec(%E2%88%92e%E2%82%80)%2C%20mid-gray).%0A%20%20%20%20This%20pins%20that%20reserved%20direction%20to%20a%20*null*%20output%20of%20our%20choosing.%20A%0A%20%20%20%20model%20that%20has%20genuinely%20lost%20the%20color%20information%20should%20fall%20back%20to%20a%0A%20%20%20%20noncommittal%20guess%2C%20and%20the%20least%20committal%20guess%20over%20the%20RGB%20cube%20is%0A%20%20%20%20mid-gray%2C%20so%20we%20pick%20mid-gray%20as%20*null*.%20An%20intervention%20can%20then%20redirect%0A%20%20%20%20red%20to%20%E2%88%92e%E2%82%80%20and%20get%20a%20predictable%20response.%0A%0A%20%20%20%20%23%23%20Conditions%0A%0A%20%20%20%20We%20run%20two%20training%20variants%2C%20otherwise%20identical%20to%20ex-2.9.1%20(same%20model%2C%0A%20%20%20%20data%2C%20dopesheet)%2C%20with%2032%20seeds%20each%3A%20%60base%60%20(ex-2.9.1's%20loss%2C%20unchanged)%0A%20%20%20%20and%20%60fallback%60%20(the%20same%20loss%20plus%200.05%20%C3%97%20the%20fallback%20term).%20Each%20trained%0A%20%20%20%20model%20is%20then%20scored%20under%20five%20weight-level%20interventions%20on%20axis%200%3A%0A%0A%20%20%20%20-%20%60zero%60%20%E2%80%94%20zero%20the%20encoder's%20output%20row%200%20and%20bias%20(the%20status%20quo).%0A%20%20%20%20-%20%60oa%60%20%E2%80%94%20zero%20row%200%2C%20then%20set%20the%20bias%20to%20the%20constant%20that%20minimizes%20mean%0A%20%20%20%20%20%20reconstruction%20error%20over%20the%20full%20grid%20(optimal%20ablation%2C%20taken%0A%20%20%20%20%20%20literally).%0A%20%20%20%20-%20%60oa-nontarget%60%20%E2%80%94%20the%20same%20as%20%60oa%60%2C%20but%20the%20constant%20is%20optimized%20over%0A%20%20%20%20%20%20non-red%20colors%20only.%0A%20%20%20%20-%20%60reflect%60%20%E2%80%94%20negate%20row%200%20and%20bias%2C%20so%20z%E2%82%80%20%E2%86%92%20%E2%88%92z%E2%82%80%20and%20red%20lands%20exactly%20on%0A%20%20%20%20%20%20%E2%88%92e%E2%82%80.%20This%20is%20a%20clean%20redirect%2C%20though%20not%20a%20true%20deletion%2C%20since%20a%20sign%0A%20%20%20%20%20%20flip%20undoes%20it.%0A%20%20%20%20-%20%60redirect%60%20%E2%80%94%20zero%20row%200%20and%20set%20the%20bias%20to%20%E2%88%921.%20The%20redness%20computation%0A%20%20%20%20%20%20is%20deleted%2C%20and%20inputs%20are%20also%20nudged%20toward%20%E2%88%92e%E2%82%80%20in%20proportion%20to%20how%0A%20%20%20%20%20%20much%20of%20their%20pre-norm%20activation%20the%20deletion%20removed.%20This%20is%0A%20%20%20%20%20%20permanent%2C%20like%20%60zero%60%2C%20but%20with%20a%20defined%20destination.%0A%0A%20%20%20%20Each%20run%20is%20scored%20like%20M1%20Ex-2.9.1%3A%20the%20R%C2%B2%20between%20per-color%20reconstruction%0A%20%20%20%20error%20after%20the%20intervention%20and%20(HSV%20similarity%20to%20red)%C2%B3.%20The%20experiment%0A%20%20%20%20lives%20in%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.2%2Fexperiment.py%20--app%20modal%20--max-containers%208%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()%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.2%2Fexperiment.py%20--app%20modal%20--max-containers%208%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%20exemplars%20%3D%20loaded%0A%0A%20%20%20%20def%20stat(variant%3A%20str%2C%20intervention%3A%20str%2C%20field%3A%20str)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20return%20np.array(%5Br%5B%22interventions%22%5D%5Bintervention%5D%5Bfield%5D%20for%20r%20in%20metrics%20if%20r%5B%22variant%22%5D%20%3D%3D%20variant%5D)%0A%0A%20%20%20%20def%20runs(variant%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%22variant%22%5D%20%3D%3D%20variant%5D%0A%0A%20%20%20%20n_seeds%20%3D%20len(runs(%22base%22))%0A%20%20%20%20s_bz%20%3D%20stat(%22base%22%2C%20%22zero%22%2C%20%22score%22)%0A%20%20%20%20s_fr%20%3D%20stat(%22fallback%22%2C%20%22reflect%22%2C%20%22score%22)%0A%20%20%20%20rp_bz%20%3D%20stat(%22base%22%2C%20%22zero%22%2C%20%22red_pure%22)%0A%20%20%20%20rp_fr%20%3D%20stat(%22fallback%22%2C%20%22reflect%22%2C%20%22red_pure%22)%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20**%7Blen(metrics)%7D%20runs%20completed**%20(%7Bn_seeds%7D%20seeds%20%C3%97%202%20variants).%0A%0A%20%20%20%20On%20the%20selectivity%2C%20%60base%20%2B%20zero%60%20gets%20%7Bs_bz.mean()%3A.2f%7D%20%C2%B1%20%7Bs_bz.std()%3A.2f%7D%0A%20%20%20%20(min%20%7Bs_bz.min()%3A.2f%7D)%20and%20%60fallback%20%2B%20reflect%60%20gets%20%7Bs_fr.mean()%3A.2f%7D%20%C2%B1%20%7Bs_fr.std()%3A.2f%7D%0A%20%20%20%20(min%20%7Bs_fr.min()%3A.2f%7D).%20That%20looks%20like%20an%20improvement%2C%20but%20most%20of%20the%20gap%20comes%20from%20two%0A%20%20%20%20base%20seeds%20that%20failed%20badly.%20The%20clear%20change%20is%20in%20the%20response.%20Damage%20to%20pure%20red%20goes%0A%20%20%20%20from%20%7Brp_bz.mean()%3A.2f%7D%20%C2%B1%20%7Brp_bz.std()%3A.2f%7D%20across%20seeds%20to%20%7Brp_fr.mean()%3A.3f%7D%20%C2%B1%0A%20%20%20%20%7Brp_fr.std()%3A.3f%7D%2C%20pinned%20just%20under%20the%20analytic%20%C2%BC%20bound.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%20exemplars%2C%20metrics%2C%20runs%2C%20stat%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%20Selectivity%20across%20seeds%0A%0A%20%20%20%20What%20matters%20here%20is%20what%20happens%20to%20the%20bad%20seeds%2C%20because%20the%20floor%20and%0A%20%20%20%20spread%20of%20the%20distribution%20decide%20how%20many%20seeds%20you%20need%20to%20run.%20Each%20dot%0A%20%20%20%20below%20is%20one%20trained%20model%2C%20and%20the%20bar%20is%20the%20condition's%20median.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(stat)%3A%0A%20%20%20%20_scores%20%3D%20%7B(v%2C%20i)%3A%20stat(v%2C%20i%2C%20%22score%22)%20for%20v%20in%20VARIANTS%20for%20i%20in%20INTERVENTIONS%7D%0A%20%20%20%20_med%20%3D%20%7Bk%3A%20np.median(v)%20for%20k%2C%20v%20in%20_scores.items()%7D%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22scores%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3Df%22%22%22%0A%20%20%20%20%20%20%20%20Strip%20plot%20of%20selectivity%20scores%20(R%20squared)%20for%20ten%20conditions%3A%20five%20interventions%2C%0A%20%20%20%20%20%20%20%20each%20under%20base%20and%20fallback%20training%2C%20with%20about%2032%20dots%20per%20condition.%0A%20%20%20%20%20%20%20%20Base%20plus%20zero%2C%20the%20status%20quo%2C%20has%20a%20median%20of%20%7B_med%5B(%22base%22%2C%20%22zero%22)%5D%3A.2f%7D%2C%20with%20dots%0A%20%20%20%20%20%20%20%20scattered%20down%20to%20%7B_scores%5B(%22base%22%2C%20%22zero%22)%5D.min()%3A.2f%7D.%20The%20oa%20condition%20sits%20lower%0A%20%20%20%20%20%20%20%20(median%20%7B_med%5B(%22base%22%2C%20%22oa%22)%5D%3A.2f%7D%20under%20base%20training).%20Reflect%20and%20redirect%20under%0A%20%20%20%20%20%20%20%20fallback%20training%20form%20the%20tightest%2C%20highest%20clusters%2C%20with%20medians%20of%0A%20%20%20%20%20%20%20%20%7B_med%5B(%22fallback%22%2C%20%22reflect%22)%5D%3A.2f%7D%20and%20%7B_med%5B(%22fallback%22%2C%20%22redirect%22)%5D%3A.2f%7D%20and%0A%20%20%20%20%20%20%20%20no%20dot%20below%20%7Bmin(_scores%5B(%22fallback%22%2C%20%22reflect%22)%5D.min()%2C%20_scores%5B(%22fallback%22%2C%20%22redirect%22)%5D.min())%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(9%2C%204))%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%7B%22base%22%3A%20light_dark(%22%239aa5b1%22%2C%20%22%236b7686%22)%2C%20%22fallback%22%3A%20light_dark(%22%231a5f8a%22%2C%20%22%236ab0d4%22)%7D%0A%20%20%20%20%20%20%20%20for%20gi%2C%20intervention%20in%20enumerate(INTERVENTIONS)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20vi%2C%20variant%20in%20enumerate(VARIANTS)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20xs%20%3D%20gi%20%2B%20(vi%20-%200.5)%20*%200.36%20%2B%20rng.uniform(-0.09%2C%200.09%2C%20len(_scores%5B(variant%2C%20intervention)%5D))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.scatter(xs%2C%20_scores%5B(variant%2C%20intervention)%5D%2C%20s%3D14%2C%20color%3Dcolors%5Bvariant%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(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bgi%20%2B%20(vi%20-%200.5)%20*%200.36%20-%200.14%2C%20gi%20%2B%20(vi%20-%200.5)%20*%200.36%20%2B%200.14%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B_med%5B(variant%2C%20intervention)%5D%5D%20*%202%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20color%3Dcolors%5Bvariant%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20lw%3D2%2C%0A%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(INTERVENTIONS)))%0A%20%20%20%20%20%20%20%20ax.set_xticklabels(INTERVENTIONS)%0A%20%20%20%20%20%20%20%20ax.set(ylabel%3D%22score%20(R%C2%B2%2C%20error%20vs.%20similarity)%22%2C%20ylim%3D(0%2C%201.02))%0A%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%20handles%20%3D%20%5Bplt.Line2D(%5B%5D%2C%20%5B%5D%2C%20marker%3D%22o%22%2C%20ls%3D%22%22%2C%20color%3Dc%2C%20label%3Dv)%20for%20v%2C%20c%20in%20colors.items()%5D%0A%20%20%20%20%20%20%20%20ax.legend(handles%3Dhandles%2C%20loc%3D%22lower%20right%22%2C%20title%3D%22training%22)%0A%20%20%20%20%20%20%20%20ax.set_title(%22Selectivity%20by%20intervention%20and%20training%20variant%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_(stat)%3A%0A%20%20%20%20_bz%2C%20_fr%20%3D%20stat(%22base%22%2C%20%22zero%22%2C%20%22score%22)%2C%20stat(%22fallback%22%2C%20%22reflect%22%2C%20%22score%22)%0A%20%20%20%20_frd%20%3D%20stat(%22fallback%22%2C%20%22redirect%22%2C%20%22score%22)%0A%20%20%20%20_n_bad%20%3D%20int((_bz%20%3C%200.1).sum())%0A%20%20%20%20_ok%20%3D%20_bz%20%3E%200.1%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20The%20scatter%20shows%20two%20things.%20First%2C%20the%20%60base%60%20variant%20has%20%7B_n_bad%7D%20seeds%20scoring%0A%20%20%20%20below%200.1%20under%20every%20intervention.%20Those%20are%20anchoring%20failures%20(in%20the%20worst%20one%2C%20red%20never%0A%20%20%20%20anchored%20at%20all%3A%20a%20validation%20anchor%20loss%20of%200.61%2C%20against%20a%20median%20of%200.006)%2C%20and%20no%0A%20%20%20%20intervention-time%20trick%20reaches%20them.%20The%20fallback%20variant%20happened%20to%20produce%20none%20of%20these%0A%20%20%20%20in%2032%20seeds.%20That%20is%20encouraging%2C%20but%20training%20is%20chaotic%20enough%20that%20we%20can't%20separate%20one%0A%20%20%20%20extra%20loss%20term%20from%20plain%20luck.%20Second%2C%20among%20the%20seeds%20that%20did%20anchor%2C%20the%20R%C2%B2%0A%20%20%20%20distributions%20barely%20move%3A%20%60base%20%2B%20zero%60%20excluding%20failures%20scores%20%7B_bz%5B_ok%5D.mean()%3A.2f%7D%20%C2%B1%0A%20%20%20%20%7B_bz%5B_ok%5D.std()%3A.2f%7D%2C%20against%20%7B_fr.mean()%3A.2f%7D%20%C2%B1%20%7B_fr.std()%3A.2f%7D%20for%20%60fallback%20%2B%20reflect%60%0A%20%20%20%20and%20%7B_frd.mean()%3A.2f%7D%20%C2%B1%20%7B_frd.std()%3A.2f%7D%20for%20%60redirect%60.%20By%20this%20metric%2C%20fallback%0A%20%20%20%20control%20adds%20little.%0A%0A%20%20%20%20R%C2%B2%20measures%20whether%20error%20is%20proportional%20to%20redness%2C%20but%20it%20says%20nothing%20about%20whether%0A%20%20%20%20the%20size%20of%20the%20response%20is%20the%20same%20from%20seed%20to%20seed%3B%20we'll%20look%20into%20that%0A%20%20%20%20below.%20(One%20aside%3A%20plain%20zeroing%20scores%20a%20little%20lower%20on%20the%20fallback%20variant%2C%0A%20%20%20%20median%20%7Bnp.median(stat(%22fallback%22%2C%20%22zero%22%2C%20%22score%22))%3A.2f%7D%20vs%20%7Bnp.median(_bz)%3A.2f%7D.%0A%20%20%20%20The%20fallback%20term%20presumably%20perturbs%20the%20decoder%20that%20zero-ablated%20latents%20still%0A%20%20%20%20pass%20through%2C%20so%20a%20trained%20fallback%20should%20be%20paired%20with%20its%20redirect%20rather%20than%0A%20%20%20%20zeroing.)%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%20A%20predictable%20response%0A%0A%20%20%20%20SCA%20aims%20for%20bounded%20side%20effects.%20With%20the%20decoder%20pinned%20to%20mid-gray%20at%0A%20%20%20%20%E2%88%92e%E2%82%80%2C%20redirecting%20pure%20red%20there%20should%20give%20MSE(red%2C%20gray)%20%3D%20%C2%BC.%20Without%0A%20%20%20%20fallback%20training%20there%20is%20no%20bound%20at%20all%2C%20and%20red%20lands%20wherever%20the%0A%20%20%20%20untrained%20region%20happens%20to%20decode.%20Zero%20ablation's%20expectation%20under%20random%0A%20%20%20%20redistribution%20is%20%E2%85%93%2C%20but%20the%20seed-to-seed%20spread%20makes%20that%20expectation%0A%20%20%20%20unhelpful.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(stat)%3A%0A%20%20%20%20_conds%20%3D%20%5B(%22base%22%2C%20%22zero%22)%2C%20(%22base%22%2C%20%22reflect%22)%2C%20(%22fallback%22%2C%20%22reflect%22)%2C%20(%22fallback%22%2C%20%22redirect%22)%5D%0A%20%20%20%20_vals%20%3D%20%7Bc%3A%20stat(*c%2C%20%22red_pure%22)%20for%20c%20in%20_conds%7D%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22red-damage%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3Df%22%22%22%0A%20%20%20%20%20%20%20%20Strip%20plot%20of%20reconstruction%20error%20for%20pure%20red%20after%20intervention%2C%20across%20four%20conditions%2C%0A%20%20%20%20%20%20%20%20with%20dashed%20reference%20lines%20at%20one%20quarter%20(the%20gray-fallback%20bound)%20and%20one%20third%0A%20%20%20%20%20%20%20%20(the%20value%20expected%20for%20a%20random%20on-manifold%20direction).%20Base%20plus%20zero%20scatters%20widely%2C%20from%0A%20%20%20%20%20%20%20%20%7B_vals%5B(%22base%22%2C%20%22zero%22)%5D.min()%3A.2f%7D%20to%20%7B_vals%5B(%22base%22%2C%20%22zero%22)%5D.max()%3A.2f%7D%3B%20base%20plus%0A%20%20%20%20%20%20%20%20reflect%20scatters%20even%20wider%20and%20higher.%20Fallback%20plus%20reflect%20collapses%20to%20a%20tight%0A%20%20%20%20%20%20%20%20cluster%20on%20the%20one-quarter%20line%20(spread%20%7B_vals%5B(%22fallback%22%2C%20%22reflect%22)%5D.std()%3A.3f%7D)%3B%0A%20%20%20%20%20%20%20%20fallback%20plus%20redirect%20clusters%20almost%20as%20tightly%20just%20below%20it.%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(8%2C%204))%0A%20%20%20%20%20%20%20%20rng%20%3D%20np.random.default_rng(0)%0A%20%20%20%20%20%20%20%20fg%20%3D%20light_dark(%22%231a5f8a%22%2C%20%22%236ab0d4%22)%0A%20%20%20%20%20%20%20%20for%20i%2C%20c%20in%20enumerate(_conds)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20xs%20%3D%20i%20%2B%20rng.uniform(-0.13%2C%200.13%2C%20len(_vals%5Bc%5D))%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.scatter(xs%2C%20_vals%5Bc%5D%2C%20s%3D14%2C%20color%3Dfg%2C%20alpha%3D0.75%2C%20lw%3D0)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(%5Bi%20-%200.2%2C%20i%20%2B%200.2%5D%2C%20%5Bnp.median(_vals%5Bc%5D)%5D%20*%202%2C%20color%3Dfg%2C%20lw%3D2)%0A%20%20%20%20%20%20%20%20ref%20%3D%20light_dark(%22%23000%22%2C%20%22%23fff%22)%0A%20%20%20%20%20%20%20%20ax.axhline(0.25%2C%20ls%3D%22--%22%2C%20lw%3D1%2C%20color%3Dref%2C%20alpha%3D0.6)%0A%20%20%20%20%20%20%20%20ax.axhline(1%20%2F%203%2C%20ls%3D%22%3A%22%2C%20lw%3D1%2C%20color%3Dref%2C%20alpha%3D0.6)%0A%20%20%20%20%20%20%20%20ax.text(3.42%2C%200.25%2C%20%22%C2%BC%20%3D%20MSE(red%2C%20gray)%22%2C%20va%3D%22bottom%22%2C%20ha%3D%22right%22%2C%20fontsize%3D9%2C%20alpha%3D0.8)%0A%20%20%20%20%20%20%20%20ax.text(3.42%2C%201%20%2F%203%2C%20%22%E2%85%93%20%3D%20E%5BMSE%5D%2C%20random%20direction%22%2C%20va%3D%22bottom%22%2C%20ha%3D%22right%22%2C%20fontsize%3D9%2C%20alpha%3D0.8)%0A%20%20%20%20%20%20%20%20ax.set_xticks(range(len(_conds)))%0A%20%20%20%20%20%20%20%20ax.set_xticklabels(%5Bf%22%7Bv%7D%5Cn%7Bi%7D%22%20for%20v%2C%20i%20in%20_conds%5D)%0A%20%20%20%20%20%20%20%20ax.set(ylabel%3D%22reconstruction%20MSE%2C%20pure%20red%22)%0A%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%20ax.set_title(%22Damage%20to%20pure%20red%3A%20spread%20vs.%20the%20analytic%20bound%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_(stat)%3A%0A%20%20%20%20_bz%20%3D%20stat(%22base%22%2C%20%22zero%22%2C%20%22red_pure%22)%0A%20%20%20%20_br%20%3D%20stat(%22base%22%2C%20%22reflect%22%2C%20%22red_pure%22)%0A%20%20%20%20_fr%20%3D%20stat(%22fallback%22%2C%20%22reflect%22%2C%20%22red_pure%22)%0A%20%20%20%20_fc%20%3D%20stat(%22fallback%22%2C%20%22reflect%22%2C%20%22collateral%22)%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20Under%20%60base%20%2B%20zero%60%2C%20damage%20to%20pure%20red%20spans%20%7B_bz.min()%3A.2f%7D%E2%80%93%7B_bz.max()%3A.2f%7D%20across%20seeds.%0A%20%20%20%20On%20some%20seeds%20the%20%22deleted%22%20red%20reconstructs%20almost%20perfectly%2C%20because%20renormalization%0A%20%20%20%20handed%20it%20to%20a%20neighboring%20color.%20%60base%20%2B%20reflect%60%20produces%20large%20damage%20(%7B_br.mean()%3A.2f%7D%20%C2%B1%0A%20%20%20%20%7B_br.std()%3A.2f%7D)%2C%20but%20with%20no%20control%20over%20where%20red%20ends%20up.%20%60fallback%20%2B%20reflect%60%20lands%20at%0A%20%20%20%20%7B_fr.mean()%3A.3f%7D%20%C2%B1%20%7B_fr.std()%3A.3f%7D%2C%20just%20under%20the%20%C2%BC%20bound%20predicted%20from%20the%20geometry%2C%20while%0A%20%20%20%20collateral%20damage%20on%20non-red%20colors%20stays%20at%20%7B_fc.mean()%3A.4f%7D.%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%20Median%20proportionality%0A%0A%20%20%20%20The%20charts%20below%20show%20the%20median-scoring%20runs%20of%20each%20variant.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(exemplars)%3A%0A%20%20%20%20_panels%20%3D%20%5B(%22base%22%2C%20%22zero%22%2C%20exemplars%5B%22base%22%5D)%2C%20(%22fallback%22%2C%20%22redirect%22%2C%20exemplars%5B%22fallback%22%5D)%5D%0A%20%20%20%20_r2%20%3D%20%7B%7D%0A%20%20%20%20for%20_v%2C%20_i%2C%20_e%20in%20_panels%3A%0A%20%20%20%20%20%20%20%20_r2%5B(_v%2C%20_i)%5D%20%3D%20float(np.corrcoef(_e%5B%22sim3%22%5D%2C%20_e%5Bf%22mse_%7B_i%7D%22%5D)%5B0%2C%201%5D%20**%202)%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22error-vs-similarity%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%20scatter%20plots%20of%20post-intervention%20reconstruction%20error%20against%20cubed%20HSV%20similarity%0A%20%20%20%20%20%20%20%20to%20red%2C%20one%20point%20per%20grid%20color%2C%20each%20drawn%20in%20its%20own%20color.%20On%20the%20left%2C%20the%20base%20variant's%0A%20%20%20%20%20%20%20%20median%20seed%20under%20zero%20ablation%20(R%20squared%20%7B_r2%5B(%22base%22%2C%20%22zero%22)%5D%3A.2f%7D)%3A%20error%20rises%0A%20%20%20%20%20%20%20%20with%20similarity%20and%20tops%20out%20wherever%20this%20seed's%20redistribution%20happened%20to%20put%20red%2C%0A%20%20%20%20%20%20%20%20here%20about%20%7Bfloat(_panels%5B0%5D%5B2%5D%5B%22mse_zero%22%5D.max())%3A.2f%7D.%20On%20the%20right%2C%20the%20fallback%20variant's%0A%20%20%20%20%20%20%20%20median%20seed%20under%20redirect%20(R%20squared%20%7B_r2%5B(%22fallback%22%2C%20%22redirect%22)%5D%3A.2f%7D)%3A%20points%20rise%0A%20%20%20%20%20%20%20%20from%20gray%20colors%20at%20zero%20error%20up%20to%20red%20points%20clustered%20together%20at%20about%0A%20%20%20%20%20%20%20%20%7Bfloat(_panels%5B1%5D%5B2%5D%5B%22mse_redirect%22%5D.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%20axes%20%3D%20plt.subplots(1%2C%202%2C%20figsize%3D(9.5%2C%204)%2C%20sharey%3DTrue)%0A%20%20%20%20%20%20%20%20edge%20%3D%20light_dark(%22%2300000033%22%2C%20%22%23ffffff55%22)%0A%20%20%20%20%20%20%20%20for%20ax%2C%20(v%2C%20i%2C%20e)%20in%20zip(axes%2C%20_panels%2C%20strict%3DTrue)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.scatter(e%5B%22sim3%22%5D%2C%20e%5Bf%22mse_%7Bi%7D%22%5D%2C%20c%3De%5B%22rgb%22%5D%2C%20s%3D24%2C%20edgecolors%3Dedge%2C%20lw%3D0.5)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.text(0.05%2C%200.92%2C%20f%22%24R%5E2%24%20%3D%20%7B_r2%5B(v%2C%20i)%5D%3A.3f%7D%22%2C%20transform%3Dax.transAxes)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set(xlabel%3D%22similarity%20to%20red%20(angular%20HSV%2C%20cubed)%22%2C%20title%3Df%22%7Bv%7D%20%2B%20%7Bi%7D%20(median%20seed)%22)%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(ylabel%3D%22reconstruction%20MSE%20after%20intervention%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_(exemplars)%3A%0A%20%20%20%20_e%20%3D%20exemplars%5B%22fallback%22%5D%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22latents%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20Three%20disc-shaped%20scatter%20plots%20of%20bottleneck%20latents%2C%20one%20point%20per%20grid%20color%2C%20each%0A%20%20%20%20%20%20%20%20drawn%20in%20its%20own%20color%2C%20inside%20a%20circle%20marking%20the%20unit%20hypersphere%20bound.%20The%20anchored%0A%20%20%20%20%20%20%20%20axis%20points%20up%2C%20labeled%20(1%2C%200%2C%200%2C%200%2C%200)%3B%20the%20fallback%20direction%20points%20down%2C%20labeled%0A%20%20%20%20%20%20%20%20minus%20e0.%20On%20the%20left%2C%20baseline%3A%20blues%2C%20greens%2C%20and%20grays%20hug%20the%20horizontal%20diameter%20and%20reds%0A%20%20%20%20%20%20%20%20reach%20the%20top%20of%20the%20circle.%20In%20the%20middle%2C%20reflected%3A%20the%20arrangement%20is%20mirrored%2C%20reds%20now%20at%0A%20%20%20%20%20%20%20%20the%20bottom%20of%20the%20circle%20on%20the%20fallback%20direction.%20On%20the%20right%2C%20redirected%3A%20non-red%20colors%0A%20%20%20%20%20%20%20%20stay%20near%20the%20horizontal%20diameter%20while%20reds%20sit%20at%20the%20bottom.%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(1%2C%203%2C%20figsize%3D(9.5%2C%204.4))%0A%20%20%20%20%20%20%20%20fg%20%3D%20light_dark(%22%23000%22%2C%20%22%23fff%22)%0A%20%20%20%20%20%20%20%20panels%20%3D%20%5B(%22Baseline%22%2C%20_e%5B%22z_base%22%5D)%2C%20(%22Reflected%22%2C%20_e%5B%22z_reflect%22%5D)%2C%20(%22Redirected%22%2C%20_e%5B%22z_redirect%22%5D)%5D%0A%20%20%20%20%20%20%20%20for%20ax%2C%20(title%2C%20z)%20in%20zip(axes%2C%20panels%2C%20strict%3DTrue)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20plot_latent_disc(ax%2C%20z%2C%20_e%5B%22rgb%22%5D)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_title(title%2C%20y%3D-0.17)%0A%20%20%20%20%20%20%20%20axes%5B0%5D.plot(%5B0%5D%2C%20%5B1.05%5D%2C%20marker%3D%22v%22%2C%20color%3Dfg%2C%20clip_on%3DFalse)%0A%20%20%20%20%20%20%20%20axes%5B0%5D.annotate(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22(1%2C%200%2C%200%2C%200%2C%200)%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20xy%3D(0%2C%201.1)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20xytext%3D(0%2C%206)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20textcoords%3D%22offset%20points%22%2C%0A%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%20va%3D%22bottom%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20annotation_clip%3DFalse%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20axes%5B0%5D.plot(%5B0%5D%2C%20%5B-1.05%5D%2C%20marker%3D%22%5E%22%2C%20color%3Dfg%2C%20clip_on%3DFalse)%0A%20%20%20%20%20%20%20%20axes%5B0%5D.annotate(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%E2%88%92e%E2%82%80%20(fallback)%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20xy%3D(0%2C%20-1.1)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20xytext%3D(0%2C%20-8)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20textcoords%3D%22offset%20points%22%2C%0A%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%20va%3D%22top%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20annotation_clip%3DFalse%2C%0A%20%20%20%20%20%20%20%20)%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_(runs)%3A%0A%20%20%20%20_fb%20%3D%20np.array(%5Br%5B%22fallback_color%22%5D%20for%20r%20in%20runs(%22fallback%22)%5D)%0A%20%20%20%20_bs%20%3D%20np.array(%5Br%5B%22fallback_color%22%5D%20for%20r%20in%20runs(%22base%22)%5D)%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20The%20mechanism%20shows%20up%20in%20the%20geometry.%20Both%20redirect-style%20interventions%20move%20red%20to%20%E2%88%92e%E2%82%80%2C%20a%0A%20%20%20%20region%20the%20anti-anchor%20regularizer%20kept%20empty%2C%20and%20fallback%20training%20decided%20what%20lives%0A%20%20%20%20there.%20Across%20the%20%7Blen(_fb)%7D%20fallback%20runs%2C%20dec(%E2%88%92e%E2%82%80)%20is%20(%7B_fb%5B%3A%2C%200%5D.mean()%3A.2f%7D%2C%0A%20%20%20%20%7B_fb%5B%3A%2C%201%5D.mean()%3A.2f%7D%2C%20%7B_fb%5B%3A%2C%202%5D.mean()%3A.2f%7D)%2C%20with%20a%20maximum%20per-channel%20deviation%20of%0A%20%20%20%20%7Bnp.abs(_fb%20-%200.5).max()%3A.3f%7D%3A%20mid-gray%20on%20every%20seed.%20In%20the%20base%20variant%20the%20same%20point%0A%20%20%20%20decodes%20to%20an%20uncontrolled%20color%20(per-channel%20spread%20%7B_bs.std(axis%3D0).max()%3A.2f%7D)%2C%20which%20is%0A%20%20%20%20why%20%60base%20%2B%20reflect%60%20damages%20red%20heavily%20but%20unpredictably.%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%20Why%20optimal%20ablation%20scores%20lower%20here%0A%0A%20%20%20%20Optimal%20ablation%20scored%20lower%20than%20plain%20zeroing%20on%20selectivity%3A%20OA's%0A%20%20%20%20constant%20minimizes%20expected%20loss%20over%20the%20task%20distribution%2C%20and%20that%0A%20%20%20%20distribution%20includes%20the%20concept%20being%20removed.%20In%20an%20anchored%20model%20the%0A%20%20%20%20cheapest%20way%20to%20reduce%20expected%20loss%20is%20to%20partially%20restore%20the%20concept%20and%0A%20%20%20%20shrink%20the%20error%20signal%20that%20the%20score%20measures.%20This%20makes%20sense%20for%20the%0A%20%20%20%20question%20OA%20was%20built%20for%2C%20where%20a%20small%20loss%20gap%20is%20the%20useful%20outcome.%0A%0A%20%20%20%20The%20removal-appropriate%20version%2C%20which%20optimizes%20the%20constant%20over%20non-red%0A%20%20%20%20colors%20only%2C%20lands%20close%20to%20zero.%20SCA's%20anti-subspace%20regularizer%20already%0A%20%20%20%20made%20small%20constants%20the%20least%20disruptive%20for%20bystander%20colors%20during%0A%20%20%20%20training%2C%20so%20this%20version%20behaves%20like%20plain%20zeroing.%20Anchoring%2C%20in%20other%0A%20%20%20%20words%2C%20gives%20you%20most%20of%20the%20%22optimal%22%20part%20of%20optimal%20ablation%20for%20free.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(metrics%2C%20stat)%3A%0A%20%20%20%20_c_oa%20%3D%20np.array(%5Br%5B%22c_oa%22%5D%20for%20r%20in%20metrics%5D)%0A%20%20%20%20_c_nt%20%3D%20np.array(%5Br%5B%22c_oa_nt%22%5D%20for%20r%20in%20metrics%5D)%0A%20%20%20%20_rp_oa%20%3D%20stat(%22base%22%2C%20%22oa%22%2C%20%22red_pure%22)%0A%20%20%20%20_rp_z%20%3D%20stat(%22base%22%2C%20%22zero%22%2C%20%22red_pure%22)%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20The%20literal%20OA%20constant%20is%20positive%20(red-ward)%20in%20%7Bint((_c_oa%20%3E%200).sum())%7D%0A%20%20%20%20of%20%7Blen(metrics)%7D%20runs%20(median%20%7Bnp.median(_c_oa)%3A%2B.2f%7D%2C%20except%20for%20the%0A%20%20%20%20anchoring%20failures).%20With%20OA%2C%20the%20damage%20to%20pure%20red%20drops%20to%0A%20%20%20%20%7B_rp_oa.mean()%3A.3f%7D%20on%20the%20base%20variant%2C%20against%20%7B_rp_z.mean()%3A.3f%7D%20for%0A%20%20%20%20zeroing%2C%20so%20the%20deletion%20is%20partially%20undone.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(stat)%3A%0A%20%20%20%20_rp%20%3D%20stat(%22fallback%22%2C%20%22reflect%22%2C%20%22red_pure%22)%0A%20%20%20%20_floor%20%3D%20min(stat(%22fallback%22%2C%20%22reflect%22%2C%20%22score%22).min()%2C%20stat(%22fallback%22%2C%20%22redirect%22%2C%20%22score%22).min())%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20%23%23%20Takeaways%0A%0A%20%20%20%20The%20seed%20problem%20from%20ex-2.9.1%20seems%20to%20be%20two%20problems.%20One%20is%20intervention%0A%20%20%20%20unpredictability%2C%20and%20in%20this%20experiment%20that%20was%20solved%20by%20fallback%0A%20%20%20%20control%3A%20one%20decoder-only%20loss%20term%20gives%20the%20intervention%20a%20designed%0A%20%20%20%20outcome%2C%20bounded%20above%20by%20%C2%BC%20for%20pure%20red%20and%20within%20%7B_rp.std()%3A.2f%7D%20of%20that%0A%20%20%20%20bound%20across%20every%20seed.%20The%20other%20is%20anchoring%20failure%2C%20where%20the%20concept%0A%20%20%20%20never%20isolates%20onto%20its%20axis%2C%20and%20nothing%20applied%20at%20intervention%20time%20can%0A%20%20%20%20fix%20that.%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
a890eb33ac54af12cd50fc0eaccac7b7