Skip to content

vitali-sialedchyk/stability-first-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

144 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⏳ Recursive Time & Stability-First AI

A collection of experiments exploring memory, catastrophic forgetting, and temporal modularity in neural networks.

Author: Vitali Sialedchyk


🧠 Core Thesis

Modern AI systems exist in "instantaneous time" β€” optimizing only for the current data batch. This project implements the Stability-First hypothesis:

Time in an AI system is defined by structural inertia. By treating weight stability as "System Time", we can prevent catastrophic forgetting and achieve modular, reversible learning.


πŸ“‚ Project Roadmap

# Project Focus Key Insight Status
01 Active Sleep (MNIST) Generative Replay Memory can be restored using VAE "dreams" without storing real data. βœ… Complete
02 Temporal LoRA (GPT-2) LLM Scaling Main success: The "Time Mixer" router dynamically switches between knowledge epochs (Shakespeare vs Python) with 100% accuracy. 🌟 Hero
03 Stability-First Basic Foundation Preventing forgetting by protecting the backbone while maintaining interface plasticity. βœ… Complete
04 Reversibility Lazarus Effect Memory is often latent, not erased. We recovered "forgotten" tasks from 0% to 94.65% accuracy. βœ… Complete
05 Full Suite Benchmarking Comparative analysis of 5 strategies (Fractal Time, Adaptive Pain, Dream Replay). βœ… Complete
06 Subjective Time Metacognition Novel: A system with a "Critic" that automatically regulates its plasticity based on "surprise" (Surprise). βœ… Complete
07 Stability-First (CIFAR-10) Lazarus Project Breakthrough: Data-free model recovery (93.9% recovery after damage, 85.3% after 80% pruning). πŸ† New
08 Stability-First (ImageNet) Large-Scale Testing Stability-First on ImageNet/CIFAR-100 with ResNet backbone. βœ… New
10 Recursive Time Depth Subjective Time Novel: Subjective "time" measured by depth of stable recursive transformations. p90/p99 percentile-based stopping, 5-7x speedup, CKA ~0.98 with growing amplitude. βœ… Ready
11 Temporal LoRA (Large Models) LLM Scaling Confirmed on 7B: All TemporalLoRA theories validated on Mistral-7B-Instruct. Hysteresis (switch-lag: 9 tokens), Deep Crystallization (r=0.8644), 100% router accuracy. Results match and strengthen GPT-2 findings. βœ… Complete

πŸ† The Lazarus Project (Project 07)

Revolutionary discovery: Neural networks can recover from damage without training data using "Architectural Immunity".

Key Findings:

  • V-Shape Recovery: Restored 93.9% of accuracy lost to noise damage using only random noise inputs.
  • Surgical Pruning: Recovered 85.3% of accuracy lost after removing 80% of weights (5Γ— compression).
  • Frozen Mask > Regrowth: We proved that maintaining the "skeleton" (sparse topology) is more effective than trying to regrow connections with noise.
  • Zero Data: No original images were used. The model uses its own structure as a filter to reject chaos.

Full documentation & Graphs: 07-stability-first-cifar10/docs/LAZARUS_FINAL_MANIFESTO.md

Recovery Curve V-shape recovery pattern for weight noise damage

Pruning Curve Pruning curve comparison: Frozen Mask vs Regrow


⏳ Recursive Time Depth (Project 10)

Novel contribution: Subjective "time" in neural networks measured by depth of stable recursive transformations.

Key Findings:

  • p90/p99 Percentile-Based Stopping: Convergence detected via internal activation stability (percentiles of relative change norm) rather than output entropy.
  • Attractor-Entry Effect: Recursion drives activations into a stable representational regime without additional training data.
  • Time as Order Parameter: Recursion depth required for stability provides an operational internal "time" measure; high CKA (~0.98) supports stabilization consistent with attractor-like dynamics.
  • Efficiency: 5-7x speedup over self-consistency at comparable compute budget.
  • Condensation Without Degradation: CKA ~0.98 with growing amplitude (||h_t||: 1322 β†’ 12291) indicates stable representational regime (non-collapse stability).

Full documentation: 10-recursive-time-depth/README.md


πŸš€ Quick Start ("Hero" Experiment)

If you want to run just one experiment, choose Temporal LoRA. It demonstrates dynamic context switching in GPT-2.

# 1. Install dependencies
pip install -r requirements.txt

# 2. Run GPT-2 experiment
cd 02-temporal-lora-gpt2
python temporal_lora.py

Watch as the model automatically learns to route "To code or not to code" to the Shakespeare adapter, and "import torch" to the Python adapter.


πŸ“Š Key Results

1. Lazarus Effect (Latent Reversibility)

We proved that even when model accuracy on Task A drops to 0.00% after training on Task B, knowledge remains encoded in the backbone.

Recovery: 94.65% accuracy recovered with just 50 examples.

2. Time Mixer Accuracy (GPT-2)

