The promise of this tutorial: the companion tutorials left our physics-obeying model able to speak „circuit“ through Ψ-HDL and to use recurrent memory through Ψ-xLSTM. Ψ-Vortex extends that path with a chronology-safe recurrent protocol, BIC-inspired structural regularization, symmetry analysis, validation-only structure selection, latent thermal-coupling inference, and stateful Verilog-A export.
Two outputs must be kept separate. The effective thermal-coupling coefficient $$\hat{\alpha}$$ is recovered post hoc from held-out recurrent predictions, while the selected recurrent student is compressed and exported separately as a simulator-executable Verilog-A compact model.
Scope note: the latent thermal-coupling experiment uses synthetic data calibrated to published device parameters. It is not a demonstration of thermal-coupling discovery in fabricated 3D stacks. The separate measured-device experiments validate recurrent compact-model fidelity, not thermal-coupling recovery.
1. A 30-second recap: the ladder so far
If you have read the earlier tutorials, this is the complete progression in compact form. If you have not, it is enough context to follow the rest of this tutorial.
-
Ψ-NN, introduced by Liu et al. (2025), established the foundation: a physics-informed teacher learns the target behavior, a student learns from the teacher under structural regularization, and compact internal organization can then be extracted and reconstructed.
-
Ψ-HDL extended that idea toward engineering deployment by translating discovered structure into compact behavioral models and Verilog-A suitable for circuit-simulation workflows.
-
Ψ-xLSTM introduced recurrent xLSTM-based learning and Recurrent Relation-Aware Distillation (RRAD) so that fast transients, temporal memory, and history-dependent device behavior could be represented.
The conceptual progression is therefore: structure discovery → engineering deployment → recurrent temporal modeling → validation-controlled recurrent inference and circuit execution
2. The two bottlenecks Ψ-Vortex targets
Ψ-xLSTM addressed an important modeling limitation by giving the Ψ-family recurrent memory for history-dependent device dynamics. Real devices are often not pointwise functions because their present current can depend on earlier voltage excitation, switching history, accumulated heat, relaxation, hysteresis, and other internal-state effects.
But recurrent modeling introduces two practical bottlenecks.
Bottleneck 1: recurrent teachers can be expensive
The xLSTM-style teacher uses matrix memory. A simplified matrix-memory update can be written as
$$C_t = \operatorname{mean}(f_t) C_{t-1} + \operatorname{mean}(i_t)(v_t k_t^\top).$$
If the matrix-memory dimension is \(d\), the update has approximately $$O(d^2)$$ cost per timestep. That can be acceptable for a high-capacity teacher used during model development, but it is not desirable for a compact model that must execute repeatedly inside circuit-level simulation.
The objective is therefore not to deploy the large teacher directly. The teacher captures the difficult recurrent dynamics, while a smaller student is trained to preserve the relevant behavior.
Earlier Ψ-family workflows still require human decisions at several stages, such as clustering thresholds, cluster candidates, low-rank candidates, recurrent architecture size, and other search limits. Those choices are manageable for an individual experiment but become increasingly cumbersome when many devices or operating regimes require separate compact models.
Ψ-Vortex reduces this burden through bounded validation-based selection rather than unrestricted automatic search. The user still defines the problem, data, candidate architecture set, training budget, BIC bandwidth, cluster candidates, and other declared limits, while the framework performs systematic selection inside those limits.
That distinction is important:
Ψ-Vortex reduces manual structural decisions, but it does not remove scientific problem formulation or claim unrestricted neural architecture search.
3. Physics-aware initialization: a task-dependent prior
The physical intuition behind the initialization stage is straightforward: when a physically plausible symmetry is available, the model can begin from weights that approximately reflect that relation rather than from an entirely unstructured random state.
For example, if a device approximately follows an odd current-voltage relation, $$ I(-V) \approx -I(V),$$ a signed transform can be applied to selected weights.
In the final formulation, the initialization is better understood as
where:
-
$$T_g$$ is the selected identity, odd, or even transform;
-
\(\mathcal{W}_{\mathrm{orth}}\) is an orthogonally initialized weight matrix;
-
$$s$$ is a scale factor;
-
the Gaussian term introduces a small perturbation;
-
recurrent matrices can remain orthogonal rather than being forced through the same symmetry transform.
The crucial interpretation is that this is an initialization bias, not a permanent mathematical constraint tying weights together.
What the final experiments actually show
Physics-aware initialization is not universally superior. In the declared shared-target printed-sequence experiment, it reaches the common MSE target in an average of 6.8 epochs compared with 462 epochs for random initialization, corresponding to a recorded 116.6\times acceleration.
On the thermal-recovery experiment, however, random initialization gives a lower test MSE than the physical-retention initialization.
The correct conclusion is therefore:
Physics-aware initialization can accelerate convergence for some tasks, but it does not guarantee improved transfer or final predictive fidelity.
A simple pedagogical sketch is:
import torch
import torch.nn as nn
def transformed_init(weight, transform="none", scale=0.1, eps=0.01, sigma=0.01):
"""
Pedagogical initialization only.
The production implementation uses a declared transform T_g and
keeps recurrent preservation rules separate.
"""
W = torch.empty_like(weight)
nn.init.orthogonal_(W)
if transform == "odd":
# Toy signed transform for illustration.
sign = torch.ones_like(W)
sign[W.shape[0] // 2:] = -1.0
W = sign * W
elif transform == "even":
W = W.abs()
return scale * (W + eps * sigma * torch.randn_like(W))
4. Automatic symmetry detection with abstention
Automatic symmetry detection is useful only if the algorithm is also allowed to say none.
The detector pairs sufficiently positive inputs with nearby negative inputs of comparable magnitude, evaluates odd and even reflection consistency, and then applies a thresholded decision rule:
g^*= \begin{cases} \mathrm{odd}, & C_{\mathrm{odd}} > C_{\mathrm{even}} \text{ and } C_{\mathrm{odd}}\ge \tau_{\mathrm{sym}},\\ \mathrm{even}, & C_{\mathrm{even}}\ge C_{\mathrm{odd}} \text{ and } C_{\mathrm{even}}\ge \tau_{\mathrm{sym}},\\ \mathrm{none}, & \text{otherwise}. \end{cases}
$$
The final implementation also requires a minimum number of matched reflection pairs.
This abstention behavior is not a minor detail. In the final Ψ-Vortex experiments, the automatic detector selects none on all five declared seeds for the tested case. That result is useful because it shows that the framework does not automatically force an odd symmetry simply because such a prior was considered during method development.
A toy detector can look like this:
def detect_symmetry(x_pos, y_pos, x_neg, y_neg, tau=0.7):
"""
Pedagogical mirror-consistency detector.
Production use should include robust pairing, tolerance checks,
minimum-pair requirements, and validation.
"""
c_odd = torch.corrcoef(
torch.stack([y_pos.flatten(), -y_neg.flatten()])
)[0, 1]
c_even = torch.corrcoef(
torch.stack([y_pos.flatten(), y_neg.flatten()])
)[0, 1]
best = max(c_odd.item(), c_even.item())
if best < tau:
return "none"
return "odd" if c_odd > c_even else "even"
The correct lesson is not that Ψ-Vortex always discovers symmetry. The stronger lesson is that it can test a bounded symmetry hypothesis and abstain when the evidence is insufficient.
5. The main automation mechanism: differentiable BIC-inspired structure regularization
The structural question is:
How many effective degrees of freedom does the student need while still preserving the target behavior?
Classical Bayesian Information Criterion uses a discrete parameter count:
BIC = k\ln(n)-2\ln(\hat{L}),
$$
where $$k$$ is the number of parameters, $$n$$ is the number of observations, and $$\hat{L}$$ is the maximized likelihood.
A discrete cluster count cannot be optimized directly by gradient descent, so Ψ-Vortex introduces a smooth local-density proxy for effective degrees of freedom.
For trainable scalar parameters $$\theta_i$$,
D_i(\theta) = \sum_{j=1}^{W} \exp\left[ -\frac{(\theta_i-\theta_j)^2}{2\gamma^2} \right],
$$
and
d_{\mathrm{eff}}(\theta) = \sum_{i=1}^{W} \frac{1}{\max(D_i(\theta),\varepsilon_D)}.
$$
If many parameters are close together, their local density $$D_i$$ becomes large, so the group contributes less than the same number of isolated parameters.
The final BIC-inspired structural score is
\mathcal{R}_{\mathrm{BIC}}(\theta,E,n) = n\ln\left(\max(E,\varepsilon_M)\right) + \ln(n)d_{\mathrm{eff}}(\theta),
$$
where $$E$$ is the supervised MSE and $$n$$ is the number of scalar target elements.
Important: this is a differentiable BIC-inspired surrogate. It is not classical BIC, and the formal asymptotic model-selection guarantees of classical BIC are not claimed.
The complete student objective
The final Ψ-Vortex student objective is
\boxed{ \mathcal{L}_{\mathrm{Vortex}} = \mathcal{L}_{\mathrm{sup}} + \mathcal{L}_{\mathrm{RRAD}} + \lambda_{\mathrm{struct}}\mathcal{R}_{\mathrm{BIC}} }
$$
where:
-
$$\mathcal{L}_{\mathrm{sup}}$$ preserves fidelity to the supervised target;
-
$$\mathcal{L}_{\mathrm{RRAD}}$$ preserves recurrent teacher behavior;
-
$$\mathcal{R}_{\mathrm{BIC}}$$ applies pressure toward a simpler effective parameter structure.
A small conceptual implementation is:
import math
import torch
def soft_effective_dof(theta, gamma=0.1, eps_d=1e-12):
theta = theta.flatten()
diff2 = (theta[:, None] - theta[None, :]) ** 2
density = torch.exp(-diff2 / (2 * gamma ** 2)).sum(dim=1)
density = torch.clamp(density, min=eps_d)
return (1.0 / density).sum()
def bic_inspired_score(theta, supervised_mse, n_targets,
gamma=0.1, eps_m=1e-8, eps_d=1e-12):
n = torch.as_tensor(
float(n_targets),
device=theta.device,
dtype=theta.dtype
)
mse_safe = torch.clamp(supervised_mse, min=eps_m)
d_eff = soft_effective_dof(theta, gamma=gamma, eps_d=eps_d)
return n * torch.log(mse_safe) + torch.log(n) * d_eff
The exact expression has $$O(W^2)$$ pairwise cost. The final reported model-selection experiments use the exact blocked expression
6. RRAD: preserving recurrent behavior during compression
Compactness alone is insufficient. A small student that reproduces only average outputs can lose the temporal behavior that made the recurrent teacher useful.
Ψ-Vortex retains Recurrent Relation-Aware Distillation from Ψ-xLSTM. In the final formulation,
$$\mathcal{L}_{\mathrm{RRAD}} = a_o\mathcal{L}_{\mathrm{out}} + b_o\mathcal{L} {\Delta\mathrm{out}} + a_h\mathcal{L}_{\mathrm{hid}} + b_h\mathcal{L}_{\Delta\mathrm{hid}}.$$
The terms have distinct roles:
– $$\(\mathcal{L}_{\mathrm{out}}\)$$: match teacher and student outputs;
– $$\(\mathcal{L}_{\Delta\mathrm{out}}\)$$: match temporal differences of the outputs;
– $$\(\mathcal{L}_{\mathrm{hid}}\)$$: match student hidden state to a learned projection of the teacher state;
– $$\(\mathcal{L}_{\Delta\mathrm{hid}}\)$$: match temporal differences of those recurrent states.
The final configuration uses weights $$ (a_o,b_o,a_h,b_h)=(1,0.5,1,0.5).$$
def temporal_difference(y, dt):
return (y[:, 1:] - y[:, :-1]) / dt[:, 1:]
def rrad_loss(y_s, y_t, h_s, h_t_proj, dt,
a_o=1.0, b_o=0.5, a_h=1.0, b_h=0.5):
l_out = ((y_s - y_t) ** 2).mean()
dy_s = temporal_difference(y_s, dt)
dy_t = temporal_difference(y_t, dt)
l_delta_out = ((dy_s - dy_t) ** 2).mean()
l_hid = ((h_s - h_t_proj) ** 2).mean()
dh_s = temporal_difference(h_s, dt)
dh_t = temporal_difference(h_t_proj, dt)
l_delta_hid = ((dh_s - dh_t) ** 2).mean()
return (
a_o * l_out
+ b_o * l_delta_out
+ a_h * l_hid
+ b_h * l_delta_hid
)
7. What actually enables hidden coupling recovery?
This is the central conceptual result.
The hidden thermal coupling is not recovered because the BIC-inspired term directly identifies $$\(\alpha\)$$. The BIC-inspired term regularizes the learned structure.
The effective coupling becomes recoverable because the model has a recurrent state that can integrate information over time.
A pointwise model behaves approximately as $$ I_t=f(V_t),$$
while a recurrent model behaves more like $$ I_t=f(V_t,h_{t-1}),$$
where $$\(h_{t-1}\)$$ carries information from previous timesteps.
A simple thermal trace illustrates why this distinction is important: $$ \Delta T_t = \rho\DeltaT_{t-1} + \eta P_t. $$
The present temperature depends on accumulated past power, not only the instantaneous driver value. If that hidden thermal history changes the observed victim current, then a recurrent model can encode the trajectory-dependent effect while a pointwise model lacks an explicit evolving state.
The final experiments test this directly:
– chronological Ψ-Vortex passes 3/3 seeds at $$\(\alpha=0.08\)$$;
– state-reset control passes 0/3;
– shuffled-timestep control passes 0/3;
– pointwise/no-memory control passes 0/3;
– a chronological vanilla LSTM passes 14/15 conditions across the broader coupling sweep.
The correct interpretation is therefore:
$$
\boxed{
\text{latent-recovery capability}
\;\leftarrow\;
\text{chronological stateful recurrence}
}
$$
not:
$$
\text{latent recovery}
\;\leftarrow\;
\text{BIC alone}
$$
and not:
$$
\text{latent recovery}
\;\leftarrow\;
\text{one unique recurrent cell}
$$
The synthetic case study considers a driver on layer $$N$$ thermally coupled to a victim on layer $$N+1$$ across a $$100-\mu\text{m}$$ paper substrate. The broader technological motivation includes massive multilayer printed structures, but the evaluated latent-recovery problem is a pairwise synthetic driver-victim benchmark, not a reconstruction of an entire 1000-layer stack.
The victim is held at a constant read voltage below its own reported switching threshold. The model receives electrical trajectories and must learn the driver-history effect visible in the victim response. After recurrent learning, the effective thermal coefficient is recovered post hoc using a free-intercept regression:
\log\left( \frac{I_{\mathrm{pred}}} {V_{\mathrm{read}}G_{\mathrm{base}}} \right) = b+\hat{\alpha}\Delta T.
$$
The intercept $$b$$ is important because it absorbs baseline conductance offsets. A through-origin estimator can incorrectly convert baseline mismatch into a nonzero slope.
Nominal result
At true coupling $$ \alpha=0.08,$$ the final three-seed result is $$ \hat{\alpha} = 0.08738\pm0.00900,$$ with held-out $$ R^2=0.981$$ and 3/3 accepted seeds. The mean coefficient error is 9.2%.
The full coupling sweep is bounded
The final sweep is:
| True \alpha | Mean \hat{\alpha} | Mean error | Mean R^2 | Accepted |
|---|---|---|---|---|
| 0.05 | 0.05232 | 4.6% | 0.980 | 3/3 |
| 0.08 | 0.08738 | 9.2% | 0.981 | 3/3 |
| 0.10 | 0.06628 | 36.0% | 0.698 | 1/3 |
| 0.15 | 0.06521 | 56.5% | 0.588 | 1/3 |
| 0.20 | 0.08289 | 58.6% | 0.569 | 0/3 |
Only $$\alpha=0.05$$ and $$\alpha=0.08$$ pass every declared seed.
That is why the final paper does not claim full-range recovery or a universal detection floor.
The extracted $$\hat{\alpha}$$ should be interpreted as an effective system-level thermal-electrical coupling descriptor for the calibrated generator, not as a universal material constant.
9. Stateful Verilog-A export: a separate branch from $$\hat{\alpha}$$
This section is where the distinction between inference and deployment becomes especially important.
The post-hoc thermal coefficient and the generated Verilog-A artifact are not the same object.
The final Ψ-Vortex pipeline has two related branches:
-
recurrent predictions are analyzed post hoc to recover $$\hat{\alpha}$$;
-
the validation-selected recurrent student is independently materialized and exported as a stateful Verilog-A model.
The reported $$\hat{\alpha}=0.08738$$ is not a literal parameter inside the recurrent Verilog-A artifact
The validated artifact is a sampled-state recurrent export of the selected clustered GRU student. Conceptually, the recurrent map is
The generated Verilog-A expands the learned affine operations and constants, and uses explicit state-holding nodes plus a two-phase sample-and-hold mechanism so that recurrent state is updated consistently.
A schematic interface is:
module psi_vortex_recurrent(in_0, sample_clock, out_0);
input in_0, sample_clock;
output out_0;
electrical in_0, sample_clock, out_0;
// Internal state_j and candidate_j nodes represent
// sampled recurrent state in the generated artifact.
analog begin
// Low phase:
// compute candidate recurrent state
//
// High phase:
// commit candidate state to persistent state
//
// Output:
// decode out_0 from the committed recurrent state
end
endmodule
This is only a pedagogical sketch. The generated source expands the actual learned recurrent equations component by component.
Circuit-simulation validation
OpenVAF-reloaded compiles the sampled-state Verilog-A artifact to OSDI, and ngspice executes five declared stimuli.
All five pass.
The worst absolute OSDI-versus-PyTorch error is $$ 5.46249\times10^{-5},$$ which is below the declared $$10^{-3}$$ tolerance.
This establishes equation-level circuit-simulator consistency. It is not PDK qualification and it is not fabricated-device validation.
10. Did the model recover a hidden interaction, or only fit waveforms?
A latent-variable claim becomes more credible when the method fails appropriately after the required causal or temporal information is removed.
The final Ψ-Vortex evaluation therefore includes several controls.
At the nominal \alpha=0.08$$ condition:
-
chronological Ψ-Vortex accepts 3/3 runs;
-
state-reset recurrence accepts 0/3;
-
shuffled timesteps accept 0/3;
-
pointwise/no-memory accepts 0/3.
Additional null-style controls include shuffled driver, unrelated slow drift, victim-only input, and zero coupling. These accept 0/12 in total under the declared acceptance rule.
The result supports a bounded identifiability-style interpretation under the calibrated synthetic protocol because the model succeeds when chronological driver-history information is available and fails when that information is deliberately removed.
Measured devices answer another question
The same recurrent compact-modeling pipeline is also evaluated on three independent measured graphene-oxide/polyelectrolyte memristor devices using source-disjoint cycles.
The seed-mean held-out results are:
| Device | Held-out correlation | NRMSE | Cross-device minimum | Cross-rate minimum |
|---|---|---|---|---|
| GO-PDADMAC4 | 0.9973 | 0.0334 | 0.9743 | 0.9762 |
| GO-PEI3 | 0.9999 | 0.0112 | 0.9804 | 0.9995 |
| GO-PEI4 | 0.9980 | 0.0290 | 0.9893 | 0.9894 |
These experiments validate recurrent compact-model fidelity and transfer on measured data.
They do not validate thermal-coupling recovery because the measured dataset contains no thermal-coupling ground truth.
Static baselines can fit measured data without recovering the latent coupling
On measured current-voltage data, static MLP and PIKAN baselines can obtain correlations close to the recurrent model, while SINDy performance is more variable.
The distinction appears in the synthetic latent-coupling sweep:
-
MLP accepts 0/15;
-
PIKAN accepts 0/15;
-
SINDy accepts 0/15;
-
chronological vanilla LSTM accepts 14/15.
This is one of the most useful lessons in the paper:
High static fitting accuracy is not evidence that a model can recover a history-dependent latent interaction.
11. The honest boundaries
A technical tutorial should mark the supported region clearly.
The thermal-coupling result is synthetic
The latent thermal-coupling benchmark uses a calibrated synthetic generator. It does not demonstrate discovery of thermal coupling inside a fabricated multilayer stack.
Recovery is bounded
Only $$\alpha=0.05$$ and $$\alpha=0.08$$ pass every declared seed. The higher tested couplings do not. There is therefore no justified claim of universal full-range recovery or a precisely established detection floor.
Source-count and noise behavior is not a universal threshold
The noise-source grid is non-monotonic. The final paper explicitly does not establish a universal statement such as „two sources are sufficient.“
Automation remains bounded
The user still supplies:
-
the target physical problem;
-
the training data;
-
source-disjoint split definitions;
-
candidate architectures;
-
cluster candidates;
-
low-rank candidates where used;
-
BIC bandwidth;
-
training budget;
-
optimization settings;
-
acceptance criteria and operating regime.
The BIC term is a surrogate
The differentiable score is BIC-inspired and does not inherit the complete formal guarantees of classical BIC.
The exact BIC score is computationally expensive
Its pairwise parameter-density calculation scales as $$O(W^2)$$. The final model-selection results use the exact blocked form. Approximate variants are evaluated as scalability studies.
The multilayer extension is not yet a general solution
The final paper reports limited performance on the three-layer extension, so the validated claim remains centered on the bounded pairwise regime.
Circuit execution is not PDK qualification
Compiled Verilog-A/ngspice agreement verifies the learned equations under the tested stimuli. It is not industrial process-corner qualification.
12. The complete Ψ-Vortex workflow on one page
The best compact description is:
# 0. User defines the experiment and bounded search space.
data = load_source_labeled_trajectories()
search_space = define_bounded_candidates()
# 1. Split complete source trajectories.
train, val, test = source_disjoint_split(data)
# 2. Optional bounded setup analysis.
symmetry = detect_symmetry(train) # odd / even / none
architecture = select_architecture_on_validation(
train, val, search_space
)
# 3. Train recurrent teacher chronologically.
teacher = train_recurrent_teacher(
train,
architecture=architecture,
symmetry_prior=symmetry
)
# 4. Train compact recurrent student.
student = train_student(
teacher=teacher,
train=train,
supervised_target=True,
rrad=True,
bic_inspired_structure=True
)
# 5. Use validation data to choose and materialize structure.
student = materialize_validation_selected_structure(
student,
val,
cluster_candidates=search_space.cluster_candidates
)
# 6. Evaluate once on held-out sources.
pred_test = evaluate_source_disjoint(student, test)
# 7A. Latent-inference branch.
alpha_hat, intercept = recover_alpha_free_intercept(
predictions=pred_test,
heldout_thermal_trace=test.delta_T
)
# Report alpha_hat only if the declared acceptance gate passes.
# 7B. Deployment branch.
verilog_a = export_stateful_recurrent_verilog_a(student)
osdi_model = compile_with_openvaf(verilog_a)
validate_ngspice_against_pytorch(osdi_model, student)
13. Where Ψ-Vortex is useful, and what remains open
Useful application classes
Ψ-Vortex is particularly relevant when a problem combines several requirements:
-
history-dependent device behavior, where present outputs depend on prior excitation;
-
latent interactions, where the internal interaction is not directly measured at the terminals;
-
compact-model generation, where the final representation should be smaller than the recurrent teacher;
-
validation-controlled model selection, where the test set should remain isolated from structural decisions;
-
circuit-simulator execution, where the learned recurrence needs to become an executable behavioral model.
Already demonstrated in the final study
The final evaluation includes:
-
chronological recurrence controls;
-
a five-coupling synthetic sweep with three seeds per coupling;
-
validation-only architecture selection over a bounded candidate grid;
-
BIC-inspired structure regularization and validation-selected clustering;
-
independent measured-device validation;
-
cross-device and cross-rate transfer;
-
MLP, PIKAN, SINDy, and vanilla-LSTM comparisons;
-
compression accounting that separates centroid values, expanded parameters, and serialized storage;
-
exact blocked BIC evaluation plus separate scalability studies;
-
compiled Verilog-A execution through OpenVAF-reloaded, OSDI, and ngspice.
Open research directions
The strongest next steps are:
-
direct validation of latent thermal coupling on fabricated printed multilayer devices;
-
stronger distributed multi-layer coupling models;
-
uncertainty quantification under fabrication variability and measurement noise;
-
larger arrays and process-corner studies;
-
broader recurrent baseline comparisons;
-
symbolic or equation-discovery extensions for closed-form model extraction;
-
further deployment validation beyond the current equation-level simulator tests
14. Appendix: a corrected runnable mini-pipeline
The following code is intentionally pedagogical. It does not reproduce the final paper numerically.
A GRU stands in for the production recurrent architecture, and the code illustrates four concepts:
-
chronological recurrent fitting;
-
BIC-inspired structural pressure;
-
free-intercept post-hoc recovery of $$\hat{\alpha}$$;
-
the separation between $$\hat{\alpha}$$ recovery and recurrent-model export.
import math
import torch
import torch.nn as nn
torch.manual_seed(42)
# ---------------------------------------------------------------------
# Synthetic driver-victim sequence
# ---------------------------------------------------------------------
T = 400
TAU = 30.0
ALPHA_TRUE = 0.08
V_READ = 0.2
G_BASE = 1e-5
driver = torch.zeros(T)
for a, b in [(60, 100), (150, 175), (250, 310)]:
driver[a:b] = 2.0
power = driver ** 2
delta_T = torch.zeros(T)
for t in range(1, T):
delta_T[t] = (
delta_T[t - 1] * (1.0 - 1.0 / TAU)
+ 0.10 * power[t]
)
victim_current_clean = (
V_READ * G_BASE * torch.exp(ALPHA_TRUE * delta_T)
)
victim_current = (
victim_current_clean
+ 0.01 * victim_current_clean.std() * torch.randn(T)
)
x = driver.reshape(1, T, 1)
# Normalize the current by the baseline read current.
y = (
victim_current / (V_READ * G_BASE)
).reshape(1, T, 1)
# ---------------------------------------------------------------------
# Small recurrent model
# ---------------------------------------------------------------------
class SmallRecurrent(nn.Module):
def __init__(self, hidden=8):
super().__init__()
self.rnn = nn.GRU(1, hidden, batch_first=True)
self.out = nn.Linear(hidden, 1)
def forward(self, x):
h, _ = self.rnn(x)
return self.out(h)
# ---------------------------------------------------------------------
# Differentiable BIC-inspired structural score
# ---------------------------------------------------------------------
def soft_effective_dof(theta, gamma=0.1, eps_d=1e-12):
theta = theta.flatten()
diff2 = (theta[:, None] - theta[None, :]) ** 2
D = torch.exp(-diff2 / (2 * gamma ** 2)).sum(dim=1)
D = torch.clamp(D, min=eps_d)
return (1.0 / D).sum()
def bic_inspired_score(theta, supervised_mse, n_targets,
gamma=0.1, eps_m=1e-8):
n = torch.tensor(
float(n_targets),
device=theta.device,
dtype=theta.dtype
)
mse_safe = torch.clamp(supervised_mse, min=eps_m)
d_eff = soft_effective_dof(theta, gamma=gamma)
return (
n * torch.log(mse_safe)
+ torch.log(n) * d_eff
)
# ---------------------------------------------------------------------
# Train the pedagogical recurrent model
# ---------------------------------------------------------------------
model = SmallRecurrent(hidden=8)
opt = torch.optim.Adam(model.parameters(), lr=1e-2)
lambda_struct = 1e-4
for epoch in range(800):
opt.zero_grad()
pred = model(x)
# Pedagogical supervised fidelity term.
l_sup = ((pred - y) ** 2).mean()
# This small demo does not include a separate teacher, so RRAD is
# omitted here. In the production Ψ-Vortex objective:
#
# L_Vortex = L_sup + L_RRAD + lambda_struct * R_BIC
theta = torch.cat([
p.flatten() for p in model.parameters()
if p.requires_grad
])
r_bic = bic_inspired_score(
theta,
supervised_mse=l_sup,
n_targets=y.numel()
)
loss = l_sup + lambda_struct * r_bic
loss.backward()
opt.step()
# ---------------------------------------------------------------------
# Post-hoc alpha recovery with a FREE intercept
# ---------------------------------------------------------------------
with torch.no_grad():
pred_ratio = torch.clamp(
model(x).flatten(),
min=1e-8
)
log_ratio = torch.log(pred_ratio)
X = torch.stack([
torch.ones_like(delta_T),
delta_T
], dim=1)
beta = torch.linalg.lstsq(X, log_ratio).solution
intercept = beta[0].item()
alpha_hat = beta[1].item()
print("true alpha:", ALPHA_TRUE)
print("recovered alpha_hat:", alpha_hat)
print("intercept:", intercept)
# ---------------------------------------------------------------------
# Deployment branch
# ---------------------------------------------------------------------
print(
"\nDeployment is a separate branch:"
"\n selected recurrent model -> stateful Verilog-A ->"
" OpenVAF/OSDI -> ngspice"
)
print(
"\nalpha_hat is a post-hoc effective coupling descriptor."
"\nIt is not automatically inserted as a literal parameter"
" into the recurrent Verilog-A artifact."
)
This mini-pipeline deliberately leaves out the production requirements that make the final Ψ-Vortex evaluation rigorous, including:
-
multiple source trajectories;
-
source-disjoint train, validation, and test partitions;
-
TBPTT state propagation rules;
-
teacher-student RRAD;
-
validation-only architecture selection;
-
validation-selected clustering;
-
multiple random seeds;
-
recurrence-destruction controls;
-
held-out acceptance gates;
-
measured-device transfer tests;
-
generated sampled-state Verilog-A;
-
OpenVAF-reloaded/OSDI/ngspice comparison.
Its purpose is conceptual rather than numerical reproduction.
15. Your next step: follow the two outputs
A useful way to understand Ψ-Vortex is to follow two outputs rather than forcing everything into a single chain.
Output 1: effective latent coupling
The physical interaction begins as an unobserved history-dependent effect:
The recurrent model learns a representation capable of reproducing that history-dependent response on held-out drivers.
Only after prediction is the effective coupling extracted through
\log\left( \frac{I_{\mathrm{pred}}} {V_{\mathrm{read}}G_{\mathrm{base}}} \right) = b+\hat{\alpha}\Delta T.
$$
So the first path is: hidden interaction → temporal signature → recurrent prediction → post-hoc $$\hat{\alpha}$$
Output 2: simulator-executable recurrent compact model
The same learned recurrent representation is also compressed under validation-controlled structural selection and materialized as a smaller recurrent student.
That student follows a different path: recurrent student → selected clustered structure → stateful Verilog-A → OpenVAF/OSDI → ngspice
Once that split is clear, the architecture of the complete method becomes much easier to understand.
16. Final takeaway
Ψ-Vortex does not stop at fitting a waveform, but its strongest claim is also deliberately bounded.
It asks whether a chronology-safe recurrent model can represent a hidden history-dependent interaction, whether a compact recurrent structure can be selected without test-set leakage, whether an effective coupling coefficient can be recovered from held-out recurrent predictions inside a validated synthetic regime, and whether the selected recurrent equations can then be exported and executed consistently in a circuit simulator.
For the calibrated pairwise synthetic benchmark, chronological recurrence succeeds at the supported $$\(\alpha=0.05\)$$ and $$\(\alpha=0.08\)$$ conditions across every declared seed, while destructive recurrence controls fail at the nominal condition. Independent measured-device experiments support recurrent compact-model fidelity and transfer, but do not provide thermal-coupling ground truth. The selected recurrent student is then carried into compiled Verilog-A/ngspice execution with numerical agreement against the learned implementation under the declared simulator tests.
The result is therefore best understood as a reproducible chain: chronological trajectories → recurrent inference → validation-controlled compression → bounded latent-coupling interpretation + simulator-executable recurrent compact modeling
The next experimental frontier is direct validation of the inferred thermal interaction on fabricated printed multilayer devices and stacks.
Neueste Kommentare