Views
No views yet

transformers==4.54.1for compatibility.
config.json file:1{
2 "total_ut_steps": 4,
3 "early_exit_threshold": 1.0
4}total_ut_steps: Controls the number of recurrent steps (default: 4). You can adjust this value to trade off between performance and computation time.early_exit_threshold: Controls the adaptive exit mechanism (default: 1.0). Lower values encourage earlier exit, while 1.0 means always use all steps.1from transformers import AutoConfig, AutoModelForCausalLM
2
3config = AutoConfig.from_pretrained("ByteDance/Ouro-2.6B-Thinking")
4config.total_ut_steps = 3 # Use 3 recurrent steps instead of 4
5model = AutoModelForCausalLM.from_pretrained(
6 "ByteDance/Ouro-2.6B-Thinking",
7 config=config,
8 device_map="auto"
9)Note: vLLM does not currently support the adaptive exit feature due to its inference optimization characteristics. When using vLLM, the model will always execute the full number oftotal_ut_steps.
| Configuration | Value |
|---|---|
| Parameters | 2.6B |
| Layers | 24 |
| Recurrent Steps | 4 |
| Hidden Size | 2048 |
| Attention Heads | Multi-Head Attention (MHA) |
| FFN Activation | SwiGLU |
| Position Embedding | RoPE |
| Vocabulary Size | 49,152 |
| Context Length | 32K (SFT) |
| Normalization | Sandwich RMSNorm |
transformers<4.56.0 to avoid compatibility issues. We recommend transformers==4.54.1 or earlier versions.1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "Bytedance/Ouro-2.6B-Thinking"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = AutoModelForCausalLM.from_pretrained(
6 model_name,
7 device_map="auto",
8 torch_dtype="auto"
9)
10
11# Generate with reasoning
12messages = [
13 {"role": "user", "content": "Solve: If 2x + 3 = 11, what is x?"}
14]
15inputs = tokenizer.apply_chat_template(
16 messages,
17 tokenize=True,
18 add_generation_prompt=True,
19 return_tensors="pt"
20).to(model.device)
21
22outputs = model.generate(inputs, max_new_tokens=512, temperature=1.0, top_p=0.7)
23print(tokenizer.decode(outputs[0], skip_special_tokens=True))1@article{zhu2025scaling,
2 title={Scaling Latent Reasoning via Looped Language Models},
3 author={Zhu, Rui-Jie and Wang, Zixuan and Hua, Kai and Zhang, Tianyu and Li, Ziniu and Que, Haoran and Wei, Boyi and Wen, Zixin and Yin, Fan and Xing, He and others},
4 journal={arXiv preprint arXiv:2510.25741},
5 year={2025}
6}
7
8
9## License
10
11This model is licensed under Apache-2.0. See the LICENSE file for details.
12
13## Project Links
14
15- **Paper**: [Scaling Latent Reasoning via Looped Language Models](https://huggingface.co/papers/2510.25741)
16- **Project Page**: [https://ouro-llm.github.io](https://ouro-llm.github.io)
17- **Code**: [https://github.com/ByteDance/Ouro](https://github.com/ByteDance/Ouro)
18
19---