In our Temporal LoRA experiment, the gating network successfully learned to distinguish semantic epochs.

Router accuracy: 100.0% after contrastive calibration.

3. Pruning & Compression

We demonstrated that Frozen Mask stability optimization allows for massive compression without retraining.

Result: +1.62% accuracy gain on an 80% pruned model using the Lazarus Protocol.


πŸ“ Project Structure

D:\new\
β”œβ”€β”€ README.md                          # This file
β”œβ”€β”€ requirements.txt                   # Common dependencies
β”‚
β”œβ”€β”€ 07-stability-first-cifar10/        # πŸ† The Lazarus Project
β”‚   β”œβ”€β”€ experiments/
β”‚   β”‚   β”œβ”€β”€ noise/
β”‚   β”‚   β”‚   β”œβ”€β”€ experiment_cifar10.py          # V-Shape Recovery
β”‚   β”‚   β”‚   β”œβ”€β”€ experiment_analysis.py        # Recovery Curve Analysis
β”‚   β”‚   β”‚   └── experiment_statistical_significance.py
β”‚   β”‚   └── pruning/
β”‚   β”‚       β”œβ”€β”€ experiment_pruning.py         # Pruning Recovery
β”‚   β”‚       └── experiment_pruning_curve.py   # Pruning Curve
β”‚   β”œβ”€β”€ docs/
β”‚   β”‚   β”œβ”€β”€ LAZARUS_FINAL_MANIFESTO.md        # Full Scientific Report
β”‚   β”‚   β”œβ”€β”€ LAZARUS_MANIFESTO.md              # Complete Documentation
β”‚   β”‚   └── RESULTS_VISUALIZATION.md          # Visualizations
β”‚   β”œβ”€β”€ results/
β”‚   β”‚   β”œβ”€β”€ lazarus_recovery_curve.png        # Visual Proof
β”‚   β”‚   └── pruning_curve_comparison.png       # Frozen vs Regrow Chart
β”‚   └── README.md
β”‚
β”œβ”€β”€ 02-temporal-lora-gpt2/             # 🌟 Temporal LoRA (GPT-2)
β”‚   β”œβ”€β”€ temporal_lora.py
β”‚   └── README.md
β”‚
β”œβ”€β”€ 11-temporal-lora-large-model/      # βœ… Temporal LoRA (Mistral-7B)
β”‚   β”œβ”€β”€ run_full_suite.py
β”‚   β”œβ”€β”€ temporal_lora.py
β”‚   β”œβ”€β”€ test_hysteresis.py
β”‚   β”œβ”€β”€ test_fatigue.py
β”‚   β”œβ”€β”€ RESULTS.md
β”‚   └── results/
β”‚
β”œβ”€β”€ 06-subjective-time-critic/         # Metacognition
β”‚   β”œβ”€β”€ demo_6_subjective_time.py
β”‚   └── README.md
β”‚
β”œβ”€β”€ 10-recursive-time-depth/           # ⏳ Recursive Time Depth
β”‚   β”œβ”€β”€ recursive_time_depth.py       # Main experiment
β”‚   β”œβ”€β”€ strict_validation_tests.py    # 5 validation tests
β”‚   β”œβ”€β”€ TEST_RESULTS_FINAL.md         # Final results
β”‚   └── README.md
β”‚
└── docs/                              # Documentation
    └── RESULTS_SUMMARY.md             # Final report

πŸ”§ Technical Details

Windows Fixes

βœ… num_workers=0, pin_memory=False in DataLoader
βœ… Unicode symbols (Ξ”, Ξ») replaced with ASCII
βœ… All scripts have if __name__ == "__main__"

Dependencies

  • torch
  • torchvision
  • numpy
  • transformers (for project 2)
  • matplotlib

🀝 Citation

If you find this research useful, please use the following citation:

Published Paper:

@misc{sialedchyk2026stability,
  author = {Sialedchyk, Vitali},
  title = {Stability-First AI: Completed Experimental Studies and the Physics of Learning Time},
  year = {2026},
  publisher = {Zenodo},
  doi = {10.5281/zenodo.18148080},
  url = {https://doi.org/10.5281/zenodo.18148080}
}

Repository:

@misc{stability_first_ai,
  author = {Vitali Sialedchyk},
  title = {Stability-First AI: Memory and Recursive Stability as System Time},
  year = {2026},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/vitali-sialedchyk/stability-first-ai}}
}

DOI Badge: DOI


βš–οΈ License & Commercial Use

This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0).

βœ… Free for: Academic research, education, personal testing, and non-profit use.
❌ Not allowed: Commercial products, paid services, or corporate R&D without a separate agreement.

Want to use Stability-First AI in your product?

We offer commercial licensing options including support and architectural consulting.

πŸ“© Contact: vitali@agdgroup.pl or via GitHub Issues.

See the LICENSE file for full terms and conditions.


Last updated: January 2026

Releases

No releases published

Packages

 
 
 

Contributors

Languages