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
Add model card with project links and citation
Browse files
README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
tags:
|
| 5 |
+
- memory-decoder
|
| 6 |
+
- parametric-memory
|
| 7 |
+
- long-term-memory
|
| 8 |
+
- memorydecoder-at-scale
|
| 9 |
+
- text-generation
|
| 10 |
+
- olmo
|
| 11 |
+
- law
|
| 12 |
+
datasets:
|
| 13 |
+
- Rubin-Wei/MemoryDecoder-at-Scale-domain-data
|
| 14 |
+
---
|
| 15 |
+
# MemoryDecoder-OLMo-1.7B-law
|
| 16 |
+
|
| 17 |
+
This repository contains the **1.7B law Memory Decoder** released
|
| 18 |
+
with [Memory Decoder at Scale](https://arxiv.org/abs/2607.27919). It is a pretrained parametric long-term
|
| 19 |
+
memory that can be swapped into a compatible frozen language-model backbone.
|
| 20 |
+
|
| 21 |
+
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.
|
| 22 |
+
|
| 23 |
+
This checkpoint is a memory component, not a standalone chat- or
|
| 24 |
+
instruction-tuned model. The memory and backbone must use compatible token IDs
|
| 25 |
+
and vocabularies.
|
| 26 |
+
|
| 27 |
+
## Model details
|
| 28 |
+
|
| 29 |
+
| Field | Value |
|
| 30 |
+
|---|---|
|
| 31 |
+
| Memory size | 1.7B class |
|
| 32 |
+
| Architecture/tokenizer family | Qwen3-style 1.7B memory; OLMo tokenizer/vocabulary |
|
| 33 |
+
| Domain | Law |
|
| 34 |
+
| Evaluation benchmark | LawBench |
|
| 35 |
+
| Intended backbone | Frozen OLMo-family model with the matching tokenizer/vocabulary |
|
| 36 |
+
| Release contents | Inference weights, configuration, and tokenizer files |
|
| 37 |
+
|
| 38 |
+
Optimizer states and training-resume artifacts are not part of this release.
|
| 39 |
+
|
| 40 |
+
## Usage
|
| 41 |
+
|
| 42 |
+
Install the matching environment from the [GitHub repository](https://github.com/LUMIA-Group/MemoryDecoder-at-Scale), then
|
| 43 |
+
set `MODEL_PATH` to a compatible frozen backbone and `MEMDEC_PATH` to this
|
| 44 |
+
repository:
|
| 45 |
+
|
| 46 |
+
```bash
|
| 47 |
+
MODEL_PATH=/path/to/compatible-base-model \
|
| 48 |
+
MEMDEC_PATH=Rubin-Wei/MemoryDecoder-OLMo-1.7B-law \
|
| 49 |
+
bash eval/opencompass/scripts/domain/evaluate_lawbench.sh
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
See the repository documentation and launcher for benchmark-specific options,
|
| 53 |
+
including interpolation weights and batch settings.
|
| 54 |
+
|
| 55 |
+
## Intended use and limitations
|
| 56 |
+
|
| 57 |
+
This checkpoint is intended for research and evaluation in the law
|
| 58 |
+
domain. Its outputs depend on the backbone, prompt, and interpolation settings.
|
| 59 |
+
Domain specialization does not guarantee factual correctness or safety, and the
|
| 60 |
+
model may inherit biases and errors from its training sources.
|
| 61 |
+
|
| 62 |
+
## Links
|
| 63 |
+
|
| 64 |
+
- [Project page](https://rubin-wei.github.io/memory-decoder-at-scale/)
|
| 65 |
+
- [GitHub repository](https://github.com/LUMIA-Group/MemoryDecoder-at-Scale)
|
| 66 |
+
- [Paper](https://arxiv.org/abs/2607.27919)
|
| 67 |
+
- [Model and data collection](https://huggingface.co/collections/Rubin-Wei/memorydecoder-at-scale)
|
| 68 |
+
- [Released domain data](https://huggingface.co/datasets/Rubin-Wei/MemoryDecoder-at-Scale-domain-data/tree/main/law)
|
| 69 |
+
|
| 70 |
+
## Citation
|
| 71 |
+
|
| 72 |
+
If you use this checkpoint, please cite:
|
| 73 |
+
|
| 74 |
+
```bibtex
|
| 75 |
+
@misc{wei2026memorydecoderscalepretrained,
|
| 76 |
+
title={Memory Decoder at Scale: A Pretrained, Parametric Long-Term Memory},
|
| 77 |
+
author={Rubin Wei and Jiaqi Cao and Jiarui Wang and Junming Zhang and Qipeng Guo and Bowen Zhou and Zhouhan Lin},
|
| 78 |
+
year={2026},
|
| 79 |
+
eprint={2607.27919},
|
| 80 |
+
archivePrefix={arXiv},
|
| 81 |
+
primaryClass={cs.CL},
|
| 82 |
+
url={https://arxiv.org/abs/2607.27919},
|
| 83 |
+
}
|
| 84 |
+
```
|