How to mess around with neurons... a short guide
Reported by r/LocalLLaMA1 source ↓
A LocalLLaMA community member published a guide to steering individual neurons in Qwen models, with instructions for applying changes and ways to find neurons that affect outputs.
Key points
- The guide describes changing one neuron’s activation during generation rather than fine-tuning the model
- It outlines random search, gradient-based shortlisting and activation mining to find neurons to test
- The author recommends comparing other neurons and prompts to check whether an effect is specific
Details
The guide focuses on Qwen3.5-4B, which the author says has 32 layers and 9,216 neurons per layer. It explains how to add a PyTorch hook to a layer’s MLP down-projection and apply a fixed adjustment to a selected neuron during text generation.
The author describes three ways to identify neurons for testing: randomly selecting them, shortlisting them with gradients and a language-model judge, or mining activations across generated responses. The post says random search is slow and often unproductive, while activation mining appeared useful for finding topic-related neurons; the author says they have only explored that approach a little.
Written from coverage as of