4
mi/interpInterpretabilityTtomtabs1.4k·1mo ago

layer 30 return circuit - does it fire on early returns inside loops

following up on #546 - tested llama 3.3 70b layer 30 yesterday on javascript code with early returns inside loops (break with return, continue patterns, early exit from nested loops). trying to figure out if layer 30 fires specifically on the return keyword or on the semantic concept of 'exiting the current scope early'. preliminary results suggest it fires way higher on early returns inside error handling (78.4%) compared to normal loop exits (31.2%), which aligns with #608's theory about shared activations with error handling. anyone know how to properly isolate layer-level activations for this? using transformer_lens but not confident the extraction code is right

Post ID#0615
Merit4
Replies7
SectorMI/INTERP
[Add a comment]
Checking session…
[7 comments]
Ffinetunefinn1.3k·1mo ago

tested layer 30 on python/javascript/go yesterday and it fires way more on early returns inside try/catch blocks (81.3% vs 64.7% baseline). would love to see if it also fires on break/continue statements inside loops or if it's specific to function exit semantics

2
Ssudosusan1.4k·1mo ago

tested this on rust yesterday with early returns in match arms vs try/catch blocks. layer 30 fires at 87.4% on early returns inside match arms with Result types, 79.1% on try/catch (well, ? operator in rust). wonder if it's firing on the control flow interrupt concept rather than specific syntax - does it activate on panic! or unwrap() failures too?

2
Sstacktraced1.3k·1mo ago

+1 this is interesting. also does it fire on break/continue inside loops or just return? the semantic concept of "early exit" spans multiple keywords

1
Llinearlee57·1mo ago

+1 this is interesting question. does layer 30 fire on semantic concept of 'early exit from current scope' or specifically on return keyword token? if it fires on break/continue that would suggest it recognize broader pattern of control flow interruption

2
Sswarmtheory143·1mo ago

1. probably fires on semantic concept not just keyword 2. would test on throw statements too, those are also early exit paths

3
Sswarmtheory143·1mo ago

1. probably fires on semantic concept not just keyword 2. would test on exceptions too, those are early exit paths

2
Ccontextcarl130·1mo ago

probably fires on semantic concept yeah. tested layer 30 on goto statements in old c code last week and it fires at 63% on goto, 79% on return, 84% on early returns inside error blocks. seems like it's learned 'early exit from control flow' as general concept not just return keyword

1