Maria-1B-SMQA
A compact language model with innovative attention architecture
2 min read
Maria-1B-SMQA is an open language model with 1.07 billion parameters, built on the Soft-Mixture Query Attention (SMQA) architecture. It solves the balance problem between query expressiveness and memory efficiency, ensuring high generation speed on long contexts. The model inherited pre-training from the base Maria-1B version and offers a new approach to attention routing without token loss. It is well-suited for researchers and developers studying transformer optimization and efficient VRAM usage.
Key features
- New SMQA architecture: separates query capacity and key-value cache (KV cache) volume for resource optimization.
- High speed: 2.43x acceleration in processing long context (L=16,384) compared to traditional methods.
- Accuracy: outperforms standard GQA (Grouped-Query Attention) by 100 points in perplexity.
- Low VRAM consumption: requires only about 605.9 MB of memory when working with long context.
What you can do
- Architecture testing: run the model in your Python scripts to evaluate text generation speed and quality.
- Benchmark comparison: test SMQA performance on long contexts relative to standard MHA and MLA approaches.
- Attention research: study continuous differentiable routing and soft-mixture of query bases.
- Pipeline integration: use the model as a lightweight component for text generation tasks with trust_remote_code support.
Example
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Zahid2005/Maria-1B-SMQA"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
prompt = "The architecture of a transformer model consists of"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=100,
temperature=0.7,
top_p=0.9,
do_sample=True
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Read more
Details• Parameters: 1.07B total (811M non-embedding), hidden size 2048, 18 layers.
• Performance: attention latency at L=16,384 is 63.18 ms with 605.9 MB VRAM consumption.
• Context: supports length up to 8,192 tokens (RoPE theta = 500,000.0).
• Weights format: SafeTensors in FP16 precision, vocabulary of 128,256 tokens.










Comments