MultiHashFormer: Hash-based Generative Language Models

TL;DR

MultiHashFormer employs a multi-hash signature mechanism supporting causal language modeling, outperforming standard Transformers across 100M-3B parameters, with zero-parameter multilingual vocabulary expansion.

cs.CL 🔴 Advanced 2026-06-26 90 views
Huiyin Xue Atsuki Yamaguchi Nikolaos Aletras
Natural Language Processing Hash Encoding Generative Models Parameter Efficiency Multilingual Expansion

Key Findings

Methodology

MultiHashFormer introduces a multi-hash signature framework where each token is represented by a sequence of discrete hash IDs generated by multiple independent hash functions, effectively avoiding the multi-to-one collision problem inherent in traditional hash models. The architecture comprises three core modules: a Hash Encoder compresses the multi-ID signature into a dense latent vector; a Transformer decoder processes the sequence; and a Hash Decoder autoregressively reconstructs the next token's hash signature, which is then mapped back to text. This design supports causal language modeling, with experiments conducted at 100M, 1B, and 3B scales demonstrating consistent outperformance over standard Transformer models. The approach also enables vocabulary expansion from 32K to 48K tokens without additional parameters, maintaining performance across multilingual tasks.

Key Results

  • Across 100M, 1B, and 3B parameter models, MultiHashFormer consistently surpasses baseline Transformers on multiple benchmarks, notably achieving a 4.93% increase on LAMBADA and an 8.62% increase on the same task at the 3B scale. In the 1B model, the H4B16K configuration scored 64.90 on ReCoRD, exceeding the baseline's 63.78, indicating a significant performance gain. The models also demonstrated robust multilingual vocabulary expansion, supporting a 46.9% larger vocabulary without parameter increase, and outperforming standard models in Arabic, Chinese, and Hindi tasks.
  • In semantic similarity evaluations on Card-660, the models showed higher correlation coefficients (Pearson and Spearman) than standard models, especially in the second-to-last hidden states, confirming their superior ability to represent rare words semantically. This indicates that the multi-hash signature approach enhances the semantic encoding of infrequent vocabulary items.
  • The models' ability to expand vocabulary without parameter growth was validated by experiments where the vocabulary was increased from 32K to 48K tokens, with the models maintaining or improving performance in multilingual tasks. This demonstrates the framework's scalability and robustness, making it suitable for large-scale, multi-language applications.

Significance

This research addresses the fundamental bottleneck of linear vocabulary scaling in language models by introducing a parameter-efficient multi-hash signature mechanism. It enables models to handle vastly larger vocabularies and better represent rare words, which are critical for real-world applications such as multilingual translation, low-resource language processing, and domain adaptation. The approach paves the way for deploying large-scale, multilingual generative models with significantly reduced parameter footprints, reducing computational costs and facilitating broader accessibility. Its ability to support causal autoregressive generation while maintaining high performance marks a significant advancement in NLP model architecture, with potential impacts spanning academia and industry.

Technical Contribution

The core technical innovation lies in the multi-hash signature framework that replaces traditional embedding matrices, allowing each token to be represented by a unique sequence of hash IDs. This approach effectively prevents hash collisions during autoregressive generation, a challenge in previous hash-based models limited to encoder-only architectures. The integration of a Gated Compositional Embedding module and a Cascaded Predictor for iterative hash signature reconstruction ensures deterministic token recovery. The architecture's independence from specific sequence processing backbones and its scalability across different parameter sizes demonstrate its versatility. Theoretical analysis confirms that the model can support an astronomically large number of signatures with minimal parameters, opening new avenues for parameter-efficient large vocabulary modeling.

Novelty

This work is the first to enable causal language modeling with hash-based signatures that avoid multi-to-one collisions, overcoming the limitations of prior hash models restricted to discriminative or encoder-only tasks. The multi-ID signature approach, combined with a structured autoregressive decoder, introduces a novel way to decouple vocabulary size from parameter count, supporting exponential growth in vocabulary capacity without parameter increase. This represents a fundamental shift from traditional embedding-based methods, offering a scalable, language-agnostic solution for large-scale generative modeling.

Limitations

  • Despite its advantages, the model's performance on extremely sparse or highly long-tail vocabulary items can degrade due to increased hash collision probabilities, especially with limited hash functions or bucket sizes.
  • The discrete nature of hash signatures may introduce noise or ambiguity in semantic representations, potentially impacting tasks requiring fine-grained semantic distinctions.
  • Current experiments focus on moderate vocabulary sizes and multilingual settings; scaling to very large vocabularies or integrating multimodal data remains an open challenge, requiring further research.

Future Work

Future directions include developing adaptive hash functions that dynamically optimize for collision avoidance, integrating multi-modal data to extend the framework beyond text, and exploring learned hashing strategies to further improve semantic fidelity. Additionally, investigating the impact of different hash function parameters and architectures on model robustness and scalability will be crucial. Extending the approach to unsupervised or semi-supervised settings, and deploying in real-world multilingual applications, will be key steps toward practical adoption.

AI Executive Summary

The rapid growth of language models has been driven by increasing parameter counts and expanding vocabularies, yet this trend faces fundamental limitations due to the linear scaling of embedding matrices. As vocabulary sizes reach hundreds of thousands or millions, the parameter footprint becomes prohibitively large, hindering deployment and scalability. Existing solutions, such as subword tokenization, partially mitigate this issue but still struggle with rare or out-of-domain words, especially in multilingual contexts.

