How Do Deep Networks Encode and Selectively Use Information? Shared Encoding and Conditional Signed Readout in Vision and Language Models
Organizations: Independent Researcher
Abstract
How can trained deep networks retain contextual information across internal representations while using it selectively in a decision? We study this question through controlled background-texture edits in vision classifiers and entity-binding edits in frozen language models. Across both modalities, factor perturbations preserve recognizable structure across pre-fixed, mutually disjoint blocks of hidden units: visual channel blocks match their complements more closely for the same image than for other images under the same texture edit, while language blocks transfer a relational direction fitted under one query role to rank relational states within held-out name pairs under the other role. We then decompose the local output change into signed channel and pathway contributions. In a convolutional classifier, net channel-level reinforcement () coexists on individual images with cancellation between positive- and negative-weight groups (). Holding weights, the paired relation edit, and red/blue answer words fixed, switching prompt presentation reverses the mean finite selection effect in Qwen2.5. Two held-out tests validate this mechanism. Attenuating development-selected antagonistic units amplifies edit effects on unseen inputs; in a vision transformer, attenuating the same frozen units in one forward pass increases the mean magnitude of the background-edit effect on one class margin and reduces it on another, with the opposite pattern for a second group (four-cell paired interaction logit). Finally, combining conditional channel variance with fixed downstream readout weights predicts single-channel pruning recovery across ten cuts. These results show how shared encoding and conditional signed readout can coexist in vision and language models.
Figures & tables
| Cut regime | Constraint on | Active axes | Representative models and behavior |
|---|---|---|---|
| Type III (full dynamic) | Unconstrained: both and vary with context and query | Frozen LLMs (Qwen2.5, Llama-3.2): competing paths ( ), prompt-conditioned gain modulation and sign flips ( Sections 4.4 and 4.5 ). | |
| Type II (nonlinear static- ) | Fixed readout contrast , instance-dependent nonlinear and multiple paths | Intermediate CNN and ViT/Swin cuts: backbone-dependent path Gram geometry, class-pair reweighting, functional MLP gating ( Sections 4.4 , 4.5 and 4.6 ). | |
| Type I (fixed linear head) | Constant downstream Jacobian and single path | (units/groups) | Final CNN head (Pets ResNet-18 two-scale synthesis, Section 4.3 ) and post-GELU fc2 pruning cuts ( Section 4.7 ). |
| Type 0 (structural zero) | on subspace ( , undefined) | None on | Pure ViT-B/16 final-layer non- [CLS] patches under a [CLS] -only head ( Section 4.4 ). |
| Experiment (§) | Frozen models & cuts | Fixed vs. varied quantities | Native endpoint & unit |
|---|---|---|---|
| Shared encoding, vision ( 4.2 ) | CUB ResNet-18 ( layer3 , layer4.0 ), ViT-B/16 (Block 6); Pets ResNet-18 | Fixed texture pairs & dev 16D basis; compare same-image block-to-complement vs. mismatched same-texture image | Mean-centered cosine advantage across 4 disjoint blocks (1,024 CUB); weak tint probe (442 Pets); source image |
| Shared encoding, language ( 4.2 ) | Qwen2.5-1.5B (Block 14), Llama-3.2-1B (Block 8) | Frozen dev relation direction; evaluate across query roles in 4 disjoint hidden-dim blocks | Within-name-pair cross-role ranking AUC & cosine (256 name pairs); name pair |
| Channel synthesis ( 4.3 ) | Pets ResNet-18 final 512 channels | Fixed source image, clean top-1 class, 4 donor BG/FG edits; head sign partition vs. random partitions | Signed contributions, two-scale & , finite forward rank corr (444 + 128 images); source image |
| Pathway geometry ( 4.4 ) | ResNet-18/50, Swin-T, ViT-B/16 (CUB); Qwen2.5, Llama-3.2 | Fixed input & readout; vision: subspace-projected, unit-normalized channel vector from background edits (broadcast across spatial/token sites) vs. matched random channel vectors; LLM: pair-specific interaction projected onto frozen dev subspace (query-token attention output); coarse vs. functional MLP split | Directional , Gram integral, 6 normalized cross-terms, clamped forward, coarse fine ; image / name pair |
| Readout switch, vision ( 4.5 ) | CUB ResNet-18 ( layer3 ) | Fixed clean image, subspace-projected unit-normalized background channel vector broadcast at layer3 , dose, and identical 8 bird classes; re-pair within vs. across habitats | Unit-dose DiD (full/half dose) & decomposition (1,024 images); source image |
| Readout switch, language ( 4.5 ) | Qwen2.5 (Block 14), Llama-3.2 (Block 8) | Frozen cross-name relation axis ( , query-token attention output); presentation (Direct/Alias) answer pair (RB/OP) | Signed finite selection contrast ( logit, 52 dual-tokenizer pairs); name pair |
| Symbol | Space / Type | Definition |
|---|---|---|
| Primal input | Source input ( : pixels in vision, token embeddings in language); empirical second-moment / covariance matrix . | |
| Primal cut state | Internal cut and hidden activation vector/tensor . | |
| Primal perturbation | First-order pushforward or direct hidden injection induced by controlled factor . | |
| Orthogonal projections | Complete mutually orthogonal coordinate/block partition ( , ); coarse grouping . | |
| Linear operators | Upstream and downstream output-map Jacobians evaluated at working point ; ∗ denotes adjoint transpose. | |
| Scalar margin | Task- or query-conditioned scalar margin selected by contrast vector . |
| Mode | Physical mechanism | |||
|---|---|---|---|---|
| Mode 1 | Increases | Pure background cancellation | ||
| Mode 2 | Increases | Pure foreground reinforcement (e.g. , ) | ||
| Mode 3a | Strongly increases | Joint background cancellation + foreground reinforcement (Pets native Section 4.3 ) | ||
| Mode 3b | Increases | Both regions attenuated, background more strongly (LAC maps, Section S14 ) | ||
| Mode 4 | Unchanged | Incoherent / random-phase superposition |
| Audit check | Model / Cut (cohort size) | Measured value | Unit / Scope |
|---|---|---|---|
| Tangent-space path sum closure | CUB ResNet-18 layer3 / layer4.0 ( ) | / | max abs error |
| Tangent-space path sum closure | Qwen2.5 / Llama-3.2 4 paths ( pairs) | max abs error | |
| Coordinate-scaling covariance check | Pets ResNet-18 Wiener transport ( ) | max relative | |
| Two-scale exact bridge error | Pets ResNet-18 ( , points) | max abs error | |
| Gram quadrature ( vs. nodes) | R50 / Swin-T / ViT-B/16 ( ) | max abs | |
| Finite-diff vs. derivative sign match | CUB ResNet-18 early / late ( ) | fraction (main) |
| Question (§) | Primary confirmation results (95% CI unless noted) | Scope and explicit boundaries |
|---|---|---|
| Shared encoding across disjoint blocks ( 4.2 ) | CUB (1,024): centered block matching (R18 L3, 42.1% energy), (L4.0, 14.1%), (ViT B6, 49.3%; 99.375% CIs). Pets localized tint (442): joint (56.1%–60.9%). LLMs (256): all 4 blocks within-pair cross-role AUC (cos ). | Per-texture-pair cross-image GAP mean directions cover on average only energy; vision proves paired complement matching within a pre-fixed 16D subspace (not intrinsic dimensionality or single-block identity decoding). |
| Fixed-task channel synthesis ( 4.3 ) | Pets (444): BG vs. FG (128 batch: vs. ); sign vs. random partition ; 512-ch BG ; 248/444 images simultaneously satisfy and (266/444 have positive within and negative between terms). | Conditional on fixed clean top-1 class, 4 donor edits, and head sign grouping; alternative top1 top2 margin gives BG . |
| Multi-path geometry & scale ( 4.4 ) | CUB (1,024) tex/rand : R18 (Gram , diff ), R50 , Swin-T , ViT (Gram ; clamped rounds to ). Across ViT/Qwen/Llama, both ( ) and ( ) are negative. Splitting MLP deepens by (Qwen) and (Llama). | Swin-T refutes universal Transformer cancellation; ViT texture minus random is ; ViT terminal non- [CLS] exact (Type 0). |
| Fixed factor, varied readout ( 4.5 ) | CUB (1,024): 8-species re-pairing DiD ; first-order splits into amplitude + composition (diff ). LLMs (52 pairs, logit): Qwen RB mean flips ; Llama RB with interaction . | Finite injection in LLMs; prompt switch covaries wording, length, and query position; Alias RB two-choice accuracy stays high (81.7% Qwen, 79.8% Llama). |
| Prospective gating & readout flip ( 4.6 ) | LLM heads (256, ): Qwen pro / anti ( vs. rand); Llama / ( ). MLP functional groups ( ): ViT-B/16 B6 replay ( vs. contiguous); B10 holdout ( vs. cont., vs. matched); Qwen/Llama beat tight matched by / . ViT B10 same-forward means: Group A ( imgs), Group B ( ), 4-cell interaction . | Qwen matching is post-hoc sensitivity; Llama locked pre-holdout; ViT 264 reserve shared with B/32 comparison. |
| Pruning channel recovery ( 4.7 ) | ImageNet (4,096, 10 cuts): FWL Spearman overall ( across 6 ViT/Swin cuts); R50 stage 2 jumps (no cross-terms ); Swin mid switches top unit (85.3%) (100%). | Holds for single-cut fixed linear successor + OLS; under direct slicing Swin post pre MAE is flat ( ), whereas under OLS both post pre drop (Swin , ViT ); whole-network Table S10 open. |
| Model & direction | |||||||
|---|---|---|---|---|---|---|---|
| ViT-B/16 texture ( ) | |||||||
| ViT-B/16 random | |||||||
| Qwen2.5 relation ( ) | |||||||
| Qwen2.5 random | |||||||
| Llama-3.2 relation ( ) | |||||||
| Llama-3.2 random |
| Metric | Qwen Old ( ) | Qwen New ( ) | Llama Old ( ) | Llama New ( ) |
|---|---|---|---|---|
| Functional group ( logit) | ||||
| Minus best contiguous block | ||||
| Minus -bin stratified matched | ||||
| Minus tight matched | ||||
| Selection edit interaction | ||||
| Coarse four-path |
| Group or paired contrast | Block 10 ( holdout) | Block 6 ( holdout) | Block 6 ( replay) | Block 10 ( replay) |
|---|---|---|---|---|
| Functional group | ||||
| Best contiguous block | ||||
| Strength-matched random mean | — | — | ||
| Best in random partitions | — | — | ||
| Functional best contiguous | ||||
| Functional strength-matched | — | — |
| Model & cut | Images | Variance | FWL | Gain ( ) | Family CI for |
|---|---|---|---|---|---|
| ResNet-50 layer1.0.conv2 | 4,096 | 0.8671 | 1.0000 | ||
| ResNet-50 layer2.0.conv2 | 4,096 | 0.4201 | 0.9967 | ||
| ResNet-50 layer3.0.conv2 | 4,096 | 0.5689 | 0.9936 | ||
| ResNet-50 layer4.0.conv2 | 4,096 | 0.5641 | 0.8650 | ||
| ViT-S/16 early MLP | 4,096 | 0.9189 | 0.9985 | ||
| ViT-S/16 middle MLP | 4,096 | 0.9351 | 0.9959 |
| Images | Cut | Model | Pre slice | LAMP slice | Post slice | Pre OLS | LAMP OLS | Post OLS |
| 4,096 | Early | ViT-S/16 | 0.781 | 0.733 | 0.800 | 0.848 | 0.833 | 0.918 |
| 4,096 | Early | Swin-T | 0.836 | 0.762 | 0.846 | 0.897 | 0.894 | 0.887 |
| 4,096 | Middle | ViT-S/16 | 0.897 | 0.881 | 0.959 | 0.953 | 0.935 | 0.979 |
| 4,096 | Middle | Swin-T | 0.898 | 0.881 | 0.858 | 0.916 | 0.901 | 0.890 |
| 4,096 | Late | ViT-S/16 | 0.890 | 0.827 | 0.753 | 0.914 | 0.873 | 0.859 |
| 4,096 | Late | Swin-T | 0.961 | 0.942 | 0.948 | 0.973 | 0.969 | 0.975 |
| Architecture | Budget | (%) | vs. | Best other | vs. best | (%) | vs. Fisher | Best other | vs. best |
|---|---|---|---|---|---|---|---|---|---|
| ConvNeXt-B | 30% | 71.69 | APoZ | 65.69 | TaylorGate | ||||
| ConvNeXt-B | 40% | 47.09 | APoZ | 49.69 | FisherGate | ||||
| ConvNeXt-B | 50% | 3.03 | APoZ | 15.22 | OBD | ||||
| EfficientNet-B3 | 30% | 39.66 | FPGM | 61.03 | OBD | ||||
| EfficientNet-B3 | 40% | 19.38 | APoZ | 39.97 | OBD | ||||
| EfficientNet-B3 | 50% | 5.19 | APoZ | 19.88 | OBD |
| Condition | Top-1 acc. | Class flip | FG | BG | BG vs. clean | BG coh. energy |
|---|---|---|---|---|---|---|
| Clean | ||||||
| Noise level 5 ( ) | ||||||
| Blur level 5 ( px) | ||||||
| Equal-weight max-corruption BG decomposition: In the -image cohort, total shift splits into angle ( , : ) plus norm balance ( , : ). In the -image cohort, total shift splits into angle plus balance . | ||||||
Mechanistic Interpretability
Mechanistic interpretability studies how neural networks implement behaviors through internal features, circuits, and causal information flow.
See all 448 papers