6.3.7 · HinglishInterpretability & Explainability

Circuits and superposition

2,806 words13 min readRead in English

6.3.7 · AI-ML › Interpretability & Explainability

Circuits Kya Hain?

Circuits Kyun Bante Hain: First Principles Se

Ek neural network par gradient descent se shuru karo. Loss function saare parameters par depend karta hai, isliye:

Key insight: Saare paths equally contribute nahi karte. Gradient routing ke through, sirf kuch specific weight combinations kisi task ke liye reinforce hote hain. Training ke dauran:

  1. Specialization: Weights task-relevant paths ke saath strong connections banate hain
  2. Pruning: Irrelevant paths ke gradients near-zero hote hain, unke weights chote rehte hain
  3. Emergence: High-weight paths milke interpretable circuits banate hain

Superposition Kya Hai?

Geometry Se Superposition Capacity Derive Karna

Setup: Model ke paas dimensions hain, features represent karne hain (). Har feature probability se appear hoti hai (sparsity).

Claim: Agar features sparse hain, toh superposition ko se bahut zyada exceed karne deta hai.

Derivation:

  1. Orthogonal baseline: Har feature ke liye ek dimension dedicate karo. Capacity: exactly features. Agar features sparse hain, toh zyaatar dimensions zyaatar time zero hote hain — wasteful.

  2. Superposition alternative: Feature ko unit vector ke roop mein represent karo, chhota overlap for tolerate karte hue (ek "almost-orthogonal" set).

  3. Kitne almost-orthogonal vectors fit hote hain? Ye spherical-code / Johnson–Lindenstrauss question hai. Key, correct fact ye hai: ek fixed maximum overlap ke liye. Yaani, jinhe aap pack kar sakte ho while overlaps se neeche rakhte ho unki sankhya mein exponentially badhti hai (fixed ke liye), linearly nahi. Isliye sirf dimensions wala ek model se bahut zyada features encode kar sakta hai.

    Exponential kyun, nahi? mein random unit vectors ka pairwise overlap ke aas-paas concentrated hota hai standard deviation ke saath. Probability ki ek random pair overlap exceed kare, ki tarah decay hoti hai. pairs par union bound tab tak chhota rehta hai jab tak — isliye exponential capacity.

  4. Sparsity hi use karne layak banati hai: Kai vectors pack karna geometrically possible hai, lekin interference ke saath unhe decode karne ke liye active features kam hone chahiye. Agar ek waqt mein sirf features active hain, toh kisi bhi feature par total interference hai (random-sign accumulation). Ise signal () se neeche rakhne ke liye chhota hona chahiye — isliye sparse features → zyada usable superposition.

Neurons Polysemantic Kyun Bante Hain

Ek polysemantic neuron multiple unrelated features ke liye activate hota hai. Ye superposition ka ek consequence hai.

Mechanism:

  1. Model -dimensional space mein feature vectors seekhta hai
  2. Neuron ka activation hota hai jahan feature presence hai
  3. Agar features 3, 17, aur 42 sab neuron ke axis ke saath component rakhte hain, toh wo neuron teeno ke liye respond karta hai

Example: Ek LM neuron activate ho sakta hai:

  • Word "apple" ke liye (fruit feature)
  • Corporate tech mentions ke liye (Apple Inc. feature)
  • Color "red" ke liye (apple-color feature)

Teeno overlapping subspaces use karte hain → ek neuron teeno ko encode karne mein participate karta hai.

Circuits Aur Superposition Kaise Interact Karte Hain

Key relationship:

  • Circuits algorithm hain (computational graph)
  • Superposition storage format hai (features kaise pack hote hain)

Ek circuit "edges detect karo phir cat classify karo" implement kar sakta hai. "Edge" features 50 neurons mein superpose ho sakti hain, aur "cat" feature "dog" aur "fox" ke saath superpose ho sakti hai. Circuit specific linear combinations use karta hai un neurons ki taaki sahi features extract ho sakein.

Experimental Evidence

  1. Induction heads (Anthropic, 2022): Repeating-token circuits identify kiye gaye jo previous-token heads (earlier) aur induction heads (deeper) ke cross-layer composition se bante hain. Ablation in-context copying ko strongly degrade karta hai.

  2. Toy models mein superposition (Elhage et al., 2022): Sparse features par ReLU networks train kiye. Paya ki networks reliably dimensions se bahut zyada features superposition ke through seekhte hain jab features sufficiently sparse hoon.

  3. Vision models mein polysemanticity (Olah et al., 2020): InceptionV1 mein neurons multiple unrelated concepts ke liye respond karte hain (e.g., "car" + "dog face"). Sparse autoencoders inhe monosemantic features mein disentangle karte hain.

