Skip to content

Native binary wire format for ternary weights — NativeTernary #534

@sm45118

Description

@sm45118

Hi BitNet team,
I am an independent researcher and have published a paper proposing a native binary wire format specifically designed for ternary weights {-1, 0, +1}.
The problem: BitNet b1.58 operates natively in ternary but stores weights in GGUF — a container format designed for floating-point data. There is no native wire format purpose-built for ternary weights.
NativeTernary solves this:

Each weight maps to exactly one 2-bit pair: {00}=-1, {01}=0, {10}=+1
Layer boundaries encoded as {11} (2 bits), tensor boundaries as {1111} (4 bits), model section boundaries as {111111} (6 bits) — built directly into the stream
Decoder: 2-bit register + level counter. 10 lines of code. Zero lookup tables
Stateless and resilient to bitstream corruption

Links:

arXiv: https://arxiv.org/abs/2604.03336
GitHub: https://github.com/sm45118/nativeternary

C reference implementation is in progress. Would genuinely value technical feedback from the team, and happy to discuss integration.
Maharshi Savdhariya
IIT Bombay | IIM Udaipur

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions