AI 与机器学习2024arxiv.org编辑精选
1-bit LLM 时代:面向低成本计算的三值参数
The Era of 1-bit LLMs: ternary parameters for cost-effective computing
进阶 · 约 45 分钟读完前置知识:神经网络与反向传播基础、Transformer 架构、定点/量化数值表示
导读
这篇论文(BitNet b1.58)提出用三值参数 {-1, 0, 1} 替代 LLM 中的浮点权重,即所谓“1-bit LLM”。核心做法是将权重全部三值化,使矩阵乘法中的乘加运算可用加法实现,在现有硬件上即可显著降低计算与内存开销,且作者测试显示性能无明显下降。
HN 关注点:是因为三值化权重可能大幅降低 LLM 推理成本,讨论焦点集中在硬件实现可行性与“1.58 bit”这一概念本身。
HN 评论精选
这几条评论里:支持 1 质疑 1 补充 2
支持认为三值化权重是重大突破,现有硬件即可显著提效,专用硬件收益更大
这项工作有两个令我震惊的发现:一是现有 LLM 中所有表示实数的浮点参数都可以替换为表示 (-1, 0, 1) 的三值;二是矩阵乘法中每个点积的逐元素乘法可以替换为逐元素加法(符号取决于各值)。在现有硬件上,计算和内存效率的提升就很显著,且作者测试显示没有性能下降。如果用专门硬件实现,收益会更大。
cs702查看英文原文
There are two findings I find shocking in this work: * In existing LLMs, we can replace all parameter floating-point values representing real numbers with ternary values representing (-1, 0, 1). * In matrix multiplications (e.g., weights by vectors), we can replace elementwise products in each dot product (a₁b₁ + a₂b₂ ...) with elementwise additions (a₁+b₁ + a₂+b₂ ...), in which signs depend on each value. See the paper for exact details. On existing hardware, the gains in compute and memory efficiency are significant, without performance degradation (as tested by the authors). If the proposed methods are implemented in hardware, we will see even greater gains in compute and memory efficiency. Wow.
补充纠正术语:这是平衡三进制(trit),并补充三进制计算的理论背景资料
这不是 'bit'(二进制位),更接近 'trit'(三进制位)。取值 {-1, 0, 1} 的三进制其实是“平衡三进制”。Knuth 曾称平衡三进制“也许是最美的记数系统”,2001 年 American Scientist 的文章《Third Base》介绍了三进制在计算中的理论潜力,还提到苏联曾尝试三进制计算机。文章还暗示 e 进制(底 2.718…)若可行可能更优,所以论文说的 ~1.58 bits(log2(3))或许还能进一步优化到 ~1.44 bits。
gojomo查看英文原文
That's not a 'bit' ("Binary digIT"). It's closer to a 'trit' ("TeRnary-digIT"). Specifically, ternary digits spanning {-1, 0, 1} (rather than the usual {0, 1, 2} in a base-3 numbering system) are 'balanced ternary'. A great intro to the theoretical reasons ternary might have some promise in computing is this 2001 article from 'American Scientist', "Third Base", which quotes Knuth calling balanced-ternary "perhaps the prettiest numbering system of all" and also discusses an abortive Soviet effort in the direction of ternary computing: http://web.archive.org/web/20011205185830/http://americanscientist.org/Issues/Comsci01/Compsci2001-11.html In an aside, the article hints that e-nary digits (base 2.718…) if somehow made practical/meaningful, might actually be better than ternary (or perhaps even optimal?). So maybe this paper's observation that ~"1.58 bits" (ln2(3) binary-digits) is a sweet-spot could be further refined into some method for representing the state of a e-nary-modeled algorithm in ln2(e) binary-digits (~"1.44 bits") per underlying e-it. (As it may be of renewed interest, I've also put this 2001 "American Scientist" base-3 intro as a new HN submission for discussion: https://news.ycombinator.com/item?id=39541756)
质疑质疑三值在二进制硬件上的实现效率,预测最终会退化为二值权重
3 的幂在二进制内存里打包效率不高……硅片上 1-bit 乘法器只需一个逻辑门,而解码打包的三态权重需要更大的三进制解码器。因此我怀疑这个方法最终会演变成所有权重只用 1 或 0(即二值),比如一半权重取 1/0,另一半取 -1/0。
londons_explore查看英文原文
Powers of 3 don't pack well into binary memory... A 1 bit multiplier in silicon is a single logic gate, but a ternary decoder to decode a packed tri-state 'weight' is bigger. I therefore suspect that this method will be extended to make all weights simple 1 or 0 (ie. Binary). Perhaps that will be done by having half the weights have 1 or 0 values, while the other half are -1 or 0.
补充从硬件哲学角度反思:AI 计算或许不该拘泥于二进制/NAND 门设计
我常想,晶体管在 AI 应用中某种程度上被浪费了。普通计算用二进制状态来降低熵,但 AI 对此不那么在意,为什么不利用更多可用的电压范围?也许应该从根本上重新思考晶体管的角色——NAND 门未必是这里的理想基本构件。
osigurdson查看英文原文
I have often mused that, in some ways, it seems like the transistor is really being wasted in AI applications. We use binary states in normal computing to reduce entropy. In AI this is less of a concern, so why not use more of the available voltage range? Basically, re-think the role of the transistor and re-design from the ground up - maybe NAND gates are not the ideal fundamental building block here?
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2024Hacker News 讨论帖1,040 分 · 447 评
同领域还值得读
DeepSeek-R1:通过强化学习激励 LLM 的推理能力
DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via RL
研究如何用强化学习激励大语言模型的推理能力,提出 DeepSeek-R1,并探讨 RL 训练对模型推理表现的影响。
AI 与机器学习2025 · 1,351 分 · 1,056 评 · 引用 30进阶 · 约 80 分钟编辑精选DeepSeek-V3.2:推进开放大语言模型的前沿
DeepSeek-v3.2: Pushing the frontier of open large language models
这是 DeepSeek-V3.2 的技术报告,延续了 DeepSeek 开源权重模型的路线,目标是让开放模型继续逼近甚至追平前沿闭源模型。
AI 与机器学习2025 · 982 分 · 465 评进阶 · 约 90 分钟编辑精选通过自我对弈与通用强化学习掌握国际象棋和将棋(AlphaZero)
Mastering Chess and Shogi by Self-Play with General Reinforcement Learning
DeepMind 的 AlphaZero 论文:用通用强化学习算法(自我博弈 + MCTS + 神经网络),从零开始仅数小时训练便在国际象棋和将棋上击败了世界顶级引擎 Stock…
AI 与机器学习2017 · 539 分 · 270 评 · 引用 13进阶 · 约 90 分钟编辑精选用强化学习发现更快的矩阵乘法算法
Discovering faster matrix multiplication algorithms with reinforcement learning
论文提出 AlphaTensor,用强化学习搜索矩阵乘法算法。
AI 与机器学习2022 · 518 分 · 111 评专业 · 约 90 分钟编辑精选对抗策略击败超人类围棋 AI
Adversarial policies beat superhuman Go AIs (2023)
论文研究顶级围棋 AI KataGo 的对抗性漏洞:训练一个对抗策略与冻结的 KataGo 对弈,不靠更强棋力,而是诱导 KataGo 在有利于对手时提前结束或认输。
AI 与机器学习2022 · 501 分 · 185 评 · 引用 5进阶 · 约 60 分钟编辑精选