Text Generation
Transformers
Safetensors
English
lds
recurrent-transformers
adaptive-depth
loopus
vxtral
selective-gate
causal-lm
conversational
custom_code
Instructions to use vxltxrllc/vxtral-loopus-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vxltxrllc/vxtral-loopus-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vxltxrllc/vxtral-loopus-4b", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("vxltxrllc/vxtral-loopus-4b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use vxltxrllc/vxtral-loopus-4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vxltxrllc/vxtral-loopus-4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vxltxrllc/vxtral-loopus-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/vxltxrllc/vxtral-loopus-4b
- SGLang
How to use vxltxrllc/vxtral-loopus-4b 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 "vxltxrllc/vxtral-loopus-4b" \ --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": "vxltxrllc/vxtral-loopus-4b", "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 "vxltxrllc/vxtral-loopus-4b" \ --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": "vxltxrllc/vxtral-loopus-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use vxltxrllc/vxtral-loopus-4b with Docker Model Runner:
docker model run hf.co/vxltxrllc/vxtral-loopus-4b
π vxtral-loopus-4b (True Loopformer)
vxtral-loopus-4b is a contractive recurrent language model powered by the LoopUS architecture. It implements an adaptive reasoning loop with Mamba-style SelectiveGate residual mixing, enabling dynamic inference-time depth scaling ($N \in [1..8]$) without altering model weights.
π₯ Model Overview
- Architecture: Recurrent Contractive Transformer (
VxtralForCausalLM) - Base Backbone:
synthetic-voxtral-text-3b_tekken - Tokenizer: Tekken
- Checkpointed Step:
step_46000(FineWeb dataset) - Recurrent Depth Range ($N$): $1 \le N \le 8$
- Parameters:
3.2B base + recurrent reasoning loop (4B effective capacity at $N=8$)
π Quickstart & Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "vxltxrllc/vxtral-loopus-4b"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="cuda",
trust_remote_code=True,
)
prompt = "The future of artificial intelligence is"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
# Dynamically adjust the reasoning depth on the fly:
# N=1 (fast surface generation), N=4 (balanced reasoning), N=8 (deep contractive synthesis)
model.N = 4
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=60,
do_sample=False,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
π Dynamic Depth Scaling Behavior ($N$)
The recurrent reasoning block utilizes a Mamba-style SelectiveGate to perform a convex combination of activations between passes:
Changing $N$ shifts the reasoning trajectory dynamically during inference:
| Depth ($N$) | Generation Profile | Output Characteristics |
|---|---|---|
| $N = 1, 2$ | Surface-level completion | Fast response, relies on local token transitions and standard templates. |
| $N = 4$ | Structural expansion | Balanced reasoning, introduces more detailed contextual relationships. |
| $N = 8$ | Deep contractive synthesis | High-level abstraction, broader conceptual synthesis and systemic implications. |
π οΈ Model Architecture Details
[Input Embeddings] ββ> [Encoder Layers: 0..21]
β
βΌ
βββββββββββββββββββββββββββββββββ
β Recurrent Loop (Passes: 1..N) β
β Reasoning Layers: 22..28 β
β Gate: SelectiveGate(dt, A) β
βββββββββββββββββ¬ββββββββββββββββ
β
βΌ
[Decoder Layer: 29] ββ> [RMSNorm + LM Head]
- Encoder: 22 standard Transformer layers.
- Reasoning Loop: 7 recurrent Transformer layers bound by
SelectiveGate. - Decoder: 1 final alignment layer.
- Early Exit: Integrated $Q$-oracle for dynamic halting.
- Downloads last month
- -