r/learnmachinelearning • • 7d ago

My activation function moved from MLPs to 50-layer CNNs: 11 preregistered studies, a hardware replication, and the hypothesis I got wrong

A few weeks ago I posted about building my own activation function (BPreCap) and testing it with preregistered studies. One piece of feedback was "MLPs are a toy setting, try CNNs." So I did, and here's what I learned.
The setup: 50-layer CNNs with no BatchNorm and no skip connections on CIFAR-10, quantized to 4-bit activations after training. Without normalization, the activation function alone decides whether such a deep network trains and how much it loses when you quantize it.
What worked

  • At 4 bits, BPreCap had a lower test error than SELU (−2.6 pp) and TAT (−13.7 pp) on all 12 seeds.
  • I re-implemented everything in PyTorch and ran it on a different GPU. Same result (−3.1 and −15.7 pp). That was the moment I trusted it.

What didn't, or where it costs

  • In full precision (fp32), BPreCap is 1.6–3.2 pp worse. It's only better once you quantize.
  • A plain bounded tanh loses even less to quantization, but it barely learns at this depth, so its final error is far worse.
  • My explanation for why BPreCap quantizes well was wrong. I thought it was the late, steep saturation of the bound. I preregistered a test that moves the saturation earlier, and the 4-bit error didn't change. The real reason is still open.

What I took away

  • Preregistering (writing down the hypothesis, the test and the decision rule before running anything, then hash-freezing the code) made it much easier to accept the negative result instead of explaining it away.
  • Replicating on different hardware is cheap insurance. One baseline (TAT) moved by up to 15 pp per seed between platforms; the medians of BPreCap and SELU stayed within 1 pp.
  • Always report the cost next to the win. Here: better at 4 bits, worse at fp32.

Preprint: https://doi.org/10.5281/zenodo.24491869 · Code and all raw data: https://github.com/hermi-labs/precap-activation
Happy to answer questions about the setup or the preregistration workflow.

4 Upvotes

3 comments sorted by

2

u/dekiwho 2d ago

Not sure if you heard but major LLMs are sabotaging work, or giving misleading code that poisons downstream results. They clearly state they do this for ML.

So hard to trust anything that is vibe coded for ML.

You need to do better than discuss your loss, and show actual usecase with real data and out of sample validation before this can even be considered as trustworthy development

0

u/UnitOk6056 2d ago

Fair point, and I'd rather address it than wave it away.
Yes, I wrote most of the code with an AI coding assistant (Claude). That's stated in the repo (docs/Danksagung_und_Werkzeuge.md). Whether or not models actually sabotage ML work, I agree that "an LLM wrote it" is no reason to trust anything. So the setup is built so that you don't have to trust the code or me:

  • Preregistered and frozen: before every run, the question, decision rule, seeds and analysis were written down and frozen with SHA-256 hashes. Before the freeze, the analysis scripts were tested on synthetic data, once with a planted effect and once without. The frozen files and hashes are in the repo.
  • Held-out evaluation: hyperparameters were tuned on separate seeds and a validation split (the last 5,000 training images), and quantization was calibrated on training images. The CIFAR-10 test set is only used for the final, preregistered tests.
  • Second implementation: the two main comparisons were rerun in a separate PyTorch/CUDA implementation on an RTX 4070 and reproduced (12/12 seeds each; BPreCap and SELU medians within 0.9 pp of the original runs). To be fair: same author, same assistant. That guards against framework bugs, not against a shared conceptual mistake.
  • Unflattering results stay in: in fp32, BPreCap is 1.6–3.2 pp worse than the baselines, and one of my own hypotheses was falsified by a preregistered intervention. Both are in the paper.
  • Everything is public: code, preregistrations, raw per-seed CSVs and reports. Anyone can rerun a study or point to the line where it's wrong. If you find a bug, I'll fix it and report it openly.

Where you're right: this isn't a real-world use case yet. It's one dataset (CIFAR-10), plain CNNs without BatchNorm or residual connections, and post-training quantization only. A test on a standard architecture with real deployment data is the missing piece, and the limitations section says so. Until then, it's a controlled measurement, not a claim that it works in production.

3

u/dekiwho 1d ago

So annoying when you use AI to even formulate a response. Ugh shit gets annoying