2025
This repository contains the reference implementation of SCI, a closed-loop metacognitive controller that wraps existing models and turns prediction into a regulated process rather than a one-shot function evaluation.
SCI is introduced in:
Vishal Joshua Meesala
SCI: A Metacognitive Control for Signal Dynamics.
arXiv:2511.12240, 2025
https://arxiv.org/abs/2511.12240
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
DeltaSP(t) = SP_target(t) - SP(t)
under Lyapunov-style stability constraints.
This codebase provides:
- A modular implementation of SCI’s metacognitive control loop
- Tools to construct reliability-weighted feature decompositions for time-series and other signals
- A controller that monitors interpretive stability and adapts parameters over time
- Experiment scripts and utilities to reproduce key empirical findings from the paper
SCI sits on top of existing models and signal pipelines; it does not replace them.
It adds a control-theoretic layer for inference-time regulation, safety, and interpretive stability.
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:
- Easy and ambiguous inputs receive the same computational budget
- Explanations are static, post hoc, and do not adapt under drift
- There is no explicit notion of “interpretive error” that can be monitored and controlled
SCI addresses this by introducing a closed-loop metacognitive layer that:
- Monitors a scalar interpretive state
SP(t)in[0, 1]over time - Computes interpretive error
DeltaSP = SP_target - SPrelative to a target clarity levelSP_target - Updates interpreter parameters
Thetaaccording to a stability-aware rule with safeguards - Allocates more inference steps and adaptation to ambiguous or unstable inputs
- Exposes
DeltaSPas a safety signal for abstention, escalation, or human-in-the-loop review
Empirically, SCI:
- Allocates roughly 3.6–3.8x more computation to misclassified inputs than to correct ones under matched budgets
- Produces a scalar safety signal
DeltaSPwith AUROC around 0.70–0.86 for detecting errors across vision, medical, and industrial benchmarks
SCI is a modular architecture with four core components.
A multi-scale, multimodal feature bank P(t, s) that organizes raw signals X(t) into interpretable blocks:
- Rhythmic components (frequency bands, oscillatory structure)
- Trend components (low-frequency baselines, drifts)
- Spatial / structural components (sensor topology, modes)
- Cross-modal interactions (coherence, cross-correlation, causal couplings)
- Compact but auditable latent composites
Pi_star
Each feature is associated with a reliability weight w_f(t), derived from quantities such as:
- Signal-to-noise ratio (SNR)
- Temporal persistence
- Multi-sensor or cross-modal coherence
These weights allow SCI to emphasize trustworthy features and down-weight degraded sensors or spurious patterns.
A knowledge-guided interpreter that maps the reliability-weighted feature bank into:
- Markers
m_k: human-meaningful states or concepts - Confidences
p_k(t): calibrated probabilities - Rationales
r_k(t): sparse feature-level attributions and/or templated text
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.
A scalar interpretive signal SP(t) in [0, 1] that aggregates calibrated components such as:
- Clarity or selectivity
- Pattern strength
- Domain consistency
- Predictive alignment
In the minimal implementation, SP is instantiated as normalized entropy of a marker or predictive distribution:
high SP corresponds to focused, confident internal usage of markers; low SP indicates a diffuse or ambiguous
internal state.
The controller monitors DeltaSP(t) and updates the interpreter parameters over time.
-
Compute the interpretive error:
DeltaSP(t) = SP_target(t) - SP(t) -
If
|DeltaSP(t)|is large, update parameters:Theta_{t+1} = Proj_C( Theta_t + eta_t * ( DeltaSP(t) * grad_Theta_SP(t) + lambda_h * u_h(t) ) )where:
eta_tis a step-size schedulelambda_his a human-gain budgetu_h(t)is an optional, bounded human feedback signalProj_Cenforces constraints (e.g., trust region, sparsity, parameter bounds)
-
Define the interpretive energy:
V(t) = 0.5 * ( DeltaSP(t) )^2
Under suitable conditions on eta_t and lambda_h, the energy V(t) decreases monotonically up to bounded noise,
so explanations become more stable and consistent over time.
This yields a reactive interpretability layer that not only explains but also stabilizes explanations under drift, feedback, and evolving conditions.
Clone the repository and install in editable mode:
git clone https://github.com/vishal-1344/sci.git
cd sci
pip install -e .
Or install from requirements:
pip install -r requirements.txt