riea-r1-small - a compact model for semantic search and long context handling
2 min readupdated
riea-r1-small is a lightweight, open-weight multilingual semantic search model with a CPU-first focus, built on mmBERT-small. It uses adaptive token compression and matrix embeddings to efficiently encode queries and documents of varying lengths, with support for FP32, INT8, and 1-bit quantization. It is designed for developers who need fast and cost-effective document search without requiring powerful graphics cards.
Key features
- Token compression: Mid-layer adaptive compression (ATRR + SMRA) for handling long contexts.
- Matrix embeddings: Combined Matryoshka structure supporting nested dimensions [384, 256, 128].
- On-the-fly quantization: Support for FP32, FP16, INT8, and binary quantization (STE) to save memory.
- Clean data: Trained exclusively on commercially safe datasets with permissive licenses.
What you can do
- Semantic search: Implement fast search across text databases and documents on a CPU.
- Local deployment: Use ONNX and INT8 variants to run on standard processors and Apple Silicon.
- Text vectorization: Generate compact vector representations of text with fixed or reduced dimensionality.
Example
from ria import RIAEmbedder
model = RIAEmbedder.from_pretrained("Cyrax321/riea-r1-small")
query_vec = model.encode_query("How does adaptive token compression work?", output_dim=256)
doc_vecs = model.encode_documents(
["Mid-layer compression retains high-salience entities after layer 6."],
output_dim=256,
compression_ratio=0.5,
precision="int8",
)
scores = model.similarity(query_vec, doc_vecs)Read more
DetailsModel size: ~0.14 billion parameters (base weight 570 MB).
Hardware: Trained on NVIDIA T4 (16 GB), supports running on CPU, Apple Silicon, and CUDA.
Performance: CPU p50 from 43.47 to 139.35 ms depending on the variant (ONNX INT8 / FP16).
License: GNU AGPL-3.0.










Comments