{
  "schemaVersion": 1,
  "slug": "dit",
  "title": "Use a Transformer as the diffusion backbone",
  "className": "TinyDiT",
  "question": "What changes when a Transformer denoises latent patches?",
  "description": "Trace latent patches into a class- and time-conditioned Transformer, then inspect adaLN-Zero gates and reconstruct the spatial predictions.",
  "category": "Generative models",
  "tags": [
    "DiT",
    "Diffusion Transformer",
    "adaLN-Zero",
    "Latent patches"
  ],
  "curator": "TensorViz",
  "attribution": "Original TensorViz teaching example. PyTorch provides the underlying operators.",
  "license": "No separate redistribution license has been declared for these project examples.",
  "limitations": "Untrained backbone, not DiT-XL/2 or a complete diffusion pipeline. No autoencoder, sampler, classifier-free guidance or variance-learning loss. Last two output channels are raw interpolation parameters, not variances. Nonzero cases deliberately perturb weights to expose conditioning and are not trained checkpoints. Paper preprint 2022, ICCV 2023.",
  "openingStep": "gates",
  "provenance": {
    "capturedAt": "2026-09-17T06:51:52.437778+00:00",
    "productRevision": "cf0ab1c9c58c1dc640235b742fa032cade00b43c",
    "sourceSha256": "28f6731c80c062f05c2bbf7266158a764af77382d11ddb24f5b30444b7426c44",
    "python": "3.13.13",
    "torch": "2.7.1",
    "execution": {
      "inputs": {
        "args": [
          {
            "shape": [
              1,
              2,
              4,
              4
            ],
            "dtype": "float32",
            "fill": "randn"
          },
          {
            "shape": [
              1
            ],
            "dtype": "int64",
            "fill": "ones"
          },
          {
            "shape": [
              1
            ],
            "dtype": "int64",
            "fill": "ones"
          }
        ]
      },
      "device": "cpu",
      "mode": "eval",
      "seed": 0,
      "deterministic": true
    },
    "outcome": "passed",
    "outputShape": [
      1,
      4,
      4,
      4
    ],
    "method": "TensorViz multifile projection and isolated execution worker",
    "scope": "Reduced class-conditioned DiT backbone. Patch projection, exact zero-initialized identity, spatial unpatchification, gradient-path and conditional-intervention checks. Output packs epsilon and raw variance parameters.",
    "numericalChecks": [
      "Convolutional patch embeddings equal explicit unfold plus linear projection",
      "Zero modulation initializes the residual block as identity and the final prediction as zero",
      "Unpatchification preserves every patch coordinate and output channel",
      "Initial gradients reach the output projection; after a declared nonzero intervention both timestep and class change predictions"
    ]
  },
  "layers": [
    {
      "id": "input",
      "label": "input",
      "op": "Input",
      "kind": "input",
      "parent": null,
      "params": {
        "shape": "1,2,4,4"
      }
    },
    {
      "id": "patchify",
      "label": "patchify",
      "op": "Conv2d",
      "kind": "layer",
      "parent": null,
      "params": {
        "in_channels": 2,
        "out_channels": 8,
        "kernel_size": 2,
        "stride": 2
      },
      "source": {
        "line": 108,
        "endLine": 108
      }
    },
    {
      "id": "flatten@TinyDiT#0",
      "label": "flatten@TinyDiT#0",
      "op": "Flatten",
      "kind": "layer",
      "parent": null,
      "params": {
        "start_dim": 2
      },
      "source": {
        "line": 116,
        "endLine": 116
      }
    },
    {
      "id": "time_embedding",
      "label": "time_embedding",
      "op": "Module",
      "kind": "module",
      "parent": null,
      "params": {},
      "source": {
        "line": 110,
        "endLine": 110
      }
    },
    {
      "id": "class_embedding",
      "label": "class_embedding",
      "op": "Embedding",
      "kind": "layer",
      "parent": null,
      "params": {
        "num_embeddings": 4,
        "embedding_dim": 8
      },
      "source": {
        "line": 111,
        "endLine": 111
      }
    },
    {
      "id": "add@TinyDiT#0",
      "label": "add@TinyDiT#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": null,
      "params": {},
      "source": {
        "line": 117,
        "endLine": 117
      }
    },
    {
      "id": "block",
      "label": "block",
      "op": "Module",
      "kind": "module",
      "parent": null,
      "params": {},
      "source": {
        "line": 112,
        "endLine": 112
      }
    },
    {
      "id": "decoder",
      "label": "decoder",
      "op": "Module",
      "kind": "module",
      "parent": null,
      "params": {},
      "source": {
        "line": 113,
        "endLine": 113
      }
    },
    {
      "id": "output",
      "label": "output",
      "op": "Output",
      "kind": "output",
      "parent": null,
      "params": {}
    },
    {
      "id": "time_embedding.up",
      "label": "time_embedding.up",
      "op": "Linear",
      "kind": "layer",
      "parent": "time_embedding",
      "params": {
        "in_features": 8,
        "out_features": 8
      },
      "source": {
        "line": 22,
        "endLine": 22
      }
    },
    {
      "id": "mul@time_embedding#0",
      "label": "mul@time_embedding#0",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "time_embedding",
      "params": {},
      "source": {
        "line": 27,
        "endLine": 31
      }
    },
    {
      "id": "python@time_embedding#0",
      "label": "python@time_embedding#0",
      "op": "Python",
      "kind": "layer",
      "parent": "time_embedding",
      "params": {},
      "source": {
        "line": 27,
        "endLine": 31
      }
    },
    {
      "id": "mul@time_embedding#1",
      "label": "mul@time_embedding#1",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "time_embedding",
      "params": {},
      "source": {
        "line": 32,
        "endLine": 32
      }
    },
    {
      "id": "cat@time_embedding#0",
      "label": "cat@time_embedding#0",
      "op": "torch.cat",
      "kind": "layer",
      "parent": "time_embedding",
      "params": {
        "dim": -1
      },
      "source": {
        "line": 33,
        "endLine": 35
      }
    },
    {
      "id": "time_embedding.silu",
      "label": "time_embedding.silu",
      "op": "SiLU",
      "kind": "layer",
      "parent": "time_embedding",
      "params": {},
      "source": {
        "line": 23,
        "endLine": 23
      }
    },
    {
      "id": "time_embedding.down",
      "label": "time_embedding.down",
      "op": "Linear",
      "kind": "layer",
      "parent": "time_embedding",
      "params": {
        "in_features": 8,
        "out_features": 8
      },
      "source": {
        "line": 24,
        "endLine": 24
      }
    },
    {
      "id": "block.silu",
      "label": "block.silu",
      "op": "SiLU",
      "kind": "layer",
      "parent": "block",
      "params": {},
      "source": {
        "line": 59,
        "endLine": 59
      }
    },
    {
      "id": "block.modulation",
      "label": "block.modulation",
      "op": "Linear",
      "kind": "layer",
      "parent": "block",
      "params": {
        "in_features": 8,
        "out_features": 48
      },
      "source": {
        "line": 60,
        "endLine": 60
      }
    },
    {
      "id": "python@block#0",
      "label": "python@block#0",
      "op": "Python",
      "kind": "layer",
      "parent": "block",
      "params": {},
      "source": {
        "line": 71,
        "endLine": 73
      }
    },
    {
      "id": "block.attention_norm",
      "label": "block.attention_norm",
      "op": "LayerNorm",
      "kind": "layer",
      "parent": "block",
      "params": {
        "normalized_shape": 8,
        "elementwise_affine": false
      },
      "source": {
        "line": 61,
        "endLine": 61
      }
    },
    {
      "id": "mul@block#0",
      "label": "mul@block#0",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "block",
      "params": {},
      "source": {
        "line": 74,
        "endLine": 74
      }
    },
    {
      "id": "add@block#0",
      "label": "add@block#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": "block",
      "params": {},
      "source": {
        "line": 74,
        "endLine": 74
      }
    },
    {
      "id": "block.attention",
      "label": "block.attention",
      "op": "Module",
      "kind": "module",
      "parent": "block",
      "params": {},
      "source": {
        "line": 62,
        "endLine": 62
      }
    },
    {
      "id": "mul@block#1",
      "label": "mul@block#1",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "block",
      "params": {},
      "source": {
        "line": 75,
        "endLine": 75
      }
    },
    {
      "id": "add@block#1",
      "label": "add@block#1",
      "op": "torch.add",
      "kind": "layer",
      "parent": "block",
      "params": {},
      "source": {
        "line": 75,
        "endLine": 75
      }
    },
    {
      "id": "block.ff_norm",
      "label": "block.ff_norm",
      "op": "LayerNorm",
      "kind": "layer",
      "parent": "block",
      "params": {
        "normalized_shape": 8,
        "elementwise_affine": false
      },
      "source": {
        "line": 63,
        "endLine": 63
      }
    },
    {
      "id": "mul@block#2",
      "label": "mul@block#2",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "block",
      "params": {},
      "source": {
        "line": 76,
        "endLine": 76
      }
    },
    {
      "id": "add@block#2",
      "label": "add@block#2",
      "op": "torch.add",
      "kind": "layer",
      "parent": "block",
      "params": {},
      "source": {
        "line": 76,
        "endLine": 76
      }
    },
    {
      "id": "block.up",
      "label": "block.up",
      "op": "Linear",
      "kind": "layer",
      "parent": "block",
      "params": {
        "in_features": 8,
        "out_features": 32
      },
      "source": {
        "line": 64,
        "endLine": 64
      }
    },
    {
      "id": "block.gelu",
      "label": "block.gelu",
      "op": "GELU",
      "kind": "layer",
      "parent": "block",
      "params": {
        "approximate": "tanh"
      },
      "source": {
        "line": 65,
        "endLine": 65
      }
    },
    {
      "id": "block.down",
      "label": "block.down",
      "op": "Linear",
      "kind": "layer",
      "parent": "block",
      "params": {
        "in_features": 32,
        "out_features": 8
      },
      "source": {
        "line": 66,
        "endLine": 66
      }
    },
    {
      "id": "mul@block#3",
      "label": "mul@block#3",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "block",
      "params": {},
      "source": {
        "line": 77,
        "endLine": 77
      }
    },
    {
      "id": "add@block#3",
      "label": "add@block#3",
      "op": "torch.add",
      "kind": "layer",
      "parent": "block",
      "params": {},
      "source": {
        "line": 77,
        "endLine": 77
      }
    },
    {
      "id": "block.attention.query",
      "label": "block.attention.query",
      "op": "Linear",
      "kind": "layer",
      "parent": "block.attention",
      "params": {
        "in_features": 8,
        "out_features": 8
      },
      "source": {
        "line": 41,
        "endLine": 41
      }
    },
    {
      "id": "python@block.attention#0",
      "label": "python@block.attention#0",
      "op": "Python",
      "kind": "layer",
      "parent": "block.attention",
      "params": {},
      "source": {
        "line": 49,
        "endLine": 49
      }
    },
    {
      "id": "block.attention.key",
      "label": "block.attention.key",
      "op": "Linear",
      "kind": "layer",
      "parent": "block.attention",
      "params": {
        "in_features": 8,
        "out_features": 8
      },
      "source": {
        "line": 42,
        "endLine": 42
      }
    },
    {
      "id": "python@block.attention#1",
      "label": "python@block.attention#1",
      "op": "Python",
      "kind": "layer",
      "parent": "block.attention",
      "params": {},
      "source": {
        "line": 50,
        "endLine": 50
      }
    },
    {
      "id": "div@block.attention#0",
      "label": "div@block.attention#0",
      "op": "torch.div",
      "kind": "layer",
      "parent": "block.attention",
      "params": {},
      "source": {
        "line": 52,
        "endLine": 52
      }
    },
    {
      "id": "block.attention.value",
      "label": "block.attention.value",
      "op": "Linear",
      "kind": "layer",
      "parent": "block.attention",
      "params": {
        "in_features": 8,
        "out_features": 8
      },
      "source": {
        "line": 43,
        "endLine": 43
      }
    },
    {
      "id": "python@block.attention#2",
      "label": "python@block.attention#2",
      "op": "Python",
      "kind": "layer",
      "parent": "block.attention",
      "params": {},
      "source": {
        "line": 51,
        "endLine": 51
      }
    },
    {
      "id": "block.attention.softmax",
      "label": "block.attention.softmax",
      "op": "Softmax",
      "kind": "layer",
      "parent": "block.attention",
      "params": {},
      "source": {
        "line": 44,
        "endLine": 44
      }
    },
    {
      "id": "block.attention.project",
      "label": "block.attention.project",
      "op": "Linear",
      "kind": "layer",
      "parent": "block.attention",
      "params": {
        "in_features": 8,
        "out_features": 8
      },
      "source": {
        "line": 45,
        "endLine": 45
      }
    },
    {
      "id": "silu@decoder#0",
      "label": "silu@decoder#0",
      "op": "SiLU",
      "kind": "layer",
      "parent": "decoder",
      "params": {},
      "source": {
        "line": 92,
        "endLine": 92
      }
    },
    {
      "id": "decoder.norm",
      "label": "decoder.norm",
      "op": "LayerNorm",
      "kind": "layer",
      "parent": "decoder",
      "params": {
        "normalized_shape": 8,
        "elementwise_affine": false
      },
      "source": {
        "line": 83,
        "endLine": 83
      }
    },
    {
      "id": "decoder.modulation",
      "label": "decoder.modulation",
      "op": "Linear",
      "kind": "layer",
      "parent": "decoder",
      "params": {
        "in_features": 8,
        "out_features": 16
      },
      "source": {
        "line": 84,
        "endLine": 84
      }
    },
    {
      "id": "python@decoder#0",
      "label": "python@decoder#0",
      "op": "Python",
      "kind": "layer",
      "parent": "decoder",
      "params": {},
      "source": {
        "line": 92,
        "endLine": 92
      }
    },
    {
      "id": "mul@decoder#0",
      "label": "mul@decoder#0",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "decoder",
      "params": {},
      "source": {
        "line": 93,
        "endLine": 93
      }
    },
    {
      "id": "add@decoder#0",
      "label": "add@decoder#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": "decoder",
      "params": {},
      "source": {
        "line": 93,
        "endLine": 93
      }
    },
    {
      "id": "decoder.project",
      "label": "decoder.project",
      "op": "Linear",
      "kind": "layer",
      "parent": "decoder",
      "params": {
        "in_features": 8,
        "out_features": 16
      },
      "source": {
        "line": 85,
        "endLine": 85
      }
    },
    {
      "id": "python@decoder#1",
      "label": "python@decoder#1",
      "op": "Python",
      "kind": "layer",
      "parent": "decoder",
      "params": {},
      "source": {
        "line": 94,
        "endLine": 94
      }
    }
  ],
  "connections": [
    {
      "id": "edge-1",
      "source": "time_embedding.up",
      "target": "mul@time_embedding#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-2",
      "source": "mul@time_embedding#0",
      "target": "python@time_embedding#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-3",
      "source": "python@time_embedding#0",
      "target": "mul@time_embedding#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-4",
      "source": "mul@time_embedding#1",
      "target": "cat@time_embedding#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-5",
      "source": "cat@time_embedding#0",
      "target": "time_embedding.up",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-6",
      "source": "time_embedding.up",
      "target": "time_embedding.silu",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-7",
      "source": "time_embedding.silu",
      "target": "time_embedding.down",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-8",
      "source": "block.attention.query",
      "target": "python@block.attention#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-9",
      "source": "block.attention.key",
      "target": "python@block.attention#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-10",
      "source": "block.attention.value",
      "target": "python@block.attention#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-11",
      "source": "python@block.attention#0",
      "target": "div@block.attention#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-12",
      "source": "python@block.attention#1",
      "target": "div@block.attention#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-13",
      "source": "div@block.attention#0",
      "target": "block.attention.softmax",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-14",
      "source": "block.attention.softmax",
      "target": "block.attention.project",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-15",
      "source": "python@block.attention#2",
      "target": "block.attention.project",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-16",
      "source": "block.silu",
      "target": "block.modulation",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-17",
      "source": "block.modulation",
      "target": "python@block#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-18",
      "source": "block.attention_norm",
      "target": "mul@block#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-19",
      "source": "python@block#0",
      "target": "mul@block#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-20",
      "source": "mul@block#0",
      "target": "add@block#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-21",
      "source": "python@block#0",
      "target": "add@block#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-22",
      "source": "add@block#0",
      "target": "block.attention.query",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-23",
      "source": "add@block#0",
      "target": "python@block.attention#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-24",
      "source": "add@block#0",
      "target": "block.attention.key",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-25",
      "source": "add@block#0",
      "target": "python@block.attention#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-26",
      "source": "add@block#0",
      "target": "block.attention.value",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-27",
      "source": "add@block#0",
      "target": "python@block.attention#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-28",
      "source": "add@block#0",
      "target": "block.attention.project",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-29",
      "source": "add@block#0",
      "target": "block.attention",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-30",
      "source": "python@block#0",
      "target": "mul@block#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-31",
      "source": "block.attention.project",
      "target": "mul@block#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-32",
      "source": "block.attention",
      "target": "mul@block#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-33",
      "source": "mul@block#1",
      "target": "add@block#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-34",
      "source": "add@block#1",
      "target": "block.ff_norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-35",
      "source": "block.ff_norm",
      "target": "mul@block#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-36",
      "source": "python@block#0",
      "target": "mul@block#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-37",
      "source": "mul@block#2",
      "target": "add@block#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-38",
      "source": "python@block#0",
      "target": "add@block#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-39",
      "source": "add@block#2",
      "target": "block.up",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-40",
      "source": "block.up",
      "target": "block.gelu",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-41",
      "source": "block.gelu",
      "target": "block.down",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-42",
      "source": "python@block#0",
      "target": "mul@block#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-43",
      "source": "block.down",
      "target": "mul@block#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-44",
      "source": "add@block#1",
      "target": "add@block#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-45",
      "source": "mul@block#3",
      "target": "add@block#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-46",
      "source": "silu@decoder#0",
      "target": "decoder.modulation",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-47",
      "source": "decoder.modulation",
      "target": "python@decoder#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-48",
      "source": "decoder.norm",
      "target": "mul@decoder#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-49",
      "source": "python@decoder#0",
      "target": "mul@decoder#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-50",
      "source": "mul@decoder#0",
      "target": "add@decoder#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-51",
      "source": "python@decoder#0",
      "target": "add@decoder#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-52",
      "source": "add@decoder#0",
      "target": "decoder.project",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-53",
      "source": "decoder.project",
      "target": "python@decoder#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-54",
      "source": "input",
      "target": "patchify",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-55",
      "source": "patchify",
      "target": "flatten@TinyDiT#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-56",
      "source": "input",
      "target": "mul@time_embedding#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-57",
      "source": "input",
      "target": "mul@time_embedding#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-58",
      "source": "input",
      "target": "time_embedding",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-59",
      "source": "input",
      "target": "class_embedding",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-60",
      "source": "time_embedding.down",
      "target": "add@TinyDiT#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-61",
      "source": "time_embedding",
      "target": "add@TinyDiT#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-62",
      "source": "class_embedding",
      "target": "add@TinyDiT#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-63",
      "source": "flatten@TinyDiT#0",
      "target": "block.silu",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-64",
      "source": "flatten@TinyDiT#0",
      "target": "block.attention_norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-65",
      "source": "flatten@TinyDiT#0",
      "target": "add@block#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-66",
      "source": "flatten@TinyDiT#0",
      "target": "block",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-67",
      "source": "add@TinyDiT#0",
      "target": "block.silu",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-68",
      "source": "add@TinyDiT#0",
      "target": "block.attention_norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-69",
      "source": "add@TinyDiT#0",
      "target": "add@block#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-70",
      "source": "add@TinyDiT#0",
      "target": "block",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-71",
      "source": "add@block#3",
      "target": "silu@decoder#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-72",
      "source": "add@block#3",
      "target": "decoder.norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-73",
      "source": "block",
      "target": "decoder",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-74",
      "source": "add@TinyDiT#0",
      "target": "silu@decoder#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-75",
      "source": "add@TinyDiT#0",
      "target": "decoder.norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-76",
      "source": "add@TinyDiT#0",
      "target": "decoder",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-77",
      "source": "python@decoder#1",
      "target": "output",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-78",
      "source": "decoder",
      "target": "output",
      "sourcePort": null,
      "targetPort": null
    }
  ],
  "steps": [
    {
      "id": "patches",
      "target": "patchify",
      "title": "Turn the noisy latent into four tokens",
      "note": "A 2 × 2 stride-two convolution projects latent patches into eight features. Fixed 2D sinusoidal positions preserve the row and column coordinates. Unlike ViT classification, this backbone has no class token."
    },
    {
      "id": "condition",
      "target": "class_embedding",
      "title": "Combine diffusion time with the class label",
      "note": "The timestep passes through sinusoidal features and an MLP. A learned class embedding is added to it. This shared conditioning vector controls every spatial token, without becoming an image patch."
    },
    {
      "id": "gates",
      "target": "block.modulation",
      "title": "Start each residual block as the identity",
      "note": "Conditioning produces six vectors: attention and feed-forward shifts, scales and residual gates. Zero initialization closes both residual branches, so the block starts as identity. A recorded nonzero intervention makes the effect of class and time visible."
    },
    {
      "id": "spatial",
      "target": "decoder.project",
      "title": "Return tokens to noise and variance-parameter maps",
      "note": "Adaptive normalization and a linear projection emit each patch’s spatial values. Unpatchification restores the 4 × 4 grid with two epsilon and two raw variance-parameter channels. This final projection is also zero-initialized."
    }
  ],
  "milestone": {
    "name": "Diffusion Transformer (DiT)",
    "year": 2022,
    "kind": "Architecture",
    "fidelity": "Four 2 × 2 patches from a two-channel latent; one width-eight, two-head block; fixed 2D sinusoidal positions; sinusoidal time embedding plus class embedding; adaLN-Zero and spatial epsilon/variance-parameter heads.",
    "papers": [
      {
        "title": "Scalable Diffusion Models with Transformers",
        "url": "https://arxiv.org/abs/2212.09748"
      }
    ]
  },
  "experiment": {
    "kind": "matrices",
    "title": "Open the residual gates with conditioning.",
    "description": "Recorded adaLN-Zero initialization and a controlled nonzero parameter intervention. A Transformer maps latent patches back to spatial noise and variance parameters.",
    "controlLabel": "DiT condition",
    "cases": [
      {
        "id": "zero",
        "label": "Zero initialization",
        "target": "block.modulation",
        "note": "At initialization all modulation and final projection weights are zero. The block is exactly identity and both output branches are zero. The first two spatial channels predict epsilon; the last two are raw variance-interpolation parameters, not positive variances. Class and timestep controls hold the latent fixed.",
        "matrices": [
          {
            "label": "Input latent · channel 0",
            "values": [
              [
                1.1626142800867196,
                -0.08964593330327447,
                -1.2818679493112486,
                0.858252382858498
              ],
              [
                1.516428366605048,
                1.1679628280766112,
                1.569611110837446,
                -0.49071144227489166
              ],
              [
                -1.317656254044494,
                0.8684318074290708,
                -2.2598687287084513,
                -0.48149340839881927
              ],
              [
                -0.7131361559261371,
                -1.0837304955292957,
                0.9033751311779289,
                0.8995537822450012
              ]
            ]
          },
          {
            "label": "Attention / FFN shift, scale and gate · six rows",
            "values": [
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ]
            ]
          },
          {
            "label": "Predicted epsilon · channel 0",
            "values": [
              [
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0
              ]
            ]
          },
          {
            "label": "Raw variance parameter · channel 0",
            "values": [
              [
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Condition embedding",
            "values": [
              -1.5027184111553846,
              -1.2601057719143869,
              0.06687121108847072,
              0.26430942020142595,
              0.5072075458625862,
              0.30406866998420523,
              0.16238499543249574,
              0.07721230317228928
            ]
          }
        ],
        "metrics": [
          {
            "label": "Timestep",
            "value": 6
          },
          {
            "label": "Class ID",
            "value": 1
          },
          {
            "label": "Maximum block change from input",
            "value": 0
          },
          {
            "label": "Latent patch tokens",
            "value": 4
          }
        ]
      },
      {
        "id": "open",
        "label": "Nonzero parameter intervention",
        "target": "block.modulation",
        "note": "A seeded nonzero parameter intervention opens the block and output projection. It is not training or a released DiT checkpoint. The first two spatial channels predict epsilon; the last two are raw variance-interpolation parameters, not positive variances. Class and timestep controls hold the latent fixed.",
        "matrices": [
          {
            "label": "Input latent · channel 0",
            "values": [
              [
                1.1626142800867196,
                -0.08964593330327447,
                -1.2818679493112486,
                0.858252382858498
              ],
              [
                1.516428366605048,
                1.1679628280766112,
                1.569611110837446,
                -0.49071144227489166
              ],
              [
                -1.317656254044494,
                0.8684318074290708,
                -2.2598687287084513,
                -0.48149340839881927
              ],
              [
                -0.7131361559261371,
                -1.0837304955292957,
                0.9033751311779289,
                0.8995537822450012
              ]
            ]
          },
          {
            "label": "Attention / FFN shift, scale and gate · six rows",
            "values": [
              [
                -0.042453966171181884,
                0.03616134520246229,
                0.060297734429193534,
                0.030016228057448878,
                0.02594128602717799,
                -0.07074842565002032,
                0.01052175292202695,
                0.08744557738670018
              ],
              [
                0.0329058083346138,
                -0.04730012436269691,
                0.10713131138157544,
                0.026678274791538035,
                -0.022220326053414903,
                -0.014796162687299184,
                -0.0033141930981729507,
                -0.05037492869013893
              ],
              [
                -0.05318929401290075,
                0.05986158907831454,
                -0.004159274096037365,
                -0.003367432618828445,
                -0.019317294923955772,
                0.0017041650639760576,
                -0.0479154117560216,
                -0.04871500308074172
              ],
              [
                0.05387519478178145,
                -0.04875492316808626,
                0.04435621266805061,
                -0.061125536069570954,
                0.023794305156991668,
                0.046157797995807236,
                0.06988152001694692,
                0.037199363558995516
              ],
              [
                -0.002876016604993625,
                -0.033764021964859114,
                0.037425110709309525,
                0.06549276376507548,
                -0.021464059151804465,
                0.024652794050118835,
                0.08949303990483848,
                0.03216849548279188
              ],
              [
                0.04711250970110936,
                0.040148812725505335,
                -0.01918559331861978,
                -0.00927632866905821,
                -0.02993860280642041,
                -0.07572695672555597,
                0.004813655341067157,
                0.05243274111094015
              ]
            ]
          },
          {
            "label": "Predicted epsilon · channel 0",
            "values": [
              [
                -0.342076913111516,
                0.296629506966993,
                -0.376178662659689,
                0.18888644356402023
              ],
              [
                0.2116764390318723,
                0.2374480923397814,
                0.2667002537820606,
                0.2492978785129875
              ],
              [
                0.3932629052039246,
                0.06839584503785542,
                -0.2655385793508193,
                0.04075003332112442
              ],
              [
                0.10915815473700052,
                -0.14150966843514623,
                0.32011346870098145,
                0.6069915492770268
              ]
            ]
          },
          {
            "label": "Raw variance parameter · channel 0",
            "values": [
              [
                -0.34724966726416934,
                0.11131437439028245,
                -0.654458421874743,
                0.0805058090811192
              ],
              [
                -0.24955279700384436,
                -0.09511919447609853,
                0.21486134659710848,
                -0.3888587878399932
              ],
              [
                0.13985104713895757,
                0.22310703644427898,
                -0.6883910014101701,
                -0.1496291634178462
              ],
              [
                -0.5051366330679062,
                0.12674791661297125,
                0.5343495428557357,
                -0.46497527717632825
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Condition embedding",
            "values": [
              -1.5027184111553846,
              -1.2601057719143869,
              0.06687121108847072,
              0.26430942020142595,
              0.5072075458625862,
              0.30406866998420523,
              0.16238499543249574,
              0.07721230317228928
            ]
          }
        ],
        "metrics": [
          {
            "label": "Timestep",
            "value": 6
          },
          {
            "label": "Class ID",
            "value": 1
          },
          {
            "label": "Maximum block change from input",
            "value": 0.026694849608706717
          },
          {
            "label": "Latent patch tokens",
            "value": 4
          }
        ]
      },
      {
        "id": "class",
        "label": "Same intervention · class 2",
        "target": "block.modulation",
        "note": "A seeded nonzero parameter intervention opens the block and output projection. It is not training or a released DiT checkpoint. The first two spatial channels predict epsilon; the last two are raw variance-interpolation parameters, not positive variances. Class and timestep controls hold the latent fixed.",
        "matrices": [
          {
            "label": "Input latent · channel 0",
            "values": [
              [
                1.1626142800867196,
                -0.08964593330327447,
                -1.2818679493112486,
                0.858252382858498
              ],
              [
                1.516428366605048,
                1.1679628280766112,
                1.569611110837446,
                -0.49071144227489166
              ],
              [
                -1.317656254044494,
                0.8684318074290708,
                -2.2598687287084513,
                -0.48149340839881927
              ],
              [
                -0.7131361559261371,
                -1.0837304955292957,
                0.9033751311779289,
                0.8995537822450012
              ]
            ]
          },
          {
            "label": "Attention / FFN shift, scale and gate · six rows",
            "values": [
              [
                -0.01022496636650061,
                0.010581942719137885,
                -0.06926922244322856,
                -0.11044422953771965,
                0.03523208723085444,
                0.16819841363792348,
                -0.018250198178176594,
                0.14785166644209763
              ],
              [
                0.11632840900676468,
                -0.21232052683470556,
                0.10232996472531719,
                0.07328692238977866,
                0.13300359032936007,
                0.05011410060599942,
                0.017663217508276586,
                -0.04092980241684515
              ],
              [
                -0.019818937781545004,
                0.16788406447318743,
                -0.005743400324445931,
                -0.012399127118876863,
                0.17136094900677945,
                0.04801159728827781,
                0.10364296439234065,
                0.0363624280622239
              ],
              [
                0.09765989378381279,
                -0.007720117199491207,
                0.10185970210538926,
                0.0762767885427962,
                0.008179945791610545,
                0.12680111691929713,
                0.13104589688922713,
                -0.2197640313068736
              ],
              [
                -0.027353457005067854,
                -0.07363433065293007,
                -0.05609983070799332,
                -0.10040626644881698,
                -0.015907607684846694,
                0.00744574112199952,
                0.13985690683983423,
                -0.14428640421054012
              ],
              [
                -0.05619274335535115,
                -0.058225762086854746,
                0.01681218381959743,
                -0.07714282267042515,
                -0.07049628610455244,
                0.10278256066282185,
                -0.0984448545201469,
                -0.006857602165252847
              ]
            ]
          },
          {
            "label": "Predicted epsilon · channel 0",
            "values": [
              [
                -0.27921076099227926,
                0.2519712689147018,
                -0.33919099478499704,
                0.14611619607134327
              ],
              [
                0.2620327656959113,
                0.3017805855958651,
                0.3427048391999828,
                0.29075569505471843
              ],
              [
                0.5489519718420902,
                0.020774108927162676,
                -0.265445668630797,
                0.01796424660819109
              ],
              [
                0.15230768475262552,
                -0.1630725517643693,
                0.40814913842295775,
                0.6730005266242365
              ]
            ]
          },
          {
            "label": "Raw variance parameter · channel 0",
            "values": [
              [
                -0.3838040157003941,
                0.08202924277221649,
                -0.7323787617448938,
                0.07156098714458195
              ],
              [
                -0.19872562376032965,
                -0.12230566002457718,
                0.27655241521526047,
                -0.4231880663688633
              ],
              [
                0.1757685553049596,
                0.21485070179692872,
                -0.7862524375291253,
                -0.16829323057627518
              ],
              [
                -0.48446884650913413,
                0.13637115423333748,
                0.6036985563616866,
                -0.5093038136506494
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Condition embedding",
            "values": [
              0.7556531804126084,
              -1.5688932966145517,
              0.9724519850380938,
              -0.14219258998291423,
              -0.21417000569304728,
              0.6901680085156994,
              0.7654247071462866,
              0.7523919932948937
            ]
          }
        ],
        "metrics": [
          {
            "label": "Timestep",
            "value": 6
          },
          {
            "label": "Class ID",
            "value": 2
          },
          {
            "label": "Maximum block change from input",
            "value": 0.08313480986743937
          },
          {
            "label": "Latent patch tokens",
            "value": 4
          }
        ]
      },
      {
        "id": "time",
        "label": "Same intervention · timestep 11",
        "target": "block.modulation",
        "note": "A seeded nonzero parameter intervention opens the block and output projection. It is not training or a released DiT checkpoint. The first two spatial channels predict epsilon; the last two are raw variance-interpolation parameters, not positive variances. Class and timestep controls hold the latent fixed.",
        "matrices": [
          {
            "label": "Input latent · channel 0",
            "values": [
              [
                1.1626142800867196,
                -0.08964593330327447,
                -1.2818679493112486,
                0.858252382858498
              ],
              [
                1.516428366605048,
                1.1679628280766112,
                1.569611110837446,
                -0.49071144227489166
              ],
              [
                -1.317656254044494,
                0.8684318074290708,
                -2.2598687287084513,
                -0.48149340839881927
              ],
              [
                -0.7131361559261371,
                -1.0837304955292957,
                0.9033751311779289,
                0.8995537822450012
              ]
            ]
          },
          {
            "label": "Attention / FFN shift, scale and gate · six rows",
            "values": [
              [
                -0.06622089808889972,
                0.028940713073882535,
                0.027198939463807508,
                0.04073474669147212,
                0.007889939737034344,
                -0.08310271185862864,
                0.007382574447568992,
                0.05345210901417496
              ],
              [
                0.01737263359846803,
                -0.03456679657034425,
                0.10413606749986656,
                0.03212391738907307,
                -0.028086971025682368,
                -0.020863090084760172,
                0.006572720588617327,
                -0.04801922190083019
              ],
              [
                -0.05931984212732507,
                0.04821134773507243,
                -0.005550437980624563,
                0.009797768405752867,
                -0.01682923454182254,
                -0.0009523818252502505,
                -0.07280040773427186,
                -0.04787020242137422
              ],
              [
                0.020647950738743606,
                -0.04106625317002032,
                0.0370308593475181,
                -0.06898785489547066,
                0.03862477319490261,
                0.010543765714852549,
                0.059317483937875996,
                0.07641154700987389
              ],
              [
                0.024182369884228665,
                -0.030443753280716516,
                0.04691353133793103,
                0.07646696476563868,
                -0.04080513979824331,
                0.008063502232166554,
                0.08279193509967066,
                0.04167690323882986
              ],
              [
                0.04011667256655752,
                0.04546996109860552,
                -0.020936015376856548,
                -0.004992581874731406,
                -0.022630445462871372,
                -0.07305632946251178,
                -0.0039818281830271,
                0.05240175107233769
              ]
            ]
          },
          {
            "label": "Predicted epsilon · channel 0",
            "values": [
              [
                -0.3442993138178855,
                0.28772293674031746,
                -0.375536588786501,
                0.18084524351032102
              ],
              [
                0.20316592550036525,
                0.2253841530075995,
                0.25755908944147565,
                0.24093755327841337
              ],
              [
                0.38725830355728974,
                0.06290126165170828,
                -0.25936891176545834,
                0.0333771249940714
              ],
              [
                0.10204377602225903,
                -0.14099397739409553,
                0.30669323240083574,
                0.5961588234357365
              ]
            ]
          },
          {
            "label": "Raw variance parameter · channel 0",
            "values": [
              [
                -0.3476794406826104,
                0.12059858096752347,
                -0.6508678449106686,
                0.08764638978865624
              ],
              [
                -0.2588962882480914,
                -0.09338064113489822,
                0.20306923018467798,
                -0.38536503544733286
              ],
              [
                0.13628013739871592,
                0.22858097882050185,
                -0.6788305028043732,
                -0.1423312756189809
              ],
              [
                -0.5132930783556906,
                0.12515795473383123,
                0.522463038494717,
                -0.46123762482644415
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Condition embedding",
            "values": [
              -1.2329391058437382,
              -1.175330077989708,
              0.15706016232875258,
              0.2918437800980325,
              0.5427610595512569,
              0.21553235031958573,
              -0.1673022068224298,
              0.041183732119828065
            ]
          }
        ],
        "metrics": [
          {
            "label": "Timestep",
            "value": 11
          },
          {
            "label": "Class ID",
            "value": 1
          },
          {
            "label": "Maximum block change from input",
            "value": 0.02866442941068581
          },
          {
            "label": "Latent patch tokens",
            "value": 4
          }
        ]
      }
    ]
  },
  "revision": "331d96f24b49d20a",
  "files": {
    "graph.tensorviz.json": {
      "url": "/models/dit/331d96f24b49d20a/graph.tensorviz.json",
      "sha256": "e158066cbcc0aa974017663937df066a89525321e27606b3eb80a22ec3bf832f",
      "bytes": 115815
    },
    "model.py": {
      "url": "/models/dit/331d96f24b49d20a/model.py",
      "sha256": "28f6731c80c062f05c2bbf7266158a764af77382d11ddb24f5b30444b7426c44",
      "bytes": 9931
    },
    "run.py": {
      "url": "/models/dit/331d96f24b49d20a/run.py",
      "sha256": "231d90b34d48b495afbf6564f304fbdab12ba74830b3a873ade29cc6b0380835",
      "bytes": 733
    },
    "requirements.txt": {
      "url": "/models/dit/331d96f24b49d20a/requirements.txt",
      "sha256": "edb86016b42cb3cc6cdc0c490aab929d3bb098ced4515394f0b55766033e0daf",
      "bytes": 91
    },
    "preview.svg": {
      "url": "/models/dit/331d96f24b49d20a/preview.svg",
      "sha256": "b4186cd7bee5fd375a6333adc0ffaaf8574a517185d3ea6486201d9bbd9513bb",
      "bytes": 2067
    }
  }
}
