Instructions to use deepakdsoni/antahkarana-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use deepakdsoni/antahkarana-base with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Antaḥkaraṇa-base
- What it is (and isn't)
- Architecture — the four organs (the Vedic abstraction is the API; SOTA algorithms are the engine)
- Validated results (seeded; from the gated build G0–G5)
- Validation gates (G0–G5) — how we know it works, and that it's not cherry-picked
- How to use
- Per-organ attribution (ablations)
- Limitations (honest)
- What didn't work (archived, not hidden)
- Citation
Antaḥkaraṇa-base
A backbone-agnostic continual-learning "mind" — not a frozen checkpoint, a runtime that lets a model keep learning without forgetting, notice the novel, know what it doesn't know, and consolidate in sleep.
Antaḥkaraṇa-base is the foundational ("base") size of the Antaḥkaraṇa line. It is a four-organ continual-learning core (modelled on the Vedic antaḥkaraṇa: manas / buddhi / ahaṃkāra / citta) that wraps any backbone via a thin adapter and adds: anti-forgetting consolidation, dark-knowledge replay, calibrated abstention, energy-based novelty/OOD detection, adaptive plasticity, and sleep consolidation. It is validated, with seeds and adaptive evaluation, on three different modalities with one unchanged runtime.
- Author: Deepak Soni
- License: Apache-2.0 (language flagship freezes
mistralai/Mistral-7B-v0.1, Apache-2.0) - Base of the language flagship: frozen Mistral-7B (7.25 B params) + 13.6 M trainable adapter (0.19 %)
- Status: research; all six validation gates (G0–G5) green
- Install:
pip install antahkarana· PyPI: https://pypi.org/project/antahkarana/ — train it on your data in ~10 lines (a thin adapter + your data stream)
What it is (and isn't)
- It is a continual-learning base / middleware: the organs + a generic training/inference loop. A new
domain plugs in by implementing one
BackboneAdapter(5 methods); the mind is identical for all. - It is not a single set of weights. The "model" is the architecture + the small trainable adapters per domain. Think "continual-learning OS you drop onto a backbone," not a pretrained snapshot.
Use it for ANY domain
The core is backbone- and modality-agnostic. It already runs unchanged on language (a 7B LLM, generative),
vision (a ViT classifier), and security (tabular intrusion detection) — three completely different
modalities. Any new domain — coding, time-series, audio, tabular, multi-modal, robotics, … — plugs in the same
way: implement one BackboneAdapter over your encoder, hand the core a stream of tasks, and you get
continual learning, novelty/OOD detection, calibrated abstention, and sleep consolidation for free. The four
organs don't change; only the thin adapter does.
Architecture — the four organs (the Vedic abstraction is the API; SOTA algorithms are the engine)
| Organ | Role | Faculties / algorithms |
|---|---|---|
| manas (intake) | novelty / OOD | avidyā — max-softmax or energy-OOD (Liu et al. 2020) |
| buddhi (decision) | calibrate & adapt | pramāṇa abstention (risk–coverage) · viveka selection · guṇa adaptive plasticity (rajas/sattva/tamas × domain base-lr) |
| ahaṃkāra (identity) | self / boundary | label-free task-boundary detection |
| citta (memory) | retain/consolidate | saṃskāra (Fisher consolidation) · vijñāna-smṛti replay (naive or DER++, Buzzega et al. 2020) · nidrā sleep |
Validated results (seeded; from the gated build G0–G5)
| Modality | Backbone | Core result |
|---|---|---|
| Language | frozen Mistral-7B + LoRA (generative) | reproduces the validated v3.0 system; DER++ replay drives forgetting → ~0 |
| Vision | frozen ViT-B/16 + adapter (Split-CIFAR-100) | acc 0.925 ± .003, faculties vs naive: ~+9 pts, ~6× less forgetting (3-seed) |
| Security | tabular IDS encoder (NSL-KDD) | forgetting 0.069 ± .021 vs naive 0.152; zero-day AUROC 0.949 ± .005 (3-seed); calibrated triage |
Adaptive / honest security eval: zero-day AUROC for every held-out attack family = dos 0.79 / probe 0.90 / r2l 0.78 / u2r 0.96 (no cherry-pick); an evasion curve (blend attacks toward normal) degrades 0.95 → 0.25 — the detector is a strong novelty signal, not an unbeatable defense.
Validation gates (G0–G5) — how we know it works, and that it's not cherry-picked
The whole thing was built as a gated pipeline: each gate had to go green before the next, so nothing rests on faith and a refactor can't silently break the science.
| Gate | What it proves |
|---|---|
| G0 — golden lock | freeze the known-good baselines; every later gate diffs against them (regression safety net) |
| G1 — faculties (20/20) | each organ/algorithm is correct in isolation |
| G2 — integration (12/12) | the four organs compose into one working loop on a trivial backbone |
| G3-language | the core reproduces the validated 7B continual-learning system |
| G3.5 | a SOTA organ (DER++) measurably improves the real 7B (forgetting → ~0) |
| G3-vision | the same core runs a ViT classifier — cross-modal proof |
| G4 — security | the same core runs tabular intrusion detection (3rd modality): no-forgetting + zero-day + triage |
| G5 — honesty | seeds + std, adaptive evasion eval, per-organ ablations, archived negatives, stated limits |
All six green. Because G3-vision and G4-security run the identical core that passed G3-language, "works on any
domain" is demonstrated, not asserted — and G4 even surfaced and fixed a general core bug that only a third
modality could expose. See GATES_STATUS.md and G5_HONESTY.md in this repo.
How to use
from antahkarana.core import Antahkarana
from antahkarana.domains.language import LanguageBackbone, build_language_stream
bb = LanguageBackbone() # frozen Mistral-7B + LoRA
stream = build_language_stream() # a sequence of tasks/skills
mind = Antahkarana(bb, samskara=True, replay=True, sleep=True,
replay_strategy="der", # DER++ dark-knowledge replay (SOTA)
avidya_strategy="energy")
result = mind.run(stream) # learns continually; returns matrix, forgetting, risk_coverage, ...
A new domain = one BackboneAdapter subclass implementing named_trainable / train_step / eval_task / predict_with_confidence / confidence_pairs (+ optional logits for energy-OOD, capture/der_loss for DER++).
See domains/{language,vision,security,mock}.py.
Per-organ attribution (ablations)
No single organ wins everywhere — it's a toolkit:
- Vision / class-incremental: saṃskāra dominates.
- Security: replay is the main anti-forgetting lever (saṃskāra ~neutral; sleep small/occasionally −).
- Language (7B): saṃskāra → +vijñāna-smṛti → DER++ each lower forgetting.
Limitations (honest)
- Effect sizes are domain-dependent (large in vision/security, modest in 7B-generative).
- Generic, not specialized — lands near tuned domain SOTA (e.g. vision 0.925 vs a specialized 0.947), not always at it.
- Per-domain hyperparameters (base-lr, epochs, memory fraction, guṇa bands) are set, not auto-tuned.
- The zero-day detector is evadable under full adaptive disguise.
- Scale: 3–4 seeds; NSL-KDD is a dated IDS benchmark; in-RAM memory, single-GPU loop; research-grade, no formal guarantees.
What didn't work (archived, not hidden)
- Co-training at 7B (shared frozen backbone → correlated views → no gain).
- Self-directed curriculum ("tapas") in the fully-supervised regime (no headroom).
- Order-biased replay memory (
train[:frac]) — a real bug the security modality exposed and fixed.
Citation
@software{soni_antahkarana_base_2026,
author = {Deepak Soni},
title = {Antaḥkaraṇa-base: a backbone-agnostic continual-learning mind (manas/buddhi/ahaṃkāra/citta)},
year = {2026},
note = {Validated across language, vision, and security; gates G0–G5.}
}
The antaḥkaraṇa framing is a design philosophy and explanatory map — every organ resolves to a real, citable algorithm. Not a claim of supernatural capability.
Model tree for deepakdsoni/antahkarana-base
Base model
mistralai/Mistral-7B-v0.1
