Test: Q steer's push is made visible in the tiny model by sharpening its attention (the video moved by rounding only)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tw9fjV3UWsHHjJiAXix29B
This commit is contained in:
digital-garbage
2026-11-05 14:48:36 +02:00
co-authored by Claude Sonnet 5.5
parent f7b1da518d
commit e3e2f5829a
@@ -53,6 +53,11 @@ def test_a_learned_direction_moves_the_picture_and_never_the_sound(tiny_h3):
attn = tiny_h3.patcher.model.diffusion_model.blocks[0].attn
liked = torch.zeros(attn.heads * attn.head_dim)
liked[::attn.head_dim] = 1.0
# The tiny model's weights are so small that attention is near uniform and a pushed query barely reaches the output
# (its video moved by float rounding only); sharpened attention in the steered block lets the push show.
for block in tiny_h3.patcher.model.diffusion_model.blocks:
for p in block.attn.parameters():
p.mul_(8)
for i, (vec, rating) in enumerate([(liked, "liked"), (-liked, "disliked")] * 2):
store.capture("fox", "q_steer", {3: vec}, prompt_id=f"t{i}")
store.rate(f"t{i}", rating)