Loop7B v3 — v0.1 (From-Scratch Dynamic 4-Loop Transformer)
Loop7B v3 (v0.1) is an experimental 6.85B-parameter Looped Transformer trained 100% from scratch on a single GPU (Google Colab Pro+ A100-80GB & G4 Blackwell).
It features dynamic test-time compute depth (low=1, medium=2, high=3, xhigh=4 loops → 32 / 64 / 96 / 128 effective Transformer layers), Multi-Token Prediction (MTP) pretraining, Input Re-Injection, <think>...</think> reasoning, and <tool_call> structured tool calling in Turkish & English.
Note (
v0.1Research Preview): Thisv0.1checkpoint is the first end-to-end milestone (1.0B Stage 1 pretraining tokens + Stage 2A 4-Loop adaptation + Stage 2B SFT). Future releases (v0.2,v0.3, ...,v1.0) will scale Stage 1 pretraining to multi-billion tokens.
Architecture Highlights
- Parameters: 6.85B physical (
dim=4096,core_layers=32,n_heads=32,n_kv_heads=8GQA,ffn_dim=12288SwiGLU, RoPEtheta=500000, tied embeddings) - Dynamic Loop Depth:
low=1(32L),medium=2(64L),high=3(96L),xhigh=4(128L) with learnedloop_embsandloop_alphainput re-injection - Training Pipeline:
- Stage 1: 1.00B tokens (
15,260steps, 4-head MTP, sequence packing, Stochastic BF16 Adafactor) - Stage 2A: 1,500 steps (
2 -> 3 -> 4loop curriculum, All-Exit Supervision) - Stage 2B: 1,200 steps ChatML SFT (
<think>,<tool_call>, Turkish + English + Code + Replay)
- Stage 1: 1.00B tokens (
How to Run Locally (6 GB+ NVIDIA GPU)
⚠️ Local Testing Notice: The model weights were trained and tested on cloud GPUs (A100-80GB / G4). However, the local inference launcher (
app.py,start_loop7b.bat, and 4-bit NF4 mode) has not been tested on local consumer hardware yet, as the model does not fit on my local GPU. If you encounter any issues or bugs when running it locally, please report them in the Community tab!
Why not LM Studio / Ollama (
llama.cpp)? Loop7B v3 uses a custom Dynamic 4-Loop architecture (loop_embs+loop_alphainput re-injection + per-loop KV-Cache), which standardllama.cppGGUF backends do not support natively. Use the includedapp.pyWeb UI (Gradio) orinference.pyinstead!
Hardware Requirements
| GPU VRAM | Mode (Auto-Selected by app.py) |
VRAM Usage |
|---|---|---|
| 6 GB – 12 GB (e.g. RTX 4050 6GB, RTX 4060, RTX 3060) | 4-bit NF4 + BF16 (Embed/Loop/Norm in BF16) | ~4.7 – 5.2 GB |
| 16 GB+ (e.g. RTX 4090, L4, A100, H200) | Full BF16 | ~13.7 GB |
Option 1: Interactive Web Chat UI (app.py — Recommended)
Includes per-loop KV-Cache, streaming output, and a live low / medium / high / xhigh loop depth selector.
# 1. Install PyTorch with CUDA 12.4
pip install torch --index-url https://download.pytorch.org/whl/cu124
# 2. Download app.py & requirements.txt (or clone the repo)
git clone https://huggingface.co/tm1324/Loop7B-v3-v0.1
cd Loop7B-v3-v0.1
# 3. Install dependencies & launch Web UI
pip install -r requirements.txt
python app.py
Open http://127.0.0.1:7860 in your browser!
(Tip: Force 4-bit or BF16 manually with LOOP7B_QUANT=4bit python app.py or LOOP7B_QUANT=bf16 python app.py.)
Option 2: Windows 1-Click Launcher
If you cloned the repo on Windows, simply double-click start_loop7b.bat — it automatically creates a venv, installs PyTorch CUDA + dependencies, and opens the chat UI in your browser.
Option 3: Python API (inference.py, 16 GB+ GPU)
from inference import load_loop7b
model, tokenizer = load_loop7b("tm1324/Loop7B-v3-v0.1", device="cuda")
- Downloads last month
- 34