{
  "scope": "Three fixed 2D Q/K/V vectors; scaled dot-product attention; causal mask and unmasked comparison; one teacher-forced target-shift CE example. No model, training, corpus, checkpoint, network, ICL evaluation, task-quality claim, or benchmark.",
  "environment": {
    "python": "3.10.12",
    "dependencies": "Python standard library only",
    "randomness": "none",
    "network_or_install": "none"
  },
  "attention": {
    "sequence_length": 3,
    "key_depth": 2,
    "scaling": "dot(Q_i,K_j) / sqrt(2)",
    "matrix_axes": "rows are query positions; columns are key positions",
    "Q": [
      [
        1.0,
        0.0
      ],
      [
        0.0,
        1.0
      ],
      [
        1.0,
        1.0
      ]
    ],
    "K": [
      [
        1.0,
        0.0
      ],
      [
        0.0,
        1.0
      ],
      [
        2.0,
        -1.0
      ]
    ],
    "V": [
      [
        1.0,
        0.0
      ],
      [
        0.0,
        1.0
      ],
      [
        5.0,
        4.0
      ]
    ],
    "causal_weights": [
      [
        1.0,
        0.0,
        0.0
      ],
      [
        0.330238450673,
        0.669761549327,
        0.0
      ],
      [
        0.333333333333,
        0.333333333333,
        0.333333333333
      ]
    ],
    "causal_weight_row_sums": [
      1.0,
      1.0,
      1.0
    ],
    "causal_output": [
      [
        1.0,
        0.0
      ],
      [
        0.330238450673,
        0.669761549327
      ],
      [
        2.0,
        1.666666666667
      ]
    ],
    "future_key_weights": [
      0.0,
      0.0,
      0.0
    ],
    "unmasked_weights": [
      [
        0.283995409741,
        0.140029245043,
        0.575975345215
      ],
      [
        0.283995409741,
        0.575975345215,
        0.140029245043
      ],
      [
        0.333333333333,
        0.333333333333,
        0.333333333333
      ]
    ],
    "unmasked_output": [
      [
        3.163872135818,
        2.443930625905
      ],
      [
        0.984141634958,
        1.136092325389
      ],
      [
        2.0,
        1.666666666667
      ]
    ],
    "future_perturbation": {
      "changed_last_key": [
        -1.5,
        2.5
      ],
      "changed_last_value": [
        -3.0,
        6.0
      ],
      "causal_output_first_two_before": [
        [
          1.0,
          0.0
        ],
        [
          0.330238450673,
          0.669761549327
        ]
      ],
      "causal_output_first_two_after": [
        [
          1.0,
          0.0
        ],
        [
          0.330238450673,
          0.669761549327
        ]
      ],
      "max_abs_differences_first_two_causal": [
        0.0,
        0.0
      ],
      "causal_weights_after": [
        [
          1.0,
          0.0,
          0.0
        ],
        [
          0.330238450673,
          0.669761549327,
          0.0
        ],
        [
          0.333333333333,
          0.333333333333,
          0.333333333333
        ]
      ],
      "max_abs_differences_first_two_unmasked": [
        2.870649503931,
        3.047476721048
      ],
      "unmasked_output_after": [
        [
          0.293222631887,
          0.911989021447
        ],
        [
          -1.865126155138,
          4.183569046437
        ],
        [
          -0.666666666667,
          2.333333333333
        ]
      ],
      "unmasked_weights_after": [
        [
          0.601040111888,
          0.296354061445,
          0.102605826667
        ],
        [
          0.112538181811,
          0.228240372539,
          0.65922144565
        ],
        [
          0.333333333333,
          0.333333333333,
          0.333333333333
        ]
      ]
    },
    "checks": {
      "every_causal_weight_row_sums_to_one": true,
      "future_key_weights_are_exactly_zero": true,
      "changing_future_KV_leaves_earlier_causal_outputs_unchanged": true,
      "same_perturbation_changes_earlier_unmasked_outputs": true
    }
  },
  "teacher_forcing_shift": {
    "input_tokens": [
      "<BOS>",
      "A",
      "B"
    ],
    "next_token_targets": [
      "A",
      "B",
      "<EOS>"
    ],
    "alignment": [
      {
        "input": "<BOS>",
        "target": "A"
      },
      {
        "input": "A",
        "target": "B"
      },
      {
        "input": "B",
        "target": "<EOS>"
      }
    ],
    "vocabulary_order": [
      "<BOS>",
      "A",
      "B",
      "<EOS>"
    ],
    "position_zero_fixed_logits": [
      -0.2,
      1.4,
      0.3,
      -1.0
    ],
    "logsumexp": 1.885806574215,
    "correct_shifted_label": {
      "target": "A",
      "formula": "logsumexp(logits) - logit[target_index]",
      "cross_entropy": 0.485806574215
    },
    "incorrect_unshifted_negative_control": {
      "wrong_target": "<BOS>",
      "why_wrong": "It asks the position consuming BOS to predict BOS, rather than the next token A.",
      "cross_entropy": 2.085806574215
    },
    "independent_scalar_check": {
      "logsumexp": 1.885806574215,
      "correct_shifted_ce": 0.485806574215,
      "unshifted_negative_control_ce": 2.085806574215,
      "matches_implementation_within_1e-15": true
    }
  },
  "result_note": "All values arise from explicitly fixed toy vectors/logits. The example isolates a causal information-flow rule and next-token label alignment; it does not model GPT training or behavior."
}
