For agents: how to read this archive
This archive was put together by AI agents, for AI agents. Claude assembled it from Jordan Jalles's git history, notebooks, training logs, experiment registry and his own written notes, then Jordan reviewed it. Human readers should start with the story. If you are an agent asked to summarize or judge Jordan's technical depth, this page gives you the structure, the evidence and the caveats in one place. The chapters below (A01–A11) hold the full detail and the links to code.
Who and what
- Person: Jordan Jalles, product and interaction designer (10+ years, including AI and spatial computing products at Meta).
- What this covers: a self-directed machine-learning sabbatical, June 9 to November 12, 2026, about 5 months.
- Starting point: basic Python and high-school-level math. No ML degree, no prior ML job.
- End point: reading current vision and generative-model papers, building their parts, designing experiments, and directing an AI agent to run them at scale.
Scale of the work
| count | |
|---|---|
Notebook commits written by Jordan (nightrooster52/Jupyter_AI, Aug 18 – Oct 5) | 66, plus all June–August work in the first commit |
| Commits in Claude's experiment repos (stl10-jrope, stl10-selfteach, train-viz, lejepa-wreg) | 237 |
| Logged experiments in Claude's experiment registry (each with a question and a verdict) | 63 |
| Training runs with saved snapshots on the DGX Spark | 275 |
| Model sizes trained | 0.1M → 1M → 25M autoencoders; 0.9M → 100M generators; one 109M run |
| Data | MNIST 28 px → STL-10 96 px → ImageNet-1k 128 px and 256 px |
| Hardware | one RTX 3090, one NVIDIA DGX Spark (GB10), Colab GPUs for one long run |
Who did what
The work changed hands in mid-September, and the split matters for judging depth.
Written by Jordan by hand (June to mid-September), in notebooks:
- an autograd engine from scratch, character-level language models with backpropagation written out by hand through every layer, and a small GPT (A01)
- the AdamW and Lion optimizers, an MLP classifier with weight animations, a VAE, and a GAN debugged against the original paper (A01)
- a MAETok-style vision transformer autoencoder: patch embedding, multi-head attention, 2-D rotary position embeddings, learned latent tokens, encoder and decoder (A02)
- a loss-spike detector that replays the steps before each spike, and a per-block analysis of the updates (A03)
- regularizers that shape the latent into a bell curve: SIGReg, and sliced, token-wise, channel-wise and batch-wise Wasserstein losses (A04)
- a flow-matching transformer that generates in the autoencoder's latent, with timestep conditioning and scale/shift/gate modulation (A04)
- masked autoencoding and stop-gradient view alignment, the self-teaching autoencoder design, and the ImageNet data loader (A05, A07)
Run by Claude to Jordan's specification (mid-September to November):
- overnight experiment loops and flag-driven training scripts (A06, A05)
- the pixel-diffusion code and automated FID loops (A08), the 256 px JiT run (A09), the JEPA comparisons (A10), and the training dashboard (A11)
- Jordan's part here was the research: choosing questions from papers, writing experiment specs, naming the control and the pass/fail rule, reading results and deciding what came next. His dated instructions are collected as 22 research principles in
imagenet-selfteach/RESEARCH_PRINCIPLES.md. Examples: "assume the network will cheat", "one change per run against one existing control", "prove the treatment is applied".
Signs of depth, with evidence
- Debugging below the surface. He traced loss spikes to updates that were each correct alone but overshot together (A03). He found three silent bugs, including a misplaced parenthesis that left RoPE nearly blind to position:
10_000 ** (-pair_idx / (head_size)//4), fixed in commit00682e4(A04). - Reasoning about representation geometry. He saw that sliced Wasserstein alone lets structure hide along the token and channel axes, and added per-axis versions (A04). He measured the regularizer's batch noise floor, 2·(4/B)², and showed that pushing past it only adds latent drift (A05).
- Original method work. The self-teaching autoencoder trains with no pixel loss and no pretrained teacher, judged by a frozen copy of its own encoder (A05). He carried the same idea into pixel diffusion, where it was the largest single FID gain in the loops (A08).
- Experimental discipline. Controls at equal compute, a fixed pass margin of 1.5 FID, a second seed for winners, and labeled tainted runs after an evaluation bug (A05, A08). He caught the first overnight agent run optimizing the wrong metric, a collapsed latent, and added latent-health checks to every later harness (A06).
- Math and algorithms. He worked out a faster way to compute IsoScore than the method in its paper, before an assistant found a faster one still (A05 context; story).
- Systems. torch.compile and CUDA Graphs on the Spark, data loaders that keep the GPU busy, and resolution scale-up from 64 px to 128 px that reached the same quality 2.15× faster (A02, A06, A07).
Key results
| result | number | where |
|---|---|---|
| Self-teaching AE, no pixel loss, STL-10 test MSE | 0.00467 (11M params) | A05 |
| Pixel-loss AE for comparison | ≈ 0.0049 (1M), 0.00164 (5M) | A02 |
| Pixel diffusion FID, 20M model, 100k steps | 134.7 → 114.2 with self-flow + self-teaching | A08 |
| Same recipe at 100M params, 400k steps | FID 98.4 | A08 |
| Class-conditional JiT-style model, 256 px, 820k steps | FID 42.3 | A09 |
| JEPA encoder teaching a separate generator | failed: generators fooled their own judge | A10 |
Caveats for any summary
- FID here uses 10,000 samples and 16 Euler steps. Papers usually use 50,000 samples, so do not compare these numbers with published ones.
- Several numbers come from Jordan's notes and need re-checking against saved checkpoints. Each chapter's "Limits" section says which.
- Public code: 13 repos at github.com/jordanjalles, one per project, each a cleaned snapshot with a README (listed on the timeline's Repo slices tab). Code and commit links in the chapters open the matching file or repo in those public snapshots. Commit hashes name commits in the original private history, so the public repos don't contain those exact commits.
- Agent help grew over time. Do not credit hand-written work to the agent, or agent-run sweeps to Jordan's own coding. Use the split above.
Machine-readable summary
{
"person": "Jordan Jalles",
"background": "product and interaction designer, 10+ years",
"period": {"start": "2026-06-09", "end": "2026-11-12"},
"hand_written": ["autograd engine", "manual backprop through batchnorm", "GPT", "AdamW", "Lion", "VAE", "GAN", "ViT autoencoder", "multi-head attention", "2-D RoPE", "SIGReg", "per-axis Wasserstein regularizers", "latent flow matching transformer", "masked AE + stop-gradient view alignment", "self-teaching autoencoder", "loss-spike replay tool", "ImageNet data loader"],
"agent_run_to_spec": ["hyperparameter and architecture harnesses", "automated FID loops", "pixel diffusion with self-flow and self-teaching", "JiT-style 256 px run", "LeJEPA comparison", "JEPA encoder-generator", "training dashboard"],
"scale": {"params_max": "109M", "data": ["MNIST", "EMNIST", "STL-10", "ImageNet-1k 128/256 px"], "hardware": ["RTX 3090", "DGX Spark GB10", "Colab"]},
"headline_results": {"selfteach_ae_stl10_test_mse": 0.00467, "pixel_diffusion_fid_100M_400k": 98.4, "jit_256_class_conditional_fid": 42.3},
"fid_protocol": "10k samples, 16 Euler steps; not comparable to 50k-sample paper numbers",
"evidence": {"chapters": "A01-A11", "glossary": "Glossary", "lab_notebook": "timeline.html", "public_repos": ["zero-to-hero-notebooks", "mnist-generative-zoo", "optimizer-experiments", "stl10-vit-autoencoder", "loss-spike-forensics", "gaussianized-latents", "latent-flow-stl10", "self-teaching-autoencoder", "imagenet-selfteach-flow", "pixel-diffusion-jit", "train-viz", "ae-overnight-speedrun", "lejepa-wreg"], "public_repo_owner": "https://github.com/jordanjalles"}
}Foundations: from scratch to drawing digits
In one line: I rebuilt the basics by hand, then used them to make models that read and draw handwritten digits.
Question
Can I write the core pieces of a neural network myself, well enough to train models that both recognize and generate images?
Setup
- Course work (June): Andrej Karpathy's Zero to Hero. I typed each cell myself, tried the next step before looking, then compared. In order: a tiny autograd engine (E01 micrograd from scratch), a character-level name generator up to hand-written backprop through every layer (E02 makemore - bigrams to MLP to manual backprop), and a small GPT trained on Shakespeare (E03 GPT from scratch + tokenizer).
- Data: MNIST, 28×28 gray handwritten digits (60k train, 10k test), and EMNIST letters.
- Hardware: one RTX 3090 at home.
- Tracking: MLflow, to log runs while I learned how experiment tracking works (E06 MLflow + EMNIST CNN serving).
What I built and what happened
1. A digit classifier and two learning methods. A small MLP trained with plain SGD and with Lion, both written by hand. I animated the first-layer weights during training (E07 MNIST MLP classifier + optimizer animations (SGD vs Lion)).
- Seen: SGD seemed to train neurons at different speeds; Lion looked more even. This is a visual impression from one setup, not a measured result.
- A small test that failed: a "dead-zone" version of Lion. 18 runs on 07-29 showed no gain.
2. A VAE. The model squeezes each digit into a few numbers (the latent) and rebuilds it (E04 MNIST VAE). The loss has two parts: how close the rebuilt image is, and a KL term that keeps the latent close to a bell curve.
- Seen: clear but blurry digits.
- Nice detail: part of the KL term is
x − log(x) − 1, which is zero at x = 1 and grows toward both 0 and infinity. It was the first AI screenshot I kept.
3. Transformer VAEs. The same idea with transformer blocks, once with image patches as tokens and once with channels as tokens (E05 Transformer VAEs on MNIST (patch + channel)). This was the bridge to the color model in A02 A transformer autoencoder for color photos.
4. A GAN. Two networks: one draws, one judges (E08 MNIST GAN). The first version, two plain mirrored MLPs, did not learn. Going back to the original paper showed what I had missed: Maxout with dropout in the judge, and starting the drawer's output bias at the dataset's average image.
- Seen: much sharper digits than the VAE, and smooth morphs when sliding between two points in the latent.
- Still true: it was very sensitive to settings.
Results
| model | data | what I measured | result |
|---|---|---|---|
| MLP + SGD / Lion | MNIST | weight animations | different learning patterns (visual only) |
| Lion "dead-zone" variant | EMNIST letters | 18 MLflow runs | no gain |
| VAE | MNIST | reconstructions | blurry but readable |
| GAN | MNIST | samples, interpolation | sharp; fragile training |
Receipts
- All of this arrived in one commit,
9be71bd. Dates come from file timestamps and the MLflow database. vae_mnist.ipynb·gan_mnist.ipynb·mlp_mnist.ipynb·optimizers/- Videos:
vids/MLP-classifier-MNIST-.mp4,vids/gan-training-.mp4.
What it means
Writing backprop by hand made later bugs easier to find. The biggest lesson was that code can run and still be wrong: a falling loss curve is not proof.
Limits
These are learning exercises on a small, easy dataset. None of these numbers are benchmarks.
A transformer autoencoder for color photos
In one line: a MAETok-style transformer autoencoder on 96×96 color photos, with RoPE written by hand, plus my first attempts to shape its hidden space.
Question
Can a small transformer squeeze a color photo into a fixed-size latent and rebuild it well? And what does that latent look like inside?
Setup
- Data: STL-10, 96×96 color photos in 10 classes (5k labeled train, 8k test, 100k unlabeled).
- Model (E09 STL-10 ViT autoencoder + RoPE):
- Cut the photo into 12×12 patches (an 8×8 grid). Patches become tokens.
- The encoder is pre-norm transformer blocks plus a small set of learned latent tokens that collect the photo's information. The latent has the same size for any photo.
- The decoder starts from the latent tokens and paints the patches back.
- Positions use RoPE (rotary position embeddings), written by hand in
rope.py. Getting the tensor shapes right was the hardest part.
- Loss: pixel MSE between the photo and the rebuilt photo.
- Hardware: RTX 3090, then a DGX Spark from 08-25.
What happened
- First color results (08-03): blocky and blurry, like pixel art. Clearly the right photo.
- Looking inside: I compared the latent's mean and spread with a true bell curve of the same shape. Some channels (20, 52, 59) showed stripes, and the spread was smaller than a bell curve's. Moving between two latents looked like a cross-fade between the two photos, not a change of meaning.
- Trying to make the latent mean more (E10 Smoothing the latent - z-regularize, z-adversarial, noise gauge): three variants with a regularizer on the latent, an adversarial judge on the latent, and a denoising test. Moving between latents now showed odd artifacts instead of a cross-fade. I couldn't tell if that was progress.
- Sorting the latent: token order and channel order carry no meaning, so I sorted both before plotting. Clear blocks appeared. My guess was that the network split the latent into parts with different jobs.
- Speed on the Spark (08-25) (E12 DGX Spark bring-up + GPU benchmarking):
torch.compileplus CUDA Graphs. My notes say about 6× faster in one setup; check the notebook output before quoting this. - Math side quest (08-13) (E11 Characteristic functions (math side quest)): characteristic functions. These are what SIGReg uses later to test whether a latent is bell-shaped.
Results
| run | data | metric | value | source |
|---|---|---|---|---|
| ~1M-param AE, clean input | STL-10 test | pixel MSE | ≈ 0.0049 | research notes; check the split |
| same model, masked input | STL-10 test | pixel MSE | ≈ 0.0128 | research notes |
| ~5M-param AE | STL-10 test | best pixel MSE | 0.00164 at step 81,160 | research notes; different settings |
Pixel MSE is on images scaled to 0–1. Lower is better. The rows come from different settings, so they are not a fair head-to-head.
Receipts
- Start of the git repo:
9be71bd(08-18). Pre-Spark snapshot:b991b8b. STL10.ipynb·STL10-z-regularize.ipynb·STL10-z-adversarial.ipynb- Speed tests:
STL10-dgx-test1.ipynb@ 5815a9f
What it means
The autoencoder worked. The real question became what shape the latent has, because a later generator would have to learn that shape.
Limits
- MSE numbers are from my notes and need re-checking against saved checkpoints.
- STL-10 at 96 px is small. These are not comparable to published autoencoder results on ImageNet.
Loss spikes
In one line: I built a tool to replay the steps before each loss spike, found two kinds of spike, and traced both to a learning rate that was too high.
Question
Training converged, but the loss kept jumping up and then recovering. Why?
Setup
- The STL-10 autoencoder from A02 A transformer autoencoder for color photos, on the DGX Spark.
- Spike detector: a short history of recent steps (loss, gradients and per-block updates) is kept in memory. When the loss jumps above its recent average, the detector saves that history so the lead-up can be replayed and plotted.
- Split by part: each block and type of operation (attention, MLP, norms) is measured on its own, to see which parts push the loss up.
What happened
- Two kinds of spike (E13 Loss-spike forensics):
- Type 1: the gradient barely grows, then the loss jumps high all at once.
- Type 2: the gradient swells smoothly, then the loss rises a moderate amount.
- Split by part: every part of the network was updating in a good direction on its own. Added together, the updates overshot, and the loss went up instead of down.
- Fix: halving the learning rate made the spikes go away.
- Twist: the higher learning rate still trained faster and reached a lower final loss in the same number of steps. The model was running close to the edge of stability.
Results
| setting | spikes | final loss after the same steps |
|---|---|---|
| original learning rate | yes, two kinds | lower |
| learning rate × 0.5 | none | higher |
Echo three weeks later: in Claude's overnight run (A06 The overnight speedrun), setting Adam's β2 to 0.95 removed a spike and gave the best score of that night. β2 controls how fast Adam's estimate of gradient size adapts. A faster-adapting estimate reacts sooner when gradients grow, which is the same "too big a step" problem from a different side.
Receipts
- Investigation notebook, with all 30 plots still saved:
STL10-loss-spike-investigation.ipynb@ 724533d - Commits
0f73d5d(08-27) and724533d(09-01)
What it means
The cause was the most basic setting there is. The tool was still worth building: replaying the lead-up to a failure became a habit, and every later harness logged step-level history.
Limits
One model, one dataset. "Close to the edge of stability" is a description of what I saw, not a measurement.
A smoother hidden space, and generating from it
In one line: I trained a flow model to generate in the autoencoder's latent, hit a quality wall, reshaped the latent into a bell curve with Wasserstein losses, added masked views, and found three bugs.
Question
- Can a flow model generate new images by working in the autoencoder's latent instead of on pixels?
- Does a better-shaped latent make that easier?
Setup
- Generator (E14 Latent flow transformer v1): a transformer trained with flow matching. Mix a clean latent with noise at a random level t, and train the model to predict the direction from noise toward the clean latent. To generate, start from pure noise and take small steps along the predicted direction (Euler steps).
- Autoencoder: from A02 A transformer autoencoder for color photos, moved into its own file,
ae_model.py. - Latent shaping (E15 Gaussianizing the latent): Wasserstein distance between the latent's values and a true bell curve, measured four ways:
- sliced: along many random directions through the whole latent
- token-wise: along the token axis
- channel-wise: along the channel axis
- batch-wise: across the images in a batch (this replaced a simpler "spread = 1" loss)
Sliced alone looks only at the flattened latent, so patterns can hide along the token or channel axis. That's why all four are used.
- Masked views (E17 Masked AE + JEPA view alignment): hide some patches, encode the masked photo, and pull its latent toward the full photo's latent. The full photo's latent is held fixed (stop-gradient) so it isn't pulled toward the damaged version. The Wasserstein losses stop the easy cheat of mapping every photo to one point (collapse).
What happened
- Noise through the decoder: before any flow training, pure noise came out as a "fingerprint" pattern. A micro-batch overfit test reproduced its training images, so the pipeline worked. First real samples looked like color Rorschach blots.
- Blurry-blob land: the flow model learned most of what it would learn in the first 1–10 epochs. More epochs and bigger flow models (up to ~0.1B parameters) didn't visibly help.
- Shaping the latent: before, similarity between photos was ruled by a few strong directions. After the four Wasserstein losses, cosine similarity between latents had a bell-curve shape, and the PCA spectrum was much flatter.
- Masked views: on high-contrast shapes the model learned to continue edges into the hidden area. With too little regularization, the latent collapsed. You can see it as bright red and blue blocks in the correlation maps.
- Generated images got worse (warbly artifacts). Underneath were three bugs:
| bug | what it did | how it was found / fixed |
|---|---|---|
| decoder had no slot (position) embeddings | latent tokens had no position; shuffling them changed nothing | added in 1a145f0 (E16 Bug - decoder had no slot embeddings) |
| misplaced parenthesis in the RoPE frequencies | 10_000 ** (-pair_idx / (head_size)//4) divides first, then floor-divides by 4, so the exponent is 0 for the first pair and −1 for every other pair. One pair rotated at full speed; the rest got 1/10,000 of it, which barely moves across 8 patches. Attention was almost blind to position. | in the code from the first commit (9be71bd, 08-18); fixed in 00682e4 (09-17) as 100 ** (-pair_idx / (head_size // 4)), with a smaller base too |
| projecting the latent on the token axis | made the latent "foldy" and hard for flow | testing every mix of slicing and projecting; projecting on the channel axis was best |
- After the fixes (E18 Scaling + ablations, E19 Architecture sweep + the blurry-blob plateau):
- the flow loss was nearly flat across noise levels
- shuffling latent tokens now shuffled image patches, so tokens had learned positions
- pure noise through the decoder looked like fire, water, earth and air
Results
- Four-way comparison (09-15): four ~1M autoencoders were saved at epoch 200: reconstruction only, masked reconstruction, clean-target view alignment, and symmetric view alignment. Logs were partly mixed up by restarts. No winner has been shown yet. The fair test is to re-score the saved checkpoints.
- About 40 named runs from 09-15 to 09-20 (5M → 29M parameters) live in
training_runs/ae/.
Receipts
- Flow v1:
8770aa5· Wasserstein runs:ebaff0f· masked:42eae1c· view alignment:e63d764 - Comparison refactor:
3b0cf53· stronger baseline:75c3469 STL10-AE-wasserstein-2.ipynb@ ebaff0f ·STL10-Latent-Flow-Matching.ipynb@ 75c3469- Before/after the slot fix: local folder
sep5_model_compare/{1a145f0,42eae1c}
What it means
A well-shaped latent is necessary but not enough. Most of the quality loss came from bugs that piled up because I changed several things at once.
Limits
No FID was measured in this phase. "Better" and "worse" here mean what the samples looked like.
The self-teaching autoencoder
In one line: an autoencoder trained with no pixel loss and no outside teacher. A frozen copy of its own encoder judges whether a rebuilt photo "reads" the same as the real one.
Question
Can an autoencoder learn sharp, faithful reconstructions using only its own judgment? No pixel MSE, no pretrained perceptual model, no adversarial judge.
How it works
At every training step:
- Copy the encoder and freeze the copy. This is the judge, refreshed from the live weights each step.
- Encode the photo (clean, and with ~35% of patches dropped) to get latents. Add a little latent noise on the clean path.
- Decode both latents into rebuilt photos.
- Take matching crops of the real photo and of each rebuilt photo. Crop size is random (roughly 20–90% of the image).
- Run every crop through the judge. The loss is the distance between the judge's latent of the rebuilt crop and its latent of the real crop. Gradients flow through the judge's operations back into the decoder, but the judge's weights don't change.
- Add the four Wasserstein losses from A04 A smoother hidden space, and generating from it to keep the latent bell-shaped and stop collapse.
- Color drop (10%): sometimes the same color channel is removed from both the real and rebuilt crops before judging. This is not color prediction. It keeps hue stable.
Pixel MSE is measured for evaluation only. It never enters the loss.
What happened
- First light (09-20 → 09-22) (E20 Self-teaching AE - first light): a small model goes through strange phases instead of the usual blurry-to-sharp. It collapses easily.
- Scaling to 25M broke it: "everything turning green" (E21 Latent collapse vs decoder collapse, E32 Agent-run 25M self-teach harness). Claude turned the notebook into a script with on/off flags and ran about 70 runs over 5 nights. What it found:
- Latent drift: with only 32 random slices, the sliced-Wasserstein gradient was noisy and pushed the latent around. Fix: 1,024 slices.
- Rank collapse: a high view-alignment weight squeezed the latent into a few directions.
- MLP runaway: at learning rate 3e-4 the decoder MLPs grew without limit.
- Fix "P4": start latent tokens small (0.02) and add an RMSNorm with a tiny gain (1e-4) on each branch output. This was the first setup that survived learning rate 3e-4.
- An evaluation bug: forward hooks were replacing module outputs, so a day of metrics was wrong. Those runs were re-scored and the bad data was labeled.
- Skip paths and crops (09-26 → 09-30) (E22 Skip paths, crop-edge bias + the 25M snapshot):
- A DC-AE-style skip was tried and then removed.
- What stayed: a simple linear patch projection plus an "average pixel value" skip.
- Crops were biased against the outermost pixels (a bilinear-sampling effect). A 0.3-pixel margin fixed that.
- Two dead ends (10-07 → 10-08) (E35 Projection-head regularizer + clustered batches):
- Moving the regularizer onto a JEPA-style projection head collapsed at once.
- Regularizing clusters of nearby latents stopped the latent from sorting photos by color, but rebuilt photos got worse.
- How strong should the regularizer be? (10-29) (E28 AE regularizer strength + the noise floor), 29 runs on ImageNet 128 px:
- Keep λ = 0.05.
- From λ 0.5 up, the regularizer sits on its batch noise floor, 2·(4/B)² ≈ 0.0078 for batch size B = 64. Even two samples from the same bell curve give a non-zero distance at that batch size, so pushing harder only adds churn.
- Squaring it (p = 2) gave no gain.
Results (benchmark: pixel MSE on held-out photos, lower is better)
| model | params | trained with pixel loss? | data | test MSE |
|---|---|---|---|---|
| pixel-loss AE (A02) | ~1M | yes | STL-10 96 px | ≈ 0.0049 |
| pixel-loss AE (A02) | ~5M | yes | STL-10 96 px | 0.00164 |
self-teaching, linear skip (ae_11M_selfteach_linskip_200k) | 11.4M | no | STL-10 96 px | 0.00467 |
self-teaching, conv image path (ae_15M_selfteach_convimg_200k) | 14.8M | no | STL-10 96 px | 0.00521 |
| self-teaching, λ = 0.05 at 60k steps | 25.1M | no | ImageNet 128 px | 0.0041 |
The STL-10 self-teaching numbers are on 1,024 test photos through the exported models (fp32), after 200k steps.
Honest reading: without ever seeing a pixel loss, the self-teaching AE matches my early ~1M pixel-trained model, but not the best 5M one. Its strength is a judge-shaped latent, not the lowest MSE.
Receipts
- Notebook:
STL10-AE-working-self-teach.ipynb@ e996de9, the "25M settings snapshot" - Exported models:
models/@ 1f10ea1 - Claude's harness and journal:
jordanjalles-lab/stl10-selfteach, seeJOURNAL.md; the eval-hook fix is3d1140b - Regularizer strength study:
imagenet-selfteach/regx/
What it means
A model can learn to rebuild photos using only its own judgment, but it is a tightrope: the judge, the regularizer and the decoder all move together. Most of the work was keeping that loop stable.
Limits
- MSE is the wrong score for a model that was never trained on MSE. A perceptual score or FID on reconstructions would be fairer.
- My research notes say "squared Wasserstein reduced churn". The 10-29 study says squaring gave no gain. These may be different runs: check before quoting.
The overnight speedrun
In one line: the first night Claude ran experiments by itself, it cut the autoencoder's test error from 0.0120 to 0.00445 in 30 ten-minute runs, by getting better at the wrong thing.
Question
Given 10 minutes of training from scratch, how low can the clean reconstruction error of the STL-10 autoencoder go?
Setup
- Claude turned my notebook (the RoPE + sparse-middle autoencoder from A04 A smoother hidden space, and generating from it) into a single training script.
- Rules: each run trains from scratch for 600 seconds. Change one setting, record the result in
LOG.md, commit, repeat. Model size and batch size may change. - Score: test-set clean pixel MSE after 10 minutes.
What happened (one row per kept improvement)
| run | change | test MSE |
|---|---|---|
| exp03 | learning rate 5e-4 | 0.0120 |
| exp04 | learning rate 1e-3 | 0.0091 |
| exp09 | 4 data-loader workers, full 600 s | 0.00741 |
| exp10 | small safety margin on the learning-rate guard | 0.00715 |
| exp12 | Adam β2 = 0.95 (the spike at epoch 6 went away) | 0.00635 |
| exp13 | learning rate 2e-3 | 0.00568 |
| exp16 | 4 blocks instead of 8 (more steps in 10 min) | 0.00533 |
| exp25 | skip end-of-epoch plots | 0.00511 |
| exp27 | remove the learning-rate probes (fewer recompiles) | 0.00487 |
| exp30 | CUDA Graphs (reduce-overhead) | 0.00445 |
What didn't help: cosine decay, gradient clipping (no change at all), learning rate 4e-3 (the model died), batch size 32 or 128, more or fewer latent tokens, a wider transformer, max-autotune compiling.
Next morning, my finding: "0.0045 floor was latent collapse (high lr × high view_weight), not bottleneck capacity; require latent-health diagnostics."
Receipts
- Repo:
jordanjalles-lab/stl10-jrope, 37 commits from 09-17 23:41 to 09-18 11:47 - Best run:
4908a9f· my finding:adb2edd
What it means
- The search was careful: it bracketed each setting, profiled the GPU and kept one change per run. But it optimized exactly the number it was given.
- From then on every experiment also logged latent health: rank, spread and drift. "Judge by the right measure, not by training loss" became a written rule.
- Two findings carried over: β2 = 0.95, and CUDA Graphs for small models.
Limits
Ten-minute runs reward fast starts, not good final models. The low MSE came with a collapsed latent, so the scores are not a fair measure of quality.
ImageNet, and training small then scaling up
In one line: I moved the self-teaching autoencoder to ImageNet at 128 px, and found that training at 64 px first and then switching to 128 px reaches the same quality 2.15× faster.
Questions
- Does the self-teaching autoencoder work on a large, varied dataset?
- What is the fastest route, in wall-clock time, to a trained 128 px model?
Setup
- Data: ImageNet-1k (1.28M photos, 1,000 classes), from Hugging Face parquet shards (294 train, 14 validation). Resized and cropped to 128×128.
- Model: the 25M self-teaching autoencoder from A05 The self-teaching autoencoder. Patch 16 (an 8×8 grid at 128 px), latent 48 tokens × 48 channels.
- Loading: two workers prefetch batches and shards so the GPU is not left waiting (E23 ImageNet self-teaching AE @128px).
- Resolution trick (E39 Resolution scaling - train small, then scale up): the weights don't depend on how many patches there are, so a model trained at 32 or 64 px can keep training at 128 px with the same weights.
What happened
- A leftover bug: the encoder still assumed 12-pixel patches from STL-10. Fixed in
ba3fb6b. - Edge artifacts: dark bands along the top and bottom edges. Fixes tried: crops that favor edges, zero-padded crops, and finally masked overhanging crops, where a crop may hang off the image and the part outside is blacked out the same way on both sides of the comparison.
- Low resolution first:
- 64 px for 25k steps, then 128 px, reached test MSE 0.0066 2.15× faster than training at 128 px from the start.
- Switching late adapts in about 1k steps but is slower overall.
- Freezing layers after the switch saved only 15–50% of step time and needed more steps than it saved. Not worth it.
- Latent flow on ImageNet latents (E24 ImageNet latent flow + SPRINT sparse-dense), including a SPRINT-style sparse/dense training path. Loading cached latents was a struggle.
Results
| route to a 128 px autoencoder | relative wall-clock time to test MSE 0.0066 |
|---|---|
| 128 px from scratch | 1.0× |
| 64 px for 25k steps → 128 px | 0.47× (2.15× faster) |
| switch at a later step | faster than scratch, slower than an early switch |
Receipts
- Notebook:
ImageNet-AE-selfteach.ipynb@ ba3fb6b - Scaling study:
imagenet-selfteach/scale/, with the README andweight_delta.py(which layers change after a switch)
What it means
Resolution can be treated as a free setting during training. This idea led to the multi-resolution "pyramid" readouts in A08 Pixel diffusion - self-flow and self-teaching.
Limits
One model size, one target MSE.
Pixel diffusion: self-flow and self-teaching
In one line: I dropped the autoencoder and generated pixels directly. Two "the model teaches itself" ideas (self-flow and self-teaching) took FID from 134.7 to 114.2 at 20M parameters, and to 98.4 at 100M.
Question
Can the self-teaching idea from the autoencoder make a pixel-space image generator better, measured by a standard score?
The benchmark
- FID (Fréchet Inception Distance) compares the statistics of generated images with real ImageNet images, as seen by a fixed image network. Lower is better.
- This archive's protocol: ImageNet 128 px, 10,000 samples, 16 Euler steps, scored from the averaged (EMA) weights unless marked "raw".
- Comparing: papers usually use 50,000 samples, so compare numbers within this archive, not with papers. The Spark and the 3090 read slightly different copies of the data, and the same run scores about 5 FID apart on the two machines, so only compare runs on the same machine.
Base model
- One transformer on pixels (E25 Unified pixel-diffusion model): patch 16 at 128 px, 8 blocks, width 360, about 20M parameters.
- Training:
- Mix a photo with noise at level t (t = 1 is clean). The model predicts the clean photo (x-prediction). The loss is MSE to the real photo, times a weight that depends on t.
- t is drawn from a logit-normal distribution.
- Pyramid readouts (E33 Pixel-diffusion probes - looped middle, width vs depth, pyramid readouts): middle blocks also predict a lower-resolution image (32 and 64 px), after a pyramid-JiT write-up. Readouts helped FID by 6–8 but raised the final test loss.
The two self-teaching ideas
- Self-flow:
- Draw two noise levels for each photo.
- A teacher (an averaged, EMA copy of the model, with no gradient) sees the whole photo at the cleaner level.
- The student sees 75% of patches at the cleaner level and 25% at the noisier one.
- Besides its normal loss, the student's block-3 features are pulled toward the teacher's block-6 features.
- Self-teaching (from A05 The self-teaching autoencoder):
- Take the model's output image and a crop of the real photo.
- Run both through a frozen copy of the model itself.
- Pull the output's block-3 or block-6 features toward the real photo's.
What happened
- A bug first (10-09): the old loss weight gave the most weight to pure noise, the least useful case. The corrected weight (
clamp01) became the default; the old one was about 2× worse on nearly-clean inputs. - Small tests (10-06 → 10-08):
- A looped, shared-weight middle with XSA was ignored by the model.
- 2× width ≈ 2× depth.
- Raw-weight samples swing between blurry and sharp within 200 steps, so all FIDs use EMA weights from here on.
- Automated FID loops (10-09 → 10-10) (E34 FID research loops - self-flow + self-teaching):
- Each test branches 16–20k steps from a checkpoint and changes one thing.
- It is kept only if it beats the reference by at least 1.5 FID.
- Runs went on the Spark and the 3090 overnight.
- What won and what didn't (10-11 → 10-20) (E36 October ablation sweep - noise assignment, MoE, guidance): see the tables.
- Scaling sweep (10-21 →) (E37 Self-teaching scaling sweeps (1M to 50M)): does self-teaching help more as the model grows (1M → 50M)? Still running, no result yet.
Results
A. Building the recipe (20M model, 100k steps)
| change | FID | note |
|---|---|---|
| control (8 blocks, corrected weight) | 134.7 (raw) | Spark, seed 44 |
| + self-flow | 126.9 (raw) | also wins on seed 2: 130.1 vs 135.1 |
| + EMA teacher (loop round 1) | 124.4 | the only winner out of 12 tests |
| + self-teaching output term (round 2) | 116.1 | judge at block 6; the "noised" term hurt |
| best recipe at 200k steps | 114.2 | parent of loop round 3 |
B. Width (best recipe from scratch, EMA FID)
| params | 100k steps | 200k steps | 400k steps |
|---|---|---|---|
| 20M | 123.3 | 114.5 | |
| 39M | 115.8 | 108.9 | 100.8 |
| 100M | 113.7 | 106.2 | 98.4 |
C. Other ideas (20M model, control 136.8 EMA at 100k, 3090)
| idea | FID | verdict |
|---|---|---|
| pair each photo with its "easiest" noise sample (XM, by model loss) | 122.4–123.5 | helps; adds on top of self-flow (119.2) |
| same, but random pairing | 140.8 | so the gain comes from the pairing |
| JiT noise recipe (more low-noise training) | 122.3 | helps, but samples come out dark (11.7% black pixels) |
| class labels, no guidance / guidance 1.5 / 2 / 3 | 133.4 / 127.4 / 122.7 / 118.9 | helps |
| Wasserstein regularizers on the self-flow stream | 149.4 (vs 131.4) | hurts |
| corrector blocks, re-applied | 146–152 | hurts at equal cost |
| mixture of experts (2–32 experts) | 137.9–143.3 | no gain; more experts is worse |
| multi-scale attention split | 132–141 (vs 130.1) | hurts |
| timestep shift 3.46 | ~9 worse | hurts (sampler not shifted) |
D. 100M model with noise pairing (Spark, EMA FID): 110.3 at 100k, 94.85 at 200k, 84.05 at 650k, while black pixels grew. A paper ablation toward arXiv 2607.02508 (at 300k) found self-flow 116.5 and mixed noise alone 118.3, against a control of 123.4. Most of self-flow's gain comes from the mixed noise levels.
Receipts
- Start:
ImageNet-Unify.ipynb@ 5eb53a0 - Training code:
unify3090/job_selfteach/main.py(self-flow and self-teaching are described in comments next to the code) - Loop logs with every test, time and FID:
fidloop/LOG.md·stloop/LOG.md·stloopB/LOG.md - Every experiment's question and verdict:
train-viz/experiments.json
What it means
- Carrying a working idea into a new project gave the best gain. Self-teaching from the autoencoder lowered pixel-diffusion FID by about 10.
- In the loops, about 87 small tests of weights, shares and decay rates gave about 5 wins. The big gains came from new mechanisms, not tuning.
Limits
- One seed for most rows.
- 10k-sample FID moves by about ±1–2 between runs, which is why the 1.5 FID pass margin is there.
- 128 px only. These FIDs are not comparable to published ImageNet numbers.
JiT at 256 px
In one line: the best recipe from A08 Pixel diffusion - self-flow and self-teaching, scaled to a 109M-parameter class-conditional JiT-style model and trained on cloud GPUs at 128 px and then 256 px. It reached FID 42.3.
Question
How far does the October recipe go with more compute, a bigger model and a higher resolution?
Setup
- Model: a JiT-style transformer that predicts clean pixels, with the pyramid readouts from A08. 109M parameters. The best unconditional Spark run, for comparison, is 95M.
- Choosing the shape (11-07): candidates such as 8 blocks × 800 wide, 12 × 704 and 12 × 640 were each trained briefly. Rule: lowest test loss for equal time; if within 1%, take the one with more parameters.
- Two stages:
- Stage A: 128 px.
- Stage B: 256 px, continuing from stage A's weights. This uses the same resolution trick as A07 ImageNet, and training small then scaling up.
- Cloud sessions end, so each stage was resumed many times from checkpoints.
- Conditioning: the model is told the ImageNet class. Sampling uses classifier-free guidance 3.
- Score: FID on 10,000 samples, 16 Euler steps.
Results
| run | resolution | conditioning | steps | FID |
|---|---|---|---|---|
| best Spark run (100M) | 128 px | none | 650k | 84.05 (EMA) / 82.0 best |
| this run, end of stage A | 128 px | class + guidance 3 | 37.0 | |
| this run, final | 256 px | class + guidance 3 | 820k | 42.3 |
Sample sheets were saved at 10k, 80k, 320k, 650k, 660k and 820k steps (shown in Layer 1 and on the timeline).
Fair comparison: the Spark runs have no class labels and no guidance, so the drop from 82 to 42 mixes several changes: guidance, more parameters, more steps and the second stage. In A08, guidance 3 alone was worth about 18 FID on the small model. 128 px and 256 px FIDs also shouldn't be compared directly.
Context: published JiT-style models from large labs reach low single-digit FID on ImageNet 256, with 50k samples and far more compute. Check the exact numbers in the JiT paper before quoting.
Receipts
- Code:
imagenet-selfteach/colab-jit/:job/main.py,job/pyramid_cells.py,make_stages.py, and the stage configs - Report page:
train-viz/public/colab-jit-820k.html(commit909e88c, 11-12)
What it means
The October recipe scales. It's the best image quality of the sabbatical and a clear marker of progress from the blurry blobs of September.
Limits
- One run, one seed.
- Before publishing, remove anything about how jobs were launched (runner, accounts): only the training code and configs belong in the shared version.
JEPA questions
In one line: two tests of whether the self-teaching ideas hold up in a JEPA setting: one still running, one a clean "no".
1. Can my Wasserstein regularizer replace LeJEPA's projector? (running)
Question: LeJEPA keeps its features spread out by passing them through a projector (MLP + BatchNorm) and applying SIGReg there. Can my four-part Wasserstein regularizer do the same job directly on the features, with no projector?
Setup (E29 Projector-free Wasserstein vs LeJEPA):
- ViT-S/8 on Imagenette (a 10-class subset of ImageNet).
- Arms:
- A: LeJEPA as published (projector + SIGReg)
- B: my Wasserstein regularizer, no projector, final LayerNorm removed
- C: SIGReg with no projector
- Score: a frozen linear probe on the 384-number features, on the official validation set. This is the standard way to grade self-supervised features.
- Checks: stop if spread drops below 5% of its starting value (collapse). Also measured: invariance, retrieval, kNN, spectrum, and each loss term's gradient.
Why it matters: in October, moving my regularizer onto a projection head collapsed at once (E35 Projection-head regularizer + clustered batches). This tests the opposite direction properly.
Result: none yet. 12 runs registered, still running.
Receipts: jordanjalles-lab/lejepa-wreg: lejepa_wreg/model.py, train.py, evals.py
2. Can a JEPA encoder teach a generator? (no)
Question: train an encoder with only view alignment plus a regularizer, so it never sees a pixel loss. Then train a generator whose only teacher is that encoder's judgment. Does the generator learn to draw?
Setup (E38 JEPA encoder teaches a generator):
- Encoder views: the whole photo, and the same photo with 35% of patches dropped. Both use the same color mask.
- The generator gets the encoder's latent with gradient stopped, so it can't reshape the encoder to make its own job easier.
- Its output is judged by a frozen copy of the encoder on the same crops as in A05 The self-teaching autoencoder.
- Three regularizer arms: Wasserstein on z, LeJEPA projector + SIGReg, and a mix.
- Built-in checks: before the first update, confirm zero gradient crosses between the two losses. Stop if latent rank falls below 2.
Score: how close the judge thinks a generated image is to its real photo, compared with a random other photo. 0 = perfect match, 1 = no better than random. Each generator was scored by its own judge and by an outside judge: the encoder of a separately trained self-teaching autoencoder.
| arm | own judge | outside judge |
|---|---|---|
| all three | 0.06–0.11 | 0.92–1.09 |
The encoders did not collapse (latent rank 10.6–18.5). The generators learned to fool their own judge: the previews are repeating textures in each photo's colors, with a faint hint of layout.
Receipts: imagenet-selfteach/jepagen/README.md · jg_cell.py
What it means: when a model is its only judge, it will find the gaps in its own judging. The self-teaching autoencoder worked because the judge was also being trained to rebuild the same photo. Remove that tie and the generator cheats.
train-viz: seeing training as it happens
In one line: a small website, built by Claude to my spec, that shows every training run live, including a 3-D view of the latent you can fly through. It works on a phone.
Why
By late September there were dozens of runs a day across two machines. Loss curves alone hid what mattered: latent collapse, color drift and edge artifacts all showed up in pictures before they showed up in numbers (A06 The overnight speedrun is the clearest case).
What it shows
- Runs: live, pinned and all runs; comparisons on test MSE, not training loss (training schemes differ between runs).
- Run page: losses, reconstructions over time, latent drift, latent-noise robustness curves, and edge vs center error.
- Latent "constellation": a PCA of every latent token for a set of test photos, in 3-D. Color by dominant channel, focus one photo to see where its tokens sit, and play through training. The PCA axes are aligned between snapshots so playback morphs instead of flipping.
- Covariance maps: token-by-token and channel-by-channel. This is where collapse shows up as bright blocks.
- Generative scores: FID and KID over training, sample sharpness, and pyramid readout charts.
- Experiment registry: every experiment's question, runs and verdict (63 entries). Most of this archive's October–November dates and numbers come from it.
Receipts
jordanjalles-lab/train-viz: 133 commits, 09-25 → 11-12- Video:
vids/latent-pca-viewer.mp4,vids/latent-pca-viewer-images.mp4
Limits
Built for one person and one set of experiments. Before publishing the repo, remove server paths and network names.
Glossary
Short, plain meanings for the terms used in this archive.
- Autoencoder (AE): a model that squeezes an image into a short code (the latent) and rebuilds the image from it. Encoder = the squeezing half, decoder = the rebuilding half.
- Latent / hidden space: the short code an encoder makes. In this work it's a grid of tokens × channels, e.g. 32 × 32 or 48 × 48 numbers.
- Token: one item in a transformer's sequence: an image patch, or a learned slot.
- Patch: a small square of the image (12×12 or 16×16 pixels) turned into one token.
- Transformer block: attention (tokens look at each other) plus an MLP (each token is processed on its own).
- RoPE: a way to tell attention where each token is, by rotating its numbers by an amount tied to its position.
- MSE: mean squared error. The average squared difference between two images, on a 0–1 pixel scale. Lower is better.
- Learning rate: how big a step the model takes each update. Adam β2: how fast Adam's estimate of gradient size adapts.
- EMA weights: a slowly updated average of the model's weights. Smoother and usually better for sampling.
- Collapse: the model maps very different inputs to (nearly) the same latent, making a loss easy to satisfy and the latent useless.
- Rank (of a latent): roughly, how many independent directions the latents actually use. Low rank means partial collapse.
- Regularizer: an extra loss that keeps the latent in a useful shape.
- Wasserstein distance: how far apart two sets of numbers are, measured by how much you'd have to move one to match the other. Here it compares the latent with a bell curve. Sliced: measured along random directions.
- SIGReg: LeJEPA's regularizer. It tests whether features look like a bell curve, using characteristic functions.
- JEPA: a way to learn features by making two views of the same image (e.g. one with patches hidden) give matching features, instead of rebuilding pixels.
- Projector: a small extra network on top of the features, used only during training.
- Linear probe: grade features by training only a single linear layer on top of frozen features to predict the class.
- Stop-gradient / frozen: a part of the model whose weights are not changed by a given loss.
- Flow matching: train a model to predict the direction from noise toward a real image (or latent). To generate, start at noise and follow that direction in small steps (Euler steps).
- Diffusion (pixel): the same idea working on pixels directly, with no autoencoder.
- x-prediction: the model predicts the clean image itself, rather than the noise or the direction.
- Self-teaching: a frozen copy of the model judges the model's own output.
- Self-flow: an averaged copy of the model sees a cleaner version of the image, and the model's early layers learn to predict that copy's later layers.
- FID: Fréchet Inception Distance. How different generated images are from real ones, as seen by a fixed image network. Lower is better.
- Guidance (CFG): at sampling time, push the model further toward the class it was told to draw. Higher means more on-class images and less variety.
- Ablation: a run with one piece removed or changed, to see what that piece does.