Lossless Base-3/5 + Gretchen โ a multiply-free ternary toolkit
Two pieces that fit together:
- Gretchen โ train LoRA weights that crystallize to ternary {-1, 0, +1} during training, via a smooth polynomial well. No rounding, no straight-through estimator.
- Lossless base-3/5 kernels โ represent values exactly in base-3/5 (a change of base, zero rounding) and run ternary matmuls multiply-free: add / skip / subtract, no floating-point multiply, no GPU, no CUDA. Proven bit-exact in Python (torch.allclose, atol=0) and in framework-free C.
The case: a ternary model's matmul is compute-light and memory-light, so it belongs on a CPU with SIMD or hand-written assembly, not a GPU built for floating-point multiplies. (Cf. Microsoft's bitnet.cpp.) In the spirit of ancient Egyptian arithmetic โ multiply by shift-and-add, represent exactly by addition, never round.
Code, tests, and full write-ups: https://github.com/drogongod/lossless-ternary
Author: Jonathan David Wint. License: MIT.
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support