In response, the authors propose MultiHashFormer, a novel architecture that leverages a multi-hash signature mechanism to represent tokens. Instead of traditional dense embeddings, each token is mapped to a sequence of discrete hash IDs generated by multiple independent hash functions. This multi-ID signature ensures collision avoidance, enabling the model to support an astronomically large vocabulary with minimal parameters. The model architecture comprises three core modules: a Hash Encoder compresses the multi-ID signature into a dense latent vector; a Transformer decoder processes the sequence, capturing contextual information; and a Hash Decoder autoregressively reconstructs the next token's hash signature, which is then deterministically mapped back to text.

This innovative design allows the model to operate efficiently across different scales—100M, 1B, and 3B parameters—while outperforming standard Transformer models on multiple benchmarks, including language modeling, reasoning, and reading comprehension tasks. Notably, the model maintains performance during vocabulary expansion from 32K to 48K tokens without additional parameters, demonstrating its scalability and robustness in multilingual settings.

The technical novelty lies in the multi-hash signature framework, which addresses the collision problem inherent in hash-based models. By combining multiple hash functions and a structured autoregressive decoder, the approach guarantees deterministic token recovery and supports exponential vocabulary growth. The integration of a Gated Compositional Embedding module and a cascaded predictor further enhances the model's ability to generate accurate hash signatures.

Experimental results confirm that MultiHashFormer achieves significant improvements over baseline models, especially in low-resource and rare word scenarios. Its capacity to expand vocabulary without parameter increase opens new avenues for multilingual NLP, domain adaptation, and resource-constrained deployment. While challenges remain—such as handling extremely sparse vocabulary items and scaling to larger datasets—the framework sets a new standard for parameter-efficient, large-scale language modeling.

Overall, MultiHashFormer represents a breakthrough in NLP architecture, combining theoretical innovation with practical effectiveness, and promises to influence future research directions in scalable, multilingual generative models.

Deep Dive

Abstract

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.

cs.CL cs.AI cs.LG

References (20)

RACE: Large-scale ReAding Comprehension Dataset From Examinations

Guokun Lai, Qizhe Xie, Hanxiao Liu et al.

2017 1643 citations ⭐ Influential View Analysis →

Breaking the Softmax Bottleneck: A High-Rank RNN Language Model

Zhilin Yang, Zihang Dai, R. Salakhutdinov et al.

2017 425 citations ⭐ Influential View Analysis →

HellaSwag: Can a Machine Really Finish Your Sentence?

Rowan Zellers, Ari Holtzman, Yonatan Bisk et al.

2019 4433 citations ⭐ Influential View Analysis →

Crowdsourcing Multiple Choice Science Questions

Johannes Welbl, Nelson F. Liu, Matt Gardner

2017 868 citations ⭐ Influential View Analysis →

Attention is All you Need

Ashish Vaswani, Noam Shazeer, Niki Parmar et al.

2017 182071 citations ⭐ Influential View Analysis →

Canine: Pre-training an Efficient Tokenization-Free Encoder for Language Representation

J. Clark, Dan Garrette, Iulia Turc et al.

2021 304 citations View Analysis →

HashFormers: Towards Vocabulary-independent Pre-trained Transformers

Huiyin Xue, Nikolaos Aletras

2022 6 citations View Analysis →

Attention Approximates Sparse Distributed Memory

Trenton Bricken, Cengiz Pehlevan

2021 41 citations View Analysis →

Continually Adding New Languages to Multilingual Language Models

Abraham Toluwase Owodunni, Sachin Kumar

2025 5 citations View Analysis →

AdaptiVocab: Enhancing LLM Efficiency in Focused Domains through Lightweight Vocabulary Adaptation

Itay Nakash, Nitay Calderon, E. B. David et al.

2025 13 citations View Analysis →

Adapt-and-Distill: Developing Small, Fast and Effective Pretrained Language Models for Domains

Yunzhi Yao, Shaohan Huang, Wenhui Wang et al.

2021 57 citations View Analysis →

How brains make chaos in order to make sense of the world

Ronald Rosenfeld, D. Touretzky

1987 1987 citations

ReCoRD: Bridging the Gap between Human and Machine Commonsense Reading Comprehension

Sheng Zhang, Xiaodong Liu, Jingjing Liu et al.

2018 352 citations View Analysis →

From Bytes to Ideas: Language Modeling with Autoregressive U-Nets

Mathurin Videau, Badr Youbi Idrissi, A. Leite et al.

2025 14 citations View Analysis →

Parsing Natural Scenes and Natural Language with Recursive Neural Networks

R. Socher, Cliff Chiung-Yu Lin, A. Ng et al.

2011 1487 citations

SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processing

Taku Kudo, John Richardson

2018 4159 citations View Analysis →

A Corpus and Cloze Evaluation for Deeper Understanding of Commonsense Stories

N. Mostafazadeh, Nathanael Chambers, Xiaodong He et al.

2016 815 citations View Analysis →

Compressing Transformer-Based Semantic Parsing Models using Compositional Code Embeddings

P. Prakash, Saurabh Kumar Shashidhar, Wenlong Zhao et al.

2020 6 citations View Analysis →

Measuring Massive Multitask Language Understanding

Dan Hendrycks, Collin Burns, Steven Basart et al.

2020 8663 citations View Analysis →

ALBERT: A Lite BERT for Self-supervised Learning of Language Representations

Zhenzhong Lan, Mingda Chen, Sebastian Goodman et al.

2019 7541 citations View Analysis →