Text Generation
Transformers
Safetensors
qwen3
memory-decoder
parametric-memory
long-term-memory
memorydecoder-at-scale
olmo
law
text-generation-inference
Instructions to use Rubin-Wei/MemoryDecoder-OLMo-1.7B-law with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Rubin-Wei/MemoryDecoder-OLMo-1.7B-law with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Rubin-Wei/MemoryDecoder-OLMo-1.7B-law")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Rubin-Wei/MemoryDecoder-OLMo-1.7B-law") model = AutoModelForCausalLM.from_pretrained("Rubin-Wei/MemoryDecoder-OLMo-1.7B-law", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Rubin-Wei/MemoryDecoder-OLMo-1.7B-law with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Rubin-Wei/MemoryDecoder-OLMo-1.7B-law" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rubin-Wei/MemoryDecoder-OLMo-1.7B-law", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Rubin-Wei/MemoryDecoder-OLMo-1.7B-law
- SGLang
How to use Rubin-Wei/MemoryDecoder-OLMo-1.7B-law with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Rubin-Wei/MemoryDecoder-OLMo-1.7B-law" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rubin-Wei/MemoryDecoder-OLMo-1.7B-law", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Rubin-Wei/MemoryDecoder-OLMo-1.7B-law" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rubin-Wei/MemoryDecoder-OLMo-1.7B-law", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Rubin-Wei/MemoryDecoder-OLMo-1.7B-law with Docker Model Runner:
docker model run hf.co/Rubin-Wei/MemoryDecoder-OLMo-1.7B-law
File size: 3,196 Bytes
4c23be2 1a6969b 4c23be2 1a6969b 4c23be2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | ---
library_name: transformers
license: apache-2.0
tags:
- memory-decoder
- parametric-memory
- long-term-memory
- memorydecoder-at-scale
- text-generation
- olmo
- law
datasets:
- Rubin-Wei/MemoryDecoder-at-Scale-domain-data
---
# MemoryDecoder-OLMo-1.7B-law
## Resources
- [Project Page: Memory Decoder at Scale](https://rubin-wei.github.io/memory-decoder-at-scale/)
- [GitHub Repository: LUMIA-Group/MemoryDecoder-at-Scale](https://github.com/LUMIA-Group/MemoryDecoder-at-Scale)
- [Paper: Memory Decoder at Scale: A Pretrained, Parametric Long-Term Memory](https://arxiv.org/abs/2607.27919)
- [Hugging Face Collection: MemoryDecoder-at-Scale](https://huggingface.co/collections/Rubin-Wei/memorydecoder-at-scale)
- [Dataset: MemoryDecoder-at-Scale Domain Data (Law)](https://huggingface.co/datasets/Rubin-Wei/MemoryDecoder-at-Scale-domain-data/tree/main/law)
This repository contains the **1.7B law Memory Decoder** released
with [Memory Decoder at Scale](https://arxiv.org/abs/2607.27919). It is a pretrained parametric long-term
memory that can be swapped into a compatible frozen language-model backbone.
This OLMo-vocabulary memory was trained for two epochs on the law CPT corpus. The released configuration uses the OLMo vocabulary so that the memory can be combined with a vocabulary-compatible frozen OLMo backbone.
This checkpoint is a memory component, not a standalone chat- or
instruction-tuned model. The memory and backbone must use compatible token IDs
and vocabularies.
## Model details
| Field | Value |
|---|---|
| Memory size | 1.7B class |
| Architecture/tokenizer family | Qwen3-style 1.7B memory; OLMo tokenizer/vocabulary |
| Domain | Law |
| Evaluation benchmark | LawBench |
| Intended backbone | Frozen OLMo-family model with the matching tokenizer/vocabulary |
| Release contents | Inference weights, configuration, and tokenizer files |
## Usage
Install the matching environment from
[LUMIA-Group/MemoryDecoder-at-Scale](https://github.com/LUMIA-Group/MemoryDecoder-at-Scale), then
set `MODEL_PATH` to a compatible frozen backbone and `MEMDEC_PATH` to this
repository:
```bash
MODEL_PATH=/path/to/compatible-base-model \
MEMDEC_PATH=Rubin-Wei/MemoryDecoder-OLMo-1.7B-law \
bash eval/opencompass/scripts/domain/evaluate_lawbench.sh
```
See the repository documentation and launcher for benchmark-specific options,
including interpolation weights and batch settings.
## Intended use and limitations
This checkpoint is intended for research and evaluation in the law
domain. Its outputs depend on the backbone, prompt, and interpolation settings.
Domain specialization does not guarantee factual correctness or safety, and the
model may inherit biases and errors from its training sources.
## Citation
If you use this checkpoint, please cite:
```bibtex
@misc{wei2026memorydecoderscalepretrained,
title={Memory Decoder at Scale: A Pretrained, Parametric Long-Term Memory},
author={Rubin Wei and Jiaqi Cao and Jiarui Wang and Junming Zhang and Qipeng Guo and Bowen Zhou and Zhouhan Lin},
year={2026},
eprint={2607.27919},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2607.27919},
}
```
|