Input
A measured feature or an upstream neuron activation.
OPEN SOFTWARE · PEER-REVIEWED METHOD
Inspect what neurons learn and how those meanings flow through a neural network—without perturbing inputs, patching activations, or changing trained parameters during the explanation.
THE IDEA FIRST
A dense neuron receives values, multiplies each by a learned weight, adds them, then applies a nonlinear activation. Linear Lens looks at the feature × weight contributions in the original forward computation, summarizes their distribution, and assigns a layer-relative functional role.
A measured feature or an upstream neuron activation.
How strongly that input enters a particular neuron before summation.
Entropy asks whether influence is focused on one source or spread across several.
Specialized, distributed, diffuse, or—deeper in the network—composed from earlier meanings.
The explanation is computed from the model's existing weights, inputs, pre-activations, and activations. Linear Lens does not need to replace activations or perturb the model to discover these neuron/layer roles.
Linear Lens explains the processed values that actually enter the network. If the trained model receives standardized features, the explanation is in that standardized representation. If one feature enters on a radically different raw scale, its feature×weight contribution changes accordingly. This is why preprocessing provenance is shown with every browser model.
FORMULA, STEP BY STEP
The first five steps describe a first hidden layer. The same influence → entropy → layer-relative decision pattern can then be applied to deeper layers using the previous layer's activations as inputs.
xi,j is feature j for sample i; wk,j is the learned connection from feature j to neuron k; bk is the neuron's bias; zi,k is the value before the activation function.
Purpose: stay at a directly traceable point in the model's actual computation.
μk,j is the average absolute contribution of input j to neuron k over N analyzed samples. Absolute magnitude prevents positive and negative contributions from cancelling each other in this global role summary.
Purpose: turn raw feature-weight interactions into comparable evidence for each neuron.
pk,j is the share of neuron k's total measured influence assigned to input j. ε is a tiny stability constant. Each neuron's influence row sums to approximately 1.
Purpose: express “what this neuron listens to” as a probability-style profile.
Hk is Shannon entropy. Low entropy means influence is concentrated; higher entropy means it is distributed more evenly.
Purpose: reduce a full influence profile to one concentration statistic without changing the model.
H̄ is mean neuron entropy in the layer and sH is its standard deviation. The paper uses a one-tailed 90% standard-normal decision region; c = Φ−1(0.90) ≈ 1.282.
Purpose: make the labels layer-relative rather than pretending one absolute entropy threshold fits every architecture.
For a polysemantic neuron, Sk is its selected influential feature set. The paper illustrates selection with normalized influence pk,j > 0.15; the browser demonstrator uses that illustrated threshold. A regression model tests whether the selected set collectively explains the observed pre-activation. R² is validation evidence, not a new neural-network prediction.
The Qualitative Symbolic Matrix converts dense numeric influence into a human-readable layer fingerprint. This website keeps the exact numeric influence available while using text labels and strength bands for accessibility.
In deeper layers, raw features are replaced by upstream activations. A focused deeper unit is unimodal; a distributed unit is multimodal; a diffuse high-entropy unit is muted. The final output can be described as a composition of previously traced semantic paths.
ROLE DICTIONARY
Role names are shorthand for observed influence structure. They should not be interpreted more strongly than the evidence supports.
Influence is unusually concentrated relative to other neurons in the same first layer.
Influence is distributed across multiple raw features. The feature set can be regression-validated.
Important: this does not necessarily mean an inactive or useless neuron. In Linear Lens it denotes an unusually diffuse influence profile under the analyzed data.
A deeper neuron is primarily driven by one previously explained semantic path.
A deeper neuron integrates multiple earlier units or semantic pathways.
The deeper neuron's influence is comparatively diffuse under the observed activation distribution.
LIVE GITHUB VERIFICATION
The browser downloads a CSV and exported dense model directly from udanish50/LinearLens, verifies both SHA-256 hashes against the repository manifest, applies the recorded training preprocessing, and recomputes neuron roles without a server-side analysis API.
Six canonical scikit-learn datasets plus 39 deterministic controlled fixtures.
No dataset is silently substituted with local page data.
Waiting for the public manifest.
Start with the summary, then inspect neurons, QSM, and one semantic path.
ANALYZE YOUR OWN MODEL
Linear Lens analyzes internal neural computation, so this browser workspace asks for both the numeric CSV and a supported model JSON exported from the Python package. Both files remain on this device.
Dense feed-forward browser support; use Python adapters for broader architectures.
from linearlens.web import export_dense_model
export_dense_model(model, "model.json", feature_names=features)Load both files to begin.
Global layer roles plus exportable neuron evidence.
PUBLIC SOFTWARE EVIDENCE
The public suite is additional software verification. It does not replace the paper's original ten confidential energy datasets.
Evidence tables load only when requested.
Ten real-world energy consumption datasets; MLP, LSTM and Transformer architectures; statistically validated user study with N = 400. The publication reports the underlying energy data as confidential.
METHOD COMPARISON
Linear Lens explains neuron/layer organization. Local attribution, perturbation importance, activation patching, and learned dictionaries answer different questions. The comparison below makes those scopes visible instead of implying that one scalar score establishes universal superiority. In the live model result, the same verified network is also shown through a local Gradient × Input view and global permutation importance when a target column is available.
| Method | Main question | Changes model/inputs for explanation? | Typical output | Best viewed as |
|---|---|---|---|---|
| Linear Lens | What role does each neuron/layer play, and how do meanings propagate? | No intervention in the explained forward computation | Influence profiles, entropy roles, QSM, semantic pathways | Mechanistic / behavioral audit |
| Gradient × Input | Which input dimensions locally affect this output? | No parameter change; uses derivatives at the sample | Local attribution vector | Local sensitivity attribution |
| Integrated Gradients | How does attribution accumulate from a reference to this input? | Evaluates a path of interpolated inputs | Local attribution vector | Baseline-dependent attribution |
| Permutation importance | How much does predictive performance drop when a feature is disrupted? | Yes—permutes input values | Global feature importance | Performance-based importance |
| Activation patching / causal tracing | Which internal components causally affect a behavior under an intervention? | Yes—replaces/patches internal activations | Causal component/path evidence | Interventional mechanistic test |
| Sparse autoencoder feature analysis | Can activations be decomposed into a sparse learned feature dictionary? | Trains an auxiliary representation model | Learned sparse features | Representation decomposition |
If you need a local feature attribution, use an attribution method. If you need to inspect neuron specialization, distributed representations, layer organization, and semantic propagation without altering the explained computation, Linear Lens is designed for that question.
HUMAN-CENTERED INTERACTION
These are implementation choices aligned with accessible/usability principles—not a claim of formal accessibility certification.
Mental model first, equations second, live evidence third, raw neuron tables only on demand.
Every role and symbol is defined where it first appears and again in compact references.
Downloads, hash checks, parsing, analysis, and evidence loading report state through aria-live regions.
Role names and text labels accompany visual accents; tables remain interpretable without color.
LIVE, ARCHIVED, and PAPER evidence are visibly separated so visitors know what was computed now versus previously reported.
The upload workflow explains why both data and a trained model are required and rejects mismatched feature schemas before analysis.
SOURCE & REPRODUCIBILITY
The repository contains the PyTorch package, tests, architecture adapters, method documentation, public evidence suite, exported browser models, reproducibility material, and citation metadata.