Datasets:
SiT-B/2 single-block PCA experiments
This repository contains quantitative and qualitative results for inserting a PCA projection and inverse reconstruction after each individual transformer block of SiT-B/2. It covers all 48 combinations of:
- block: 1 through 12;
- rank: 64 and 128;
- PCA axis: hidden and token.
Each experiment modifies exactly one block. There are no joint/multi-block interventions in this sweep.
Method
The activation entering the PCA hook has shape [batch, 256 tokens, 768 hidden]. PCA is fitted independently for every sample and every model evaluation.
- Hidden-axis PCA: tokens are observations and hidden channels are features. The centered activation is projected to rank
k, inverse-transformed to 768 hidden channels, and passed to the next block. - Token-axis PCA: the activation is transposed, so hidden channels are observations and tokens are features. It is projected to rank
k, inverse-transformed, transposed back to[256, 768], and passed onward.
Sampling protocol:
- model: SiT-B/2, ImageNet 256;
- checkpoint:
nyu-visionx/SiT-collections/SiT-B-2-256.pt; - checkpoint SHA-256:
0c0a3867c24d5f0606de4177f25f60dc4122d5996b07c39dda11247f891ef0f6; - deterministic balanced sample set: 4 images per ImageNet class, 4,000 images total;
- ODE sampler: Euler, 50 steps;
- CFG: 4.0;
- seed: 0;
- PCA implementation: PyTorch
torch.linalg.svd(..., driver="gesvda"); - FID: OpenAI guided-diffusion Inception
pool_3andFIDStatisticsagainstVIRTUAL_imagenet256_labeled.npz.
FID4K results
Lower is better. Bold is the best of the four configurations for that block.
| Block | Hidden rank 64 | Token rank 64 | Hidden rank 128 | Token rank 128 |
|---|---|---|---|---|
| 1 | 18.1857 | 18.1743 | 18.2044 | 18.2132 |
| 2 | 18.2055 | 18.2135 | 18.1976 | 18.1887 |
| 3 | 18.1027 | 18.1174 | 18.2079 | 18.2004 |
| 4 | 18.0049 | 18.0087 | 18.1519 | 18.1712 |
| 5 | 17.1081 | 17.0915 | 18.2092 | 18.2294 |
| 6 | 16.5367 | 16.5131 | 18.1822 | 18.1563 |
| 7 | 16.8067 | 16.8337 | 18.1639 | 18.1578 |
| 8 | 16.7375 | 16.7464 | 17.8993 | 17.8906 |
| 9 | 17.4828 | 17.6022 | 17.7867 | 17.7482 |
| 10 | 24.7109 | 25.5033 | 17.4716 | 17.4656 |
| 11 | 30.5780 | 31.8097 | 17.5069 | 17.5158 |
| 12 | 18.5111 | 18.7334 | 18.2352 | 18.2395 |
The best measured case is token-axis rank 64 after block 6, with FID4K 16.5131. Rank 64 performs well at blocks 5-9 but is highly destructive at blocks 10-11. Rank 128 is much more stable and performs best around blocks 8-11.
There is no matching no-PCA FID4K baseline in this repository, so these values compare PCA variants with each other and should not be presented as improvements over the original checkpoint. FID based on 4,000 samples also has more estimator noise than standard 50K FID; small differences should be interpreted cautiously.
PCA-RGB visualization
The PCA-RGB visualization follows the three-component projection idea in SRA pca-vis. Every case includes:
- PCA-RGB maps for all 12 transformer layers;
- both pre-reconstruction and post-reconstruction maps at the intervention block;
- four noise fractions: 0.7, 0.5, 0.3, and 0.1;
- sign/permutation alignment of the top three components across adjacent maps;
- raw activation reconstruction error, RGB difference metrics, explained variance, and component correlations.
The completed visualization set contains 48 cases and 2,496 individual layer maps.
Repository layout
fid4k/
RESULTS.md # concise results report
raw/ # exact evaluator JSON and generation metadata
qualitative/ # 48 generated-image grids
pca_rgb/
axis_<axis>_rank_<rank>_block_<block>/
pca_rgb_all_layers.png
target_pre_post.png
metrics.json
maps/ # per-noise, per-layer PCA-RGB maps
code/
sample_fid4k_pca.py
fid_only.py
pca_rgb_visualize.py
run_rank_axis_sweep.py
The original checkpoint and the ImageNet FID reference statistics are not redistributed here.
- Downloads last month
- 143