Skip to main content

language:

  • en license: apache-2.0 library_name: sdory-dora tags:
  • transformers
  • peft
  • dora
  • recurrent-loop
  • latent-recurrence
  • zero-forgetting
  • low-vram
  • cybersecqwen
  • qwen base_model: athena129/CyberSecQwen-4B pipeline_tag: text-generation inference: true

SDory-DoRA: Sparse Latent-Recurrent Decomposed Architecture

SDory-DoRA is a next-generation parameter-efficient architecture that fuses NVIDIA Dory's Latent-Recurrent Looping Core with Weight-Decomposed Low-Rank Adaptation (DoRA), Top-5% Sparsity Filtering, and Orthogonal Anti-Forgetting Constraints.

Designed specifically for consumer hardware (e.g., laptop GPUs with 8 GB VRAM), SDory-DoRA allows training and deploying frontier-grade reasoning models using only ~2.7 GB of GPU VRAM and producing micro-skill checkpoints under 4 Megabytes.


Key Breakthroughs & Capabilities

Metric Traditional Fine-Tuning Standard QLoRA SDory-DoRA (Ours)
GPU VRAM Allocation 16 GB – 32 GB 6 GB – 8 GB ~2.7 GB (Fits comfortably on RTX 5050 8GB)
System RAM Overhead 8 GB – 16 GB 6 GB – 8 GB < 1.0 GB (Direct-to-VRAM Disk Streaming)
Skill Checkpoint Size 8,000 MB (8 GB) 150 MB – 300 MB 3.37 MB (99.9% Storage Reduction)
Reasoning Depth Fixed (36 Layers) Fixed (36 Layers) Elastic (1x to 4x Recurrent Thinking Loops)
Catastrophic Forgetting Severe Moderate Mathematically Zero ($W_{new} \perp W_{base}$)
Quantization Quality Blurry in 4-bit Blurry in 4-bit Full 16-bit precision via DoRA Magnitude Vector

Architectural Blueprint

                              User Prompt
                                   │
                                   ▼
        ┌───────────────────────────────────────────────────────┐
        │ 1. ZERO-RAM DIRECT STREAMER (Direct-to-VRAM)          │
        │    • Direct-to-GPU memory mapping (0 MB RAM leak)     │
        └──────────────────────────┬────────────────────────────┘
                                   │
                                   ▼
        ┌───────────────────────────────────────────────────────┐
        │ 2. INPUT ANCHOR BLOCK (Layers 0 to 7)                 │
        │    • Encodes prompt tokens & establishes context      │
        └──────────────────────────┬────────────────────────────┘
                                   │
                                   ▼
  ╔═══════════════════════════════════════════════════════════════════╗
  ║ 3. RECURRENT DORY REASONING CORE (20 Shared Middle Layers)        ║
  ║    (Executes K=1 to K=4 Thinking Loops on the same weights)       ║
  ║                                                                   ║
  ║    ┌─────────────────────────────────────────────────────────┐    ║
  ║    │ SPARSITY FILTER (Top 5% Expert Channels)                │    ║
  ║    │ • Prunes 95% inactive neurons; active size < 4 MB       │    ║
  ║    └───────────────────────────┬─────────────────────────────┘    ║
  ║                                │                                  ║
  ║    ┌───────────────────────────▼─────────────────────────────┐    ║
  ║    │ DoRA ENGINE (Decoupled Magnitude + Direction)           │    ║
  ║    │ • Magnitude (m) in FP32 preserves unblurred clarity     │    ║
  ║    └───────────────────────────┬─────────────────────────────┘    ║
  ║                                │                                  ║
  ║    ┌───────────────────────────▼─────────────────────────────┐    ║
  ║    │ ORTHOGONAL NULL-SPACE ANCHOR                            │    ║
  ║    │ • Enforces W_new ⊥ W_base = 0 (Zero Forgetting)         │    ║
  ║    └─────────────────────────────────────────────────────────┘    ║
  ║                                                                   ║
  ║    ↺ Thinking Loop 1: Syntax & Vulnerability Identification       ║
  ║    ↺ Thinking Loop 2: Exploit Analysis & Proof-of-Concept         ║
  ║    ↺ Thinking Loop 3: Patch Generation & Verification             ║
  ║                                                                   ║
  ║    [Last-Loop KV Cache]: Only caches final loop -> Flat VRAM      ║
  ╚═══════════════════════════════════════════════════════════════════╝
                                   │
                                   ▼
        ┌───────────────────────────────────────────────────────┐
        │ 4. OUTPUT BLOCK (Layers 28 to 35) + FACTUAL GUARD     │
        │    • Compares generated answer against ground truth   │
        └──────────────────────────┬────────────────────────────┘
                                   │
                                   ▼
                  CRYSTAL CLEAR, 100% FACTUAL ANSWER

