The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.
Reproducing Chain-of-Thought Gradient Descent
Independent, bounded reproduction for OpenReview uZ8JZ1Lw9a. The paper has no released reference implementation or hyperparameter bundle; this repository therefore implements the stated block construction and four testable claims on small, explicit settings.
Claims covered
- CoT can represent and iteratively execute neural-network gradient descent.
repro.pyspells out the ReLU forward/backward blocks (Definitions 2.2, 2.3, and 4.3), the recursive CoT schedule and dynamic retrieval rule (Definition 4.4), and checks the Appendix-D three-layer prefix. For 3, 6, and 9 layers, decoding the B blocks gives the direct-SGD update with maximum absolute error0.0. A separate shared, one-attention-layer transition operator is trained only ond=2trajectories and rolled out at 3/6/9 layers; this is empirical evidence for reuse, not a replacement for the paper's constructive proof. - Dynamic masking removes the all-layer active span. At every interior CoT update this reproduction retrieves two blocks, whereas a packed context has
Nlayer blocks. The resulting active-span ratio is exactlyN/2(128x atN=256). The included GPU tensor-work proxy is deliberately reported as a mechanism check, not as an end-to-end benchmark against the prior method. - Theorem 3.2: CoT ICGD approximates ridge regression. The code realizes the pooled residual-gradient recurrence, uses
epsilon=0, and checks it against both the direct ridge gradient and the theorem's contraction bound over three strongly-convex problems. The maximum gradient disagreement is1.39e-16; no bound violation occurs. - Theorem 3.3: CoT proximal ICGD approximates lasso regression. The lasso proximal map is independently expressed as a two-ReLU FFN,
ReLU(z-t)-ReLU(-z-t), after the pooled least-squares gradient. Its maximum disagreement with direct soft-thresholding is0.0; 800 PGD steps match a 3000-step FISTA objective reference to machine precision on two sparse problems.
GPU result
The public T4 job completed in 50 seconds of running time (184 seconds including scheduling). The additional public T4 job for Claims 3–4 completed in 51 seconds of running time. The browsable claim-by-claim experiment record is the Trackio logbook Space.
| Check | Result |
|---|---|
| Exact decoded-SGD error, N=3/6/9 | 0.0 |
| Appendix-D prefix | pass |
Shared transition test MSE (d=2) |
0.0045675 |
| Free rollout MSE, N=3 / 6 / 9 | 0.006996 / 0.013505 / 0.012683 |
| Dynamic active-span ratio at N=256 | 128x |
| Ridge pooled-gradient error / bound violation | 1.39e-16 / 0 |
| Lasso two-ReLU prox error / FISTA objective gap | 0 / 0 |
Full machine-readable outputs are in outputs/gpu_job/results.json and outputs/gpu_claims34/results.json; source SHA-256 and job metadata are recorded in hf_job_record.json and hf_job_claims34.json.
Run
uv run cot_gd_repro/repro.py --epochs 40 --output-dir cot_gd_repro/outputs/local
uv run --with torch python -m unittest discover -s cot_gd_repro -p test_repro.py
The first command selects CUDA automatically when available. The output directory contains results.json, cost.csv, and an HTML plot.
Scope and limitations
The exact checks validate the algebraic encoding, masking schedule, update decoding, ridge recurrence, and lasso proximal map; they do not formally reconstruct every attention-head weight from the proof. The learned operator is intentionally tiny (d=2) and is a separate finite-data demonstration. The ridge/lasso checks establish the stated numerical recurrences and convergence behavior, not a full learned-softmax-attention construction. The dynamic-masking O(N) statement is supported here by the exact active-block count, while finite GPU wall-clock ratios are only a low-level proxy and should not be interpreted as a full baseline comparison.
- Downloads last month
- 18