MultiHashFormer:基于哈希的生成式语言模型
阅读原文· arxiv.orgMultiHashFormer 使用多个独立哈希函数将每个 token 编码为短哈希 ID 序列,由 Hash Encoder 压缩为隐向量后经 Transformer 解码器处理,再由 Hash Decoder 生成下一 token 的哈希签名并映射回文本,实现基于哈希的自回归生成。在 100M、1B 和 3B 参数规模下,它在多项基准上持续优于标准 Transformer 语言模型,并支持多语言词汇表扩展而不增加参数量。
Language models (LMs) represent tokens using embedding matrices that scale linearly with the vocabulary size. To constrain the parameter footprint, prior work proposes hashing many tokens into a single vector within encoder-only models. While this offers parameter efficiency, many-to-one collisions prevent its use in causal LMs. In this paper, we propose MultiHashFormer, a new framework that allows hash-based autoregression. Each token is represented as a unique hash signature, a short sequence of discrete hash IDs, generated by multiple independent hash functions. A Hash Encoder compresses this signature into a single latent vector for processing by a Transformer decoder. Then, a Hash Decoder generates the hash signature of the next token, which is then mapped back to text. We evaluate our approach at the 100M, 1B and 3B parameter scales, demonstrating that MultiHashFormer consistently outperforms standard Transformer LMs across multiple benchmarks. Furthermore, we show that our model handles multilingual vocabulary expansion with a constant parameter footprint without any modifications.