How LLM reads your Python?

From Transformer Circuits Perspective to Hands-On Tracing of Open-Source Models

PyCon TW 2026 · poster · Anna Liang

In one paragraph

For an engineer, a black box has a concrete definition: you cannot set a breakpoint in it. This poster shows how to set one in a 2B open-source model. Take gemma-2-2b, give it a small Python function, cut the prompt right after return, and ask which local variable it will name. Then look inside: an attention heatmap says where the model looks from the return position, an attribution graph built with circuit-tracer says what is moved toward each candidate logit, and steering one pathway down says whether it matters. Every variable name turns out to have its own pathway to its own logit; binding sets how much drive a name accumulates; scaling one pathway down flips the answer. The same probes also show where the model's picture of Python breaks: it holds the wrong rules for late binding and for which names leak out of a loop.

The theory pages give the background the poster only has room to name: the 2020 to 2025 timeline from Zoom In to attribution graphs, attention as a kernel estimator, and where the word "circuit" comes from. The practice pages hold the experiment itself: prompts, numbers, interventions, the interactive graph, and the reproduction steps.

Theory and practice

Materials

  • The poster (PDF)
  • P4 attribution graph on Neuronpedia
  • Self-hosted viewer
  • Attribution reports (JSON)
  • Code