vishal-1344 commited on
Commit
cd657b1
·
verified ·
1 Parent(s): 65a66a7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +185 -133
README.md CHANGED
@@ -1,133 +1,185 @@
1
- SCI: Surgical Cognitive Interpreter
2
- A Metacognitive Control Layer for Signal Dynamics
3
-
4
- This repository contains the reference implementation of the Surgical Cognitive Interpreter (SCI), a closed-loop metacognitive controller that wraps existing models and turns prediction into a regulated process rather than a one-shot function evaluation.
5
-
6
- SCI is introduced in:
7
-
8
- Vishal Joshua Meesala
9
- SCI: A Metacognitive Control for Signal Dynamics.
10
- arXiv:2511.12240, 2025
11
- https://arxiv.org/abs/2511.12240
12
-
13
- The paper formalizes interpretability as a feedback-regulated state: SCI monitors a scalar interpretive signal SP(t), defined over reliability-weighted, multi-scale features, and adaptively adjusts an interpreter’s parameters to reduce interpretive error
14
-
15
- ΔSP(t) = SP*(t) − SP(t)
16
-
17
- under Lyapunov-style stability constraints.
18
-
19
- 1. Motivation
20
- Most neural networks are deployed as open-loop function approximators: they map inputs to outputs in a single forward pass, with no explicit mechanism to regulate how much computation, explanation quality, or clarification is applied to a given case. In safety–critical domains (medicine, industrial monitoring, environmental sensing), this is brittle:
21
-
22
- Easy and ambiguous inputs receive the same computational budget.
23
- Explanations are static, post hoc, and do not adapt under drift.
24
- There is no explicit notion of “interpretive error” that can be monitored and controlled.
25
- SCI addresses this by introducing a closed-loop metacognitive layer that:
26
-
27
- Monitors a scalar interpretive state SP(t) ∈ [0, 1] over time.
28
- Computes interpretive error ΔSP = SP* SP relative to a target clarity level SP*.
29
- Updates interpreter parameters Θ according to a Lyapunov-inspired rule with safeguards.
30
- Allocates more inference steps and adaptation to ambiguous or unstable inputs.
31
- Exposes ΔSP as a safety signal for abstention, escalation, or human-in-the-loop review.
32
- Empirically, SCI:
33
-
34
- Allocates roughly 3.6–3.8× more computation to misclassified inputs than to correct ones.
35
- Produces a scalar safety signal ΔSP with AUROC ≈ 0.70–0.86 for detecting errors across vision, medical, and industrial benchmarks.
36
- 2. Conceptual Overview
37
- SCI is a modular architecture with the following core components.
38
-
39
- 2.1 Decomposition Π
40
- A multi-scale, multimodal feature bank P(t, s) that organizes raw signals X(t) into interpretable blocks:
41
-
42
- Rhythmic components (frequency bands, oscillatory structure)
43
- Trend components (low-frequency baselines, drifts)
44
- Spatial / structural components (sensor topology, modes)
45
- Cross-modal interactions (coherence, cross-correlation, causal couplings)
46
- Compact but auditable latent composites Π*
47
- Each feature is associated with a reliability weight w_f(t), derived from quantities such as:
48
-
49
- Signal-to-noise ratio (SNR)
50
- Temporal persistence
51
- Multi-sensor or cross-modal coherence
52
- These weights allow SCI to emphasize trustworthy features and down-weight degraded sensors or spurious patterns.
53
-
54
- 2.2 Interpreter ψΘ
55
- A knowledge-guided interpreter that maps the reliability-weighted feature bank into:
56
-
57
- Markers m_k: human-meaningful states or concepts
58
- Confidences p_k(t): calibrated probabilities
59
- Rationales r_k(t): sparse feature-level attributions and/or templated text
60
- The interpreter can be instantiated as a modest neural head (e.g., linear layer or shallow MLP) on top of P(t, s), optionally constrained by ontologies or domain rules.
61
-
62
- 2.3 Surgical Precision (SP)
63
- A scalar interpretive signal SP(t) ∈ [0, 1] that aggregates calibrated components such as:
64
-
65
- Clarity / selectivity
66
- Pattern strength
67
- Domain consistency
68
- Predictive alignment
69
- In the minimal implementation, SP is instantiated as normalized entropy of a marker distribution or predictive distribution: high SP corresponds to focused, confident internal usage of markers; low SP indicates diffuse or ambiguous internal state.
70
-
71
- 2.4 Closed-Loop Controller
72
- A controller monitors ΔSP(t) and updates Θ accordingly. At a high level:
73
-
74
- Compute ΔSP(t) = SP*(t) SP(t) relative to a target SP*(t).
75
-
76
- If |ΔSP(t)| exceeds a threshold, update parameters:
77
-
78
- Θ_{t+1} = Proj_C [ Θ_t + η_t ( ΔSP(t) · ∇_Θ SP(t) + λ_h · u_h(t) ) ]
79
-
80
- where:
81
-
82
- η_t is a step-size schedule,
83
- λ_h is a human-gain budget,
84
- u_h(t) is a bounded human feedback signal (optional),
85
- Proj_C enforces constraints (e.g., trust region, sparsity, or parameter bounds).
86
- Lyapunov-style analysis shows that, under suitable conditions on η_t and λ_h, the “interpretive energy”
87
-
88
- V(t) = ½ · (ΔSP(t)
89
-
90
- decreases monotonically up to bounded noise, so explanations become more stable and consistent over time.
91
-
92
- This yields a reactive interpretability layer that not only explains but also stabilizes explanations under drift, feedback, and evolving conditions.
93
-
94
- 3. Repository Structure
95
- The repository is organized as follows:
96
-
97
- sci/ # Core library
98
- __init__.py
99
- controller.py # SCIController: closed-loop update over Θ using ΔSP
100
- interpreter.py # Interpreter / marker head and SP computation
101
- sp_evaluator.py # SP and component metrics, calibration, logging
102
- decomposition.py # Decomposition Π and reliability-weighted feature bank
103
- reliability.py # Reliability scores (SNR, persistence, coherence)
104
- utils.py # Shared utilities and helper functions
105
-
106
- configs/ # Example configuration files
107
- mnist.yaml
108
- mitbih.yaml
109
- bearings.yaml
110
-
111
- examples/ # Jupyter notebooks (to be populated)
112
- mnist_sci_demo.ipynb
113
- ecg_sci_demo.ipynb
114
- bearings_sci_demo.ipynb
115
-
116
- experiments/ # Experiment scripts, logs, and analysis
117
-
118
- scripts/ # Training utilities, Hub utilities, etc.
119
- push_to_hub.py
120
-
121
- run_sci_mitbih_fixed_k.py
122
- run_sci_bearings.py
123
- run_sci_signal_v2.py # Signal-domain SCI experiments
124
-
125
- plot_metacognition_hero.py # Plotting script for metacognitive behavior
126
- sc_arxiv.pdf # Paper PDF (for convenience)
127
- sci_latex.tex # LaTeX source of the paper
128
-
129
- pyproject.toml
130
- setup.cfg
131
- LICENSE
132
- README.md
133
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: mit
4
+ tags:
5
+ - metacognition
6
+ - interpretability
7
+ - control-theory
8
+ - explainability
9
+ - research
10
+ - pytorch
11
+ - dynamic-inference
12
+ - safety
13
+ - signal-modeling
14
+ model_name: "SCI: Surgical Cognitive Interpreter"
15
+ library_name: pytorch
16
+ papers:
17
+ - https://arxiv.org/abs/2511.12240
18
+ ---
19
+
20
+ # SCI: Surgical Cognitive Interpreter
21
+ A Metacognitive Control Layer for Signal Dynamics
22
+
23
+ This repository contains the reference implementation of the **Surgical Cognitive Interpreter (SCI)**, a closed-loop metacognitive controller that wraps existing models and turns prediction into a regulated process rather than a one-shot function evaluation.
24
+
25
+ SCI is introduced in:
26
+
27
+ **Vishal Joshua Meesala**
28
+ *SCI: A Metacognitive Control for Signal Dynamics*
29
+ arXiv:2511.12240, 2025
30
+ https://arxiv.org/abs/2511.12240
31
+
32
+ The paper formalizes interpretability as a feedback-regulated state: SCI monitors a scalar interpretive signal \( SP(t) \), defined over reliability-weighted, multi-scale features, and adaptively adjusts an interpreter’s parameters to reduce interpretive error
33
+ \[
34
+ \Delta SP(t) = SP^\*(t) - SP(t),
35
+ \]
36
+ under Lyapunov-style stability constraints.
37
+
38
+ ---
39
+
40
+ ## 1. Motivation
41
+
42
+ Most neural networks are deployed as **open-loop function approximators**: they map inputs to outputs in a single forward pass, with no explicit mechanism to regulate computation, explanation quality, or clarification depth.
43
+ In safety–critical domains (medicine, industrial monitoring, environmental sensing), this is brittle:
44
+
45
+ - Easy and ambiguous inputs receive the same computational budget.
46
+ - Explanations are static and post hoc, with no adaptation under drift.
47
+ - There is no explicit notion of “interpretive error” that can be monitored or controlled.
48
+
49
+ SCI addresses this by introducing a **closed-loop metacognitive layer** that:
50
+
51
+ - Monitors a scalar interpretive state \( SP(t) \in [0,1] \).
52
+ - Computes interpretive error \( \Delta SP = SP^\* - SP \) relative to a target clarity level.
53
+ - Updates interpreter parameters \( \Theta \) according to a Lyapunov-inspired rule with safeguards.
54
+ - Allocates more inference steps and adaptation to ambiguous or unstable inputs.
55
+ - Exposes \( \Delta SP \) as a **safety signal** for abstention, escalation, or human-in-the-loop review.
56
+
57
+ Empirically, SCI:
58
+
59
+ - Allocates **3.6–3.8× more computation** to misclassified inputs than to correct ones.
60
+ - Produces an effective scalar safety signal \( \Delta SP \) with **AUROC 0.70–0.86** for error detection across vision, medical, and industrial benchmarks.
61
+
62
+ ---
63
+
64
+ ## 2. Conceptual Overview
65
+
66
+ SCI is a modular architecture with four main components.
67
+
68
+ ### 2.1 Decomposition \( \Pi \)
69
+
70
+ A multi-scale, multimodal feature bank \( P(t, s) \) that organizes raw signals \( X(t) \) into interpretable components:
71
+
72
+ - Rhythmic components (frequency bands, oscillations)
73
+ - Trend components (baselines, drifts)
74
+ - Spatial / structural components (sensor topology, modes)
75
+ - Cross-modal interactions (coherence, correlation, causal couplings)
76
+ - Latent composites \( \Pi^\* \)
77
+
78
+ Each feature is weighted by a reliability score \( w_f(t) \) derived from:
79
+
80
+ - Signal-to-noise ratio (SNR)
81
+ - Temporal persistence
82
+ - Cross-sensor coherence
83
+
84
+ These weights ensure degraded or untrustworthy features are down-weighted.
85
+
86
+ ---
87
+
88
+ ### 2.2 Interpreter \( \psi_\Theta \)
89
+
90
+ A knowledge-guided interpreter that maps the reliability-weighted feature bank into:
91
+
92
+ - **Markers** \( m_k \): human-meaningful states or concepts
93
+ - **Confidences** \( p_k(t) \): calibrated probabilities
94
+ - **Rationales** \( r_k(t) \): sparse feature-level attributions and/or templated text
95
+
96
+ This component can be instantiated as a linear or shallow neural head on top of \( P(t, s) \), optionally constrained by domain rules or ontologies.
97
+
98
+ ---
99
+
100
+ ### 2.3 Surgical Precision (SP)
101
+
102
+ \( SP(t) \in [0,1] \) aggregates calibrated components such as:
103
+
104
+ - Clarity / selectivity
105
+ - Pattern strength
106
+ - Domain consistency
107
+ - Predictive alignment
108
+
109
+ In the minimal implementation, \( SP \) is normalized entropy of a marker or predictive distribution:
110
+ high SP corresponds to focused, confident internal usage of markers;
111
+ low SP corresponds to diffuse or ambiguous internal state.
112
+
113
+ ---
114
+
115
+ ### 2.4 Closed-Loop Controller
116
+
117
+ The controller monitors \( \Delta SP(t) \) and updates \( \Theta \) when interpretive clarity is insufficient.
118
+
119
+ \[
120
+ \Theta_{t+1} = \text{Proj}_{\mathcal{C}}\left[\Theta_t + \eta_t\left(\Delta SP(t)\nabla_\Theta SP(t) + \lambda_h u_h(t)\right)\right],
121
+ \]
122
+
123
+ where:
124
+
125
+ - \( \eta_t \): step-size schedule
126
+ - \( \lambda_h \): human-gain budget
127
+ - \( u_h(t) \): bounded human feedback signal (optional)
128
+ - \( \text{Proj}_{\mathcal{C}} \): projection enforcing constraints (trust region, sparsity, parameter bounds)
129
+
130
+ Lyapunov-style analysis shows that, under suitable conditions on \( \eta_t \) and \( \lambda_h \), the “interpretive energy”
131
+
132
+ \[
133
+ V(t) = \tfrac{1}{2}(\Delta SP(t))^2
134
+ \]
135
+
136
+ decreases monotonically up to bounded noise, so explanations become more stable and consistent over time.
137
+
138
+ This yields a **reactive interpretability layer** that not only explains but also stabilizes explanations under drift, feedback, and evolving conditions.
139
+
140
+ ---
141
+
142
+ ## 3. Repository Structure
143
+
144
+ The repository is organized as follows (file names may evolve slightly as the framework matures):
145
+
146
+ ```text
147
+ sci/ # Core SCI library
148
+ __init__.py
149
+ config.py
150
+ controller.py # SCIController: closed-loop update over Θ using ΔSP
151
+ decomposition.py # Decomposition Π and reliability-weighted feature bank
152
+ interpreter.py # Interpreter / marker head and SP computation
153
+ reliability.py # Reliability scores (SNR, persistence, coherence)
154
+ sp.py # SP scalar and related metrics
155
+ utils.py # Shared utilities and helper functions
156
+
157
+ configs/ # Example configuration files
158
+ mnist.yaml
159
+ mitbih.yaml
160
+ bearings.yaml
161
+
162
+ examples/ # Jupyter notebooks (to be populated)
163
+ mnist_sci_demo.ipynb
164
+ ecg_sci_demo.ipynb
165
+ bearings_sci_demo.ipynb
166
+
167
+ experiments/ # Experiment scripts, logs, and analysis
168
+
169
+ scripts/ # Training utilities, Hub utilities, etc.
170
+ push_to_hub.py
171
+
172
+ run_sci_mitbih_fixed_k.py
173
+ run_sci_bearings.py
174
+ run_sci_signal_v2.py # Signal-domain SCI experiments
175
+
176
+ plot_metacognition_hero.py # Plotting script for metacognitive behavior
177
+ sc_arxiv.pdf # Paper PDF (for convenience)
178
+ sci_latex.tex # LaTeX source of the paper
179
+
180
+ pyproject.toml
181
+ setup.cfg
182
+ LICENSE
183
+ README.md
184
+
185
+