Recall Ek 12-Saal Ke Bacche Ko Samjhao

Socho tumhara brain 1,000 alag types ke Pokemon yaad karna chahta hai, lekin tumhare paas sirf 100 storage boxes hain. Ek Pokemon per box nahi aa sakta!

Solution: Tum notice karte ho ki tum saare Pokemon ek saath kabhi nahi dekhte — shayad kisi bhi battle mein sirf 10 appear hote hain. Toh tum ek smart labeling system banate ho: "Box 47 thoda Pikachu, thoda Charizard, aur thoda Mewtwo store karta hai." Jab Pikachu appear hota hai, tum Box 47 (aur Boxes 12, 89) mein dekhte ho aur clues combine karke Pikachu pehchante ho. Ye hai superposition: overlap use karke apni jagah se zyada cheezein store karna (kyunki cheezein ek saath nahi aati).

Circuits teri battle strategies ki tarah hain: "Agar Pikachu dikhe, Water-type use karo." Ye wo rules hain jo tum follow karte ho. Storage trick (superposition) sirf zyada Pokemon yaad rakhne mein help karti hai taaki tumhari strategies smarter ho sakein!

Connections

  • 6.3.01-Feature-visualization: Circuits features process karte hain; superposition unhe encode karta hai
  • 6.3.05-Attention-head-interpretability: Attention heads Transformers mein circuit components hain
  • 6.3.08-Concept-activation-vectors: CAVs directions probe karte hain; superposition ka matlab hai ek direction mein multiple concepts
  • 4.2.03-Sparse-autoencoders: Superposed features ko disentangle karne ke liye use hote hain
  • 2.1.02-ReLU-and-activation-functions: Nonlinearity interference ke bawajood feature recovery mein help karta hai (lekin superposition khud linear compression hai)

Flashcards

#flashcards/ai-ml

Neural network circuit kya hota hai?
Network ka ek subgraph (neurons + weighted connections) jo ek coherent, interpretable computational algorithm implement karta hai. Ise ablate karne se corresponding behavior causally toot jaata hai.
Neural networks mein superposition kya hai?
Jab ek model dimensions se zyada features represent karta hai features ko nearly-orthogonal (lekin perfectly orthogonal nahi) directions ke roop mein store karke. Ye fundamentally linear compression hai: dimensions mein features.
Sparsity usable superposition kyun enable karti hai?
Kyunki ek waqt mein sirf kuch features active hote hain, accumulated interference signal se neeche rehta hai, isliye features decodable rehte hain. Sparse features → zyada usable superposition.
mein fixed overlap ke liye roughly kitne almost-orthogonal vectors fit hote hain?
Exponentially many: . Geometric ceiling mein exponentially badhta hai, isliye ye rarely binding constraint hota hai — sparsity hoti hai.
Polysemantic neuron kya hota hai?
Ek neuron jo multiple unrelated features ke liye activate hota hai. Ye superposition ka consequence hai: multiple feature vectors ke components us neuron ke axis ke saath hote hain.
Circuit kaise identify karte hain?
(1) Behavior observe karo, (2) Hypothesize karo kaunse neurons/heads involved hain, (3) Un components ko ablate (zero out) karo, (4) Check karo ki behavior toot jaata hai ya nahi. Circuits causal necessity se define hote hain, correlation se nahi.
Transformer mein induction heads kahan hote hain, aur kyun?
Middle/deep layers mein (e.g. GPT-2 mein layers 5, 7, 9), un previous-token heads se deeper jo unhe read karte hain — cross-layer composition ke liye writer (earlier) ko reader (later) se pehle run karna hota hai.
Kya superposition ke liye nonlinear activation chahiye?
Nahi. Superposition linear compression hai ( ek linear map ke through, jaise random projections). Nonlinearity features recover/denoise karne mein help karta hai, lekin unhe superposition mein store karne ke liye zaruri nahi.
Circuits aur superposition kaise related hain?
Circuits algorithm hain (computational graph); superposition storage format hai (features kaise compress hote hain). Circuits superposed features ke linear combinations par operate karte hain.
Sirf activation magnitude se circuits kyun identify nahi kar sakte?
Kyunki (1) circuits causal paths ke baare mein hain, magnitude ke nahi, aur (2) superposition ka matlab hai same neuron multiple circuits mein participate karta hai. Causal necessity test karne ke liye ablation use karna padta hai.

Concept Map

reinforces paths

leads to

leads to

high-weight paths emerge as

leaves

properties

example

early layer

later layer

feeds residual stream to

OV circuit copies token

packs many features per neuron

enables

Gradient descent on loss

Gradient routing

Specialization of weights

Pruning weak paths

Circuits

Localized modular causal

Induction circuit

Previous-token head

Induction head

Output logits

Superposition

Compression