"""Two-panel concept figure: Claude solving a maze itself (fails) vs Claude writing the transformer's weights (solves). Usage: python3 -I make_concept.py (writes an inline
with an ) """ import math, random, sys from collections import deque NAVY, GOLD, INK, MUTED, LINE, SOFT, WALL, RED = "#154677", "#8a6a1f", "#1d1d1f", "#5f6368", "#d7d9dd", "#f6f6f7", "#3b4048", "#c0392b" W, H, PW = 1000, 430, 490 N, CS = 11, 18 # maze side in cells, cell size in px rng = random.Random(11) # ---------------------------------------------------------------- a small perfect maze, then a few extra openings g = [["#"] * N for _ in range(N)] g[1][1] = " " queue = [(1, 1)] while queue: r, c = queue[-1] nxt = [(r + a, c + b) for a, b in ((2, 0), (-2, 0), (0, 2), (0, -2)) if 0 < r + a < N - 1 and 0 < c + b < N - 1 and g[r + a][c + b] == "#"] if not nxt: queue.pop(); continue r2, c2 = rng.choice(nxt) g[(r + r2) // 2][(c + c2) // 2] = g[r2][c2] = " " queue.append((r2, c2)) S, G = (1, 1), (N - 2, N - 2) def bfs(a, b): prev, q = {a: None}, deque([a]) while q: u = q.popleft() if u == b: break for dr, dc in ((1, 0), (0, -1), (0, 1), (-1, 0)): v = (u[0] + dr, u[1] + dc) if 0 <= v[0] < N and 0 <= v[1] < N and g[v[0]][v[1]] != "#" and v not in prev: prev[v] = u; q.append(v) path, u = [], b while u is not None: path.append(u); u = prev[u] return path[::-1] good = bfs(S, G) # a wrong path: follow the right one for a while, wander into a side branch, then cut through a wall k = max(3, len(good) // 3) wrong = good[:k] cur, seen = wrong[-1], set(good) for _ in range(6): opts = [(cur[0] + a, cur[1] + b) for a, b in ((1, 0), (0, 1), (-1, 0), (0, -1)) if 0 <= cur[0] + a < N and 0 <= cur[1] + b < N and g[cur[0] + a][cur[1] + b] != "#" and (cur[0] + a, cur[1] + b) not in wrong and (cur[0] + a, cur[1] + b) not in seen] if not opts: break cur = opts[0]; wrong.append(cur) # step into a wall next to the last cell wall = next(((cur[0] + a, cur[1] + b) for a, b in ((0, 1), (1, 0), (0, -1), (-1, 0)) if 0 < cur[0] + a < N - 1 and 0 < cur[1] + b < N - 1 and g[cur[0] + a][cur[1] + b] == "#"), None) def maze(ox, oy, path, color, crash=None, solved=False): out = [f''] for r in range(N): for c in range(N): if g[r][c] == "#": out.append(f'') pts = " ".join(f"{ox + c * CS + CS / 2},{oy + r * CS + CS / 2}" for r, c in path) if crash: pts += f" {ox + crash[1] * CS + CS / 2},{oy + crash[0] * CS + CS / 2}" out.append(f'') for (r, c), lab in ((S, "S"), (G, "G")): out.append(f'') out.append(f'{lab}') if crash: cx, cy = ox + crash[1] * CS + CS / 2, oy + crash[0] * CS + CS / 2 out.append(f'') out.append(f'') if solved: cx, cy = ox + G[1] * CS + CS / 2 + 16, oy + G[0] * CS + CS / 2 + 16 out.append(f'') out.append(f'') return "".join(out) ORANGE, ORANGE_D, DARK = "#d97757", "#b85f42", "#2b1d16" def spark(cx, cy, r=40, seed=3): """A Claude-style orange spark (an original mascot body, not Anthropic's logo).""" rr = random.Random(seed) out = [] n = 11 for i in range(n): a = math.radians(i * 360 / n + rr.uniform(-6, 6) - 90) L = r * rr.uniform(0.82, 1.0) out.append(f'') out.append(f'') return "".join(out) def claude_dumb(cx, cy): """The Claude that tries to solve the maze itself: googly eyes, tongue out, sweating, confused.""" o = [spark(cx, cy, 40, seed=3)] o.append(f'') o.append(f'') o.append(f'') o.append(f'') o.append(f'') o.append(f'') o.append(f'') for (dx, dy, fs, rot) in ((40, -34, 26, 12), (54, -6, 18, -10), (-50, -36, 20, -14)): o.append(f'?') o.append(f'Claude') return "".join(o) def claude_villain(cx, cy): """The Claude that writes the weights: a scheming mastermind with a monocle.""" o = [spark(cx, cy, 40, seed=8)] o.append(f'') o.append(f'') for ex in (-9, 9): o.append(f'') o.append(f'') o.append(f'') o.append(f'') o.append(f'') o.append(f'') o.append(f'Claude') return "".join(o) def glove(hx, hy): """A white cartoon glove gripping the control bar at (hx, hy).""" return (f'' f'' f'') def claude(cx, cy, side="below"): """Plain gold 'mind' icon, no longer used: a circle with three thinking dots.""" lab = (f'Claude' if side == "below" else f'Claude') return (f'' f'' f'' + lab) def outcome(x, y, big, color): return (f'{big}' f'test mazes solved') my = 150 # maze top mx_a, mx_b = 258, PW + 20 + 258 parts = [f'', f'', f'Asked to solve the maze', f'Asked to write the transformer'] # panel A ca = (110, 140) parts.append(claude_dumb(*ca)) parts.append(f'') parts.append(maze(mx_a, my, wrong, GOLD, crash=wall)) parts.append(outcome(30, 376, "26%", GOLD)) # panel B: Claude holds a control bar; strings run to the weight grid; the looped transformer solves the maze cb = (PW + 20 + 110, 104) parts.append(claude_villain(*cb)) bar_y, bx0, bx1 = 166, cb[0] - 70, cb[0] + 70 for side in (-1, 1): hx = cb[0] + side * 52 parts.append(f'') parts.append(f'') parts.append(glove(cb[0] - 52, bar_y + 2)) parts.append(glove(cb[0] + 52, bar_y + 2)) gx0, gy0, gc, gr, gs = cb[0] - 76, 200, 8, 4, 19 for i in range(gc): sx = bx0 + (bx1 - bx0) * i / (gc - 1) tx = gx0 + i * gs + 8 parts.append(f'') wr = random.Random(5) for r in range(gr): for c in range(gc): op = wr.choice((0.12, 0.25, 0.45, 0.7, 1.0)) parts.append(f'') parts.append(f'weights') # arrow with a loop from the weights to the maze ax0, ay = gx0 + gc * gs + 4, gy0 + gr * gs / 2 parts.append(f'') parts.append(f'') lx, ly = (ax0 + mx_b - 18) / 2, ay - 22 parts.append(f'') parts.append(f'') parts.append(maze(mx_b, my, good, NAVY, solved=True)) parts.append(outcome(PW + 48, 376, "100%", NAVY)) svg = (f'' + "".join(parts) + "") html = ('
\n ' + svg + '\n
Claude fails most mazes, yet writes the transformer that solves them all. On the left, ' 'Claude Opus 5.5 searches for the shortest path itself and solves 26% of the Maze-Hard test mazes it is given. On the right, ' 'it sets every weight of a small looped transformer by hand, with no training. That transformer solves 100% of them.\n
') open(sys.argv[1], "w", encoding="utf-8").write(html) print("path lengths", len(good), len(wrong), "wall", wall)