Text Generation
Transformers
Safetensors
ouro
looped-language-model
recurrent-depth
reinforcement-learning
grpo
math
conversational
custom_code
Instructions to use omar81939/Ouro-1.4B-Thinking-depth-GRPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use omar81939/Ouro-1.4B-Thinking-depth-GRPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="omar81939/Ouro-1.4B-Thinking-depth-GRPO", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("omar81939/Ouro-1.4B-Thinking-depth-GRPO", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use omar81939/Ouro-1.4B-Thinking-depth-GRPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "omar81939/Ouro-1.4B-Thinking-depth-GRPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "omar81939/Ouro-1.4B-Thinking-depth-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/omar81939/Ouro-1.4B-Thinking-depth-GRPO
- SGLang
How to use omar81939/Ouro-1.4B-Thinking-depth-GRPO 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 "omar81939/Ouro-1.4B-Thinking-depth-GRPO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "omar81939/Ouro-1.4B-Thinking-depth-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "omar81939/Ouro-1.4B-Thinking-depth-GRPO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "omar81939/Ouro-1.4B-Thinking-depth-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use omar81939/Ouro-1.4B-Thinking-depth-GRPO with Docker Model Runner:
docker model run hf.co/omar81939/Ouro-1.4B-Thinking-depth-GRPO
Simplify model card to usage
Browse files
README.md
CHANGED
|
@@ -11,104 +11,21 @@ tags:
|
|
| 11 |
- math
|
| 12 |
---
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
-
RL fine-tune of [ByteDance/Ouro-1.4B-Thinking](https://huggingface.co/ByteDance/Ouro-1.4B-Thinking)
|
| 17 |
-
in which the **loop count `r` is part of the RL action and is priced**. Trained with GRPO for 400
|
| 18 |
-
steps, rolling out every prompt at `r ∈ {2, 4, 8, 16}` with advantages computed *across* depth
|
| 19 |
-
groups and a linear cost `λ·(r/16)`, `λ = 0.1`.
|
| 20 |
-
|
| 21 |
-
**Depths `r = 24` and `r = 32` were never rolled out during RL.** They are evaluation-only.
|
| 22 |
-
|
| 23 |
-
Initialized from the SFT baseline
|
| 24 |
-
[`omar81939/Ouro-1.4B-Thinking-depth-SFT`](https://huggingface.co/omar81939/Ouro-1.4B-Thinking-depth-SFT) (called **W-A** below) — you need that checkpoint to
|
| 25 |
-
reproduce the comparison, because every number here is GRPO-vs-W-A, not GRPO-vs-base-Ouro.
|
| 26 |
-
|
| 27 |
-
## What this checkpoint does and does not do
|
| 28 |
-
|
| 29 |
-
**Read this before quoting a number.**
|
| 30 |
-
|
| 31 |
-
- It substantially repairs the base model's collapse at loop depths beyond the trained horizon.
|
| 32 |
-
- It does **not** make depth buy accuracy. This model's own accuracy still *falls* monotonically
|
| 33 |
-
with `r`: 0.840 → 0.802 → 0.660 → 0.478 across `r = 4/16/24/32`. Deeper is still worse.
|
| 34 |
-
- The mechanism is largely **termination**, not reasoning. At `r = 32` the W-A baseline hits the
|
| 35 |
-
3,072-token budget on 84.4% of MATH-500 problems versus 17.2% for this model, and of the 168
|
| 36 |
-
problems this model gets right where W-A fails, 160 are cases where W-A ran out of tokens or
|
| 37 |
-
never emitted a boxed answer.
|
| 38 |
-
- It is a **single training seed** (1234) evaluated on **MATH-500 only**. A confirmation run on a
|
| 39 |
-
second seed and an objective ablation (`λ = 0`, within-depth advantages) were pre-registered and
|
| 40 |
-
had not run when this was uploaded.
|
| 41 |
-
- The model also carries a depth-selection head trained against `Q(r) = mean reward − λ·(r/16)`,
|
| 42 |
-
but the sampler never consulted it during training and its behavior was never evaluated. **No
|
| 43 |
-
adaptive per-prompt depth allocation is claimed.**
|
| 44 |
-
|
| 45 |
-
## Results
|
| 46 |
-
|
| 47 |
-
MATH-500, greedy, 3,072-token budget, n = 500. `trunc` = share of generations that hit the budget.
|
| 48 |
-
|
| 49 |
-
| depth | base Ouro | W-A (SFT) acc / trunc | this model acc / trunc | Δ acc |
|
| 50 |
-
|---|---|---|---|---|
|
| 51 |
-
| r = 4 | 0.710 | 0.676 / 34.6% | **0.840** / 6.2% | +16.4 |
|
| 52 |
-
| r = 16 | 0.058 | 0.620 / 38.8% | **0.802** / 5.6% | +18.2 |
|
| 53 |
-
| r = 24 (never trained) | 0.004 | 0.378 / 62.0% | **0.660** / 8.6% | +28.2 |
|
| 54 |
-
| r = 32 (never trained) | 0.000 | 0.178 / 84.4% | **0.478** / 17.2% | +30.0 |
|
| 55 |
-
|
| 56 |
-
A pre-registered gate — the falloff from `r = 16` must be shallower than the baseline's, judged on
|
| 57 |
-
a paired item-level bootstrap (20,000 draws, Bonferroni-adjusted 97.5% lower bounds) — passed at
|
| 58 |
-
both untrained depths: `W(24) = +10.0` (LB +3.8) and `W(32) = +11.8` (LB +4.8). The identical
|
| 59 |
-
analysis **failed** 50 steps earlier at step 350 (LBs −1.0 and −0.8), which is why the
|
| 60 |
-
single-seed caveat above matters.
|
| 61 |
-
|
| 62 |
-
## Usage
|
| 63 |
-
|
| 64 |
-
The loop count is a config field, `total_ut_steps`. It is read at model-construction time, so set
|
| 65 |
-
it when you load:
|
| 66 |
|
| 67 |
```python
|
| 68 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 69 |
|
| 70 |
REPO = "omar81939/Ouro-1.4B-Thinking-depth-GRPO"
|
| 71 |
-
|
|
|
|
|
|
|
| 72 |
model = AutoModelForCausalLM.from_pretrained(
|
| 73 |
-
REPO,
|
| 74 |
-
|
|
|
|
|
|
|
| 75 |
)
|
| 76 |
```
|
| 77 |
|
| 78 |
-
With vLLM,
|
| 79 |
-
changed per-request after engine init.
|
| 80 |
-
|
| 81 |
-
The exported weights are BF16 and the config ships `total_ut_steps: 4`, matching the base model's
|
| 82 |
-
default. Evaluation numbers above were produced by overriding it per run.
|
| 83 |
-
|
| 84 |
-
## Training
|
| 85 |
-
|
| 86 |
-
| | |
|
| 87 |
-
|---|---|
|
| 88 |
-
| Base | ByteDance/Ouro-1.4B-Thinking → SFT (W-A) → GRPO |
|
| 89 |
-
| RL steps | 400 |
|
| 90 |
-
| Rollouts | 48 prompts × 4 depths × 4 generations = 768 sequences/step |
|
| 91 |
-
| Depths sampled | r ∈ {2, 4, 8, 16} |
|
| 92 |
-
| Reward | first-boxed-answer correctness, + a small bonus for emitting a parseable box |
|
| 93 |
-
| Depth pricing | `Q(r) = mean reward − λ·(r/16)`, λ = 0.1, advantages across depth groups |
|
| 94 |
-
| Prompts | DeepScaleR, decontaminated against every eval set, pass@8-filtered → 8,932 prompts |
|
| 95 |
-
| Hardware | 8 × H100, ~23 days wall clock on preemptible partitions |
|
| 96 |
-
| Sampling (train) | temperature 1.0, top-p 1.0, 2,048-token responses |
|
| 97 |
-
|
| 98 |
-
The run was bitwise deterministic: every step logged parity records (307,200 sequence-level
|
| 99 |
-
comparisons across the run, zero failures), roughly 40 preemptions all replayed byte-identically,
|
| 100 |
-
and a mid-run migration reproduced a step byte-for-byte on a different cluster on another
|
| 101 |
-
continent.
|
| 102 |
-
|
| 103 |
-
## Limitations
|
| 104 |
-
|
| 105 |
-
Single seed. One benchmark. Math only. English only. The base model's own card notes it is a
|
| 106 |
-
research artifact, not a production model, and that applies here at least as strongly. Deeper loop
|
| 107 |
-
counts cost proportionally more compute for *lower* accuracy on this checkpoint, so there is no
|
| 108 |
-
setting of `r` above 4 that is recommended for use — the interest here is scientific.
|
| 109 |
-
|
| 110 |
-
## License and attribution
|
| 111 |
-
|
| 112 |
-
Apache-2.0, inherited from the base model. Base weights © ByteDance Seed, from
|
| 113 |
-
[Ouro-1.4B-Thinking](https://huggingface.co/ByteDance/Ouro-1.4B-Thinking) — see
|
| 114 |
-
["Scaling Latent Reasoning via Looped Language Models"](https://arxiv.org/abs/2510.25741).
|
|
|
|
| 11 |
- math
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# Usage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
```python
|
| 17 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 18 |
|
| 19 |
REPO = "omar81939/Ouro-1.4B-Thinking-depth-GRPO"
|
| 20 |
+
DEPTH = 16
|
| 21 |
+
|
| 22 |
+
tokenizer = AutoTokenizer.from_pretrained(REPO)
|
| 23 |
model = AutoModelForCausalLM.from_pretrained(
|
| 24 |
+
REPO,
|
| 25 |
+
trust_remote_code=True,
|
| 26 |
+
dtype="bfloat16",
|
| 27 |
+
total_ut_steps=DEPTH,
|
| 28 |
)
|
| 29 |
```
|
| 30 |
|
| 31 |
+
With vLLM, set `hf_overrides={"total_ut_steps": DEPTH}` when creating the engine.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|