BitNet b1.58 2B4T Technical Report

主要内容

  1. 模型介绍:介绍了BitNet b1.58 2B4T,这是首个20亿参数规模的开源原生1比特大语言模型,在4万亿词元的语料库上进行训练,通过多种基准测试评估其性能,模型权重在Hugging Face上发布,并提供了针对GPU和CPU架构的开源推理实现。
  2. 模型架构:基于标准Transformer模型和BitNet框架进行修改,核心创新是用自定义的BitLinear层替换标准全精度线性层,对权重和激活值进行量化,还集成了多种提升性能和稳定性的技术,采用LLaMA 3的分词器。
  3. 训练过程:包含大规模预训练、监督微调(SFT)和直接偏好优化(DPO)三个阶段。预训练使用两阶段学习率和权重衰减策略,在不同阶段使用不同数据;SFT利用多种数据集提升模型指令跟随能力;DPO通过优化偏好数据,使模型行为更符合人类期望。
  4. 评估结果:在多种基准测试中与相似规模的全精度模型、量化模型和1比特模型对比,BitNet b1.58 2B4T在资源效率上优势显著,性能与领先的全精度模型相当,优于其他1比特模型。
  5. 推理实现:针对GPU和CPU分别开发了专用的推理库。GPU推理通过开发自定义CUDA内核,采用特殊的数据存储和计算策略;CPU推理通过bitnet.cpp库,提供优化的内核以实现高效准确的推理。

创新点

  1. 原生1比特训练:首次在20亿参数规模上进行原
微软开源bitnet b1.58大模型,应用效果测评(问答、知识、数学、逻辑、分析) 微软开源的BitNet模型(特别是BitNet b1.58 2B4T)是一种革命性的低精度大语言模型(LLM),1.58位三值权重:权重仅取-1、0、+1三种值,每个参数平均占用约1.58位存储,结合8位整数激活值(W1.58A8配置),大幅压缩模型体积,通过创新的量化技术和架构设计,在性能、能效和部署灵活性上实现了显著突破。 阅读详情

相关推荐

逆向分析PerimeterX px3:从混淆JS到生成有效令牌的完整实战

在Web安全与数据采集领域,反自动化防护是保障服务稳定和数据安全的关键技术。其核心原理是通过收集浏览器环境指纹和用户行为特征,动态生成加密令牌来区分真人用户与自动化脚本。这项技术的工程价值在于平衡安全性与用户体验,广泛应用于电商、金融、社交等需要防止恶意爬虫和自动化攻击的场景。本文聚焦于业界广泛部署的PerimeterX px3防护方案,通过JavaScript逆向工程,深入剖析其令牌生成机制。我们将探讨如何运用动态调试、反混淆工具和算法还原等关键技术,突破px3的防护壁垒,为自动化测试和数据采集提供稳定可

diankui6178的博客 547

Zynq7系列DDR3 PCB设计中的阻抗匹配与端接电阻优化策略

本文深入探讨了Zynq7系列SoC在DDR3接口PCB设计中的核心挑战,重点分析了走线阻抗与端接电阻的匹配策略。通过对比官方推荐的40欧姆与工程实践中更通用的50欧姆方案,结合仿真数据揭示了阻抗匹配对信号完整性的决定性影响,并提供了从叠层规划、布线优化到后期验证的完整实战清单,旨在帮助工程师实现高稳定性的高速电路设计。

weixin_29306011的博客 186

用Spirent Test Center测试交换机Head of Line(HOL)Blocking

测试目的:设备执行拥塞控制,使非阻塞端口不受阻塞端口影响 预设条件:在RFC2889里按以下步骤设置,端口1和端口3同时向端口4发送数据包,端口1向端口2发送数据包 测试步骤:运行设置好的RFC2889 测试结果:所有frame size都显示没有Head of Line(HOL),即非阻塞端口不受阻塞端口所影响 ...

Yuna_的博客 1362

【即插即用模块】Transformer篇 | MICCAI 2025 | ReLULA:Q/K双ReLU线性注意力,既轻又准!

本文介绍了一种基于线性注意力的多实例学习模块(Lin-MIL),适用于高分辨率视觉任务。该模块通过转置计算顺序和使用ReLU激活,将计算复杂度从O(n²d)降至O(nd²),同时提升特征判别性。核心创新包括Q/K双ReLU激活、可学习温度系数和数值稳定归一化。实验表明,该模块在轻量化视觉任务中优于传统线性注意力和Mamba架构。代码实现了模块化矩阵乘法,支持即插即用替换ViT自注意力层。该模块特别适合计算病理学等需要处理大量图像补丁的任务。

主要更新底层视觉(去噪、超分等)相关的科研内容,形式为【论文精读】+【论文复现】 147

boost::circular_buffer缓行缓冲区

1、circular_buffer实现了一个环形缓冲区,空间大小是固定的,当到达容器末尾时,将自动利用容器另一端的位置空间。 2、当程序需要容纳大量的元素,但多数情况下仅保存较少数量元素时可以使用circular_buffer_space_optimized,他可以有效的减少内存的占用,提高程序的运行效率。 3、主要接口: 4、实现一个生产者---消费者模式示例: #inc...

小米的修行之路 799

Android蓝牙中的Rfcomm协议介绍

RFCOMM(Radio Frequency Communications)是一种基于蓝牙技术的串口仿真协议,以下是详细介绍:一、协议概述二、工作原理三、应用场景

手机-手表蓝牙开发工程师的博客 718

【电容/电感】电路板会“滋滋”的响,我们称它为啸叫

一、啸叫的起源 大部分硬件工程师应该都遇到过,PCBA上电后出现“滋滋滋”的叫声,其声响或大或小,或时有时无,或深沉或刺耳,或变化无常者皆有。该现象我们称为“啸叫”,一般分为电感啸叫和电容啸叫。

云轩阁 6万+

threadX的USBX的初始化和解初始化的分析。

tx_application_define的最后会使用tx_byte_pool_create创建usb线程的内存空间“ux_device_app_byte_pool”,再创建usb线程,也就是执行。主要就是创建了线程,也就是第3个参数app_ux_device_thread_entry,这个参数内是MX_USB_Device_Init,也就是USB底层初始化。进来的参数只有1个,是memory_ptr,这个就是创建的usb线程空间“ux_device_app_byte_pool”

qq_31885403的博客 651

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

上一篇: Does Reinforcement Learning Really Incentivize Reasoning Capacity in LLMs Beyond the Base Model?
下一篇: InternVL3: Exploring Advanced Training and Test-Time Recipes for Open-Source Multimodal Models
UnknownBody
博客等级 码龄16年 5602粉丝 4817原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

UnknownBody

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址