/ Модель

Характеристики

Размер весов
1,2 ГБ
Лицензия
MIT
Библиотека
transformers
Опубликована
15 апр 2025

bitnet-b1.58-2B-4T-gguf

Генерация текстаТекст → текст6 профессий

GGUF-версия англоязычной 2-миллиардной BitNet b1.58 от Microsoft Research для генерации текста и диалога с эффективным CPU-инференсом.

26 518скачиваний за 30 дней297лайковвеса обновлены17 дек 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

BitNet b1.58 2B4T — языковая модель Microsoft Research, представленная в этом репозитории в формате GGUF для инференса на CPU с библиотекой bitnet.cpp. Модель рассчитана на генерацию текста и диалоговые сценарии; её веса в формате GGUF предназначены для запуска, а не для обучения.

Модель имеет трансформерную архитектуру с модифицированными слоями BitLinear, RoPE, активацией ReLU² и нормализацией subln. В ней около 2 млрд параметров, контекст — до 4096 токенов. Это нативная модель с весами 1,58 бита и 8-битными активациями, обученная с нуля на 4 трлн токенов; обучение включало предварительное обучение, настройку по инструкциям и DPO. В карточке указана совместимость с чатом и английский язык.

Низкая разрядность рассчитана на уменьшение затрат памяти, энергии и задержки при выводе; в README приведены сравнительные результаты для CPU-декодирования. Модель может выдавать неожиданные, предвзятые или неточные ответы, а для работы с контекстами длиннее 4096 токенов рекомендована дополнительная адаптация. Лицензия — MIT; разработчик обозначает модель как предназначенную для исследований и разработок.

Сценарии применения

  • локальный запуск языковой модели на CPU
  • генерация ответов в диалоговом интерфейсе
  • следование инструкциям и составление текстов
  • эксперименты с нативными низкоразрядными языковыми моделями

Ограничения

Контекст ограничен 4096 токенами; для более длинных последовательностей рекомендуется дополнительная адаптация. Модель может давать неточные или предвзятые ответы.

Для каких профессий подходит6

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

BitNet b1.58 2B4T - Scaling Native 1-bit LLM

This repository contains the weights for BitNet b1.58 2B4T, the first open-source, native 1-bit Large Language Model (LLM) at the 2-billion parameter scale, developed by Microsoft Research.

Trained on a corpus of 4 trillion tokens, this model demonstrates that native 1-bit LLMs can achieve performance comparable to leading open-weight, full-precision models of similar size, while offering substantial advantages in computational efficiency (memory, energy, latency).

➡️ Technical Report: BitNet b1.58 2B4T Technical Report

➡️ Official Inference Code: microsoft/BitNet (bitnet.cpp)

Model Variants

Several versions of the model weights are available on Hugging Face:

Model Details

  • Architecture: Transformer-based, modified with BitLinear layers (BitNet framework).
    • Uses Rotary Position Embeddings (RoPE).
    • Uses squared ReLU (ReLU²) activation in FFN layers.
    • Employs subln normalization.
    • No bias terms in linear or normalization layers.
  • Quantization: Native 1.58-bit weights and 8-bit activations (W1.58A8).
    • Weights are quantized to ternary values {-1, 0, +1} using absmean quantization during the forward pass.
    • Activations are quantized to 8-bit integers using absmax quantization (per-token).
    • Crucially, the model was trained from scratch with this quantization scheme, not post-training quantized.
  • Parameters: ~2 Billion
  • Training Tokens: 4 Trillion
  • Context Length: Maximum sequence length of 4096 tokens.
    • Recommendation: For optimal performance on tasks requiring very long contexts (beyond the pre-training length or for specialized long-reasoning tasks), we recommend performing intermediate long-sequence adaptation/training before the final fine-tuning stage.
  • Training Stages:
    1. Pre-training: Large-scale training on public text/code and synthetic math data using a two-stage learning rate and weight decay schedule.
    2. Supervised Fine-tuning (SFT): Fine-tuned on instruction-following and conversational datasets using sum loss aggregation and specific hyperparameter tuning.
    3. Direct Preference Optimization (DPO): Aligned with human preferences using preference pairs.
  • Tokenizer: LLaMA 3 Tokenizer (vocab size: 128,256).

