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: Ready-Made Sparse Latent-Recurrent Architecture

PyPI Version License Architecture VRAM

SDory-DoRA is an industrial, ready-made deep learning architecture for AI & ML engineers. It fuses NVIDIA Dory's Latent-Recurrent Looping Core with Weight-Decomposed Low-Rank Adaptation (DoRA), Top-5% Sparsity Filtering, and Orthogonal Anti-Forgetting Constraints.

As an engineer, you do not need to design complex layers, manage VRAM leaks, or write autograd loops. The architecture is ready-made: you simply provide your dataset (.jsonl or .txt), and the engine handles the rest—whether adapting existing foundation models or training from scratch!


🚀 Instant Quickstart via PyPI

Install the official Python package in seconds:

pip install sdory-dora

💡 How Any Engineer Uses It

Option A: Ready-Made Pretrained Adaptation (2 Lines of Code)

Equip any foundation model (CyberSecQwen, Qwen2.5, LLaMA-3, Mistral) with zero-forgetting recurrent reasoning and train on your custom data:

from sdory_dora import SDory

# 1. Initialize ready-made architecture on any base model
engine = SDory.from_pretrained("athena129/CyberSecQwen-4B", loops=2)

# 2. Train on your dataset (JSONL or raw text)
engine.fit(data="my_dataset.jsonl", epochs=2, output_dir="checkpoints/my_skill")

# 3. Test interactively with elastic thinking loops
response = engine.chat("Explain Kerberos Golden Ticket attack and prevention.")
print(response)

Option B: Ready-Made Pre-Training from Scratch

Train a native S-Dory causal transformer architecture from zero weights:

from sdory_dora import SDory

# 1. Initialize native S-Dory architecture from scratch
engine = SDory.from_scratch(
    vocab_size=32000,
    hidden_size=768,
    num_layers=12,
    loops=2 # Elastic recurrent thinking loops
)

# 2. Train directly on your corpus
engine.fit(data="corpus.jsonl", epochs=3, output_dir="checkpoints/scratch_model")

# 3. Generate text
print(engine.chat("Security analysis of"))

Option C: Drop-in Transformers API (AutoSDoryModel)

Use it just like Hugging Face transformers to load models and micro-adapters directly:

from transformers import AutoTokenizer
from sdory_dora import AutoSDoryModel

# Load the architecture and weights directly from Hugging Face
model = AutoSDoryModel.from_pretrained("Navadeep-123/sdory-dora-cybersecqwen-4b", loops=2)
tokenizer = AutoTokenizer.from_pretrained("athena129/CyberSecQwen-4B")

prompt = "<|im_start|>user\nWhat is SQL injection?<|im_end|>\n<|im_start|>assistant\n"
inputs = tokenizer(prompt, return_tensors="pt")

# Standard Transformers-style autoregressive generation
output_ids = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(output_ids[0], skip_special_tokens=True))

Option D: 1-Line Command Line Interface (CLI)

No code required—run training or interactive chat directly from your terminal:

# 1. Train on your data with pretrained base model
sdory train --model athena129/CyberSecQwen-4B --data "dataset.jsonl" --epochs 2 --loops 2

# 2. Train a native architecture from scratch
sdory train --from-scratch --data "corpus.jsonl" --epochs 5 --loops 2

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

🏛️ Complete Architecture Blueprint

                                 Engineer's Dataset (JSONL / Raw Text)
                                                  │
                                                  ▼
     ┌────────────────────────────────────────────────────────────────────────┐
     │ 1. ZERO-RAM DIRECT DISK STREAMER                                       │
     │    • Direct-to-VRAM streaming without caching dataset in system RAM     │
     └────────────────────────────────────┬───────────────────────────────────┘
                                          │
                                          ▼
     ┌────────────────────────────────────────────────────────────────────────┐
     │ 2. INPUT ANCHOR LAYERS (Layers 0 to 7)                                 │
     │    • Encodes prompt tokens & establishes lexical context               │
     └────────────────────────────────────┬───────────────────────────────────┘
                                          │
                                          ▼
   ╔══════════════════════════════════════════════════════════════════════════════╗
   ║ 3. RECURRENT DORY REASONING CORE (Middle Shared Layers)                      ║
   ║    (Executes K=1 to K=4 Thinking Loops on the same layer weights)            ║
   ║                                                                              ║
   ║    ┌────────────────────────────────────────────────────────────────────┐    ║
   ║    │ SPARSITY FILTER (Top 5% Salient Expert Neurons)                    │    ║
   ║    │ • Prunes 95% inactive weights; micro-checkpoint size < 4 MB        │    ║
   ║    └─────────────────────────────────┬──────────────────────────────────┘    ║
   ║                                      │                                       ║
   ║    ┌─────────────────────────────────▼──────────────────────────────────┐    ║
   ║    │ DoRA ENGINE (Decoupled Magnitude + Direction)                      │    ║
   ║    │ • Magnitude vector m in FP32 ensures 100% sharp reasoning clarity  │    ║
   ║    └─────────────────────────────────┬──────────────────────────────────┘    ║
   ║                                      │                                       ║
   ║    ┌─────────────────────────────────▼──────────────────────────────────┐    ║
   ║    │ NULL-SPACE ORTHOGONAL PROJECTION                                   │    ║
   ║    │ • Enforces W_new ⊥ W_base = 0 (Mathematically Zero Forgetting)     │    ║
   ║    └────────────────────────────────────────────────────────────────────┘    ║
   ║                                                                              ║
   ║    ↺ Thinking Loop 1: Syntax Analysis & Pattern Identification               ║
   ║    ↺ Thinking Loop 2: Exploit Path Analysis & Deep Synthesis                 ║
   ║    ↺ Thinking Loop 3: Verification & Formal Proof                            ║
   ║                                                                              ║
   ║    [Last-Loop KV Cache]: Only caches final loop -> Flat VRAM Allocation      ║
   ╚══════════════════════════════════════════════════════════════════════════════╝
                                          │
                                          ▼
     ┌────────────────────────────────────────────────────────────────────────┐
     │ 4. OUTPUT ANCHOR LAYERS (Layers 28 to 35) + FACTUAL GUARD              │
     │    • Self-verifying confidence head measuring grounding scores         │
     └────────────────────────────────────┬───────────────────────────────────┘
                                          │
                                          ▼
                           SHARP, FACTUAL, VERIFIED OUTPUT

