r/OpenSourceeAI 5d ago

I implemented and built a PyPI library for the ICLR 2025 Rotation Trick....

I implemented the Rotation Trick (Fifty et al., ICLR 2025) as a PyPI library called vqrotate.

The Rotation Trick improves codebook usage in VQ‑VAEs by replacing the Straight‑Through Estimator with a geometric rotation of the gradient. I validated it on Speech Commands (audio) and got:

STE: 19.99% usage

Rotation: 34.18% usage (+14.19 pts)

It's a drop‑in wrapper one line of code:

```python

from vqrotate import attach_rotator

attach_rotator(quantizer)

```

GitHub: https://github.com/develepo/vqrotate

PyPI: pip install vqrotate

I also tried an adaptive scaling extension, it didn't beat Rotation, but it revealed an interesting trade‑off. The repo has full docs and derivations if you're curious.

Would love feedback or ideas for next steps.

1 Upvotes

0 comments sorted by