LLM
BitNet
Ternary Weights
Lookup Tables
FPGA
This project explores efficient inference for Microsoft’s BitNet b1.58 2B4T transformer. I converted its 2.08 billion ternary parameters into lookup-table operations designed for FPGA implementation.
What I Built
- Extracted and validated ternary weights across all 30 transformer layers
- Converted seven linear projections per layer into lookup-table representations
- Built a full inference emulator for checking the converted model
- Confirmed token-for-token agreement between lookup-table and direct ternary inference
- Eliminated DSP use for the main linear products
- Increased estimated throughput by 1.83× by grouping four ternary weights per lookup
Tech Stack
Python, PyTorch, BitNet b1.58, ternary neural networks, lookup tables, fixed-point arithmetic and FPGA-oriented inference.