Back to directory

BitNet

A PyTorch implementation of BitNet, a 1-bit Transformer architecture that replaces standard linear layers with a quantized BitLinear layer to scale large language models with lower-precision weights.

BitNet

BitNet is a PyTorch implementation of the linear methods and model described in the paper on scaling 1-bit Transformers for large language models. Its core building block, BitLinear, replaces a standard linear layer with a pipeline of layer normalization, binarization and absolute-max quantization, so a Transformer can be built by swapping in BitLinear modules in place of ordinary linear projections.

The repository also implements a full BitNetTransformer with multi-head attention and BitFeedforward layers, residual and skip connections, and a BitAttention variant built on multi-grouped query attention. A model must be fine-tuned or trained from scratch to use BitLinear; changing the linear layers of an already-trained model does not work.

It installs as a Python package and includes example scripts for using the BitLinear and BitNetTransformer components directly.

More in Models

See all 405
  • mini-AGI

    github.com

    A continual learning language model that trains from scratch on a single 8 GB VRAM GPU, assembling its own architecture and adapting its size to the hardware and data available rather than shipping as a fixed pretrained model.

  • An open-source contrastive-embedding pipeline that maps technical CVE vulnerability descriptions to formal cybersecurity compliance controls in NIST SP 800-53 and CMMC, published with its model generation, fine-tuning and evaluation code.

  • peekaboolean

    github.com

    A small vision-language model, fine-tuned with LoRA on a 500-million-parameter backbone, that answers typed multiple-choice, ordinal-score and yes/no questions about an image with calibrated probabilities, in about 400 milliseconds on a laptop.