MistralMosaic-24B-v2
Base language model with associative memory
2 min readupdated
The Eureka-COM/MistralMosaic-24B-v2 model is built on Mistral-Small-24B-Base-2501 by replacing attention layers with associative memory from the Two-stage Memory Mosaics+ architecture. Version v2 adds support for running without FlexAttention (on CPUs and CUDA GPUs using pure PyTorch), along with official 8-bit and 4-bit versions to save memory. The new model handles long texts and context structuring exceptionally well, maintaining efficiency on documents up to 131,072 tokens.
Key features
- Compatibility: Runs without FlexAttention via the native PyTorch path on CUDA GPUs and CPUs.
- VRAM savings: Ready-to-use 8-bit and 4-bit versions (via the bitsandbytes library) are available for running on lower-end hardware.
- Associative memory: Attention layers are split into short memory (windowed attention), long memory (Mosaics), and cluster memory.
- Context handling: Shows stability on long token sequences (tested up to 131k tokens).
What you can do
- Long document analysis: Upload large texts or chains of related documents using the doc_lengths parameter.
- Local deployment: Run the model in 8-bit or 4-bit mode on a single GPU using the transformers library.
- Long context research: Use the model as a base for experiments with the Memory Mosaics memory architecture in NLP tasks.
Example
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
name = "Eureka-COM/MistralMosaic-24B-v2"
tok = AutoTokenizer.from_pretrained(name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(name, trust_remote_code=True, dtype=torch.bfloat16, device_map="cuda")
ids = tok("The capital of Japan is", return_tensors="pt").input_ids.to(model.device)
out = model.generate(ids, max_new_tokens=32, do_sample=False)
print(tok.decode(out[0]))Read more
DetailsBenchmarks: MMLU (5-shot) — 76.1% (compared to 80.7% for the base model), JCommonsenseQA — 94.1%.
VRAM requirements: Weights in bf16 take about 63.0 GB, in 8-bit — 33.2 GB, in 4-bit — 18.3 GB.
Limitations: The model is not instruction-tuned and has not undergone safety alignment.
Training details: Distilled on 99,991,552 tokens (Cosmopedia and fineweb-2-edu-japanese).










Comments