Downloads · 30 days
22
23% of all-time downloads
Anoy123423123/MSA-4B
MSA-4B is a question answering model from Anoy123423123. Use it when the input is a question plus a passage. The card lists the license as mit.
Anonymous release for peer review. Inference and evaluation code lives in a separate repository: Anoy123423123/MSA-Code.
Downloads · 30 days
22
23% of all-time downloads
All-time downloads
94
Public
Parameters
4.3B
8.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8.5 GB · 100%
From the Hugging Face model README
Anonymous release for peer review. Inference and evaluation code lives in a separate repository:
Anoy123423123/MSA-Code.
Long-term memory is essential for general intelligence, yet the full attention bottleneck constrains most LLMs' effective context length to 128K–1M. Existing attempts — hybrid linear attention, fixed-size state memory (e.g., RNNs), and external storage like RAG/agents — either suffer rapid precision decay and latency growth at extreme scales, lack end-to-end differentiability or dynamic memory maintenance, or require complex pipelines. We present Memory Sparse Attention (MSA): an end-to-end trainable, scalable sparse latent-state memory framework. Core ideas include:
On long-context QA and NIAH (Needle-in-a-Haystack) benchmarks, MSA surpasses same-backbone RAG, best-of-breed RAG stacks, and leading long-context models. Across an unprecedented 16K→100M token range, MSA shows < 9% degradation, suggesting a practical path to decouple memory capacity from reasoning.
This model is based on Qwen3-4B-Instruct-2507 with Memory Sparse Attention (MSA).
This checkpoint cannot be loaded with AutoModel.from_pretrained alone — the architecture is
MSAForCausalLM (model_type: msa), which is implemented in the code repository rather than in
transformers. Follow the steps below.
Full instructions, hardware requirements, results tables and troubleshooting are in the code
repository: Anoy123423123/MSA-Code.
The short version:
# 1. Code
pip install -U "huggingface_hub==0.31.4"
huggingface-cli download Anoy123423123/MSA-Code --repo-type=model --local-dir MSA
cd MSA
# 2. Environment (transformers must be exactly 4.51.3)
conda create -n msa python=3.12 -y && conda activate msa
pip install -r requirements.txt
pip install flash-attn==2.7.4.post1 --no-build-isolation
# 3. These weights
huggingface-cli download --resume-download Anoy123423123/MSA-4B --local-dir ckpt/MSA-4B
# 4. Reproduce the benchmarks (data is fetched automatically on first run)
bash scripts/run_benchmarks.sh eval_benchmark
# 5. LLM-judge scores
export OPENROUTER_API_KEY=<your key>
bash scripts/calculate_llm_score.sh eval_benchmark
Requires 8× 80GB GPUs for the default benchmark suite; the 100M-token ms_100M setting runs on
2× A800 via Memory Parallel.
| Code | Anoy123423123/MSA-Code |
| Weights (this repo) | Anoy123423123/MSA-4B |
| Benchmark data | Anoy123423123/MSA-RAG-BENCHMARKS |
MIT.