Dataset Viewer

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

  1. CoT can represent and iteratively execute neural-network gradient descent. repro.py spells 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 error 0.0. A separate shared, one-attention-layer transition operator is trained only on d=2 trajectories and rolled out at 3/6/9 layers; this is empirical evidence for reuse, not a replacement for the paper's constructive proof.
  2. Dynamic masking removes the all-layer active span. At every interior CoT update this reproduction retrieves two blocks, whereas a packed context has N layer blocks. The resulting active-span ratio is exactly N/2 (128x at N=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.
  3. 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 is 1.39e-16; no bound violation occurs.
  4. 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 is 0.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