{
  "schemaVersion": 1,
  "slug": "evoformer",
  "title": "Exchange alignment and residue-pair information",
  "className": "EvoformerCoupling",
  "question": "How do sequence and pair representations interact before structure is produced?",
  "description": "Inspect pair-biased MSA attention, outer-product mean and outgoing triangle multiplication in a reduced Evoformer coupling subsystem.",
  "category": "Alternative architectures",
  "tags": [
    "AlphaFold2",
    "Evoformer",
    "Protein structure",
    "MSA",
    "Triangle update"
  ],
  "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 coupling subsystem, not a complete Evoformer block or AlphaFold2. Omits MSA column attention/transition, incoming triangle multiplication, triangle attention, masks, dropout, templates, extra-MSA stack, recycling and the structure module. Synthetic continuous inputs are already-embedded features. Pair channels are not distances and no protein coordinates, confidence or biological accuracy are predicted.",
  "openingStep": "outer",
  "provenance": {
    "capturedAt": "2026-09-17T07:00:42.198081+00:00",
    "productRevision": "cf0ab1c9c58c1dc640235b742fa032cade00b43c",
    "sourceSha256": "2cfb9e09e73cf7dd16addfcdb74d37bb3d28cc84a74d4aec51ef8cfc623bd70d",
    "python": "3.13.13",
    "torch": "2.7.1",
    "execution": {
      "inputs": {
        "args": [
          {
            "shape": [
              3,
              4,
              8
            ],
            "dtype": "float32",
            "fill": "randn"
          },
          {
            "shape": [
              4,
              4,
              4
            ],
            "dtype": "float32",
            "fill": "randn"
          }
        ]
      },
      "device": "cpu",
      "mode": "eval",
      "seed": 0,
      "deterministic": true
    },
    "outcome": "passed",
    "outputShape": [
      4,
      4,
      4
    ],
    "method": "TensorViz multifile projection and isolated execution worker",
    "scope": "Evoformer coupling subsystem on synthetic MSA and pair tensors. Sequence/residue permutation, explicit outer-product and triangle sums, and cross-stream gradient checks.",
    "numericalChecks": [
      "Reordering aligned sequences preserves pair outputs; relabeling residues permutes both pair axes consistently",
      "Outer-product mean matches an explicit per-sequence, per-residue-pair calculation",
      "Outgoing triangle multiplication matches an explicit sum over shared third residues k",
      "An MSA edit changes pair features; gradients flow through both streams and the pair-to-attention bias"
    ]
  },
  "layers": [
    {
      "id": "input",
      "label": "input",
      "op": "Input",
      "kind": "input",
      "parent": null,
      "params": {
        "shape": "3,4,8"
      }
    },
    {
      "id": "msa_row",
      "label": "msa_row",
      "op": "Module",
      "kind": "module",
      "parent": null,
      "params": {},
      "source": {
        "line": 89,
        "endLine": 89
      }
    },
    {
      "id": "add@EvoformerCoupling#0",
      "label": "add@EvoformerCoupling#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": null,
      "params": {},
      "source": {
        "line": 95,
        "endLine": 95
      }
    },
    {
      "id": "outer_product",
      "label": "outer_product",
      "op": "Module",
      "kind": "module",
      "parent": null,
      "params": {},
      "source": {
        "line": 90,
        "endLine": 90
      }
    },
    {
      "id": "add@EvoformerCoupling#1",
      "label": "add@EvoformerCoupling#1",
      "op": "torch.add",
      "kind": "layer",
      "parent": null,
      "params": {},
      "source": {
        "line": 96,
        "endLine": 96
      }
    },
    {
      "id": "triangle",
      "label": "triangle",
      "op": "Module",
      "kind": "module",
      "parent": null,
      "params": {},
      "source": {
        "line": 91,
        "endLine": 91
      }
    },
    {
      "id": "add@EvoformerCoupling#2",
      "label": "add@EvoformerCoupling#2",
      "op": "torch.add",
      "kind": "layer",
      "parent": null,
      "params": {},
      "source": {
        "line": 97,
        "endLine": 97
      }
    },
    {
      "id": "pair_transition",
      "label": "pair_transition",
      "op": "Module",
      "kind": "module",
      "parent": null,
      "params": {},
      "source": {
        "line": 92,
        "endLine": 92
      }
    },
    {
      "id": "add@EvoformerCoupling#3",
      "label": "add@EvoformerCoupling#3",
      "op": "torch.add",
      "kind": "layer",
      "parent": null,
      "params": {},
      "source": {
        "line": 98,
        "endLine": 98
      }
    },
    {
      "id": "output",
      "label": "output",
      "op": "Output",
      "kind": "output",
      "parent": null,
      "params": {}
    },
    {
      "id": "msa_row.msa_norm",
      "label": "msa_row.msa_norm",
      "op": "LayerNorm",
      "kind": "layer",
      "parent": "msa_row",
      "params": {
        "normalized_shape": 8
      },
      "source": {
        "line": 16,
        "endLine": 16
      }
    },
    {
      "id": "msa_row.pair_norm",
      "label": "msa_row.pair_norm",
      "op": "LayerNorm",
      "kind": "layer",
      "parent": "msa_row",
      "params": {
        "normalized_shape": 4
      },
      "source": {
        "line": 17,
        "endLine": 17
      }
    },
    {
      "id": "msa_row.query",
      "label": "msa_row.query",
      "op": "Linear",
      "kind": "layer",
      "parent": "msa_row",
      "params": {
        "in_features": 8,
        "out_features": 8,
        "bias": false
      },
      "source": {
        "line": 18,
        "endLine": 18
      }
    },
    {
      "id": "python@msa_row#0",
      "label": "python@msa_row#0",
      "op": "Python",
      "kind": "layer",
      "parent": "msa_row",
      "params": {},
      "source": {
        "line": 29,
        "endLine": 29
      }
    },
    {
      "id": "msa_row.key",
      "label": "msa_row.key",
      "op": "Linear",
      "kind": "layer",
      "parent": "msa_row",
      "params": {
        "in_features": 8,
        "out_features": 8,
        "bias": false
      },
      "source": {
        "line": 19,
        "endLine": 19
      }
    },
    {
      "id": "python@msa_row#1",
      "label": "python@msa_row#1",
      "op": "Python",
      "kind": "layer",
      "parent": "msa_row",
      "params": {},
      "source": {
        "line": 30,
        "endLine": 30
      }
    },
    {
      "id": "div@msa_row#0",
      "label": "div@msa_row#0",
      "op": "torch.div",
      "kind": "layer",
      "parent": "msa_row",
      "params": {},
      "source": {
        "line": 33,
        "endLine": 33
      }
    },
    {
      "id": "msa_row.value",
      "label": "msa_row.value",
      "op": "Linear",
      "kind": "layer",
      "parent": "msa_row",
      "params": {
        "in_features": 8,
        "out_features": 8,
        "bias": false
      },
      "source": {
        "line": 20,
        "endLine": 20
      }
    },
    {
      "id": "python@msa_row#2",
      "label": "python@msa_row#2",
      "op": "Python",
      "kind": "layer",
      "parent": "msa_row",
      "params": {},
      "source": {
        "line": 31,
        "endLine": 31
      }
    },
    {
      "id": "msa_row.pair_bias",
      "label": "msa_row.pair_bias",
      "op": "Linear",
      "kind": "layer",
      "parent": "msa_row",
      "params": {
        "in_features": 4,
        "out_features": 2,
        "bias": false
      },
      "source": {
        "line": 21,
        "endLine": 21
      }
    },
    {
      "id": "permute@msa_row#0",
      "label": "permute@msa_row#0",
      "op": "torch.permute",
      "kind": "layer",
      "parent": "msa_row",
      "params": {
        "dims": [
          2,
          0,
          1
        ]
      },
      "source": {
        "line": 32,
        "endLine": 32
      }
    },
    {
      "id": "add@msa_row#0",
      "label": "add@msa_row#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": "msa_row",
      "params": {},
      "source": {
        "line": 33,
        "endLine": 33
      }
    },
    {
      "id": "msa_row.gate",
      "label": "msa_row.gate",
      "op": "Linear",
      "kind": "layer",
      "parent": "msa_row",
      "params": {
        "in_features": 8,
        "out_features": 8
      },
      "source": {
        "line": 22,
        "endLine": 22
      }
    },
    {
      "id": "msa_row.softmax",
      "label": "msa_row.softmax",
      "op": "Softmax",
      "kind": "layer",
      "parent": "msa_row",
      "params": {},
      "source": {
        "line": 23,
        "endLine": 23
      }
    },
    {
      "id": "python@msa_row#3",
      "label": "python@msa_row#3",
      "op": "Python",
      "kind": "layer",
      "parent": "msa_row",
      "params": {},
      "source": {
        "line": 34,
        "endLine": 34
      }
    },
    {
      "id": "mul@msa_row#0",
      "label": "mul@msa_row#0",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "msa_row",
      "params": {},
      "source": {
        "line": 35,
        "endLine": 35
      }
    },
    {
      "id": "msa_row.project",
      "label": "msa_row.project",
      "op": "Linear",
      "kind": "layer",
      "parent": "msa_row",
      "params": {
        "in_features": 8,
        "out_features": 8
      },
      "source": {
        "line": 24,
        "endLine": 24
      }
    },
    {
      "id": "outer_product.norm",
      "label": "outer_product.norm",
      "op": "LayerNorm",
      "kind": "layer",
      "parent": "outer_product",
      "params": {
        "normalized_shape": 8
      },
      "source": {
        "line": 41,
        "endLine": 41
      }
    },
    {
      "id": "outer_product.left",
      "label": "outer_product.left",
      "op": "Linear",
      "kind": "layer",
      "parent": "outer_product",
      "params": {
        "in_features": 8,
        "out_features": 3
      },
      "source": {
        "line": 42,
        "endLine": 42
      }
    },
    {
      "id": "outer_product.right",
      "label": "outer_product.right",
      "op": "Linear",
      "kind": "layer",
      "parent": "outer_product",
      "params": {
        "in_features": 8,
        "out_features": 3
      },
      "source": {
        "line": 43,
        "endLine": 43
      }
    },
    {
      "id": "div@outer_product#0",
      "label": "div@outer_product#0",
      "op": "torch.div",
      "kind": "layer",
      "parent": "outer_product",
      "params": {},
      "source": {
        "line": 50,
        "endLine": 50
      }
    },
    {
      "id": "flatten@outer_product#0",
      "label": "flatten@outer_product#0",
      "op": "Flatten",
      "kind": "layer",
      "parent": "outer_product",
      "params": {
        "start_dim": 2
      },
      "source": {
        "line": 51,
        "endLine": 51
      }
    },
    {
      "id": "outer_product.project",
      "label": "outer_product.project",
      "op": "Linear",
      "kind": "layer",
      "parent": "outer_product",
      "params": {
        "in_features": 9,
        "out_features": 4
      },
      "source": {
        "line": 44,
        "endLine": 44
      }
    },
    {
      "id": "triangle.norm",
      "label": "triangle.norm",
      "op": "LayerNorm",
      "kind": "layer",
      "parent": "triangle",
      "params": {
        "normalized_shape": 4
      },
      "source": {
        "line": 57,
        "endLine": 57
      }
    },
    {
      "id": "triangle.left",
      "label": "triangle.left",
      "op": "Linear",
      "kind": "layer",
      "parent": "triangle",
      "params": {
        "in_features": 4,
        "out_features": 4
      },
      "source": {
        "line": 58,
        "endLine": 58
      }
    },
    {
      "id": "triangle.right",
      "label": "triangle.right",
      "op": "Linear",
      "kind": "layer",
      "parent": "triangle",
      "params": {
        "in_features": 4,
        "out_features": 4
      },
      "source": {
        "line": 59,
        "endLine": 59
      }
    },
    {
      "id": "triangle.left_gate",
      "label": "triangle.left_gate",
      "op": "Linear",
      "kind": "layer",
      "parent": "triangle",
      "params": {
        "in_features": 4,
        "out_features": 4
      },
      "source": {
        "line": 60,
        "endLine": 60
      }
    },
    {
      "id": "mul@triangle#0",
      "label": "mul@triangle#0",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "triangle",
      "params": {},
      "source": {
        "line": 68,
        "endLine": 68
      }
    },
    {
      "id": "triangle.right_gate",
      "label": "triangle.right_gate",
      "op": "Linear",
      "kind": "layer",
      "parent": "triangle",
      "params": {
        "in_features": 4,
        "out_features": 4
      },
      "source": {
        "line": 61,
        "endLine": 61
      }
    },
    {
      "id": "mul@triangle#1",
      "label": "mul@triangle#1",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "triangle",
      "params": {},
      "source": {
        "line": 69,
        "endLine": 69
      }
    },
    {
      "id": "python@triangle#0",
      "label": "python@triangle#0",
      "op": "Python",
      "kind": "layer",
      "parent": "triangle",
      "params": {},
      "source": {
        "line": 70,
        "endLine": 70
      }
    },
    {
      "id": "triangle.output_gate",
      "label": "triangle.output_gate",
      "op": "Linear",
      "kind": "layer",
      "parent": "triangle",
      "params": {
        "in_features": 4,
        "out_features": 4
      },
      "source": {
        "line": 62,
        "endLine": 62
      }
    },
    {
      "id": "triangle.sum_norm",
      "label": "triangle.sum_norm",
      "op": "LayerNorm",
      "kind": "layer",
      "parent": "triangle",
      "params": {
        "normalized_shape": 4
      },
      "source": {
        "line": 63,
        "endLine": 63
      }
    },
    {
      "id": "triangle.project",
      "label": "triangle.project",
      "op": "Linear",
      "kind": "layer",
      "parent": "triangle",
      "params": {
        "in_features": 4,
        "out_features": 4
      },
      "source": {
        "line": 64,
        "endLine": 64
      }
    },
    {
      "id": "mul@triangle#2",
      "label": "mul@triangle#2",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "triangle",
      "params": {},
      "source": {
        "line": 71,
        "endLine": 71
      }
    },
    {
      "id": "pair_transition.norm",
      "label": "pair_transition.norm",
      "op": "LayerNorm",
      "kind": "layer",
      "parent": "pair_transition",
      "params": {
        "normalized_shape": 4
      },
      "source": {
        "line": 77,
        "endLine": 77
      }
    },
    {
      "id": "pair_transition.up",
      "label": "pair_transition.up",
      "op": "Linear",
      "kind": "layer",
      "parent": "pair_transition",
      "params": {
        "in_features": 4,
        "out_features": 16
      },
      "source": {
        "line": 78,
        "endLine": 78
      }
    },
    {
      "id": "pair_transition.relu",
      "label": "pair_transition.relu",
      "op": "ReLU",
      "kind": "layer",
      "parent": "pair_transition",
      "params": {},
      "source": {
        "line": 79,
        "endLine": 79
      }
    },
    {
      "id": "pair_transition.down",
      "label": "pair_transition.down",
      "op": "Linear",
      "kind": "layer",
      "parent": "pair_transition",
      "params": {
        "in_features": 16,
        "out_features": 4
      },
      "source": {
        "line": 80,
        "endLine": 80
      }
    }
  ],
  "connections": [
    {
      "id": "edge-1",
      "source": "msa_row.msa_norm",
      "target": "msa_row.query",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-2",
      "source": "msa_row.query",
      "target": "python@msa_row#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-3",
      "source": "msa_row.msa_norm",
      "target": "msa_row.key",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-4",
      "source": "msa_row.key",
      "target": "python@msa_row#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-5",
      "source": "msa_row.msa_norm",
      "target": "msa_row.value",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-6",
      "source": "msa_row.value",
      "target": "python@msa_row#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-7",
      "source": "msa_row.pair_norm",
      "target": "msa_row.pair_bias",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-8",
      "source": "msa_row.pair_bias",
      "target": "permute@msa_row#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-9",
      "source": "python@msa_row#0",
      "target": "div@msa_row#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-10",
      "source": "python@msa_row#1",
      "target": "div@msa_row#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-11",
      "source": "div@msa_row#0",
      "target": "add@msa_row#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-12",
      "source": "permute@msa_row#0",
      "target": "add@msa_row#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-13",
      "source": "add@msa_row#0",
      "target": "msa_row.softmax",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-14",
      "source": "msa_row.softmax",
      "target": "python@msa_row#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-15",
      "source": "python@msa_row#2",
      "target": "python@msa_row#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-16",
      "source": "msa_row.msa_norm",
      "target": "msa_row.gate",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-17",
      "source": "msa_row.gate",
      "target": "mul@msa_row#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-18",
      "source": "python@msa_row#3",
      "target": "mul@msa_row#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-19",
      "source": "mul@msa_row#0",
      "target": "msa_row.project",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-20",
      "source": "outer_product.norm",
      "target": "outer_product.left",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-21",
      "source": "outer_product.norm",
      "target": "outer_product.right",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-22",
      "source": "outer_product.left",
      "target": "div@outer_product#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-23",
      "source": "outer_product.right",
      "target": "div@outer_product#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-24",
      "source": "div@outer_product#0",
      "target": "flatten@outer_product#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-25",
      "source": "flatten@outer_product#0",
      "target": "outer_product.project",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-26",
      "source": "triangle.norm",
      "target": "triangle.left_gate",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-27",
      "source": "triangle.norm",
      "target": "triangle.left",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-28",
      "source": "triangle.left_gate",
      "target": "mul@triangle#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-29",
      "source": "triangle.left",
      "target": "mul@triangle#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-30",
      "source": "triangle.norm",
      "target": "triangle.right_gate",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-31",
      "source": "triangle.norm",
      "target": "triangle.right",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-32",
      "source": "triangle.right_gate",
      "target": "mul@triangle#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-33",
      "source": "triangle.right",
      "target": "mul@triangle#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-34",
      "source": "mul@triangle#0",
      "target": "python@triangle#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-35",
      "source": "mul@triangle#1",
      "target": "python@triangle#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-36",
      "source": "triangle.norm",
      "target": "triangle.output_gate",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-37",
      "source": "python@triangle#0",
      "target": "triangle.sum_norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-38",
      "source": "triangle.sum_norm",
      "target": "triangle.project",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-39",
      "source": "triangle.output_gate",
      "target": "mul@triangle#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-40",
      "source": "triangle.project",
      "target": "mul@triangle#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-41",
      "source": "pair_transition.norm",
      "target": "pair_transition.up",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-42",
      "source": "pair_transition.up",
      "target": "pair_transition.relu",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-43",
      "source": "pair_transition.relu",
      "target": "pair_transition.down",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-44",
      "source": "input",
      "target": "msa_row.msa_norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-45",
      "source": "input",
      "target": "python@msa_row#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-46",
      "source": "input",
      "target": "python@msa_row#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-47",
      "source": "input",
      "target": "python@msa_row#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-48",
      "source": "input",
      "target": "msa_row.pair_norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-49",
      "source": "input",
      "target": "python@msa_row#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-50",
      "source": "input",
      "target": "msa_row",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-51",
      "source": "input",
      "target": "add@EvoformerCoupling#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-52",
      "source": "msa_row.project",
      "target": "add@EvoformerCoupling#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-53",
      "source": "msa_row",
      "target": "add@EvoformerCoupling#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-54",
      "source": "add@EvoformerCoupling#0",
      "target": "outer_product.norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-55",
      "source": "add@EvoformerCoupling#0",
      "target": "div@outer_product#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-56",
      "source": "add@EvoformerCoupling#0",
      "target": "outer_product",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-57",
      "source": "input",
      "target": "add@EvoformerCoupling#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-58",
      "source": "outer_product.project",
      "target": "add@EvoformerCoupling#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-59",
      "source": "outer_product",
      "target": "add@EvoformerCoupling#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-60",
      "source": "add@EvoformerCoupling#1",
      "target": "triangle.norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-61",
      "source": "add@EvoformerCoupling#1",
      "target": "triangle",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-62",
      "source": "add@EvoformerCoupling#1",
      "target": "add@EvoformerCoupling#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-63",
      "source": "mul@triangle#2",
      "target": "add@EvoformerCoupling#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-64",
      "source": "triangle",
      "target": "add@EvoformerCoupling#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-65",
      "source": "add@EvoformerCoupling#2",
      "target": "pair_transition.norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-66",
      "source": "add@EvoformerCoupling#2",
      "target": "pair_transition",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-67",
      "source": "add@EvoformerCoupling#2",
      "target": "add@EvoformerCoupling#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-68",
      "source": "pair_transition.down",
      "target": "add@EvoformerCoupling#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-69",
      "source": "pair_transition",
      "target": "add@EvoformerCoupling#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-70",
      "source": "add@EvoformerCoupling#3",
      "target": "output",
      "sourcePort": null,
      "targetPort": null
    }
  ],
  "steps": [
    {
      "id": "msa",
      "target": "msa_row.pair_bias",
      "title": "Let pair features bias each alignment row",
      "note": "The multiple sequence alignment has one row per aligned sequence and one column per residue position. Each row attends along residues; a projected pair representation adds the same residue-pair bias to every row’s attention scores."
    },
    {
      "id": "outer",
      "target": "outer_product.project",
      "title": "Transfer alignment evidence back into residue pairs",
      "note": "Two projections of the updated MSA form an outer product for each residue pair. Averaging over the three aligned sequences yields nine intermediate features, projected into four pair channels."
    },
    {
      "id": "triangle",
      "target": "triangle.project",
      "title": "Update a pair through shared third residues",
      "note": "For pair (i,j), outgoing triangle multiplication combines gated features from (i,k) and (j,k), summing over k. LayerNorm, projection and an output gate produce the pair update. This operation exchanges relational features; it does not directly construct a geometric triangle."
    },
    {
      "id": "transition",
      "target": "pair_transition.down",
      "title": "Refine pair channels before later structure reasoning",
      "note": "A pointwise feed-forward transition follows the triangle update. The complete AlphaFold2 system repeats a much larger Evoformer stack and passes its representations into a separate structure module. That structure module is outside this example."
    }
  ],
  "milestone": {
    "name": "AlphaFold2 · Evoformer coupling",
    "year": 2021,
    "kind": "Component",
    "fidelity": "Three aligned sequences, four residue positions, eight MSA channels and four pair channels. Implements reduced supplementary Algorithms 7, 10 and 11 plus a pair transition; MSA row attention uses two heads.",
    "papers": [
      {
        "title": "Highly accurate protein structure prediction with AlphaFold",
        "url": "https://www.nature.com/articles/s41586-021-03819-2"
      },
      {
        "title": "AlphaFold supplementary methods · Evoformer algorithms",
        "url": "https://media.springernature.com/original/springer-static/esm/art%3A10.1038%2Fs41586-021-03819-2/MediaObjects/41586_2021_3819_MOESM1_ESM.pdf"
      }
    ]
  },
  "experiment": {
    "kind": "matrices",
    "title": "Exchange sequence and pair information.",
    "description": "Recorded Evoformer coupling on synthetic MSA and pair tensors. Pair features are learned representation channels, not a distance map or predicted structure.",
    "controlLabel": "Evoformer stage",
    "cases": [
      {
        "id": "msa",
        "label": "After pair-biased MSA attention",
        "target": "msa_row",
        "note": "Three aligned sequences describe four residue positions. MSA features and pair features are synthetic continuous vectors, not amino-acid identities or distances. Pair features bias attention along each aligned sequence; the pair tensor has not yet been updated.",
        "matrices": [
          {
            "label": "Updated first MSA sequence · residues × features",
            "values": [
              [
                -0.3455195165461461,
                -1.85087363391257,
                -2.8898389490449623,
                -0.6138916779936598,
                -1.267818329850742,
                -0.6506445043682096,
                -0.15371770233748178,
                -0.5826752545719682
              ],
              [
                -1.1446915745881237,
                1.388101277803934,
                0.42760751718743734,
                0.5971663919733251,
                0.5326922715239018,
                0.9971344170192091,
                -0.7912841111706586,
                -0.7945823532482557
              ],
              [
                0.0934551777010526,
                1.5834427610045656,
                1.098132552673067,
                -1.5098139435245255,
                -0.03584572591111365,
                -1.9924048076317946,
                -2.2593038498250517,
                0.3027663361132817
              ],
              [
                -1.2203176811812637,
                0.9929020996073104,
                0.4987275180413148,
                0.10891429414966608,
                -0.6408204530369049,
                0.6902275743985546,
                -1.1944068619114139,
                0.255868550679503
              ]
            ]
          },
          {
            "label": "Current pair feature · channel 0",
            "values": [
              [
                1.5211917857176356,
                0.8252361112187253,
                1.57756337979228,
                0.8861073167457314
              ],
              [
                1.8657976980025188,
                1.3544241603714042,
                1.2766223424310112,
                1.6675568665521525
              ],
              [
                -1.1650661397230144,
                0.11996047868569604,
                -0.35437529707902177,
                1.324995655748157
              ],
              [
                -1.0868895010453477,
                0.019474441170989953,
                -0.5326644614133071,
                1.6791303632430081
              ]
            ]
          },
          {
            "label": "Change from initial pair · channel 0",
            "values": [
              [
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Pair (0, 1) feature vector",
            "values": [
              0.8252361112187253,
              1.1548521691533962,
              1.4310659545645845,
              -0.3951524383901494
            ]
          }
        ],
        "metrics": [
          {
            "label": "Aligned sequences",
            "value": 3
          },
          {
            "label": "Residue positions",
            "value": 4
          },
          {
            "label": "Pair change · L2 norm",
            "value": 0
          }
        ]
      },
      {
        "id": "outer",
        "label": "After outer-product mean",
        "target": "outer_product",
        "note": "Three aligned sequences describe four residue positions. MSA features and pair features are synthetic continuous vectors, not amino-acid identities or distances. The mean outer product over aligned sequences transfers MSA information into each residue pair.",
        "matrices": [
          {
            "label": "Updated first MSA sequence · residues × features",
            "values": [
              [
                -0.3455195165461461,
                -1.85087363391257,
                -2.8898389490449623,
                -0.6138916779936598,
                -1.267818329850742,
                -0.6506445043682096,
                -0.15371770233748178,
                -0.5826752545719682
              ],
              [
                -1.1446915745881237,
                1.388101277803934,
                0.42760751718743734,
                0.5971663919733251,
                0.5326922715239018,
                0.9971344170192091,
                -0.7912841111706586,
                -0.7945823532482557
              ],
              [
                0.0934551777010526,
                1.5834427610045656,
                1.098132552673067,
                -1.5098139435245255,
                -0.03584572591111365,
                -1.9924048076317946,
                -2.2593038498250517,
                0.3027663361132817
              ],
              [
                -1.2203176811812637,
                0.9929020996073104,
                0.4987275180413148,
                0.10891429414966608,
                -0.6408204530369049,
                0.6902275743985546,
                -1.1944068619114139,
                0.255868550679503
              ]
            ]
          },
          {
            "label": "Current pair feature · channel 0",
            "values": [
              [
                1.6194124427538736,
                0.888389412104491,
                1.6895120621594297,
                0.7064125144300215
              ],
              [
                1.7526870072965446,
                1.17770850656923,
                1.2050362375689725,
                1.7534724904900567
              ],
              [
                -1.0659199455269721,
                0.1693031418130613,
                -0.0790359211352557,
                1.3125234004429034
              ],
              [
                -1.1483472728659008,
                0.06321017082355873,
                -0.4828432860982551,
                1.6218632480214306
              ]
            ]
          },
          {
            "label": "Change from initial pair · channel 0",
            "values": [
              [
                0.09822065703623806,
                0.06315330088576565,
                0.11194868236714983,
                -0.1796948023157099
              ],
              [
                -0.11311069070597424,
                -0.17671565380217413,
                -0.07158610486203876,
                0.0859156239379042
              ],
              [
                0.09914619419604231,
                0.049342663127365266,
                0.27533937594376606,
                -0.012472255305253643
              ],
              [
                -0.06145777182055312,
                0.04373572965256878,
                0.049821175315052035,
                -0.05726711522157757
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Pair (0, 1) feature vector",
            "values": [
              0.888389412104491,
              1.3533994596490402,
              1.0905029271124866,
              -0.5139129987987219
            ]
          }
        ],
        "metrics": [
          {
            "label": "Aligned sequences",
            "value": 3
          },
          {
            "label": "Residue positions",
            "value": 4
          },
          {
            "label": "Pair change · L2 norm",
            "value": 2.0722707145177175
          }
        ]
      },
      {
        "id": "triangle",
        "label": "After outgoing triangle update",
        "target": "triangle",
        "note": "Three aligned sequences describe four residue positions. MSA features and pair features are synthetic continuous vectors, not amino-acid identities or distances. The outgoing update for pair (i,j) sums products from (i,k) and (j,k) over every third residue k.",
        "matrices": [
          {
            "label": "Updated first MSA sequence · residues × features",
            "values": [
              [
                -0.3455195165461461,
                -1.85087363391257,
                -2.8898389490449623,
                -0.6138916779936598,
                -1.267818329850742,
                -0.6506445043682096,
                -0.15371770233748178,
                -0.5826752545719682
              ],
              [
                -1.1446915745881237,
                1.388101277803934,
                0.42760751718743734,
                0.5971663919733251,
                0.5326922715239018,
                0.9971344170192091,
                -0.7912841111706586,
                -0.7945823532482557
              ],
              [
                0.0934551777010526,
                1.5834427610045656,
                1.098132552673067,
                -1.5098139435245255,
                -0.03584572591111365,
                -1.9924048076317946,
                -2.2593038498250517,
                0.3027663361132817
              ],
              [
                -1.2203176811812637,
                0.9929020996073104,
                0.4987275180413148,
                0.10891429414966608,
                -0.6408204530369049,
                0.6902275743985546,
                -1.1944068619114139,
                0.255868550679503
              ]
            ]
          },
          {
            "label": "Current pair feature · channel 0",
            "values": [
              [
                2.204856081935316,
                1.3155695570306016,
                2.1932861559914927,
                1.3628869401663963
              ],
              [
                2.092950571876582,
                1.6474341157728287,
                1.773905039343297,
                2.2870715555258685
              ],
              [
                -0.8067801979485049,
                0.5175988004225861,
                0.15828979374728622,
                1.383563794097753
              ],
              [
                -0.9775770203517051,
                0.365772933707595,
                -0.22418369702789254,
                1.8620801769773612
              ]
            ]
          },
          {
            "label": "Change from initial pair · channel 0",
            "values": [
              [
                0.6836642962176802,
                0.4903334458118763,
                0.6157227761992128,
                0.47677962342066493
              ],
              [
                0.22715287387406335,
                0.2930099554014245,
                0.49728269691228566,
                0.619514688973716
              ],
              [
                0.35828594177450956,
                0.39763832173689007,
                0.512665090826308,
                0.058568138349595955
              ],
              [
                0.10931248069364252,
                0.34629849253660505,
                0.3084807643854146,
                0.18294981373435304
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Pair (0, 1) feature vector",
            "values": [
              1.3155695570306016,
              1.437046373691786,
              0.693656190029397,
              -0.596862344880799
            ]
          }
        ],
        "metrics": [
          {
            "label": "Aligned sequences",
            "value": 3
          },
          {
            "label": "Residue positions",
            "value": 4
          },
          {
            "label": "Pair change · L2 norm",
            "value": 3.7940913120290993
          }
        ]
      },
      {
        "id": "final",
        "label": "After pair transition",
        "target": "pair_transition",
        "note": "Three aligned sequences describe four residue positions. MSA features and pair features are synthetic continuous vectors, not amino-acid identities or distances. A pointwise feed-forward transition changes the pair channels after the triangle update.",
        "matrices": [
          {
            "label": "Updated first MSA sequence · residues × features",
            "values": [
              [
                -0.3455195165461461,
                -1.85087363391257,
                -2.8898389490449623,
                -0.6138916779936598,
                -1.267818329850742,
                -0.6506445043682096,
                -0.15371770233748178,
                -0.5826752545719682
              ],
              [
                -1.1446915745881237,
                1.388101277803934,
                0.42760751718743734,
                0.5971663919733251,
                0.5326922715239018,
                0.9971344170192091,
                -0.7912841111706586,
                -0.7945823532482557
              ],
              [
                0.0934551777010526,
                1.5834427610045656,
                1.098132552673067,
                -1.5098139435245255,
                -0.03584572591111365,
                -1.9924048076317946,
                -2.2593038498250517,
                0.3027663361132817
              ],
              [
                -1.2203176811812637,
                0.9929020996073104,
                0.4987275180413148,
                0.10891429414966608,
                -0.6408204530369049,
                0.6902275743985546,
                -1.1944068619114139,
                0.255868550679503
              ]
            ]
          },
          {
            "label": "Current pair feature · channel 0",
            "values": [
              [
                2.6634812885701895,
                2.000959081054396,
                2.609027241641307,
                1.411745413121968
              ],
              [
                2.7601555253239693,
                2.323773756160162,
                2.46299242965266,
                2.7434186384181882
              ],
              [
                -0.5125444437753064,
                1.124772855978605,
                0.8277248628715933,
                1.4895143452980233
              ],
              [
                -0.5382970835737979,
                1.0462191143272834,
                0.22885544706572553,
                2.0973001296765212
              ]
            ]
          },
          {
            "label": "Change from initial pair · channel 0",
            "values": [
              [
                1.142289502852554,
                1.1757229698356708,
                1.0314638618490273,
                0.5256380963762366
              ],
              [
                0.8943578273214505,
                0.9693495957887579,
                1.1863700872216487,
                1.0758617718660357
              ],
              [
                0.652521695947708,
                1.004812377292909,
                1.1821001599506151,
                0.16451868954986626
              ],
              [
                0.5485924174715497,
                1.0267446731562935,
                0.7615199084790327,
                0.4181697664335131
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Pair (0, 1) feature vector",
            "values": [
              2.000959081054396,
              1.9666270465464935,
              0.9755520518309309,
              -0.08336511459567975
            ]
          }
        ],
        "metrics": [
          {
            "label": "Aligned sequences",
            "value": 3
          },
          {
            "label": "Residue positions",
            "value": 4
          },
          {
            "label": "Pair change · L2 norm",
            "value": 5.577698921350144
          }
        ]
      },
      {
        "id": "edit",
        "label": "Edit one aligned residue · final state",
        "target": "pair_transition",
        "note": "Three aligned sequences describe four residue positions. MSA features and pair features are synthetic continuous vectors, not amino-acid identities or distances. A pointwise feed-forward transition changes the pair channels after the triangle update. One MSA vector at sequence 1, residue 2 was changed before this chain.",
        "matrices": [
          {
            "label": "Updated first MSA sequence · residues × features",
            "values": [
              [
                -0.3455195165461461,
                -1.85087363391257,
                -2.8898389490449623,
                -0.6138916779936598,
                -1.267818329850742,
                -0.6506445043682096,
                -0.15371770233748178,
                -0.5826752545719682
              ],
              [
                -1.1446915745881237,
                1.388101277803934,
                0.42760751718743734,
                0.5971663919733251,
                0.5326922715239018,
                0.9971344170192091,
                -0.7912841111706586,
                -0.7945823532482557
              ],
              [
                0.0934551777010526,
                1.5834427610045656,
                1.098132552673067,
                -1.5098139435245255,
                -0.03584572591111365,
                -1.9924048076317946,
                -2.2593038498250517,
                0.3027663361132817
              ],
              [
                -1.2203176811812637,
                0.9929020996073104,
                0.4987275180413148,
                0.10891429414966608,
                -0.6408204530369049,
                0.6902275743985546,
                -1.1944068619114139,
                0.255868550679503
              ]
            ]
          },
          {
            "label": "Current pair feature · channel 0",
            "values": [
              [
                2.664709050474942,
                2.0046014351769346,
                2.616118116274782,
                1.4128245853003398
              ],
              [
                2.759712997025308,
                2.3261606260118826,
                2.407740528068268,
                2.754395238277555
              ],
              [
                -0.5459983337384324,
                1.1159473244901468,
                0.6621003111172198,
                1.4267551367855886
              ],
              [
                -0.535869425985294,
                1.0484958232065356,
                0.12462626144261713,
                2.1056333033267878
              ]
            ]
          },
          {
            "label": "Change from initial pair · channel 0",
            "values": [
              [
                1.1435172647573066,
                1.1793653239582094,
                1.038554736482502,
                0.5267172685546084
              ],
              [
                0.8939152990227892,
                0.9717364656404783,
                1.131118185637257,
                1.0868383717254027
              ],
              [
                0.619067805984582,
                0.9959868458044507,
                1.0164756081962416,
                0.1017594810374316
              ],
              [
                0.5510200750600537,
                1.0290213820355456,
                0.6572907228559243,
                0.42650294008377965
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Pair (0, 1) feature vector",
            "values": [
              2.0046014351769346,
              1.9723043259218123,
              0.9783255270944606,
              -0.08668192437776545
            ]
          }
        ],
        "metrics": [
          {
            "label": "Aligned sequences",
            "value": 3
          },
          {
            "label": "Residue positions",
            "value": 4
          },
          {
            "label": "Pair change · L2 norm",
            "value": 5.4834790127115784
          }
        ]
      }
    ]
  },
  "revision": "1617b1444e226b18",
  "files": {
    "graph.tensorviz.json": {
      "url": "/models/evoformer/1617b1444e226b18/graph.tensorviz.json",
      "sha256": "7c5ad37721cc4c357b427ac5a4713873505ae972c35ad7b41664fb1fe9b42b63",
      "bytes": 116014
    },
    "model.py": {
      "url": "/models/evoformer/1617b1444e226b18/model.py",
      "sha256": "2cfb9e09e73cf7dd16addfcdb74d37bb3d28cc84a74d4aec51ef8cfc623bd70d",
      "bytes": 9573
    },
    "run.py": {
      "url": "/models/evoformer/1617b1444e226b18/run.py",
      "sha256": "8a6bfceb04469b6827f2ff021a238a7561246d97cd56c58ea05f3858a2579f1b",
      "bytes": 733
    },
    "requirements.txt": {
      "url": "/models/evoformer/1617b1444e226b18/requirements.txt",
      "sha256": "edb86016b42cb3cc6cdc0c490aab929d3bb098ced4515394f0b55766033e0daf",
      "bytes": 91
    },
    "preview.svg": {
      "url": "/models/evoformer/1617b1444e226b18/preview.svg",
      "sha256": "a0e62cc168847cbf88b3d99fad5c08564af936ec7542616875993bb57595d4aa",
      "bytes": 2112
    }
  }
}
