CoolFace
Modelpublic

PXIN/Ouroboros-55M-2B

sourceHugging Facemitupdated 10d agoView on Hugging Face
0likes
Model Card

<div align="center">

<img src="ouroboros.png" alt="Ouroboros Banner" width="100%" style="border-radius: 10px; margin-bottom: 20px;">

<h1 align="center" style="text-align: center;">🐍 Ouroboros-55M-2B</h1> <h3 align="center" style="text-align: center;">The Autopoietic Multimodal Digital Worker: Native 4K Vision, Ternary Weights, and Discrete Diffusion Planning on Consumer Silicon</h3>

![License: MIT](https://opensource.org/licenses/MIT) ![Parameters: 55.6M](https://huggingface.co/PXIN/Ouroboros-55M-2B) ![Substrate: BitNet b1.58](https://arxiv.org/abs/2402.17764) ![Backbone: Griffin RG--LRU](https://arxiv.org/abs/2402.19427) ![Vision: VMamba SS2D](https://arxiv.org/abs/2401.10166) ![Planning: LLaDA Diffusion](https://arxiv.org/abs/2502.09992) ![Action: ShowUI & OSWorld](https://arxiv.org/abs/2411.17465) ![Hardware: 100% Consumer Edge-red.svg)]()

</div>


<h2 align="center" style="text-align: center;">⚡ Executive Summary</h2>

<div align="center">

Ouroboros-55M-2B is an ultra-compact, from-scratch Autonomous Multimodal Operator engineered to execute direct, pixel-accurate computer control (eyes and hands) on local consumer workstations at \$0.00 cloud inference cost.

Rather than following the centralized cloud paradigm—spending billions on 100,000-GPU clusters to host massive monolithic models behind rate-limited APIs—Ouroboros inverts the architectural equation:

The Brain A 55.62M parameter BitNet b1.58 ternary {-1, 0, +1} neural substrate with Griffin RG-LRU recurrent linear units, compiling down to ~14 MB of physical memory with infinite session state tracking.

The Eyes A 4-Way Omnidirectional Recurrent Cross-Scan vision spine with Continuous 2D Fourier Positional Coordinates, processing native uncropped screens from 720p up to Full 4K UHD at ~118 FPS (8.44 ms) on a laptop GPU.

The Imagination An embedded 256-token Discrete Masked Diffusion Planning Canvas, proposing, refining, and verifying 10-step sub-goal trajectories in parallel in ~12 ms before actuating physical motor events.

Ouroboros is designed to replace the user in the chair: visually perceiving the desktop, typing terminal commands, clicking UI elements, monitoring local builds, and orchestrating frontier cloud models (Claude, Codex, GPT) as high-level sub-agents.

</div>


<h2 align="center" style="text-align: center;">🏛️ Core Architecture</h2>

<div align="center"> <img src="architecture.png" alt="Ouroboros Architecture Schematic" width="100%" style="border-radius: 8px; margin-top: 15px; margin-bottom: 25px;"> </div>

<h3 align="center" style="text-align: center;">1. The Substrate: BitNet b1.58 Ternary Quantization</h3>

<div align="center">

Every linear weight in the recurrent and attention blocks is constrained to discrete ternary values {-1, 0, +1}:

$$ \widetilde{W} = \text{RoundClip}\left(\frac{W}{\gamma + \epsilon}, -1, 1\right), \quad \gamma = \frac{1}{nm}\sum{ij} |W{ij}| $$

Zero Floating-Point GEMM Replaces energy-expensive floating-point matrix multiplications with simple integer addition and subtraction (Ma et al., 2024).

14 MB Compiled Model Footprint The entire brain fits directly into L2/L3 CPU/GPU hardware cache.

Training Stability Stabilized with SubLN RMSNorm and Straight-Through Estimators (STE).

</div>


<h3 align="center" style="text-align: center;">2. The Recurrent Spine: Griffin RG-LRU + Sliding-Window Attention</h3>

<div align="center">

Ouroboros abandons pure quadratic attention O(N²) in favor of a hybrid recurrent architecture (De et al., Google DeepMind, 2024):

$$ ht = at \odot h{t-1} + \sqrt{1 - at^2} \odot (it \odot xt) $$

8 Griffin RG-LRU Layers Powered by a custom fused Triton parallel associative scan, delivering O(N) linear computation during pre-training and strictly O(1) constant-memory state updates during streaming inference.

4 Local Sliding-Window Attention Layers (W=512) Provides high-frequency local syntactic grounding without unbounded KV-cache growth. The KV cache is strictly capped at ~4.2 MB permanently.

Infinite Working Memory Ouroboros can operate for hours across hundreds of thousands of interaction steps without running out of context.

</div>


<h3 align="center" style="text-align: center;">3. The Vision Spine: 4-Way Cross-Scan + 2D Fourier Patching</h3>

<div align="center">

Traditional VLMs downsample screens into blurry 224x224 thumbnails because standard attention explodes on high-resolution displays. Ouroboros introduces the Lossless Vision Spine:

Dense Early Conv Stem Early 3x3 convolutions expand raw RGB (3 to 64 channels) prior to downsampling, preserving 1px window dividers and anti-aliased font strokes.

Continuous 2D Fourier Positional Frequencies Based on Fourier Feature Networks (Tancik et al., NeurIPS 2020), bounded within k ∈ [4, log₂(W/16)] to prevent INT8 quantization erasure at fine scales while avoiding Nyquist spatial aliasing at 4K.

2x2 Spatial Patch Merge Condenses adjacent feature patches into a dense spatial token, cutting token count by 4x.

4-Way Omnidirectional Scan Inspired by 2D Cross-Scan SS2D (Liu et al., 2024), decomposes 2D spatial layouts into four cardinal sweeps (Row-Forward, Row-Backward, Column-Forward with explicit spatial transpose, and Column-Backward), collapsing 2D nearest-neighbor distance from O(W) to O(1).

</div>

<h4 align="center" style="text-align: center;">🔬 Empirical Hardware Benchmark (RTX 4080 Laptop GPU)</h4> <div align="center"><em>Measured in an isolated environment on pure silicon (Forward + Backward pass):</em></div>

<div align="center">

Screen ResolutionToken Grid (2×2)4-Way RG-LRU (Triton)Local Attention (W=512)Speedup vs AttentionPeak Layer VRAM
1080p Full HD60 × 34 = 2,0402.67 ms (~374 FPS)3.22 ms1.21× Faster87.1 MB
4K UHD (2×2)120 × 68 = 8,1608.44 ms (~118 FPS)18.61 ms2.21× Faster284.6 MB
Raw 4K (Unmerged)240 × 135 = 32,40027.55 ms (~36 FPS)278.77 ms10.12× Faster1,075.2 MB

</div>


<h3 align="center" style="text-align: center;">4. The 256-Token Discrete Diffusion Planning Canvas</h3>

<div align="center">

Conditioned on the recurrent visual state, Ouroboros utilizes a 256-token discrete masked diffusion canvas as a sub-goal trajectory planner (Nie et al., LLaDA, 2025):

Hierarchical Masking Schedule Unmasks the action primitive and anchor coordinate (x₁, y₁) first, then predicts the bounding click target (x₂, y₂) conditioned on the anchor.

12 ms Parallel Denoising Denoises an entire multi-step plan in parallel, eliminating the sequential error compounding of pure autoregressive decoders.

</div>


<h2 align="center" style="text-align: center;">📦 Pre-Training Data Mixture & Token Allocation</h2>

<div align="center">

Ouroboros is trained from scratch on a balanced 2.0 Billion Token Golden Reasoning Mixture, specifically curated for maximum informational density in sub-100M parameter ternary networks:

Corpus / DatasetDomainToken CountProportionCuration & Filter Methodology
**FineWeb-Edu**Educational Web800 Million40.0%LLaMA-3-70B classifier score ≥ 3; high-signal knowledge and synthetic didactics
**DCLM-Baseline**Curated Web Text400 Million20.0%FastText & model-based filtering of Common Crawl for conversational connective tissue
**Cosmopedia v2**Synthetic Textbooks300 Million15.0%Mixtral-8x7B generated textbooks, courses, and stories across 34,000 BISAC categories
**FineMath (4+)**Formal Mathematics300 Million15.0%Step-by-step proofs and mathematical derivations scored 4+ for spatial & logical reasoning
**Python-Edu**Cleaned Source Code200 Million10.0%Cleaned AST algorithms & educational Python for bracket matching & memory tracking
Total Foundation RunGolden Mixture2.0 Billion100.0%Dynamic 3-Phase Streaming Curriculum (512 → 1024 → 2048 ctx)

</div>

<br>

<h3 align="center" style="text-align: center;">🖥️ Native Multimodal Computer-Use Operator Bundle</h3>

<div align="center">

In Phase 2 and Phase 3, Ouroboros incorporates an additional 80.2 Million Token (~76,500 native desktop trajectories) multimodal dataset for pixel-accurate GUI grounding:

Operator DatasetModality / FocusTrajectory CountPrimary Interaction Space
**ShowUI-Desktop**High-Res UI Grounding~25,000Desktop application navigation, click anchors & bounding targets
**SeeClick**GUI Coordinate Grounding~30,000Sub-pixel element localization and continuous cursor clicks
**Mind2Web**Generalist Web Agent~10,000Complex DOM traversal and multi-turn web workflows across 137 domains
**ScreenSpot**Cross-Platform Grounding~6,500Multi-environment element localization across mobile, desktop, and web
**OSWorld**Operating System Tasks~5,000Full OS environment task execution (Ubuntu/Windows terminal, file manager)

</div>


<h2 align="center" style="text-align: center;">📊 Pre-Training Curriculum & Hardware Schedule</h2>

<div align="center">

Ouroboros executes on a dynamic 3-phase curriculum optimizing context expansion and diffusion alignment:

PhaseToken HorizonContext Length (L)Optimization Focus
Phase 1: Syntax & Lex0 – 500M Tokens512 tokensGrammar, Python/Shell Code, Syntax Primitives
Phase 2: Reasoning Exp.500M – 1.0B Tokens1,024 tokensAlgorithms, Logic, Structural Flow, Operator Traces
Phase 3: Long Context1.0B – 2.0B Tokens2,048 tokensMulti-Turn Sessions, Canvas Planning, Trajectory Grounding

Vocabulary Custom 16,384 BPE Tokenizer (tokenizer_16k).

Silicon Single consumer workstation (NVIDIA GeForce RTX 4080 Laptop GPU, 12 GB VRAM).

Throughput ~10,500 – 12,000 tokens/second sustained under mixed FP16/BF16 QAT.

</div>


<h2 align="center" style="text-align: center;">💻 Hardware & Memory Footprint</h2>

<div align="center">

MetricTraditional FP16 Small ModelOuroboros-55M-2B (Ternary)
Model Weight Storage~111.2 MB~14.0 MB
Runtime KV Cache (W=512)Dynamic / Unbounded~4.2 MB (Constant)
Recurrent Hidden StateN/A~1.8 MB
4K Vision Activation Buffer> 30 GB (OOM)~284 MB
Total Inference VRAM4 – 8 GB< 350 MB
Power Consumption60 – 120 W15 – 25 W

</div>


<h2 align="center" style="text-align: center;">🚀 Quickstart & Architecture Verification</h2>

<div align="center">

Instantiate Ouroboros in PyTorch and verify parameter count on your local machine:

</div>

python
import torch
from model import OuroborosConfig, OuroborosModel

# 1. Initialize Ouroboros Config
cfg = OuroborosConfig(
    vocab_size=16384,
    d_model=512,
    num_layers=12,
    num_heads=8,
    canvas_size=256,
    window_size=512
)

# 2. Instantiate Model
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = OuroborosModel(cfg).to(device)

print(f"Total Parameters: {sum(p.numel() for p in model.parameters()):,}")
# Output: Total Parameters: 55,618,560 (55.62M)

# 3. Stream Inference
inputs = torch.randint(0, cfg.vocab_size, (1, 512), device=device)
with torch.no_grad():
    logits, _ = model(inputs)
print(f"Logits Shape: {logits.shape}")

<h2 align="center" style="text-align: center;">📚 Foundational Research & Citations</h2>

<div align="center">

Ouroboros-55M-2B is an autopoietic synthesis of several seminal open-science breakthroughs across recurrent architectures, quantization, computer vision, and autonomous agent grounding:

Architectural DomainFoundational PaperVenue / AuthorsOfficial ArXiv
Ternary SubstrateThe Era of 1-bit LLMs: All Large Language Models are in 1.58 BitsMa et al., Microsoft Research (2024)arXiv:2402.17764
Recurrent HybridGriffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language ModelsDe et al., Google DeepMind (2024)arXiv:2402.19427
Omnidirectional VisionVMamba: Visual State Space Model (SS2D 4-Way Cross-Scan)Liu et al. (2024)arXiv:2401.10166
Planning CanvasLarge Language Diffusion Models (LLaDA)Nie et al. (2025)arXiv:2502.09992
GUI Agent GroundingShowUI: One Vision-Language-Action Model for GUI AgentZhang et al. (2024)arXiv:2411.17465
Coordinate EmbeddingsFourier Features Let Networks Learn High Frequency Functions in Low Dimensional DomainsTancik et al., NeurIPS (2020)arXiv:2006.10739
OS Computer-UseOSWorld: Benchmarking Multimodal Agents on Open-Ended Operating System EnvironmentsXie et al. (2024)arXiv:2404.07972
Web NavigationMind2Web: Towards a Generalist Agent for the Open WebDeng et al., NeurIPS (2023)arXiv:2306.06070
Visual GroundingSeeClick: Harnessing GUI Grounding for Advanced Visual Language ModelingCheng et al. (2024)arXiv:2401.10935

</div>

<br>

<h2 align="center" style="text-align: center;">📜 Citation & License</h2>

<div align="center">

Ouroboros is released under the MIT License.

</div>

bibtex
@software{ouroboros2026,
  author = {PXIN},
  title = {Ouroboros-55M-2B: The Autopoietic Multimodal Digital Worker},
  year = {2026},
  url = {https://huggingface.co/PXIN/Ouroboros-55M-2B}
}