Spaces:
Running
Running
File size: 7,841 Bytes
c846d02 8d745e5 c846d02 dab4fd5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>DenseAM hyperparameter transfer, reproduced</title>
<style>
:root { --ink:#1a1a1a; --mute:#5b5b5b; --line:#e3e3e3; --accent:#6d3bbd; }
* { box-sizing:border-box; }
body { margin:0; background:#faf9fc; color:var(--ink);
font:16px/1.62 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif; }
main { max-width:840px; margin:0 auto; padding:44px 22px 80px; }
h1 { font-size:1.85rem; line-height:1.25; margin:0 0 6px; letter-spacing:-0.01em; }
.sub { color:var(--mute); margin:0 0 28px; font-size:.95rem; }
h2 { font-size:1.16rem; margin:38px 0 10px; }
p { margin:0 0 14px; }
code { background:#f1eef7; padding:1px 5px; border-radius:4px; font-size:.9em; }
.verdict { border-left:4px solid var(--accent); background:#fff; padding:16px 20px;
border-radius:0 8px 8px 0; margin:0 0 26px; }
.verdict strong { color:var(--accent); }
table { border-collapse:collapse; width:100%; font-size:.92rem; margin:12px 0 6px; }
th, td { border:1px solid var(--line); padding:7px 9px; text-align:right; }
th:first-child, td:first-child { text-align:left; }
thead th { background:#f4f1fa; font-weight:600; }
tr.spread td { font-weight:600; background:#fbfaff; }
img { width:100%; border:1px solid var(--line); border-radius:8px; background:#fff; margin:14px 0; }
.cap { color:var(--mute); font-size:.86rem; margin:-6px 0 22px; }
ul { margin:0 0 14px; padding-left:22px; }
li { margin-bottom:7px; }
a { color:var(--accent); }
.two { display:grid; grid-template-columns:1fr 1fr; gap:26px; }
@media (max-width:620px){ .two { grid-template-columns:1fr; } }
</style>
</head>
<body>
<main>
<h1>Hyperparameter transfer for Dense Associative Memories, reproduced</h1>
<p class="sub"><a href="https://arxiv.org/abs/2605.10164">arXiv:2605.10164</a> · Holtzman, Krotov, Hanin (2026) · target: Table 1 and Figure 4. No author code was released, so this is a reimplementation from the equations.</p>
<div class="verdict">
<p><strong>Verdict: verified, with one caveat.</strong> A single effective learning rate
<code>η<sub>0</sub></code> serves all six plaquette scales of MNIST denoising, from
N = 784 down to N = 25, to within 1.4× of each scale's own optimum
under Adam, and the Adam stability threshold is the same at every scale. The ReLU + SGD panel
does not reproduce the paper's upturn location: our runs stay stable to
<code>η<sub>0</sub> ≈ 30</code> instead of 0.3–1.</p>
</div>
<h2>The claim</h2>
<p>A DenseAM</p>
<p><code>f(x) = s<sub>2</sub> W<sup>T</sup> σ<sub>C</sub>( s<sub>1</sub> W g(x) + b ) + c,
σ<sub>C</sub> = C σ C, C = I − 11<sup>T</sup>/K</code></p>
<p>trained on MNIST denoising in the proportional regime (K = 2N, P = 5N,
B = 0.1P) keeps the same optimal <code>η<sub>0</sub></code> across six
input-dimension scales made by plaquette coarse graining, a 31× range of model size,
provided the centered parameterisation of Table 1 is used:
<code>s<sub>1</sub> = 1/√N</code>, <code>s<sub>2</sub> = 1/√K</code>, and
<code>η<sub>W</sub> = η<sub>0</sub>√K</code> for SGD, <code>η<sub>0</sub></code>
for Adam.</p>
<h2>Result</h2>
<p>528 runs on Modal CPU containers: 396 for the ReLU panels with three seeds, 132 for the
softmax panels with one seed. Eleven learning rates per run spanning 5.5 decades, 256 epochs
each. The whole ReLU grid finishes in 164 s with one container per run.</p>
<table>
<thead><tr><th>arm</th><th>optimal η<sub>0</sub>, j=1…6</th><th>spread</th><th>one η<sub>0</sub></th><th>worst penalty</th></tr></thead>
<tbody>
<tr><td>ReLU + SGD</td><td>30, 30, 10, 10, 3, 3</td><td>10×</td><td>3</td><td>3.67×</td></tr>
<tr><td>ReLU + Adam</td><td>0.1, 0.1, 0.03, 0.01, 0.01, 0.01</td><td>10×</td><td><strong>0.03</strong></td><td><strong>1.42×</strong></td></tr>
<tr><td>Softmax + SGD</td><td>30, 30, 30, 30, 10, 10</td><td>3×</td><td>10</td><td>1.17×</td></tr>
<tr><td>Softmax + Adam</td><td>1, 0.3, 0.3, 0.3, 0.3, 0.1</td><td>10×</td><td>0.1</td><td>1.13×</td></tr>
</tbody>
</table>
<p class="cap">"one η<sub>0</sub>" is the single learning rate that minimises the worst per-scale
penalty relative to that scale's own optimum. Across a 31× range of N, one number is within
1.4× of optimal everywhere in three of the four arms. That is the paper's claim.</p>
<img src="results/figure4_repro.png" alt="Final train MSE against the effective learning rate for six plaquette scales, four panels: ReLU SGD, ReLU Adam, softmax SGD, softmax Adam.">
<p class="cap">Our Figure 4: final train MSE against <code>η<sub>0</sub></code>, medians over
seeds, stars mark each scale's optimum. Compare with Figure 4 of the paper: same ordering, same
collapse onto one profile, minima one decade apart rather than in one band.</p>
<h2>What reproduces</h2>
<ul>
<li>Curve shapes and their ordering across all four (activation, optimiser) arms: Adam below SGD,
ReLU below softmax, and final train MSE falling monotonically with N at fixed <code>η<sub>0</sub></code>.</li>
<li>Transfer itself: worst-case penalty 1.13× (softmax Adam), 1.17× (softmax SGD) and
1.42× (ReLU Adam) against a grid 5.5 decades wide.</li>
<li>The Adam stability threshold, <code>η<sub>0</sub> = 10</code>, is identical at all six scales.
That is a sharper statement of the same phenomenon than the position of the minimum.</li>
</ul>
<h2>Where it diverges from the paper</h2>
<ul>
<li><strong>The SGD upturn is two decades late.</strong> The paper's ReLU + SGD curves turn up
around <code>η<sub>0</sub> ≈ 0.3–1</code>; ours keep improving to 30 and diverge above
100, so that panel has no interior minimum and its "optimal" value is the grid edge. Adam matches the
paper's shape at the printed values, so this is specific to the
<code>η<sub>W</sub> = η<sub>0</sub>√K</code> branch, not a global scale error.</li>
<li><strong>Our ReLU fits better.</strong> Best train MSE 1.5e-3 to 2.7e-3 against 1e-2 to 4e-1 in the
figure. At j=6 there are 120 points and 1325 parameters, so memorisation is cheap and a well tuned run
can go below the Bayes denoising floor. The softmax levels, 0.004 to 0.25, do land in the paper's range.</li>
</ul>
<h2>Assumptions the caption leaves open</h2>
<div class="two">
<div>
<ul>
<li>noise <code>σ<sub>ε</sub> = 0.1</code> on inputs mapped to [-1, 1]</li>
<li>plaquette border edge-replicated on the ⌈28/j⌉ grid</li>
</ul>
</div>
<div>
<ul>
<li>biases trainable, <code>η<sub>b</sub> = η<sub>c</sub> = η<sub>0</sub></code></li>
<li>metric: per-element MSE on the P training points, median over seeds, 2000-image held-out slice reported alongside</li>
</ul>
</div>
</div>
<h2>Everything is public</h2>
<p>Code: <code>denseam_repro.py</code>, <code>run_grid.py</code>, <code>analyze.py</code>.
Full write-up: <a href="REPRO.md">REPRO.md</a>. Every run, including the diverged ones and their loss
curves: <code>results/grid_*.jsonl</code>. Modal client logs, including the failed first attempts:
<code>logs/</code>. Machine-readable verdict: <a href="verdict.json">verdict.json</a>.
Raw runs as a dataset:
<a href="https://huggingface.co/datasets/UncleanCode/neurips2026-repro-denseam">UncleanCode/neurips2026-repro-denseam</a>,
which also carries the agent trace.</p>
<p class="sub" style="margin-top:34px">Produced on 3 December 2026 for the NeurIPS 2026 reproducibility
hackathon. Runs executed on Modal; no GPU was used.</p>
</main>
</body>
</html>
|