Skip to content
nonconvexcard

Implement Hessian-aware rounding

CodingAdvanced⏱ 1 dayQuantizationgptqimplementationreconstruction error

Problem

Implement and evaluate layer-wise quantization.

  1. Implement round-to-nearest and the Hessian-aware sweep for a single linear layer.
  2. Compare reconstruction error ∥WX−W^X∥F\|WX - \widehat WX\|_F on held-out activations across bit widths.
  3. Vary the input correlation and show the gap behaves as the theory predicts.
  4. Demonstrate the numerical failure of naive repeated rank-one updates and fix it with Cholesky.

Implement it, then check the implementation against something you can verify independently.

Write it

Solve it here5 tests · Python runs in your browser
⌘/Ctrl + ↵ to run · limit 30s · draft saved in this browser
5 tests will run against your code. The first run downloads the Python runtime — several megabytes, once per browser.

Solution

Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.

Related problems

All problems
SolvedProblemFieldTypeDifficultyTime
Implement backpropagation from scratch runDeep LearningCodingIntermediate3 hours
Implement kernel ridge regression runClassical MLCodingIntermediate1 hour
Implement multi-head attention from scratch runDeep LearningCodingIntermediate3 hours
Implement power iteration and verify the convergence rate runFoundationsCodingIntermediate1 hour
Implement random projection and measure the distortion runHigh-Dim ProbabilityCodingIntermediate1 hour