Text Generation
Transformers
Safetensors
English
arloop_baseline
arloop
recurrent
custom_code
pretrained
Instructions to use osunlp/PreNormLoop-0.6B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use osunlp/PreNormLoop-0.6B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="osunlp/PreNormLoop-0.6B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("osunlp/PreNormLoop-0.6B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use osunlp/PreNormLoop-0.6B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "osunlp/PreNormLoop-0.6B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "osunlp/PreNormLoop-0.6B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/osunlp/PreNormLoop-0.6B
- SGLang
How to use osunlp/PreNormLoop-0.6B 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 "osunlp/PreNormLoop-0.6B" \ --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": "osunlp/PreNormLoop-0.6B", "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 "osunlp/PreNormLoop-0.6B" \ --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": "osunlp/PreNormLoop-0.6B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use osunlp/PreNormLoop-0.6B with Docker Model Runner:
docker model run hf.co/osunlp/PreNormLoop-0.6B
Simplify model card and hide internal checkpoint filenames
Browse files
README.md
CHANGED
|
@@ -14,19 +14,13 @@ tags:
|
|
| 14 |
# ARLoop-baseline-0.6B
|
| 15 |
|
| 16 |
This is the fixed-loop PreNorm baseline for ARLoop. This release
|
| 17 |
-
contains the final checkpoint of the approximately 180B-token run
|
| 18 |
-
`prenorm640m-l3-hybrid500b23-180b-lr3e3-gbs256-mbs4-s4096`.
|
| 19 |
It is a **base pretrained model** for text completion, not a chat/SFT model.
|
| 20 |
|
| 21 |
Training code: [ykyaol7/ARLoop](https://github.com/ykyaol7/ARLoop).
|
| 22 |
-
The loading implementation and file layout follow
|
| 23 |
-
[ARLoop-1.3B](https://huggingface.co/osunlp/ARLoop-1.3B).
|
| 24 |
|
| 25 |
## Load and generate
|
| 26 |
|
| 27 |
-
The included implementation uses PyTorch SDPA and standard pre-norm residual additions.
|
| 28 |
-
No ARLoop source checkout, FLA, Triton or flash-attn installation is required.
|
| 29 |
-
|
| 30 |
```bash
|
| 31 |
pip install 'transformers==5.22.0' safetensors
|
| 32 |
# Install a PyTorch build suitable for your CPU or CUDA environment separately.
|
|
@@ -48,11 +42,6 @@ with torch.inference_mode():
|
|
| 48 |
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
| 49 |
```
|
| 50 |
|
| 51 |
-
Keep the weights in FP32: the implementation preserves FP32 residuals and value embeddings with BF16
|
| 52 |
-
autocast internally, matching the training model's mixed-precision policy.
|
| 53 |
-
Total prompt plus generation length must not exceed 4096. For batches, the
|
| 54 |
-
tokenizer uses left padding; pass its `attention_mask` to the model.
|
| 55 |
-
|
| 56 |
## Architecture
|
| 57 |
|
| 58 |
| Property | Value |
|
|
@@ -68,50 +57,14 @@ tokenizer uses left padding; pass its `attention_mask` to the model.
|
|
| 68 |
| Tokenizer vocabulary | 49152, SmolLM2 tokenizer used in training |
|
| 69 |
| Output head | Tied to token embeddings |
|
| 70 |
|
| 71 |
-
|
| 72 |
-
model also allocated an unused 75,497,472-parameter output head despite using
|
| 73 |
-
tied embeddings; that unused weight is omitted here. Duplicate shared value
|
| 74 |
-
embedding tensors are stored once. The exported weights retain their original
|
| 75 |
-
FP32 values without lossy conversion.
|
| 76 |
-
|
| 77 |
-
## Training checkpoint
|
| 78 |
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
| Property | Value |
|
| 82 |
-
| --- | --- |
|
| 83 |
-
| Original filename | `step-01373280-prenorm640m-l3-hybrid500b23-180b-lr3e3-gbs256-mbs4-s4096` |
|
| 84 |
-
| Saved microbatch step | 1,373,280 |
|
| 85 |
-
| Saved optimizer step | 171,660 |
|
| 86 |
-
| Global batch size | 256 sequences |
|
| 87 |
-
| Sequence length | 4096 tokens |
|
| 88 |
-
| Training tokens | 179,998,556,160 |
|
| 89 |
-
|
| 90 |
-
The token count is calculated from the saved optimizer step × 256 × 4096.
|
| 91 |
-
Step labels in original filenames are microbatch steps, not optimizer steps.
|
| 92 |
-
For reproducible experiments, pin the model repository's commit SHA.
|
| 93 |
-
|
| 94 |
-
## Files and validation
|
| 95 |
-
|
| 96 |
-
- `configuration_baseline.py`, `modeling_baseline.py`: standalone Transformers
|
| 97 |
-
loading code matching the native fixed-loop PreNorm architecture.
|
| 98 |
-
- `config.json`, `generation_config.json`: architecture and generation defaults.
|
| 99 |
-
- Two `model-*.safetensors` shards and `model.safetensors.index.json`: FP32 weights.
|
| 100 |
-
- Tokenizer JSON, vocabulary, merges and special-token metadata.
|
| 101 |
|
| 102 |
-
|
| 103 |
-
shared embeddings, and tokenizer vocabulary/merge consistency with the training
|
| 104 |
-
run. Standalone loading, forward/loss and batched cached generation were tested
|
| 105 |
-
with Python 3.12, PyTorch 2.6.0 (CPU) and Transformers 5.22.0, with imports of the
|
| 106 |
-
training packages and FLA blocked. On the tested CPU input, logits exactly matched the native PreNorm model,
|
| 107 |
-
and cached chunk inference exactly matched full forward inference. These are
|
| 108 |
-
functional checks, not benchmark evaluations. GPU inference has not been tested
|
| 109 |
-
for this release; different attention kernels may differ numerically in BF16.
|
| 110 |
|
| 111 |
-
|
| 112 |
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
The tokenizer files are copied from the training run's SmolLM2 tokenizer assets;
|
| 117 |
-
these model weights were trained independently of SmolLM2.
|
|
|
|
| 14 |
# ARLoop-baseline-0.6B
|
| 15 |
|
| 16 |
This is the fixed-loop PreNorm baseline for ARLoop. This release
|
| 17 |
+
contains the final checkpoint of the approximately 180B-token training run.
|
|
|
|
| 18 |
It is a **base pretrained model** for text completion, not a chat/SFT model.
|
| 19 |
|
| 20 |
Training code: [ykyaol7/ARLoop](https://github.com/ykyaol7/ARLoop).
|
|
|
|
|
|
|
| 21 |
|
| 22 |
## Load and generate
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
```bash
|
| 25 |
pip install 'transformers==5.22.0' safetensors
|
| 26 |
# Install a PyTorch build suitable for your CPU or CUDA environment separately.
|
|
|
|
| 42 |
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
| 43 |
```
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
## Architecture
|
| 46 |
|
| 47 |
| Property | Value |
|
|
|
|
| 57 |
| Tokenizer vocabulary | 49152, SmolLM2 tokenizer used in training |
|
| 58 |
| Output head | Tied to token embeddings |
|
| 59 |
|
| 60 |
+
## License
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
+
Model release: [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
+
## Training checkpoints
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
+
`main` contains the final checkpoint.
|
| 67 |
|
| 68 |
+
| Optimizer step | Training tokens | Revision |
|
| 69 |
+
| ---: | ---: | --- |
|
| 70 |
+
| 171,660 (final) | 179,998,556,160 | [main](https://huggingface.co/osunlp/ARLoop-baseline-0.6B/tree/main) |
|
|
|
|
|
|