Magnitude Analysis
Skill75 starsChanged 4 months agoMITView on GitHub
Magnitude Analysis methods serve as a fundamental heuristic in interpretability, operating on the premise that internal elements with larger numerical values often exert greater influence on the model’s computation. It scores internal objects via a scalar function to identify salient components
In this repository52 other files it gives its agents.
- ablation-plannerSkill
- analyze-resultsSkill
- arxivSkill
- auto-claimSkill
- auto-experimentSkill
- auto-iteration-loopSkill
- autoSkill
- verify-pick-alternativesSkill
- auto-verifySkill
- data-ruleSkill
- experiment-auditSkill
- experiment-planSkill
- experiment-queueSkill
- finetune-hyperparameter-sweepSkill
- imageSkill
- multiple-choice-evaluationSkill
- experiment-tipsSkill
- steering-block-selectionSkill
- steering-coefficient-tuningSkill
- hypothesis-batchSkill
- idea-creatorSkill
- impact-checkSkill
- mechanic-db-searchSkill
- mechanism-auditSkill
- mechanism-behavior-discoverySkill
- mechanism-exploreSkill
- causal-attributionSkill
- CircuitSkill
- Feature Dictionary LearningSkill
- gradient-detectionSkill
- Multi-Modal InterpretabilitySkill
- Neural Feature LearningSkill
- ProbingSkill
- Representation and Parameter AnalysisSkill
- SHAPSkill
- mechanism-skillsSkill
- Vocabulary ProjectionSkill
- mguideSkill
- mhistorySkill
- monitor-experimentSkill
- msearchSkill
- next-roundSkill
- notifySkill
- novelty-checkSkill
- paper-figureSkill
- research-litSkill
- research-refine-pipelineSkill
- research-refineSkill
- research-reviewSkill
- result-to-claimSkill
- run-experimentSkill
- training-checkSkill
The file
Files
Advantage
It does not require training auxiliary classifiers or performing computationally expensive backward passes. This makes it highly scalable and suitable for analyzing large models in real-time.
Limitation
It serves primarily as a lightweight heuristic. High activation magnitude implies high presence but does not guarantee causal necessity (e.g., a high-magnitude feature might be cancelled out by a subsequent layer). Furthermore, its success relies heavily on the quality of the input data; if the dataset fails to elicit the specific behavior, the relevant components will remain dormant. Therefore, Magnitude Analysis is typically used as a “first-pass" screening tool to filter candidate objects for more rigorous verification methods.
Submethods
Given object categories, the method typically takes three forms:
- Static Parameters: In the context of model weights, Magnitude Analysis is often used to identify outliers or “heavy hitters” without running inference. Researchers typically compute perweight or per-row norms of weight matrices to highlight parameters that dominate the inner product computations. These high-magnitude weights are often associated with critical knowledge storage or outlier features. You can find a demo for this method in ./static-parameters. This demo shows rope-with-llm: Analyze and manipulate massive values in Large Language Models (LLM) attention mechanisms, particularly for understanding contextual knowledge processing in transformer models with Rotary Position Embedding (RoPE)
- Dynamic Components: For functional units whose activity varies with input, ranking them by their activation statistics helps localize specialized capabilities. You can find a demo for this method in ./dynamic-components. This demo shows language-specific-neurons: Identify and manipulate language-specific neurons in multilingual LLMs to understand and control language-specific behaviors in models like LLaMA-2, BLOOM, OPT, Mistral, and Phi-2
- Layer-wise Representation: Furthermore, measuring the magnitude of layer-wise distances reveals structural roles. Comparing representations across contrastive inputs localizes layers where task-specific information diverges most strongly, whereas comparing consecutive layers identifies layers with minimal state updates, pointing to redundant computation. You can find a demo for this method in ./layer-wise-representation. This demo shows truthx: Use this skill when you need to enhance the truthfulness of LLMs or reduce hallucinations in model outputs. This skill provides TruthX, an inference-time method that edits LLM internal representations to control truthfulness and mitigate hallucinations.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