📊 Empirical Hardware Benchmarks (RTX 5050 8GB Laptop GPU)

All numbers are measured directly on an active consumer laptop (NVIDIA RTX 5050 Laptop GPU, 8 GB VRAM, Windows 11):

Metric Traditional Fine-Tuning Standard QLoRA SDory-DoRA (Ours) Improvement
GPU VRAM Allocation 16 GB – 32 GB 6.5 GB – 8.0 GB 2,599 MB (~2.7 GB) Fits comfortably in 8 GB VRAM
System RAM Overhead 8 GB – 16 GB 6 GB – 8 GB < 1.0 GB Zero-RAM Disk Streaming
Skill Checkpoint Size 8,000 MB (8 GB) 150 MB – 300 MB 3.37 MB 99.9% Storage Reduction
Training Speed (50 steps) ~120s ~65s 17.6s 3.7x Faster Convergence
Reasoning Depth Fixed (36 Layers) Fixed (36 Layers) Elastic (1x to 4x Loops) Dynamic Thinking Compute
Catastrophic Forgetting Severe (> 40% loss) Noticeable (~15% loss) 0.0000% Guaranteed by Orthogonal Projection

🔬 Mathematical Formulations

1. Weight-Decomposed Low-Rank Adaptation (DoRA)

Instead of standard LoRA additive updates $W = W_0 + \Delta W$, DoRA decomposes the weight matrix into magnitude $m$ and directional matrix $V$: $$W = m \frac{V + \Delta V}{|V + \Delta V|_F}$$ where $\Delta V = B \cdot A$ ($r=8$), and $m = |W_0|_c$ is maintained in full 16-bit precision, eliminating the blurring effects of standard 4-bit quantization.

2. Null-Space Orthogonal Anti-Forgetting

To guarantee that new skills never overwrite foundational base knowledge, the new adapter weight subspace is strictly constrained to be orthogonal to the base model's principal components: $$\mathcal{L}{total} = \mathcal{L}{CE} + \lambda_{ortho} |B^T B - I|_F$$ Following training, post-epoch Gram-Schmidt orthogonal QR projection is enforced with column magnitude conservation: $$B^* = \text{QR}(B) \cdot \text{diag}(|B|_c)$$

3. Top-5% Expert Sparsity Filtering

During export, only the top 5% most salient neuron channels based on activation energy are preserved: $$M_{mask} = \mathbb{I}\left(|A_{ij}| \ge \text{Top}_{5%}(|A|)\right)$$ This compresses the final deployed adapter from hundreds of megabytes down to 3.37 MB.


📁 Repository Contents

  • skills/kerberos_security/trained_sdory_dora_skill.pt: Pretrained 3.37 MB micro-adapter for Kerberos AD security.
  • skills/python_coding/trained_sdory_dora_skill.pt: Pretrained 3.37 MB micro-adapter for Python systems coding.
  • SDORY_DORA_WHITEPAPER.md: Complete mathematical whitepaper.
  • MODEL_CARD.md: Architectural specification and card.

📖 Citation

@software{sdory_dora_2026,
  author = {VANTiX Labs},
  title = {SDory-DoRA: Sparse Latent-Recurrent Decomposed Architecture for Zero-Forgetting LLM Adaptation and Pre-Training},
  year = {2026},
  publisher = {Hugging Face / PyPI},
  url = {https://huggingface.co/Navadeep-123/sdory-dora-cybersecqwen-4b}
}

Metadata

Release files for sdory-dora 1.2.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.2.0
File Size Uploaded Provenance
sdory_dora-1.2.0.tar.gz 29.3 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 53.5 kB

Release files / sdory_dora-1.2.0.tar.gz

Download URL sdory_dora-1.2.0.tar.gz
Size 29.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4d58d0d0065f96b2197b4e99c3f2dcad9197351059e54d88b577f62211d506d9
BLAKE2b-256 checksum
How to use checksums
08d8ca9745c98fe826b44cf6ea63557e5b57d37874c9a19879c9171054336977
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.2.0-py3-none-any.whl

Download URL sdory_dora-1.2.0-py3-none-any.whl
Size 24.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0540aab181020562e4cb1d4b46e46aec82688a9b9792e96cc764c2d28d3c263
BLAKE2b-256 checksum
How to use checksums
6486b23d7b345bb2dfab6c51f1f4601238b9684dc4b974eb6a1b7a23a8b9f250
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.2.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