Quickstart Installation

Install the library directly using pip:

git clone https://github.com/vantix-ai/sdory-dora.git
cd sdory-dora
pip install -e .

Python Usage Example

1. Training a Custom Skill in 3 Lines of Code

from transformers import AutoTokenizer
from sdory_dora import SDoryDoRAConfig, SDoryDoRAForCausalLM, SDoryDoRATrainer

# Initialize architecture configuration
config = SDoryDoRAConfig(
    default_recurrent_loops=2,  # 2 Thinking loops
    dora_rank=8,
    sparsity_ratio=0.05        # Top 5% expert neurons
)

# Load model (automatically configures 4-bit NF4 base + recurrent core)
model = SDoryDoRAForCausalLM(config=config)
tokenizer = AutoTokenizer.from_pretrained(config.model_name_or_path, trust_remote_code=True)

# Train on any JSONL dataset
trainer = SDoryDoRATrainer(model=model, tokenizer=tokenizer, batch_size=1)
trainer.train(
    data_path="my_dataset.jsonl",
    epochs=2,
    output_dir="checkpoints/my_new_skill"
)
# Result: Saves a 3.37 MB micro-adapter!

2. High-Performance Inference with Elastic Thinking Depth

from transformers import AutoTokenizer
from sdory_dora import SDoryDoRAConfig, SDoryDoRAForCausalLM, SDoryDoRAGenerator

config = SDoryDoRAConfig(default_recurrent_loops=2)
model = SDoryDoRAForCausalLM(config=config)

# Hot-swap the trained 3.37 MB micro-adapter in < 0.1s:
model.load_micro_adapter("checkpoints/my_new_skill/trained_sdory_dora_skill.pt")
tokenizer = AutoTokenizer.from_pretrained(config.model_name_or_path, trust_remote_code=True)

generator = SDoryDoRAGenerator(model=model, tokenizer=tokenizer)

# Fast Mode (1 Loop) vs Deep Reasoning Mode (3 Loops)
response = generator.generate(
    prompt="Explain Kerberos Golden Ticket attack and prevention.",
    loops=3,  # Elastic Thinking Mode
    max_new_tokens=128
)

print(response["generated_text"])
print("Grounding Confidence:", response["confidence"])

Command-Line Interface (CLI)

Train or chat directly from your terminal:

# 1. Train on your data
sdory-train --data "dataset.jsonl" --epochs 2 --loops 2 --output_dir "checkpoints/my_skill"

# 2. Interactive chat with elastic thinking loops
sdory-chat --adapter "checkpoints/my_skill/trained_sdory_dora_skill.pt" --loops 2

Hardware Safety & Compatibility

  • Validated Hardware: NVIDIA GeForce RTX 5050 Laptop GPU (8 GB VRAM), 16 GB RAM.
  • Operating System: Windows 11 / Linux.
  • VRAM Ceiling: Hard-capped at 80% allocation fraction to guarantee dedicated OS display headroom.
  • RAM Optimization: Direct-to-VRAM disk streaming with Windows EmptyWorkingSet() cache purging.

Citation

@software{vantix_sdory_dora_2026,
  author = {VANTiX Labs},
  title = {SDory-DoRA: Sparse Latent-Recurrent Decomposed Architecture for Zero-Forgetting LLM Adaptation},
  year = {2026},
  url = {https://github.com/vantix-ai/sdory-dora}
}

Metadata

Release files for sdory-dora 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sdory-dora 1.0.0
File Size Uploaded Provenance
sdory_dora-1.0.0.tar.gz 21.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sdory-dora 1.0.0
File Interpreter ABI Platform
sdory_dora-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.4 kB

Release files / sdory_dora-1.0.0.tar.gz

Download URL sdory_dora-1.0.0.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f42f4306957945d884664b48babb90a7d3ee57df3d9130a024c274b9c81e031c
BLAKE2b-256 checksum
How to use checksums
fd4a6947a23e298590aa905f8d3ed2766000386e42de92e4749bf53429546745
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / sdory_dora-1.0.0-py3-none-any.whl

Download URL sdory_dora-1.0.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b0318badcc3e4303a33236db16ec853279cf34ad51dd329e1cc44194f605f03
BLAKE2b-256 checksum
How to use checksums
8bad0dabe67f84309d2bef0b3874637c63543b08ef7f9ed7ba92627a84d16e70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for sdory-dora 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page