Add cortex/__init__.py
Browse files- cortex/__init__.py +32 -0
cortex/__init__.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Cortex: Modular Cognitive Plug-ins for Pretrained LLMs
|
| 3 |
+
======================================================
|
| 4 |
+
|
| 5 |
+
A framework for surgically inserting new cognitive capabilities into
|
| 6 |
+
pretrained transformer language models via layer surgery.
|
| 7 |
+
|
| 8 |
+
Modules:
|
| 9 |
+
1. MemoryBank — Persistent episodic memory via gated cross-attention (LM2-inspired)
|
| 10 |
+
2. HallucinationGate — Per-token confidence estimation & gated suppression (InternalInspector-inspired)
|
| 11 |
+
3. PauseAndThink — Learnable latent "thinking" tokens for extra compute (Pause Token paper)
|
| 12 |
+
4. BacktrackHead — Learned backtracking via early-exit confidence routing (GateSkip + River-LLM)
|
| 13 |
+
5. SteeringVector — Activation-space behavioral control (Representation Engineering)
|
| 14 |
+
6. AdaptiveDepth — Dynamic layer skipping with learned gates (Mixture of Depths)
|
| 15 |
+
|
| 16 |
+
All modules follow the CortexModule protocol and can be composed freely.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
from cortex.core import CortexModule, CortexSurgeon, CortexConfig
|
| 20 |
+
from cortex.memory_bank import MemoryBank
|
| 21 |
+
from cortex.hallucination_gate import HallucinationGate
|
| 22 |
+
from cortex.pause_and_think import PauseAndThink
|
| 23 |
+
from cortex.backtrack_head import BacktrackHead
|
| 24 |
+
from cortex.steering_vector import SteeringVector
|
| 25 |
+
from cortex.adaptive_depth import AdaptiveDepth
|
| 26 |
+
|
| 27 |
+
__version__ = "0.1.0"
|
| 28 |
+
__all__ = [
|
| 29 |
+
"CortexModule", "CortexSurgeon", "CortexConfig",
|
| 30 |
+
"MemoryBank", "HallucinationGate", "PauseAndThink",
|
| 31 |
+
"BacktrackHead", "SteeringVector", "AdaptiveDepth",
|
| 32 |
+
]
|