How to Use (with transformers)

VERY IMPORTANT NOTE ON EFFICIENCY

Please do NOT expect performance efficiency gains (in terms of speed, latency, or energy consumption) when using this model with the standard transformers library, even with the required fork.

The current execution paths within transformers do not contain the specialized, highly optimized computational kernels required to leverage the advantages of the BitNet architecture. Running the model via transformers will likely result in inference speeds and energy usage comparable to, or potentially worse than, standard full-precision models within this framework on both CPU and GPU.

While you might observe reduced memory usage due to the quantized weights, the primary computational efficiency benefits are not accessible through this standard transformers usage path.

For achieving the efficiency benefits demonstrated in the technical paper, you MUST use the dedicated C++ implementation: bitnet.cpp.

Requirements

pip install git+https://github.com/huggingface/transformers.git@096f25ae1f501a084d8ff2dcaf25fbc2bd60eba4

Example

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "microsoft/bitnet-b1.58-2B-4T"

# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16
)

# Apply the chat template
messages = [
    {"role": "system", "content": "You are a helpful AI assistant."},
    {"role": "user", "content": "How are you?"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
chat_input = tokenizer(prompt, return_tensors="pt").to(model.device)

# Generate response
chat_outputs = model.generate(**chat_input, max_new_tokens=50)
response = tokenizer.decode(chat_outputs[0][chat_input['input_ids'].shape[-1]:], skip_special_tokens=True) # Decode only the response part
print("\nAssistant Response:", response)

How to Use (with bitnet.cpp)

Please refer to the bitnet.cpp GitHub repository for detailed compilation steps, usage examples, and command-line options.

Evaluation

BitNet b1.58 2B4T was evaluated against leading open-weight full-precision LLMs of similar size. Below are the key results (all models are instruction-tuned versions):

BenchmarkLLaMA 3.2 1BGemma-3 1BQwen2.5 1.5BSmolLM2 1.7BMiniCPM 2BBitNet b1.58 2B
Memory (Non-emb)2GB1.4GB2.6GB3.2GB4.8GB0.4GB
Latency (CPU Decoding)48ms41ms65ms67ms124ms29ms
Energy (Estimated)0.258J0.186J0.347J0.425J0.649J0.028J
Training Tokens (Pre-train)9T*2T**18T11T1.1T4T
ARC-Challenge37.8038.4046.6743.5244.8049.91
ARC-Easy63.1763.1376.0162.9272.1474.79
OpenbookQA34.8038.8040.8046.0040.2041.60
BoolQ64.6574.2278.0475.7880.6780.18
HellaSwag60.8057.6968.2871.7170.8168.44
PIQA74.2171.9376.1276.1276.6677.09
WinoGrande59.5158.4862.8368.9861.8071.90
CommonsenseQA58.4842.1076.4163.5571.7471.58
TruthfulQA43.8038.6646.6739.9041.4145.31
TriviaQA37.6023.4938.3745.9734.1333.57
MMLU45.5839.9160.2549.2451.8253.17
HumanEval+31.1037.2050.6028.0043.9038.40
GSM8K38.2131.1656.7945.114.4058.38
MATH-50023.0042.0053.0017.6014.8043.40
IFEval62.7166.6750.1257.9136.8153.48
MT-bench5.436.406.125.506.575.85
Average44.9043.7455.2348.7042.0554.19

*LLaMA 3.2 1B uses pruning & distillation.

**Gemma-3 1B uses distillation.

License

The model weights and code are released under the MIT License.

Disclaimer

This model is intended for research and development purposes. While efforts have been made to align it using SFT and DPO, it may still produce outputs that are unexpected, biased, or inaccurate. Please use responsibly.

Data Summary

https://huggingface.co/microsoft/bitnet-b1.58-2B-4T-gguf/blob/main/data_summary_card.md

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

llama.cpp

Можно запустить

Подбираем GPU…

Ревизия весов
a1f2f1c

0 моделей