AI Slop Code RIsk Monitor

TransformerLensOrg/TransformerLens

A library for mechanistic interpretability of GPT-style language models

48.5 High pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for TransformerLensOrg/TransformerLens, a Python project with 3,960 GitHub stars. SynthScan examined 255,636 lines of code across 1103 source files, recording 8380 pattern matches distributed across 24 syntactic categories. The legacy adjusted pattern signal is 48.5 (High pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

48.5
Adjusted Signal
48.5
Raw Pattern Score
100%
Time Factor
2026-10-10
Last Push
4.0K
Stars
Python
Language
255.6K
Lines of Code
1.1K
Files
8.4K
Pattern Hits
2026-10-12
Scan Date
0.34
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 74.0/100 · HIGH

Can maintainers explain intent, assumptions, and trade-offs? 6231 finding(s).

Hallucinated Dependency & Supply Chain Risk 16.2/100 · LOW

Are imports declared and package/API names verified? 810 finding(s).

Agent Over-Engineering Ratio 87.7/100 · CRITICAL

Are wrappers, guards, and repeated structures necessary? 7163 finding(s).

PR Review Velocity Impact 90.5/100 · CRITICAL

Which changes need focused human review? 8380 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 2HIGH 376MEDIUM 870LOW 7132

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 8380 distinct pattern matches across 24 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hyper-Verbose Identifiers5781 hits · 6060 pts
SeverityFileLineSnippetContext
LOWtests/conftest.py62def _enable_hf_retry_for_tests():CODE
LOWtests/tiny_checkpoints.py121def sequential_residual_params() -> list:CODE
LOWtests/unit/test_key_value_cache_entry.py45def test_init_cache_entry_dtype_independent_of_global_default():CODE
LOWtests/unit/test_key_value_cache_entry.py58def test_append_preserves_cfg_dtype():CODE
LOWtests/unit/test_key_value_cache_entry.py71def test_init_cache_entry_handles_grouped_query_attention():CODE
LOWtests/unit/test_utils.py154def test_override_or_use_default_value():CODE
LOWtests/unit/test_utils.py170def test_is_library_available():CODE
LOWtests/unit/test_utils.py304 def test_init_kaiming_uniform(self, d_model, d_mlp, nonlinearity):CODE
LOWtests/unit/test_utils.py441 def test_no_split_tokens_across_chunks(self):CODE
LOWtests/unit/test_utils.py487 def test_no_split_tokens_in_no_whitespace_text(self):CODE
LOWtests/unit/test_utils.py521 def test_single_document_batch_does_not_crash(self):CODE
LOWtests/unit/test_utils.py542 def test_iterable_dataset_with_set_format_false(self, gpt2_tokenizer):CODE
LOWtests/unit/test_utils.py574def test_tokenize_and_concatenate_no_spurious_sequence_length_warning():CODE
LOWtests/unit/test_utils.py612def test_tokenize_and_concatenate_short_sequence_no_invalid_tokens():CODE
LOWtests/unit/test_evals_ioi.py18def _make_automatic_bos_tokenizer():CODE
LOWtests/unit/test_evals_ioi.py35def test_ioi_dataset_produces_diverse_samples():CODE
LOW⚡tests/unit/test_evals_ioi.py50def test_ioi_dataset_reproducible_with_seed():CODE
LOW⚡tests/unit/test_evals_ioi.py60def test_ioi_dataset_different_seeds_differ():CODE
LOW⚡tests/unit/test_evals_ioi.py70def test_ioi_dataset_no_seed_is_valid():CODE
LOW⚡tests/unit/test_evals_ioi.py77def test_ioi_dataset_symmetric():CODE
LOW⚡tests/unit/test_evals_ioi.py84def test_ioi_dataset_prepend_bos_is_the_only_source_of_special_tokens():CODE
LOWtests/unit/test_evals_ioi.py111def test_ioi_eval_reads_logits_before_the_first_answer_token():CODE
LOWtests/unit/test_lit.py132 def test_tensor_to_numpy_tensor(self):CODE
LOWtests/unit/test_lit.py143 def test_tensor_to_numpy_array(self):CODE
LOWtests/unit/test_lit.py153 def test_tensor_to_numpy_none(self):CODE
LOWtests/unit/test_lit.py170 def test_numpy_to_tensor_with_device(self):CODE
LOWtests/unit/test_lit.py251 def test_input_field_names_drive_input_spec(self, mock_hooked_transformer):CODE
LOWtests/unit/test_lit.py290 def test_no_tokenizer_error_is_raised(self, mock_hooked_transformer):CODE
LOW⚡tests/unit/test_lit.py308 def test_simple_text_dataset_init(self, sample_examples):CODE
LOW⚡tests/unit/test_lit.py318 def test_simple_text_dataset_from_strings(self, sample_texts):CODE
LOW⚡tests/unit/test_lit.py328 def test_simple_text_dataset_spec(self, sample_examples):CODE
LOWtests/unit/test_lit.py339 def test_simple_text_dataset_missing_text(self):CODE
LOWtests/unit/test_lit.py347 def test_prompt_completion_dataset(self):CODE
LOWtests/unit/test_lit.py363 def test_prompt_completion_from_pairs(self):CODE
LOWtests/unit/test_lit.py373 def test_ioi_dataset_generate(self):CODE
LOWtests/unit/test_lit.py388 def test_induction_dataset_generate(self):CODE
LOWtests/unit/test_lit.py407 def test_default_config_drives_wrapper_behavior(self, mock_hooked_transformer):CODE
LOWtests/unit/test_lit.py452 def test_model_wrapper_invalid_model(self):CODE
LOWtests/unit/test_lit.py484 def test_model_output_spec_no_embeddings(self, mock_hooked_transformer):CODE
LOWtests/unit/test_lit.py554 def test_full_prediction_flow(self, mock_hooked_transformer):CODE
LOWtests/unit/test_lit.py568 def test_dataset_model_compatibility(self):CODE
LOWtests/unit/test_activation_cache.py158def test_compute_head_results_promotes_mixed_dtypes(CODE
LOWtests/unit/test_activation_cache.py197def test_compute_head_results_limits_temporary_allocation(CODE
LOWtests/unit/test_activation_cache.py252def test_batchless_accumulated_resid_matches_batched_row(CODE
LOWtests/unit/test_activation_cache.py283def test_get_neuron_results_projection_matches_unprojected(CODE
LOWtests/unit/test_activation_cache.py329def test_compute_head_results_handles_per_layer_cache(CODE
LOWtests/unit/test_activation_cache.py385def test_compute_head_results_requires_z_for_missing_results(CODE
LOWtests/unit/test_activation_cache.py404def test_compute_head_results_recomputes_wrong_head_count(CODE
LOWtests/unit/test_activation_cache.py438def test_stack_neuron_results_integer_neuron_slice_matches_list(CODE
LOWtests/unit/test_activation_cache.py475def test_stack_neuron_results_integer_neuron_slice_without_labels(CODE
LOWtests/unit/test_activation_cache.py495def test_logit_attrs_per_example_targets_match_individual_examples(CODE
LOWtests/unit/test_activation_cache.py552def test_logit_attrs_preserves_other_target_layouts(CODE
LOWtests/unit/test_activation_cache.py595def test_full_resid_decomposition_projected_ln_uses_mlp_input_scale(CODE
LOWtests/unit/test_activation_cache.py633def test_stack_neuron_results_projected_ln_honours_mlp_input(CODE
LOWtests/unit/test_activation_cache.py664def test_stack_neuron_results_mlp_input_remainder_fills_to_resid_mid(CODE
LOWtests/unit/test_activation_cache.py697def test_stack_head_results_does_not_warn_when_results_cached(CODE
LOWtests/unit/test_activation_cache.py723def test_stack_neuron_results_rejects_out_of_contract_remainder_layer(CODE
LOWtests/unit/test_activation_cache.py733def test_stack_neuron_results_layer_zero_remainder_is_the_whole_model(CODE
LOWtests/unit/test_activation_cache.py750def test_stack_neuron_results_mlp_input_layer_zero_remainder_is_resid_mid(CODE
LOWtests/unit/test_activation_cache.py789def test_logit_attrs_batch_slice_without_normalization(CODE
5721 more matches not shown…
Decorative Section Separators805 hits · 3075 pts
SeverityFileLineSnippetContext
MEDIUM⚡tests/unit/test_direct_path_patching.py81# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/test_direct_path_patching.py83# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/test_direct_path_patching.py241# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/test_direct_path_patching.py243# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/test_direct_path_patching.py312# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/test_direct_path_patching.py314# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/test_direct_path_patching.py405# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/test_direct_path_patching.py407# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/test_direct_path_patching.py23# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/test_direct_path_patching.py25# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/test_direct_path_patching.py185# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/test_direct_path_patching.py187# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/tools/test_model_registry.py435# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_model_registry.py437# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_model_registry.py551# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_model_registry.py553# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_model_registry.py660# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_model_registry.py662# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_model_registry.py826# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_model_registry.py828# ============================================================COMMENT
MEDIUMtests/unit/tools/test_model_registry.py18# ============================================================COMMENT
MEDIUMtests/unit/tools/test_model_registry.py20# ============================================================COMMENT
MEDIUMtests/unit/tools/test_model_registry.py105# ============================================================COMMENT
MEDIUMtests/unit/tools/test_model_registry.py107# ============================================================COMMENT
MEDIUMtests/unit/tools/test_model_registry.py321# ============================================================COMMENT
MEDIUMtests/unit/tools/test_model_registry.py323# ============================================================COMMENT
MEDIUMtests/unit/tools/test_model_registry.py624# ============================================================COMMENT
MEDIUMtests/unit/tools/test_model_registry.py626# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_relevancy.py66# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_relevancy.py68# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_relevancy.py97# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_relevancy.py99# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_relevancy.py167# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_relevancy.py169# ============================================================COMMENT
MEDIUMtests/unit/tools/test_relevancy.py18# ============================================================COMMENT
MEDIUMtests/unit/tools/test_relevancy.py20# ============================================================COMMENT
MEDIUMtests/unit/tools/test_relevancy.py40# ============================================================COMMENT
MEDIUMtests/unit/tools/test_relevancy.py42# ============================================================COMMENT
MEDIUM⚡tests/unit/tools/test_attribution_patching.py313# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/tools/test_attribution_patching.py315# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/tools/test_attribution_patching.py385# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/tools/test_attribution_patching.py387# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/tools/test_attribution_patching.py611# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/tools/test_attribution_patching.py613# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/tools/test_attribution_patching.py1649# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/tools/test_attribution_patching.py1651# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/tools/test_attribution_patching.py1883# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit/tools/test_attribution_patching.py1885# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/tools/test_attribution_patching.py229# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/tools/test_attribution_patching.py231# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/tools/test_attribution_patching.py716# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/tools/test_attribution_patching.py718# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/tools/test_attribution_patching.py837# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/tools/test_attribution_patching.py839# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/tools/test_attribution_patching.py1129# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/tools/test_attribution_patching.py1131# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/tools/test_attribution_patching.py1297# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/tools/test_attribution_patching.py1299# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/tools/test_attribution_patching.py1797# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/unit/tools/test_attribution_patching.py1799# ---------------------------------------------------------------------------COMMENT
745 more matches not shown…
Cross-File Repetition175 hits · 875 pts
SeverityFileLineSnippetContext
HIGHtests/unit/model_bridge/test_batched_moe_fold_ln.py0fold layer norms only, so any logit movement is the fold's own doing.STRING
HIGHtests/unit/model_bridge/test_fused_qkv_fold_ln.py0fold layer norms only, so any logit movement is the fold's own doing.STRING
HIGHtests/unit/model_bridge/test_lfm2_fold_ln.py0fold layer norms only, so any logit movement is the fold's own doing.STRING
HIGH…ge/supported_architectures/test_deepseek_v2_adapter.py0tests that the adapter sets the correct config flags.STRING
HIGH…bridge/supported_architectures/test_granite_adapter.py0tests that the adapter sets the correct config flags.STRING
HIGH…el_bridge/supported_architectures/test_phi3_adapter.py0tests that the adapter sets the correct config flags.STRING
HIGH…ge/supported_architectures/test_deepseek_v3_adapter.py0tests that the adapter sets the correct config flags.STRING
HIGH…ge/supported_architectures/test_deepseek_v2_adapter.py0tests that component_mapping has the correct bridge types and hf module names.STRING
HIGH…del_bridge/supported_architectures/test_neo_adapter.py0tests that component_mapping has the correct bridge types and hf module names.STRING
HIGH…el_bridge/supported_architectures/test_gpt2_adapter.py0tests that component_mapping has the correct bridge types and hf module names.STRING
HIGH…bridge/supported_architectures/test_openelm_adapter.py0tests that component_mapping has the correct bridge types and hf module names.STRING
HIGH…bridge/supported_architectures/test_granite_adapter.py0tests that component_mapping has the correct bridge types and hf module names.STRING
HIGH…el_bridge/supported_architectures/test_phi3_adapter.py0tests that component_mapping has the correct bridge types and hf module names.STRING
HIGH…ge/supported_architectures/test_deepseek_v3_adapter.py0tests that component_mapping has the correct bridge types and hf module names.STRING
HIGH…el_bridge/supported_architectures/test_neox_adapter.py0tests that component_mapping has the correct bridge types and hf module names.STRING
HIGH…idge/supported_architectures/test_internlm2_adapter.py0guards against drift toward neighbouring adapter patterns.STRING
HIGH…idge/supported_architectures/test_falcon_h1_adapter.py0guards against drift toward neighbouring adapter patterns.STRING
HIGH…dge/supported_architectures/test_nemotron_h_adapter.py0guards against drift toward neighbouring adapter patterns.STRING
HIGH…el_bridge/supported_architectures/test_xglm_adapter.py0guards against drift toward neighbouring adapter patterns.STRING
HIGH…_bridge/supported_architectures/test_cohere_adapter.py0guards against drift toward neighbouring adapter patterns.STRING
HIGH…dge/supported_architectures/test_blenderbot_adapter.py0unit tests for the pegasusarchitectureadapter. download-free: tiny synthetic configs and structural assertions only.STRING
HIGH…l_bridge/supported_architectures/test_mbart_adapter.py0unit tests for the pegasusarchitectureadapter. download-free: tiny synthetic configs and structural assertions only.STRING
HIGH…bridge/supported_architectures/test_pegasus_adapter.py0unit tests for the pegasusarchitectureadapter. download-free: tiny synthetic configs and structural assertions only.STRING
HIGH…_bridge/supported_architectures/test_gemma3_adapter.py0component bridge classes — guards against silent type substitution.STRING
HIGH…ported_architectures/test_gemma3_multimodal_adapter.py0component bridge classes — guards against silent type substitution.STRING
HIGH…l_bridge/supported_architectures/test_llava_adapter.py0component bridge classes — guards against silent type substitution.STRING
HIGH…bridge/supported_architectures/test_smollm3_adapter.py0weight_processing_conversions is optional on the base class; assert it is populated.STRING
HIGH…bridge/supported_architectures/test_mixtral_adapter.py0weight_processing_conversions is optional on the base class; assert it is populated.STRING
HIGH…l_bridge/supported_architectures/test_olmoe_adapter.py0weight_processing_conversions is optional on the base class; assert it is populated.STRING
HIGH…bridge/supported_architectures/test_smollm3_adapter.py0adapter-owned config defaults that downstream bridge code relies on.STRING
HIGH…bridge/supported_architectures/test_mixtral_adapter.py0adapter-owned config defaults that downstream bridge code relies on.STRING
HIGH…l_bridge/supported_architectures/test_qwen2_adapter.py0adapter-owned config defaults that downstream bridge code relies on.STRING
HIGH…el_bridge/supported_architectures/test_ouro_adapter.py0adapter-owned config defaults that downstream bridge code relies on.STRING
HIGH…l_bridge/supported_architectures/test_olmoe_adapter.py0adapter-owned config defaults that downstream bridge code relies on.STRING
HIGH…bridge/supported_architectures/test_smollm3_adapter.py0wire a fake attention module into the bridge and verify gqa hook shapes. spec assertions cannot prove the bridge reshapeSTRING
HIGH…ridge/supported_architectures/test_stablelm_adapter.py0wire a fake attention module into the bridge and verify gqa hook shapes. spec assertions cannot prove the bridge reshapeSTRING
HIGH…bridge/supported_architectures/test_mixtral_adapter.py0wire a fake attention module into the bridge and verify gqa hook shapes. spec assertions cannot prove the bridge reshapeSTRING
HIGH…bridge/supported_architectures/test_gpt_oss_adapter.py0wire a fake attention module into the bridge and verify gqa hook shapes. spec assertions cannot prove the bridge reshapeSTRING
HIGH…bridge/supported_architectures/test_smollm3_adapter.py0setup_component_testing wires the shared rotary embedding and forces eager attention.STRING
HIGH…bridge/supported_architectures/test_mixtral_adapter.py0setup_component_testing wires the shared rotary embedding and forces eager attention.STRING
HIGH…l_bridge/supported_architectures/test_olmoe_adapter.py0setup_component_testing wires the shared rotary embedding and forces eager attention.STRING
HIGH…bridge/supported_architectures/test_smollm3_adapter.py0bridge attention only matches hf under eager attention, so it is forced on.STRING
HIGH…bridge/supported_architectures/test_mixtral_adapter.py0bridge attention only matches hf under eager attention, so it is forced on.STRING
HIGH…l_bridge/supported_architectures/test_olmoe_adapter.py0bridge attention only matches hf under eager attention, so it is forced on.STRING
HIGH…bridge/supported_architectures/test_smollm3_adapter.py0the defensive hasattr branches must not raise when config/layers are absent.STRING
HIGH…ridge/supported_architectures/test_stablelm_adapter.py0the defensive hasattr branches must not raise when config/layers are absent.STRING
HIGH…l_bridge/supported_architectures/test_olmo2_adapter.py0the defensive hasattr branches must not raise when config/layers are absent.STRING
HIGH…bridge/supported_architectures/test_mixtral_adapter.py0the defensive hasattr branches must not raise when config/layers are absent.STRING
HIGH…l_bridge/supported_architectures/test_olmoe_adapter.py0the defensive hasattr branches must not raise when config/layers are absent.STRING
HIGH…el_bridge/supported_architectures/test_bert_adapter.py0component mapping has the correct slots, bridge types, and hf module paths.STRING
HIGH…_bridge/supported_architectures/test_falcon_adapter.py0component mapping has the correct slots, bridge types, and hf module paths.STRING
HIGH…l_bridge/supported_architectures/test_llama_adapter.py0component mapping has the correct slots, bridge types, and hf module paths.STRING
HIGH…bridge/supported_architectures/test_mistral_adapter.py0component mapping has the correct slots, bridge types, and hf module paths.STRING
HIGH…_bridge/supported_architectures/test_hubert_adapter.py0component mapping has the correct slots, bridge types, and hf module paths.STRING
HIGH…ridge/supported_architectures/test_lfm2_moe_adapter.py0unit tests for gptjarchitectureadapter. tests cover: - config attribute validation - component mapping structure - weighSTRING
HIGH…el_bridge/supported_architectures/test_lfm2_adapter.py0unit tests for gptjarchitectureadapter. tests cover: - config attribute validation - component mapping structure - weighSTRING
HIGH…del_bridge/supported_architectures/test_phi_adapter.py0unit tests for gptjarchitectureadapter. tests cover: - config attribute validation - component mapping structure - weighSTRING
HIGH…pported_architectures/test_hunyuan_v1_dense_adapter.py0unit tests for gptjarchitectureadapter. tests cover: - config attribute validation - component mapping structure - weighSTRING
HIGH…el_bridge/supported_architectures/test_gptj_adapter.py0unit tests for gptjarchitectureadapter. tests cover: - config attribute validation - component mapping structure - weighSTRING
HIGH…ridge/supported_architectures/test_lfm2_moe_adapter.py0per-layer self_attn with a mutable .config so the eager flip is observable.STRING
115 more matches not shown…
Unused Imports744 hits · 581 pts
SeverityFileLineSnippetContext
LOWeasy_transformer/__init__.py4CODE
LOWtests/goldens.py20CODE
LOWtests/goldens_capture_spec.py10CODE
LOWtests/tiny_checkpoints.py9CODE
LOWtests/unit/test_lit.py15CODE
LOWtests/unit/test_deprecation_warnings.py8CODE
LOWtests/unit/test_tracr_conversion.py1CODE
LOWtests/unit/test_activation_cache_batch_dim.py9CODE
LOWtests/unit/test_goldens_infra.py7CODE
LOWtests/unit/test_lm_utils.py3CODE
LOWtests/unit/tools/test_attribution_patching.py9CODE
LOW…unit/tools/test_direct_logit_attribution_final_norm.py3CODE
LOWtests/unit/model_bridge/test_encdec_weight_stacking.py10CODE
LOW…nit/model_bridge/test_bridge_cross_run_qkv_patching.py13CODE
LOWtests/unit/model_bridge/test_inspect_vllm_provider.py5CODE
LOWtests/unit/model_bridge/test_inspect_vllm_provider.py129CODE
LOWtests/unit/model_bridge/test_inspect_vllm_provider.py315CODE
LOWtests/unit/model_bridge/test_process_weights_reentry.py7CODE
LOWtests/unit/model_bridge/test_gated_hooks.py7CODE
LOWtests/unit/model_bridge/test_state_dict_round_trip.py14CODE
LOWtests/unit/model_bridge/test_vllm_driver.py6CODE
LOWtests/unit/model_bridge/test_model_structure_doc.py3CODE
LOWtests/unit/model_bridge/test_boot_native.py3CODE
LOWtests/unit/model_bridge/test_component_hooks_fire.py9CODE
LOWtests/unit/model_bridge/test_mistral_attn_in_fork.py9CODE
LOW…/unit/model_bridge/test_position_ids_injection_gate.py12CODE
LOW…nit/model_bridge/test_original_model_not_registered.py7CODE
LOW…sts/unit/model_bridge/test_per_head_hooks_component.py16CODE
LOW…sts/unit/model_bridge/test_tl_checkpoint_conversion.py16CODE
LOW…/model_bridge/test_bridge_cross_run_mlp_in_patching.py12CODE
LOWtests/unit/model_bridge/test_reset_hooks_registry.py3CODE
LOWtests/unit/model_bridge/test_config_flag_assignment.py3CODE
LOW…t/model_bridge/test_run_with_hooks_remove_batch_dim.py3CODE
LOWtests/unit/model_bridge/test_hook_alias_resolution.py8CODE
LOWtests/unit/model_bridge/test_caching_hooks_aliases.py8CODE
LOW…s/unit/model_bridge/test_benchmark_gated_hooks_fire.py12CODE
LOWtests/unit/model_bridge/test_vllm_plugin.py7CODE
LOWtests/unit/model_bridge/test_vllm_worker_extension.py7CODE
LOW…nit/model_bridge/test_bridge_train_mode_propagation.py9CODE
LOWtests/unit/model_bridge/test_hook_set_enforcement.py3CODE
LOWtests/unit/model_bridge/test_state_dict_composition.py3CODE
LOWtests/unit/model_bridge/test_native_features.py10CODE
LOWtests/unit/model_bridge/test_inspect_driver.py7CODE
LOW…s/unit/model_bridge/test_alias_collection_traversal.py10CODE
LOWtests/unit/model_bridge/test_t5_block_parity.py9CODE
LOWtests/unit/model_bridge/test_remote_bridge.py3CODE
LOW…sts/unit/model_bridge/test_build_bridge_from_module.py6CODE
LOWtests/unit/model_bridge/test_bridge_str.py6CODE
LOWtests/unit/model_bridge/test_driver_protocol.py2CODE
LOWtests/unit/model_bridge/test_batched_string_padding.py3CODE
LOWtests/unit/model_bridge/test_vllm_internals.py7CODE
LOW…sts/unit/model_bridge/test_caching_remove_batch_dim.py9CODE
LOW…model_bridge/test_caching_hooks_pos_slice_batch_dim.py8CODE
LOW…ts/unit/model_bridge/test_stack_block_params_hybrid.py8CODE
LOWtests/unit/model_bridge/test_vllm_boot.py7CODE
LOWtests/unit/model_bridge/test_loss_attention_mask.py3CODE
LOW…odel_bridge/supported_architectures/_pretrain_mocks.py12CODE
LOW…ridge/supported_architectures/test_pretrain_adapter.py12CODE
LOW…ridge/supported_architectures/test_wav2vec2_adapter.py9CODE
LOW…pported_architectures/test_pretrain_model_container.py15CODE
684 more matches not shown…
Empty Error Handlers77 hits · 385 pts
SeverityFileLineSnippetContext
HIGHtests/unit/test_weight_processing.py743except KeyError:CODE
HIGHtests/unit/test_generate_no_tokenizer.py164except AssertionError:CODE
HIGHtests/unit/model_bridge/test_component_hooks_fire.py162except AttributeError:CODE
HIGH…ts/integration/model_bridge/test_bridge_integration.py654except Exception:CODE
HIGH…model_bridge/compatibility/test_legacy_api_coverage.py100except Exception:CODE
HIGH…model_bridge/compatibility/test_legacy_api_coverage.py165except AttributeError:CODE
HIGH…model_bridge/compatibility/test_legacy_api_coverage.py202except Exception:CODE
HIGHtests/benchmarks/test_boot_memory.py28except FileNotFoundError:CODE
HIGH…tools/adapter_builder/scripts/validate-adapter-deep.py200except Exception:CODE
HIGHscripts/inspect_parity_report.py143except Exception:CODE
HIGHscripts/vllm_parity_report.py211except Exception:CODE
HIGHtransformer_lens/weight_processing.py1301except ValueError:CODE
HIGHtransformer_lens/weight_processing.py1337except ValueError:CODE
HIGHtransformer_lens/tools/analysis/direct_path_patching.py101except (AttributeError, TypeError):CODE
HIGHtransformer_lens/tools/model_registry/hf_scraper.py106except (ValueError, TypeError):CODE
HIGHtransformer_lens/tools/model_registry/hf_scraper.py115except (ValueError, TypeError):CODE
HIGHtransformer_lens/tools/model_registry/hf_scraper.py126except (ValueError, TypeError):CODE
HIGHtransformer_lens/tools/model_registry/verify_models.py488except Exception:CODE
HIGHtransformer_lens/tools/model_registry/verify_models.py1405except ImportError:CODE
HIGHtransformer_lens/tools/model_registry/verify_models.py877except OSError:CODE
HIGHtransformer_lens/config/transformer_lens_config.py146except (ValueError, TypeError):CODE
HIGHtransformer_lens/model_bridge/architecture_adapter.py821except Exception:CODE
HIGHtransformer_lens/model_bridge/architecture_adapter.py874except Exception:CODE
HIGHtransformer_lens/model_bridge/bridge_core.py741except AttributeError:CODE
HIGHtransformer_lens/model_bridge/bridge_core.py240except AttributeError:CODE
HIGHtransformer_lens/model_bridge/bridge_core.py1536except:CODE
HIGHtransformer_lens/model_bridge/transformer_bridge.py346except Exception:CODE
HIGHtransformer_lens/model_bridge/transformer_bridge.py503except AttributeError:CODE
HIGHtransformer_lens/model_bridge/transformer_bridge.py4336except (AttributeError, TypeError):CODE
HIGHtransformer_lens/model_bridge/transformer_bridge.py4369except (AttributeError, TypeError):CODE
HIGHtransformer_lens/model_bridge/driver_protocol.py122except (BufferError, RuntimeError, ValueError, TypeError, AttributeError):CODE
HIGHtransformer_lens/model_bridge/remote_bridge.py261except Exception:CODE
HIGHtransformer_lens/model_bridge/get_params_util.py57except (StopIteration, TypeError, AttributeError):CODE
HIGH…_lens/model_bridge/supported_architectures/pretrain.py226except AttributeError:CODE
HIGH…r_lens/model_bridge/supported_architectures/openelm.py154except NotImplementedError:CODE
HIGH…rmer_lens/model_bridge/supported_architectures/gidd.py146except Exception:CODE
HIGH…er_lens/model_bridge/supported_architectures/laguna.py109except ImportError:CODE
HIGH…_lens/model_bridge/supported_architectures/baichuan.py298except Exception:CODE
HIGH…_lens/model_bridge/supported_architectures/hrm_text.py197except (KeyError, AttributeError):CODE
HIGHtransformer_lens/model_bridge/sources/_hf_format.py120except (TypeError, ValueError):CODE
HIGHtransformer_lens/model_bridge/sources/_hf_format.py140except (TypeError, ValueError, AttributeError):CODE
HIGHtransformer_lens/model_bridge/sources/_hf_format.py156except (TypeError, ValueError, AttributeError):CODE
HIGHtransformer_lens/model_bridge/sources/_hf_format.py163except (TypeError, ValueError, AttributeError):CODE
HIGH…mer_lens/model_bridge/sources/inspect/vllm_provider.py428except Exception:CODE
HIGH…mer_lens/model_bridge/sources/inspect/vllm_provider.py434except Exception:CODE
HIGHtransformer_lens/model_bridge/sources/inspect/driver.py197except Exception:CODE
HIGH…rmer_lens/model_bridge/sources/transformers/helpers.py83except Exception:CODE
HIGH…rmer_lens/model_bridge/sources/transformers/helpers.py133except Exception:CODE
HIGH…_lens/model_bridge/generalized_components/embedding.py79except StopIteration:CODE
HIGH…ormer_lens/model_bridge/generalized_components/base.py246except AttributeError:CODE
HIGH…ormer_lens/model_bridge/generalized_components/base.py228except AttributeError:CODE
HIGH…ormer_lens/model_bridge/generalized_components/base.py452except AttributeError:CODE
HIGH…ormer_lens/model_bridge/generalized_components/base.py497except AttributeError:CODE
HIGHtransformer_lens/utilities/exploratory_utils.py163except ModuleNotFoundError:CODE
HIGHtransformer_lens/utilities/hf_utils.py231except FileNotFoundError:CODE
HIGHtransformer_lens/utilities/attn_implementation.py28except Exception:CODE
HIGHtransformer_lens/utilities/multi_gpu.py333except StopIteration:CODE
HIGHtransformer_lens/benchmarks/main_benchmark.py105except Exception:CODE
HIGHtransformer_lens/benchmarks/main_benchmark.py1770except Exception:CODE
HIGHtransformer_lens/benchmarks/main_benchmark.py466except Exception:CODE
17 more matches not shown…
Docstring Block Structure62 hits · 310 pts
SeverityFileLineSnippetContext
HIGHdocs/source/content/contributing.md188Title In Title Case. A description of what the function/class does, including as much detail as is necessary to fully uSTRING
HIGHtransformer_lens/evals.py158 Load MMLU (Massive Multitask Language Understanding) dataset. MMLU tests model performance on 57 subjects acroSTRING
HIGHtransformer_lens/evals.py524Evaluate a model on the MMLU benchmark. MMLU (Massive Multitask Language Understanding) is a benchmark for evaluatiSTRING
HIGHtransformer_lens/ActivationCache.py388Accumulated Residual Stream. Returns the accumulated residual stream at each layer/sub-layer. This is useful foSTRING
HIGHtransformer_lens/ActivationCache.py893Materialize SSM effective attention for one or all SSM layers, any family. The single discovery surface for effSTRING
HIGHtransformer_lens/ActivationCache.py953Reconstruct the recurrent SSM state ``S`` from this cache. The single discovery surface for recurrent state acrSTRING
HIGHtransformer_lens/weight_processing.py171Safely get a tensor from state_dict, handling optional parameters. This is the recommended way to access parameSTRING
HIGH…former_lens/tools/analysis/direct_logit_attribution.py195Compute Direct Logit Attribution for a prompt. Decomposes the contribution of model components to the logit of STRING
HIGH…/tools/analysis/jacobian_lens_causal_swap_benchmark.py325Runs one causal-swap trial: baseline, then real and control coordinate-patch conditions. A baseline forward pass scSTRING
HIGH…mer_lens/tools/analysis/jacobian_lens_decomposition.py380Greedily decompose ``x`` into a ``k``-sparse nonnegative combination of atoms. Args: x: Target vector, shapSTRING
HIGH…mer_lens/tools/analysis/jacobian_lens_decomposition.py571Estimate how many dictionary atoms are meaningfully active in ``x``. Runs the projection-residual recurrence descriSTRING
HIGHtransformer_lens/tools/analysis/jacobian_lens.py469Load a lens from a local path, a short model name, or a Hub repo. Resolution order ---------------- STRING
HIGHtransformer_lens/tools/analysis/jacobian_lens.py612Check that ``model`` matches this lens; raise loudly if not. Requires a raw causal ``TransformerBridge`` with tSTRING
HIGHtransformer_lens/tools/analysis/jacobian_lens.py722Read per-layer vocabulary logits for a prompt. Runs the model once with caching, transports the residual streamSTRING
HIGHtransformer_lens/tools/analysis/jacobian_lens.py908Decompose an activation into its J-space content at ``layer``. ``activation_or_prompt`` is either: - aSTRING
HIGHtransformer_lens/tools/analysis/jacobian_lens.py1120Profile the J-space share of activation variance over a prompt corpus. Each prompt is run once (caching ``blockSTRING
HIGHtransformer_lens/tools/analysis/jacobian_lens.py1534Hooks that anchor-patch one J-space coordinate live, per forward-pass position. Unlike :meth:`coordinate_patch`STRING
HIGHtransformer_lens/tools/analysis/jacobian_lens.py1655Fit a Jacobian lens on a hooked model. Implements the reference estimator exactly. For each prompt: one forwardSTRING
HIGHtransformer_lens/tools/analysis/jacobian_lens.py2158Estimator-independent J-lens drive loop. Owns the mechanics shared by every estimator: the frozen-parameter lifSTRING
HIGHtransformer_lens/tools/analysis/svd_circuits.py388Decompose a head's QK (``W_Q W_K^T``) and/or OV (``W_V W_O``) maps via SVD. Weight-space only: this reads the head'STRING
HIGHtransformer_lens/tools/analysis/svd_circuits.py534Project the top-k OV output directions through the unembedding. Requires ``head_svd.which == "OV"``: QK produces noSTRING
HIGHtransformer_lens/tools/analysis/svd_circuits.py595Signed logit effect of one OV direction's rank-1 reconstruction on the given tokens. Pure weight-space computation:STRING
HIGHtransformer_lens/tools/analysis/svd_circuits.py665Project a head's actual per-position output onto its OV singular directions. Requires ``head_svd.which == "OV"``: tSTRING
HIGHtransformer_lens/tools/analysis/svd_circuits.py860Causally validate a claimed OV subfunction by reconstructing the head's output onto it. Requires ``head_svd.which =STRING
HIGHtransformer_lens/tools/analysis/sparse_probing.py777Fit a train-only-selected k-sparse binary logistic probe. The stratified split is created before feature scoring orSTRING
HIGHtransformer_lens/tools/analysis/sparse_probing.py875Fit sparse probes and optional controls over one fixed train/test split. ``ks`` must contain strictly increasing poSTRING
HIGHtransformer_lens/tools/analysis/projection_kernel.py213Extract an explicitly ranked orthonormal column-space basis. Low-precision inputs are promoted to float32 before thSTRING
HIGHtransformer_lens/tools/analysis/logit_lens.py418Read ``d_model`` vectors through the model's final norm and unembedding. Computes ``transform(ln_final(x) @ W_U + bSTRING
HIGH…_lens/tools/analysis/jacobian_lens_coordinate_patch.py357Edit one sparse J-space coordinate while preserving its recovered frame. ``substitute`` zeros the source and replacSTRING
HIGH…_lens/tools/analysis/jacobian_lens_coordinate_patch.py508Apply :func:`solve_coordinate_patch` independently to every ``(batch, position)`` pair. ``activations`` holds one aSTRING
HIGHtransformer_lens/tools/analysis/attribution_patching.py372Enumerate the full node-granularity graph from the Bridge hook graph. The graph is *explicit*: for ``n_layers`` laySTRING
HIGHtransformer_lens/tools/analysis/attribution_patching.py457Enumerate every writer -> reader edge in the residual-stream graph. At a fixed sequence position, the residual streSTRING
HIGHtransformer_lens/tools/analysis/attribution_patching.py856Estimate every component's causal effect on ``metric_fn`` in two forwards + one backward. For each clean/corrupt paSTRING
HIGHtransformer_lens/tools/model_registry/api.py43Load a JSON file from the data directory. Args: filename: Name of the JSON file Returns: ParseSTRING
HIGHtransformer_lens/tools/model_registry/api.py136Get a list of supported models. Args: architecture: Filter by architecture ID (e.g., "GPT2LMHeadModel"). STRING
HIGHtransformer_lens/tools/model_registry/api.py170Get a list of unsupported architectures sorted by model count. Args: min_models: Minimum number of models fSTRING
HIGHtransformer_lens/tools/model_registry/api.py203Check if a model is supported by TransformerLens. Args: model_id: The HuggingFace model ID to check (e.g., STRING
HIGHtransformer_lens/tools/model_registry/api.py225Get the architecture ID for a given model. Args: model_id: The HuggingFace model ID to look up ReturnsSTRING
HIGHtransformer_lens/tools/model_registry/api.py249Get all model IDs for a given architecture. Args: architecture_id: The architecture to get models for (e.g.STRING
HIGHtransformer_lens/tools/model_registry/api.py270Suggest a similar supported model for an unsupported model ID. This function attempts to find a supported model thaSTRING
HIGHtransformer_lens/tools/model_registry/api.py333Get full information about a specific model. Args: model_id: The HuggingFace model ID to look up ReturSTRING
HIGHtransformer_lens/tools/model_registry/api.py432Check if an architecture is supported by TransformerLens. Args: architecture_id: The architecture ID to cheSTRING
HIGHtransformer_lens/tools/model_registry/validate.py595Validate a JSON file against its expected schema. This function reads a JSON file and validates it against one of tSTRING
HIGHtransformer_lens/tools/model_registry/verify_models.py244Parameter count for this model: published metadata first, else a config estimate. Fetches only metadata and the conSTRING
HIGHtransformer_lens/lit/dataset.py177Load a dataset from a text file. Each line in the file becomes one example. Args: filepathSTRING
HIGHtransformer_lens/lit/dataset.py463Generate random IOI examples. Args: n_examples: Number of examples to generate. seed: RSTRING
HIGHtransformer_lens/lit/dataset.py577Generate simple induction examples. Args: n_examples: Number of examples to generate. sSTRING
HIGHtransformer_lens/lit/utils.py95Get tokens and token IDs from a TransformerLens model. Args: model: TransformerLens model with tokenizer. STRING
HIGHtransformer_lens/lit/utils.py344Split examples into batches. Args: examples: List of example dictionaries. batch_size: Size of eachSTRING
HIGHtransformer_lens/model_bridge/architecture_adapter.py379Get a component from a remote model by its path. This method should be overridden by subclasses to provide the STRING
HIGHtransformer_lens/model_bridge/architecture_adapter.py503Get the generalized component (bridge component) for a given TransformerLens path. Args: path: The STRING
HIGHtransformer_lens/model_bridge/architecture_adapter.py576Get a component from the model using the component_mapping. Args: model: The model to extract compoSTRING
HIGHtransformer_lens/model_bridge/architecture_adapter.py633Translate a TransformerLens path to a remote model path. Args: path: The TransformerLens path to trSTRING
HIGHtransformer_lens/model_bridge/transformer_bridge.py1206Map a string that makes up a single token to the id for that token. Args: string: The string to conSTRING
HIGHtransformer_lens/model_bridge/transformer_bridge.py4142Prepare multimodal inputs using the model's processor. Converts text and images into model-ready tensors (inputSTRING
HIGH…l_bridge/generalized_components/joint_qkv_attention.py465Apply attention input hook to the input tensor. This method extracts the input tensor from args/kwargs and applSTRING
HIGH…rmer_lens/model_bridge/generalized_components/block.py225Forward pass through the block bridge. Args: *args: Input arguments **kwargs: Input keySTRING
HIGHtransformer_lens/utilities/exploratory_utils.py23Test if the Model Can Give the Correct Answer to a Prompt. Intended for exploratory analysis. Prints out the perforSTRING
HIGHtransformer_lens/utilities/slice.py147 Returns the indices when this slice is applied to an axis of size max_ctx. Returns them as a numpy array, for iSTRING
HIGHtransformer_lens/utilities/parameter_swap.py23Swap a parameter's value in place and restore it on exit, even on error. The parameter object is never replaced, soSTRING
2 more matches not shown…
Cross-Language Confusion60 hits · 290 pts
SeverityFileLineSnippetContext
HIGHtests/unit/test_patching.py265 assert df.equals(flat.index_df)CODE
HIGHtests/unit/tools/test_jacobian_lens_coordinate_patch.py548 # (near-null) direction of the atom1/atom2 pair, so recovering it needs the amplifying inverse.COMMENT
HIGH⚡tests/integration/model_bridge/test_exaone4_adapter.py100 The 1.2B fixture above is non-hybrid (sliding_window=null, RoPE everywhere)STRING
HIGH⚡docs/make_docs.py268 if (n === null || n === undefined) return null;CODE
HIGH⚡docs/make_docs.py268 if (n === null || n === undefined) return null;CODE
HIGH⚡docs/make_docs.py277 const d = cfg.hidden_size || cfg.n_embd || cfg.d_model;CODE
HIGH⚡docs/make_docs.py278 const L = cfg.num_hidden_layers || cfg.n_layer || cfg.num_layers;CODE
HIGH⚡docs/make_docs.py280 const dff = cfg.intermediate_size || cfg.d_ff;CODE
HIGH⚡docs/make_docs.py281 if (!d || !L) return null;CODE
HIGH⚡docs/make_docs.py289 if (cfg.rms_norm_eps !== undefined) return 'RMSNorm';CODE
HIGH⚡docs/make_docs.py290 if (cfg.layer_norm_epsilon !== undefined || cfg.layer_norm_eps !== undefined) return 'LayerNorm';CODE
HIGH⚡docs/make_docs.py290 if (cfg.layer_norm_epsilon !== undefined || cfg.layer_norm_eps !== undefined) return 'LayerNorm';CODE
HIGH⚡docs/make_docs.py291 if (cfg.norm_eps !== undefined) return 'LayerNorm';CODE
HIGH⚡docs/make_docs.py292 return null;CODE
HIGH⚡docs/make_docs.py297 if (cfg.rope_theta || cfg.rope_parameters || cfg.rope_scaling ||CODE
HIGH⚡docs/make_docs.py298 cfg.rotary_pct || cfg.rotary_dim || cfg.rotary_emb_base) return 'Rotary (RoPE)';CODE
HIGH⚡docs/make_docs.py299 if (cfg.partial_rotary_factor !== undefined) return 'Partial Rotary (RoPE)';CODE
HIGH⚡docs/make_docs.py301 if (cfg.alibi || cfg.position_embedding_type === 'alibi') return 'ALiBi';CODE
HIGH⚡docs/make_docs.py303 if (cfg.relative_attention_num_buckets !== undefined) return 'Relative Bias (T5)';CODE
HIGH⚡docs/make_docs.py307 if (cfg.max_position_embeddings || cfg.n_positions) return 'Learned';CODE
HIGH⚡docs/make_docs.py308 return null;CODE
HIGH⚡docs/make_docs.py313 if (cfg.parallel_attn !== undefined) return cfg.parallel_attn;CODE
HIGH⚡docs/make_docs.py318 return null;CODE
HIGH⚡docs/make_docs.py333 if (cfg.feed_forward_proj && cfg.feed_forward_proj.includes('gated')) return true;CODE
HIGH⚡docs/make_docs.py337 return null;CODE
HIGH⚡docs/make_docs.py343 if (t === null || t === undefined) return null;CODE
HIGH⚡docs/make_docs.py343 if (t === null || t === undefined) return null;CODE
HIGH⚡docs/make_docs.py346 return null;CODE
HIGH⚡docs/make_docs.py424 if (def !== null) return def;CODE
HIGH⚡docs/make_docs.py426 return null;CODE
HIGH⚡docs/make_docs.py433 return est ? fmtParam(est) + ' (est.)' : null;CODE
HIGH⚡docs/make_docs.py440 if (cfg[k] !== undefined && cfg[k] !== null) return cfg[k];CODE
HIGH⚡docs/make_docs.py440 if (cfg[k] !== undefined && cfg[k] !== null) return cfg[k];CODE
HIGH⚡docs/make_docs.py442 return null;CODE
HIGH⚡docs/make_docs.py486 if (raw === null || raw === undefined) continue;CODE
HIGH⚡docs/make_docs.py486 if (raw === null || raw === undefined) continue;CODE
HIGH⚡docs/make_docs.py492 if (raw && typeof raw === 'object') {CODE
HIGH⚡docs/make_docs.py669 const aN = (va === null || va === undefined || va === '');CODE
HIGH⚡docs/make_docs.py670 const bN = (vb === null || vb === undefined || vb === '');CODE
HIGH⚡docs/make_docs.py671 if (aN && bN) return 0;CODE
HIGHdocs/make_docs.py228 let all=[], filt=[], pg=1, dt=null, sortCol='', sortDir='asc';CODE
HIGHdocs/make_docs.py389 const classDefaults = (cls && TOKENIZER_CLASS_DEFAULTS[cls]) || {};CODE
HIGHdocs/make_docs.py394 return null;CODE
HIGHdocs/make_docs.py411 if (tok[k] !== undefined && tok[k] !== null) {CODE
HIGHdocs/make_docs.py411 if (tok[k] !== undefined && tok[k] !== null) {CODE
HIGHdocs/make_docs.py473 if (val === null || val === undefined) continue;CODE
HIGHdocs/make_docs.py473 if (val === null || val === undefined) continue;CODE
HIGHdocs/make_docs.py529 if (nextRow && nextRow.classList.contains('bt-detail-row')) {CODE
HIGHdocs/make_docs.py547 const tok = tokResult.ok ? tokResult.tok : null;CODE
HIGHdocs/make_docs.py588 if (pinned.length && rest.length) {CODE
HIGHdocs/make_docs.py594 if (cur && pc[cur]) sel.value = cur; else sel.value = '';CODE
HIGHdocs/make_docs.py634 if (a && m.architecture_id !== a) return false;CODE
HIGHdocs/make_docs.py635 if (pf && getPrefix(m.model_id) !== pf) return false;CODE
HIGHdocs/make_docs.py697 const qs = p.toString();CODE
HIGHdocs/make_docs.py698 history.replaceState(null, '', qs ? '?' + qs : location.pathname);CODE
HIGHdocs/make_docs.py766 const pages=[1]; if(tp>1) pages.push(tp);CODE
HIGHdocs/make_docs.py767 for(let i=Math.max(2,pg-1);i<=Math.min(tp-1,pg+1);i++) if(!pages.includes(i)) pages.push(i);CODE
HIGHtransformer_lens/model_bridge/transformer_bridge.py3265 # reject the paths whose cache would be wrong/undefined, with a clear pointer to theCOMMENT
HIGHtransformer_lens/utilities/statistics.py131 hits = _count_hits(null, observed, alternative)CODE
HIGHtransformer_lens/utilities/statistics.py142 hits_total = hits_total + _count_hits(null, observed, alternative)CODE
Excessive Try-Catch Wrapping187 hits · 176 pts
SeverityFileLineSnippetContext
LOWtests/goldens.py71 except Exception:CODE
LOWtests/unit/model_bridge/test_component_hooks_fire.py47 except Exception:CODE
LOWtests/unit/model_bridge/test_hook_alias_resolution.py97 except Exception as exc:CODE
LOWtests/integration/model_bridge/test_ssm_real_weights.py64 except Exception as e: # availability gate: network / missing arch / OOM / gated repoCODE
LOW…ts/integration/model_bridge/test_bridge_integration.py336 except Exception as e:CODE
LOW…ts/integration/model_bridge/test_bridge_integration.py654 except Exception:CODE
LOW…model_bridge/compatibility/test_legacy_api_coverage.py38 except Exception as e:CODE
LOW…model_bridge/compatibility/test_legacy_api_coverage.py100 except Exception:CODE
LOW…model_bridge/compatibility/test_legacy_api_coverage.py143 except Exception as e:CODE
LOW…model_bridge/compatibility/test_legacy_api_coverage.py202 except Exception:CODE
LOW…model_bridge/compatibility/test_legacy_api_coverage.py267 except Exception as e:CODE
LOW…model_bridge/compatibility/test_legacy_api_coverage.py308 except Exception as e:CODE
LOW…ce/model_bridge/compatibility/test_activation_cache.py118 except Exception as e:CODE
LOW…ce/model_bridge/compatibility/test_activation_cache.py168 except Exception as e:CODE
LOWtests/benchmarks/test_boot_memory.py37 except Exception:CODE
LOWdevtools/adapter_builder/agents/ops.sh77except Exception:CODE
LOWdevtools/adapter_builder/agents/watch-completion.sh87except Exception:CODE
LOWdevtools/adapter_builder/agents/watch-completion.sh115except Exception:CODE
LOWdevtools/adapter_builder/agents/watch-completion.sh133except Exception:CODE
LOWdevtools/adapter_builder/agents/solo-coordinator.sh206except Exception:CODE
LOWdevtools/adapter_builder/agents/solo-coordinator.sh216except Exception:CODE
LOW…pter_builder/agents/hooks/gate-reviewer-writes-file.sh70 except Exception:CODE
LOW…pter_builder/agents/hooks/gate-reviewer-writes-file.sh88except Exception:CODE
LOW…ls/adapter_builder/agents/hooks/guard-verify-models.sh93except Exception:CODE
LOWdevtools/adapter_builder/scripts/format-timeline.py67 except Exception:CODE
LOW…tools/adapter_builder/scripts/validate-adapter-deep.py126 except Exception:CODE
LOW…tools/adapter_builder/scripts/validate-adapter-deep.py200 except Exception:CODE
MEDIUM…tools/adapter_builder/scripts/validate-adapter-deep.py237 print(f"Error importing TransformerLens: {e}", file=sys.stderr)CODE
MEDIUM…tools/adapter_builder/scripts/validate-adapter-deep.py243 print(f"Error: {args.architecture} not found in SUPPORTED_ARCHITECTURES", file=sys.stderr)CODE
LOW…tools/adapter_builder/scripts/validate-adapter-deep.py265 except Exception as e:CODE
MEDIUM…tools/adapter_builder/scripts/validate-adapter-deep.py266 print(f"Error creating adapter: {e}", file=sys.stderr)CODE
LOW…tools/adapter_builder/scripts/validate-architecture.py79 except Exception:CODE
LOWscripts/bridge_multi_device_parity.py112 except Exception as exc: # gated repo, OOM, unsupported arch -> SKIP with reasonCODE
LOWscripts/inspect_parity_report.py135 except Exception as e: # download/gating/locate failures are not parity failuresCODE
LOWscripts/inspect_parity_report.py143 except Exception:CODE
LOW⚡scripts/vllm_parity_report.py193 except Exception as e: # logit synth is best-effort; don't fail parity on itCODE
LOW⚡scripts/vllm_parity_report.py203 except Exception as e: # download/gating/OOM/vLLM-unavailable are not parity failuresCODE
LOW⚡scripts/vllm_parity_report.py211 except Exception:CODE
LOWscripts/vllm_parity_report.py231 except Exception as e:CODE
LOWscripts/phase4_rerun.py169 except Exception:CODE
LOWscripts/phase4_rerun.py183 except Exception:CODE
LOWscripts/phase4_rerun.py321 except Exception as exc: # a corrupt cache must not stop verificationCODE
LOWscripts/phase4_rerun.py353 except Exception as exc:CODE
LOWscripts/phase4_rerun.py852 except Exception:CODE
MEDIUMscripts/phase4_rerun.py331def free_bytes(self) -> float:CODE
LOW⚡scripts/text_quality_judge_bakeoff.py206 except Exception as exc: # noqa: BLE001CODE
LOWtransformer_lens/evals.py235 except Exception as e:CODE
LOWtransformer_lens/tools/model_registry/registry_io.py218 except Exception:CODE
LOWtransformer_lens/tools/model_registry/registry_io.py418 except Exception:CODE
LOWtransformer_lens/tools/model_registry/hf_scraper.py275 except Exception as exc: # pragma: no cover — network/transientCODE
LOWtransformer_lens/tools/model_registry/hf_scraper.py312 except Exception as exc: # pragma: no cover — network/transientCODE
LOWtransformer_lens/tools/model_registry/hf_scraper.py594 except Exception as exc:CODE
LOWtransformer_lens/tools/model_registry/hf_scraper.py631 except Exception as e:CODE
LOWtransformer_lens/tools/model_registry/hf_scraper.py659 except Exception as exc:CODE
LOW…er_lens/tools/model_registry/discover_architectures.py76 except Exception:CODE
LOW⚡transformer_lens/tools/model_registry/verify_models.py1040 except Exception as e:CODE
LOWtransformer_lens/tools/model_registry/verify_models.py235 except Exception:CODE
LOWtransformer_lens/tools/model_registry/verify_models.py488 except Exception:CODE
LOWtransformer_lens/tools/model_registry/verify_models.py971 except Exception as e:CODE
LOWtransformer_lens/tools/model_registry/verify_models.py1099 except Exception as e:CODE
127 more matches not shown…
Deep Nesting166 hits · 134 pts
SeverityFileLineSnippetContext
LOWtests/unit/test_activation_cache.py552CODE
LOWtests/unit/tools/test_jacobian_lens_decomposition.py248CODE
LOWtests/unit/tools/conftest.py151CODE
LOWtests/unit/tools/test_attribution_patching.py141CODE
LOWtests/unit/factored_matrix/test_get_item.py218CODE
LOWtests/unit/model_bridge/test_batched_moe_fold_ln.py115CODE
LOWtests/unit/model_bridge/test_fused_qkv_fold_ln.py239CODE
LOWtests/unit/model_bridge/test_boot_native.py596CODE
LOWtests/unit/model_bridge/test_boot_native.py904CODE
LOWtests/unit/model_bridge/test_component_hooks_fire.py123CODE
LOWtests/unit/model_bridge/test_hook_alias_resolution.py92CODE
LOWtests/unit/model_bridge/test_inspect_driver.py833CODE
LOWtests/unit/benchmarks/test_text_quality_scoring.py293CODE
LOWtests/unit/benchmarks/test_text_quality_scoring.py569CODE
LOW…tils/conversion_steps/test_repeat_tensor_conversion.py33CODE
LOWtests/integration/test_hook_shape_compatibility.py122CODE
LOW…tegration/model_bridge/test_optimizer_compatibility.py119CODE
LOW…ion/model_bridge/test_encdec_weight_stacking_parity.py42CODE
LOW…ce/model_bridge/compatibility/test_activation_cache.py61CODE
LOWtests/benchmarks/test_boot_memory.py16CODE
LOWdevtools/adapter_builder/scripts/format-timeline.py25CODE
LOW…tools/adapter_builder/scripts/validate-adapter-deep.py23CODE
LOW…tools/adapter_builder/scripts/validate-adapter-deep.py90CODE
LOW…tools/adapter_builder/scripts/validate-adapter-deep.py144CODE
LOWdevtools/adapter_builder/scripts/analyze-hf-model.py138CODE
LOWscripts/bridge_multi_device_parity.py53CODE
LOWscripts/inspect_parity_report.py83CODE
LOWscripts/vllm_parity_report.py106CODE
LOWscripts/phase4_rerun.py504CODE
LOWtransformer_lens/HookedRootModule.py447CODE
LOWtransformer_lens/patching.py262CODE
LOWtransformer_lens/ActivationCache.py204CODE
LOWtransformer_lens/ActivationCache.py1251CODE
LOWtransformer_lens/ActivationCache.py1497CODE
LOWtransformer_lens/weight_processing.py109CODE
LOWtransformer_lens/weight_processing.py320CODE
LOWtransformer_lens/weight_processing.py475CODE
LOWtransformer_lens/weight_processing.py626CODE
LOWtransformer_lens/weight_processing.py1076CODE
LOWtransformer_lens/weight_processing.py1176CODE
LOWtransformer_lens/weight_processing.py1453CODE
LOWtransformer_lens/weight_processing.py1626CODE
LOWtransformer_lens/weight_processing.py1931CODE
LOWtransformer_lens/weight_processing.py2065CODE
LOWtransformer_lens/weight_processing.py2149CODE
LOWtransformer_lens/tools/analysis/jacobian_lens.py1109CODE
LOWtransformer_lens/tools/analysis/logit_lens.py406CODE
LOWtransformer_lens/tools/analysis/logit_lens.py212CODE
LOW…_lens/tools/analysis/jacobian_lens_coordinate_patch.py494CODE
LOWtransformer_lens/tools/analysis/attribution_patching.py849CODE
LOWtransformer_lens/tools/analysis/attribution_patching.py100CODE
LOWtransformer_lens/tools/model_registry/registry_io.py279CODE
LOWtransformer_lens/tools/model_registry/hf_scraper.py86CODE
LOWtransformer_lens/tools/model_registry/hf_scraper.py132CODE
LOWtransformer_lens/tools/model_registry/hf_scraper.py246CODE
LOWtransformer_lens/tools/model_registry/hf_scraper.py320CODE
LOWtransformer_lens/tools/model_registry/validate.py207CODE
LOWtransformer_lens/tools/model_registry/validate.py594CODE
LOW…ansformer_lens/tools/model_registry/generate_report.py187CODE
LOW…ansformer_lens/tools/model_registry/generate_report.py212CODE
106 more matches not shown…
Self-Referential Comments41 hits · 125 pts
SeverityFileLineSnippetContext
MEDIUM⚡tests/unit/test_hook_points.py129 # Create a test hook conversionCOMMENT
MEDIUM⚡tests/unit/test_hook_points.py137 # Create a simple test module that uses HookPointCOMMENT
MEDIUMtests/unit/test_hook_points.py178 # Create a test hook conversionCOMMENT
MEDIUMtests/unit/test_hook_points.py445 # Create a complex setup with multiple hooksCOMMENT
MEDIUMtests/unit/test_weight_processing.py761 # Create a state dict with known values for deterministic testingCOMMENT
MEDIUMtests/unit/model_bridge/test_gpt_oss_moe.py144 # Create a small GPT-OSS config with random weightsCOMMENT
MEDIUM⚡tests/unit/model_bridge/test_component_setup.py65 # Create a component with submodulesCOMMENT
MEDIUMtests/unit/model_bridge/test_component_setup.py94 # Create a component with nested submodulesCOMMENT
MEDIUMtests/unit/model_bridge/test_component_setup.py267 # Create a simpler adapter without outer_blocks for this testCOMMENT
MEDIUMtests/unit/model_bridge/test_get_params_util.py16 # Create a mock bridge with basic componentsCOMMENT
MEDIUMtests/unit/model_bridge/test_get_params_util.py49 # Create a mock bridge with missing componentsCOMMENT
MEDIUMtests/unit/model_bridge/test_end_to_end_bridge.py21 # Create a mock model with different naming conventionsCOMMENT
MEDIUMtests/unit/model_bridge/test_end_to_end_bridge.py44 # Create the bridgeCOMMENT
MEDIUM…l_bridge/supported_architectures/test_bd3lm_adapter.py179 # Create a mock model matching the real BD3LM structureCOMMENT
MEDIUM…dge/generalized_components/test_joint_qkv_attention.py99 # Create a mock linear layer for testingCOMMENT
MEDIUM…dge/generalized_components/test_joint_qkv_attention.py118 # Create a mock attention layer for testing, doesn't do anything because we're only interested in the QKV componCOMMENT
MEDIUM…dge/generalized_components/test_joint_qkv_attention.py140 # Create a hook that returns the inputCOMMENT
MEDIUM…dge/generalized_components/test_joint_qkv_attention.py181 # Create a mock linear layer for testingCOMMENT
MEDIUM…dge/generalized_components/test_joint_qkv_attention.py200 # Create a mock attention layer for testing, doesn't do anything because we're only interested in the QKV componCOMMENT
MEDIUM…dge/generalized_components/test_joint_qkv_attention.py223 # Create a hook that returns the inputCOMMENT
MEDIUM…dge/generalized_components/test_joint_qkv_attention.py264 # Create a mock linear layer for testingCOMMENT
MEDIUM…dge/generalized_components/test_joint_qkv_attention.py283 # Create a mock attention layer for testing, doesn't do anything because we're only interested in the QKV componCOMMENT
MEDIUM…dge/generalized_components/test_joint_qkv_attention.py306 # Create a hook that returns the inputCOMMENT
MEDIUMtests/unit/utilities/test_aliases.py203 # Create a mock module structureCOMMENT
MEDIUMtests/unit/utilities/test_aliases.py241 # Create a mock module structure that mimics real bridge componentsCOMMENT
MEDIUMtests/unit/utilities/test_aliases.py320 # Create a class that will actually raise AttributeErrorCOMMENT
MEDIUM⚡tests/unit/utilities/test_cache.py26 # Create a real cache entry with 0 positionsCOMMENT
MEDIUMtests/unit/utilities/test_cache.py41 # Create a real cache entry with 1 positionCOMMENT
MEDIUMtests/unit/utilities/test_cache.py56 # Create a real cache entry with multiple positionsCOMMENT
MEDIUMtests/unit/utilities/test_cache.py71 # Create a real cache entry with many positionsCOMMENT
MEDIUM…ts/integration/model_bridge/test_bridge_integration.py189 # Create a custom QKV conversion ruleCOMMENT
MEDIUM…ts/integration/model_bridge/test_bridge_integration.py577 # Create a simple backward hook that tracks if it was calledCOMMENT
MEDIUM…model_bridge/compatibility/test_legacy_api_coverage.py289 # Create a longer prompt (but not too long to avoid timeouts)COMMENT
MEDIUMtransformer_lens/hook_points.py224 # Create a simple wrapper that acts like a HookPoint but with a different nameCOMMENT
MEDIUMtransformer_lens/hook_points.py228 # Create a view of this HookPoint with the alias nameCOMMENT
MEDIUMtransformer_lens/patching.py489 # Create an empty tensor to show the patched metric for each patchCOMMENT
MEDIUMtransformer_lens/lit/__init__.py15 >>> # Create a datasetSTRING
MEDIUMtransformer_lens/lit/dataset.py10 >>> # Create a dataset from examplesSTRING
MEDIUMtransformer_lens/lit/dataset.py559 # Create the full text: pattern + separator + repeated startCOMMENT
MEDIUM…ormer_lens/model_bridge/generalized_components/base.py369 # Create a new parameter from the weight tensorCOMMENT
MEDIUMtransformer_lens/benchmarks/encoder_common.py249 # Create a slightly perturbed versionCOMMENT
Modern Structural Boilerplate94 hits · 88 pts
SeverityFileLineSnippetContext
LOW⚡tests/unit/tools/test_attribution_patching.py979 def set_use_attn_result(self, use_attn_result: bool) -> None:CODE
LOW⚡tests/unit/tools/test_attribution_patching.py982 def set_use_split_qkv_input(self, use_split_qkv_input: bool) -> None:CODE
LOW⚡tests/unit/tools/test_attribution_patching.py987 def set_use_hook_mlp_in(self, use_hook_mlp_in: bool) -> None:CODE
LOW⚡tests/unit/tools/test_attribution_patching.py990 def set_use_attn_in(self, use_attn_in: bool) -> None:CODE
LOW⚡tests/unit/tools/test_attribution_patching.py1459 def set_use_attn_result(self, use_attn_result: bool) -> None:CODE
LOW⚡tests/unit/tools/test_attribution_patching.py1462 def set_use_split_qkv_input(self, use_split_qkv_input: bool) -> None:CODE
LOW⚡tests/unit/tools/test_attribution_patching.py1465 def set_use_hook_mlp_in(self, use_hook_mlp_in: bool) -> None:CODE
LOW…bridge/supported_architectures/test_smollm3_adapter.py116 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW…ridge/supported_architectures/test_lfm2_moe_adapter.py124 def set_rotary_emb(self, pos_emb: object) -> None:CODE
LOW…ridge/supported_architectures/test_stablelm_adapter.py128 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW…el_bridge/supported_architectures/test_lfm2_adapter.py115 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW…del_bridge/supported_architectures/test_phi_adapter.py74 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW…l_bridge/supported_architectures/test_olmo2_adapter.py97 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW…bridge/supported_architectures/test_mixtral_adapter.py110 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW…bridge/supported_architectures/test_apertus_adapter.py273 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW…pported_architectures/test_hunyuan_v1_dense_adapter.py102 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW…bridge/supported_architectures/test_gpt_oss_adapter.py114 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW⚡…l_bridge/supported_architectures/test_llama_adapter.py207 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW…l_bridge/supported_architectures/test_qwen2_adapter.py93 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW…el_bridge/supported_architectures/test_ouro_adapter.py73 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW…ridge/supported_architectures/test_glm4_moe_adapter.py50 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW…el_bridge/supported_architectures/test_neox_adapter.py79 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOW…l_bridge/supported_architectures/test_olmoe_adapter.py118 def set_rotary_emb(self, rotary_emb: object) -> None:CODE
LOWtransformer_lens/__init__.py100__all__ = [CODE
LOWtransformer_lens/tools/__init__.py20__all__ = ["analysis", "model_registry", "training"]CODE
LOWtransformer_lens/tools/analysis/__init__.py135__all__ = [CODE
LOWtransformer_lens/tools/model_registry/registry_io.py17logger = logging.getLogger(__name__)CODE
LOWtransformer_lens/tools/model_registry/hf_scraper.py66logger = logging.getLogger(__name__)CODE
LOWtransformer_lens/tools/model_registry/__init__.py392__all__ = [CODE
LOWtransformer_lens/tools/model_registry/api.py32logger = logging.getLogger(__name__)CODE
LOWtransformer_lens/tools/model_registry/validate.py15logger = logging.getLogger(__name__)CODE
LOWtransformer_lens/tools/model_registry/verify_models.py71logger = logging.getLogger(__name__)CODE
LOWtransformer_lens/lit/__init__.py63__all__ = [CODE
LOWtransformer_lens/lit/__init__.py86logger = logging.getLogger(__name__)CODE
LOWtransformer_lens/lit/model.py73logger = logging.getLogger(__name__)CODE
LOWtransformer_lens/lit/dataset.py58logger = logging.getLogger(__name__)CODE
LOWtransformer_lens/lit/utils.py19logger = logging.getLogger(__name__)CODE
LOWtransformer_lens/config/transformer_bridge_config.py260 def _set_bridge_managed_hook_flag(self, name: str, value: bool) -> None:CODE
LOWtransformer_lens/config/__init__.py7__all__ = ["TransformerBridgeConfig", "TransformerLensConfig"]CODE
LOWtransformer_lens/model_bridge/architecture_adapter.py254 def _set_rms_rotary_defaults(self, *, final_rms: bool = True, gated: bool = True) -> None:CODE
LOWtransformer_lens/model_bridge/transformer_bridge.py281 def _set_processed_weight_attributes(self) -> None:CODE
LOWtransformer_lens/model_bridge/transformer_bridge.py615 def set_compatibility_mode(component: Any) -> None:CODE
LOWtransformer_lens/model_bridge/transformer_bridge.py642 def _setup_hook_compatibility(self) -> None:CODE
LOWtransformer_lens/model_bridge/transformer_bridge.py4324 def set_use_hook_mlp_in(self, use_hook_mlp_in: bool) -> None:CODE
LOWtransformer_lens/model_bridge/bridge.py14__all__ = ["BridgeCore", "RemoteBridge", "TransformerBridge"]CODE
LOWtransformer_lens/model_bridge/__init__.py37__all__ = [CODE
LOWtransformer_lens/model_bridge/driver_protocol.py218__all__ = [CODE
LOWtransformer_lens/model_bridge/component_setup.py8logger = logging.getLogger(__name__)CODE
LOWtransformer_lens/model_bridge/get_params_util.py7logger = logging.getLogger(__name__)CODE
LOW…_lens/model_bridge/supported_architectures/pretrain.py80 def set_original_component(self, component: torch.nn.Module) -> None:CODE
LOW…r_lens/model_bridge/supported_architectures/apertus.py19logger = logging.getLogger(__name__)CODE
LOW…r_lens/model_bridge/supported_architectures/gemma3n.py39 def set_processed_weights(self, weights, verbose: bool = False) -> None:CODE
LOW…mer_lens/model_bridge/supported_architectures/llada.py45 def set_original_component(self, original_component: torch.nn.Module) -> None:CODE
LOW…mer_lens/model_bridge/supported_architectures/llada.py230 def set_original_component(self, original_component: torch.nn.Module) -> None:CODE
LOW…_lens/model_bridge/supported_architectures/__init__.py322__all__ = [CODE
LOW…mer_lens/model_bridge/supported_architectures/qwen3.py43 def _setup_qwen3_config(self, cfg: Any) -> None:CODE
LOW…ns/model_bridge/supported_architectures/olmo_hybrid.py58 def set_original_component(self, original_component: nn.Module) -> None:CODE
LOW…r_lens/model_bridge/supported_architectures/granite.py54 def _setup_common_config(self, cfg: Any) -> None:CODE
LOWtransformer_lens/model_bridge/sources/__init__.py20__all__ = [CODE
LOW…ormer_lens/model_bridge/sources/transformers_driver.py99 def set_underlying_model(self, value: nn.Module) -> None:CODE
34 more matches not shown…
Over-Commented Block52 hits · 49 pts
SeverityFileLineSnippetContext
LOWtests/tiny_checkpoints.py21FP32_NOISE_TOL = 1e-2 if _MACOS_ARM64 else 1e-5COMMENT
LOWtests/integration/test_jacobian_lens.py661 tokens = model.to_tokens(PROMPT)COMMENT
LOWdocs/make_docs.py101#bt-root thead th {COMMENT
LOWdocs/make_docs.py121#bt-root .bt-muted { color: var(--color-foreground-muted, #999); }COMMENT
LOWdocs/source/_static/adapter-template.py81 }COMMENT
LOWdevtools/adapter_builder/agents/launch.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/agents/launch.sh21# [--worktree-dir <path>] Where to create the worktree (default: $WORKTREE_BASE/<new-branch>)COMMENT
LOWdevtools/adapter_builder/agents/launch.sh181 || err "--target-repo '$TARGET_REPO' is not a git repository."COMMENT
LOWdevtools/adapter_builder/agents/launch.sh201FACTORY_REL="transformer_lens/factories/architecture_adapter_factory.py"COMMENT
LOWdevtools/adapter_builder/agents/launch.sh581COMMENT
LOWdevtools/adapter_builder/agents/check-signals.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/agents/ops.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/agents/ops.sh41COMMENT
LOWdevtools/adapter_builder/agents/ops.sh501 # a bracketed paste, which stages them as `[Pasted text #1]` and swallowsCOMMENT
LOWdevtools/adapter_builder/agents/progress.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/agents/watch-completion.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/agents/watch-completion.sh21#COMMENT
LOWdevtools/adapter_builder/agents/solo-coordinator.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/agents/solo-coordinator.sh21# *-approved, *-changes-N → programmer (proceed / address review)COMMENT
LOWdevtools/adapter_builder/agents/launch-solo-pair.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/agents/launch-solo-pair.sh21# Options:COMMENT
LOWdevtools/adapter_builder/agents/signals.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/agents/overlord-request.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/agents/launch-agent-pair.sh1#!/usr/bin/env bashCOMMENT
LOW…tools/adapter_builder/agents/hooks/timeline-capture.sh1#!/usr/bin/env bashCOMMENT
LOW…pter_builder/agents/hooks/gate-reviewer-writes-file.sh1#!/usr/bin/env bashCOMMENT
LOW…pter_builder/agents/hooks/gate-reviewer-writes-file.sh21# timestamp, it:COMMENT
LOWdevtools/adapter_builder/agents/hooks/guard-git.sh1#!/usr/bin/env bashCOMMENT
LOW…tools/adapter_builder/agents/hooks/gate-lint-checks.sh1#!/usr/bin/env bashCOMMENT
LOW…ls/adapter_builder/agents/hooks/guard-verify-models.sh1#!/usr/bin/env bashCOMMENT
LOW…s/adapter_builder/agents/hooks/notify-on-completion.sh1#!/usr/bin/env bashCOMMENT
LOW…ls/adapter_builder/agents/hooks/guard-review-rounds.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/agents/lib/common.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/docs/adapter-template.py81COMMENT
LOWdevtools/adapter_builder/scripts/dry-run-test.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/scripts/validate-adapter.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/scripts/compare-adapters.sh1#!/usr/bin/env bashCOMMENT
LOWdevtools/adapter_builder/scripts/notify.sh1#!/usr/bin/env bashCOMMENT
LOWtransformer_lens/__init__.py21from .HookedRootModule import HookedRootModuleCOMMENT
LOW…mer_lens/tools/analysis/jacobian_lens_decomposition.py81#: norms. This is a numerical-activity threshold, not an interpretability one. It matches theCOMMENT
LOW…_lens/tools/analysis/jacobian_lens_coordinate_patch.py221 # Measure the selected span's conditioning once and relax the compatibility checks by it: theCOMMENT
LOWtransformer_lens/tools/model_registry/hf_scraper.py461 # scan of 200K+ models needs only ~200 paginated requests (well within theCOMMENT
LOWtransformer_lens/model_bridge/architecture_adapter.py81 return {"max_new_tokens": max_new_tokens}COMMENT
LOWtransformer_lens/model_bridge/transformer_bridge.py721 # Folding and centering do arithmetic on raw weights, so packed orCOMMENT
LOWtransformer_lens/model_bridge/transformer_bridge.py2201 input_ids,COMMENT
LOWtransformer_lens/model_bridge/transformer_bridge.py2621 _hf_kv_cache = NoneCOMMENT
LOWtransformer_lens/model_bridge/transformer_bridge.py4721COMMENT
LOW…mer_lens/model_bridge/supported_architectures/bd3lm.py81 # ── Component mapping ──────────────────────────────────────────COMMENT
LOW…er_lens/model_bridge/supported_architectures/gemma2.py41 # Note: n_key_value_heads is now automatically mapped from num_key_value_headsCOMMENT
LOW…er_lens/model_bridge/supported_architectures/cohere.py81 # sources/transformers.py copies num_key_value_heads generically.COMMENT
LOW…er_lens/model_bridge/supported_architectures/cohere.py121 # Submodule shapes follow Llama: separate q/k/v/o projections and SwiGLU MLP.COMMENT
LOWtransformer_lens/model_bridge/sources/vllm/driver.py61 # ranks within a stage hold replicas of that stage's post-all-reduce hookCOMMENT
Redundant / Tautological Comments29 hits · 44 pts
SeverityFileLineSnippetContext
LOWtests/unit/model_bridge/test_optimizer_compatibility.py181 # Check if parameter changedCOMMENT
LOWdevtools/adapter_builder/scripts/dry-run-test.sh221 # Check if any SIG_* variable contains this phraseCOMMENT
LOW…tools/adapter_builder/scripts/validate-adapter-deep.py132 # Check if the source_key (if any) maps to somethingCOMMENT
LOWtransformer_lens/hook_points.py318 # Check if this hook matches our criteriaCOMMENT
LOWtransformer_lens/weight_processing.py345 # Check if standard keys exist, otherwise update to use underscore-prefixed versionsCOMMENT
LOWtransformer_lens/weight_processing.py593 # Check if a separate ln2 exists for this layerCOMMENT
LOWtransformer_lens/weight_processing.py1968 # Check if we have a conversion for this parameter.COMMENT
LOWtransformer_lens/weight_processing.py2103 # Check if we have a conversion for this parameter.COMMENT
LOWtransformer_lens/lit/__init__.py60# Check if LIT is availableCOMMENT
LOWtransformer_lens/model_bridge/transformer_bridge.py770 # Check if they point to the same tensor (weight tying)COMMENT
LOWtransformer_lens/model_bridge/transformer_bridge.py4093 # Check if output is a ModelOutputCOMMENT
LOWtransformer_lens/model_bridge/transformer_bridge.py4490 # Check if this part is a registered submoduleCOMMENT
LOWtransformer_lens/model_bridge/transformer_bridge.py4502 # Check if next is weight/biasCOMMENT
LOWtransformer_lens/model_bridge/transformer_bridge.py4607 # Check if this is a valid bridge path (not a nested HF component)COMMENT
LOW…r_lens/model_bridge/supported_architectures/apertus.py102 # Check if upstream already defers scalar computation (fix landed)COMMENT
LOW…odel_bridge/supported_architectures/llava_onevision.py32 # Check if text config expects tied weights but top-level config doesn'tCOMMENT
LOW…mer_lens/model_bridge/supported_architectures/bd3lm.py201 # Check if VAR_KEYWORD (like **kwargs) is acceptedCOMMENT
LOW…rmer_lens/model_bridge/generalized_components/block.py393 # Check if the signature accepts **kwargs (VAR_KEYWORD)COMMENT
LOW…conversion_utils/helpers/merge_quantiziation_fields.py22 # Check if existing field is None and raise error as expected by testsCOMMENT
LOW…conversion_utils/helpers/merge_quantiziation_fields.py37 # Check if the second element is a TensorConversionSet-like objectCOMMENT
LOWtransformer_lens/utilities/aliases.py47 # Check if the final attribute existsCOMMENT
LOWtransformer_lens/utilities/aliases.py55 # Check if the target attribute exists before getting itCOMMENT
LOWtransformer_lens/benchmarks/backward_gradients.py200 # Check if mismatches are acceptable patternsCOMMENT
LOWtransformer_lens/benchmarks/component_outputs.py829 # Check if shared_inputs contains positional argsCOMMENT
LOWtransformer_lens/benchmarks/component_outputs.py1017 # Check if within toleranceCOMMENT
LOWtransformer_lens/benchmarks/component_outputs.py1063 # Set models to eval mode (disable dropout, etc.)COMMENT
LOWtransformer_lens/benchmarks/weight_processing.py423 # Check if W_out exists and is accessible (HT format or bridge format)COMMENT
LOWtransformer_lens/benchmarks/weight_processing.py579 # Check if b_V existsCOMMENT
LOWtransformer_lens/benchmarks/weight_processing.py598 # Check if b_V is approximately zeroCOMMENT
AI Slop Vocabulary19 hits · 38 pts
SeverityFileLineSnippetContext
MEDIUM…del_bridge/supported_architectures/test_opt_adapter.py404 # via set_use_hook_mlp_in, which this harness bypasses.COMMENT
MEDIUMtests/benchmarks/test_benchmarks.py19 """Test suite that runs comprehensive benchmarks for each model."""STRING
LOWtransformer_lens/hook_points.py293 # we could just pass this as an argument in PyTorch 2.0, but for now we manually do this...COMMENT
LOWtransformer_lens/FactoredMatrix.py129 # It's a vector, so we collapse the factorisation and just return a vectorCOMMENT
LOWtransformer_lens/FactoredMatrix.py176 # It's a vector, so we collapse the factorisation and just return a vectorCOMMENT
LOWtransformer_lens/weight_processing.py1987 # Legacy string mapping - just return the tensor as-isCOMMENT
LOWtransformer_lens/weight_processing.py2118 # Legacy string mapping - just return the tensor as-isCOMMENT
MEDIUMtransformer_lens/model_bridge/architecture_adapter.py87 # component harness's synthesized probes — e.g. fused top-k routers whoseCOMMENT
MEDIUM…rmer_lens/model_bridge/supported_architectures/rwkv.py110 # MLPBridge so the component harness sizes inputs by theCOMMENT
MEDIUM…ns/model_bridge/supported_architectures/deepseek_v4.py166 # The isolated component harness assumes a three-dimensional residual. V4'sCOMMENT
MEDIUM…er_lens/model_bridge/supported_architectures/jetmoe.py46 # the harness's isolated probes; routers stay hookable at runtime.COMMENT
LOW…_lens/model_bridge/generalized_components/bloom_mlp.py77 # The original BLOOM block passes it, so we just pass everything throughCOMMENT
LOW…odel_bridge/generalized_components/rotary_embedding.py134 # For unexpected tuple lengths, just pass throughCOMMENT
MEDIUM…former_lens/model_bridge/generalized_components/moe.py306 # Symmetric restore so a rebinding harness cannot leave a chimera.COMMENT
LOWtransformer_lens/utilities/components_utils.py51 # If this was called on a full name, just return itCOMMENT
MEDIUMtransformer_lens/benchmarks/main_benchmark.py487 """Run comprehensive benchmark suite for TransformerBridge.STRING
MEDIUMtransformer_lens/benchmarks/component_benchmark.py65 # Run comprehensive benchmarkCOMMENT
MEDIUM⚡transformer_lens/benchmarks/generation.py189 """Benchmark multiple generation calls to ensure KV cache handling is robust.STRING
LOWtransformer_lens/benchmarks/component_outputs.py887 # Some pos embeds just return their embeddings directlyCOMMENT
AI Structural Patterns43 hits · 35 pts
SeverityFileLineSnippetContext
LOW…odel_bridge/supported_architectures/_pretrain_mocks.py108CODE
LOW…l_bridge/supported_architectures/test_raven_adapter.py34CODE
LOW…idge/supported_architectures/test_falcon_h1_adapter.py40CODE
LOW…ridge/supported_architectures/test_lfm2_moe_adapter.py42CODE
LOW…el_bridge/supported_architectures/test_lfm2_adapter.py41CODE
LOW…del_bridge/supported_architectures/test_opt_adapter.py33CODE
LOW…dge/supported_architectures/test_nemotron_h_adapter.py31CODE
LOW…_bridge/supported_architectures/test_falcon_adapter.py40CODE
LOW…bridge/supported_architectures/test_cohere2_adapter.py41CODE
LOW…el_bridge/supported_architectures/test_phi3_adapter.py44CODE
LOW…_bridge/supported_architectures/test_cohere_adapter.py23CODE
LOW…_bridge/supported_architectures/test_mamba2_adapter.py32CODE
LOW…l_bridge/supported_architectures/test_bd3lm_adapter.py30CODE
LOW…l_bridge/supported_architectures/test_jamba_adapter.py27CODE
LOWtransformer_lens/tools/analysis/sparse_probing.py761CODE
LOWtransformer_lens/tools/analysis/sparse_probing.py857CODE
LOWtransformer_lens/tools/analysis/logit_lens.py572CODE
LOWtransformer_lens/tools/model_registry/hf_scraper.py320CODE
LOWtransformer_lens/tools/model_registry/api.py428CODE
LOWtransformer_lens/config/transformer_bridge_config.py35CODE
LOWtransformer_lens/model_bridge/bridge_core.py1233CODE
LOWtransformer_lens/model_bridge/bridge_core.py1431CODE
LOWtransformer_lens/model_bridge/transformer_bridge.py2033CODE
LOWtransformer_lens/model_bridge/transformer_bridge.py2950CODE
LOWtransformer_lens/model_bridge/transformer_bridge.py3607CODE
LOWtransformer_lens/model_bridge/transformer_bridge.py3940CODE
LOWtransformer_lens/model_bridge/remote_bridge.py133CODE
LOWtransformer_lens/model_bridge/sources/vllm/source.py138CODE
LOW…ormer_lens/model_bridge/sources/transformers/source.py46CODE
LOW…_lens/model_bridge/generalized_components/attention.py68CODE
LOW…model_bridge/generalized_components/bloom_attention.py134CODE
LOW…odel_bridge/generalized_components/depthwise_conv1d.py45CODE
LOW…_lens/model_bridge/generalized_components/bloom_mlp.py84CODE
LOW…_lens/model_bridge/generalized_components/embedding.py94CODE
LOW…_lens/model_bridge/generalized_components/gated_mlp.py387CODE
LOW…l_bridge/generalized_components/joint_qkv_attention.py381CODE
LOW…_lens/model_bridge/generalized_components/pos_embed.py94CODE
LOW…ens/model_bridge/generalized_components/unembedding.py152CODE
LOW…del_bridge/generalized_components/codegen_attention.py267CODE
LOW…r_lens/model_bridge/generalized_components/t5_block.py214CODE
LOW…r_lens/model_bridge/generalized_components/t5_block.py97CODE
LOW…s/model_bridge/generalized_components/normalization.py211CODE
LOWtransformer_lens/benchmarks/main_benchmark.py472CODE
Hallucination Indicators2 hits · 30 pts
SeverityFileLineSnippetContext
CRITICAL⚡tests/acceptance/model_bridge/test_inspect_provider.py484 assert next(b1._driver._model.api._hf.parameters()).dtype == torch.float32CODE
CRITICAL⚡tests/acceptance/model_bridge/test_inspect_provider.py485 assert next(b2._driver._model.api._hf.parameters()).dtype == torch.float16CODE
Modern AI Meta-Vocabulary9 hits · 26 pts
SeverityFileLineSnippetContext
MEDIUMdevtools/adapter_builder/README.md115│ ├── orchestrator.md # Teams orchestration prompt template ({{PLACEHOLDER}} tokens)CODE
MEDIUMdevtools/adapter_builder/README.md140│ ├── analyze-hf-model.py # Analyze HF model config, generate scaffold adaptersCODE
MEDIUM⚡devtools/adapter_builder/agents/launch.sh14# [--seed-model <hf-id>] Known model for scaffolding (e.g. Qwen/Qwen3.5-9B)COMMENT
MEDIUMdevtools/adapter_builder/agents/launch.sh360# Create .adapter-workspace/ for brief/plan/scaffold/timeline/reviews — NOT inCOMMENT
MEDIUMdevtools/adapter_builder/agents/launch.sh508# Build the orchestration prompt from template + signalsCOMMENT
MEDIUMdevtools/adapter_builder/agents/launch.sh591 # Write the orchestration prompt to a file (too big for shell quoting)COMMENT
MEDIUMdevtools/adapter_builder/agents/launch.sh623# Read the orchestration prompt from the fileCOMMENT
MEDIUMdevtools/adapter_builder/agents/launch-solo-pair.sh22# [--seed-model <hf-id>] Known model for scaffoldingCOMMENT
MEDIUMdevtools/adapter_builder/docs/scripts-reference.md5## Adapter analysis and scaffoldingCOMMENT
Structural Annotation Overuse14 hits · 22 pts
SeverityFileLineSnippetContext
LOWdevtools/adapter_builder/agents/programmer.md62## Step 2: ImplementCOMMENT
LOWdevtools/adapter_builder/agents/programmer.md81## Step 3: VerifyCOMMENT
LOWdevtools/adapter_builder/agents/solo-programmer.md92## Step 2: ImplementCOMMENT
LOWdevtools/adapter_builder/agents/solo-programmer.md107## Step 3: VerifyCOMMENT
LOW…vtools/adapter_builder/docs/hf-model-analysis-guide.md5## Step 1: Read the Model's config.jsonCOMMENT
LOW…vtools/adapter_builder/docs/hf-model-analysis-guide.md35## Step 2: Determine Architecture CharacteristicsCOMMENT
LOW…vtools/adapter_builder/docs/hf-model-analysis-guide.md71## Step 3: Inspect Module NamesCOMMENT
LOW…vtools/adapter_builder/docs/hf-model-analysis-guide.md109## Step 4: Check for BiasesCOMMENT
LOW…vtools/adapter_builder/docs/hf-model-analysis-guide.md120## Step 5: Examine State Dict KeysCOMMENT
LOW…vtools/adapter_builder/docs/hf-model-analysis-guide.md133## Step 6: Find an Existing Similar AdapterCOMMENT
LOW⚡transformer_lens/tools/model_registry/verify_models.py1034 # Step 1: Estimate parametersCOMMENT
LOW⚡transformer_lens/tools/model_registry/verify_models.py1044 # Step 2: Check memoryCOMMENT
LOWtransformer_lens/tools/model_registry/verify_models.py999 # Step 0: Skip formats with no HF loader path (GGUF / MLX / FP4 / FP8).COMMENT
LOWtransformer_lens/tools/model_registry/verify_models.py1059 # Step 3: Run benchmarks (all phases in a single call to share models)COMMENT
Example Usage Blocks9 hits · 18 pts
SeverityFileLineSnippetContext
LOW⚡devtools/adapter_builder/agents/launch.sh10# Usage:COMMENT
LOW⚡devtools/adapter_builder/agents/ops.sh9# Usage:COMMENT
LOWdevtools/adapter_builder/agents/solo-coordinator.sh34# Usage:COMMENT
LOWdevtools/adapter_builder/agents/launch-solo-pair.sh18# Usage:COMMENT
LOW⚡devtools/adapter_builder/agents/launch-agent-pair.sh10# Usage:COMMENT
LOWdevtools/adapter_builder/scripts/dry-run-test.sh18# Usage:COMMENT
LOW⚡devtools/adapter_builder/scripts/validate-adapter.sh8# Usage:COMMENT
LOW⚡devtools/adapter_builder/scripts/compare-adapters.sh9# Usage:COMMENT
LOW⚡devtools/adapter_builder/scripts/notify.sh11# Usage:COMMENT
Verbosity Indicators4 hits · 8 pts
SeverityFileLineSnippetContext
LOW⚡transformer_lens/tools/model_registry/verify_models.py1034 # Step 1: Estimate parametersCOMMENT
LOW⚡transformer_lens/tools/model_registry/verify_models.py1044 # Step 2: Check memoryCOMMENT
LOWtransformer_lens/tools/model_registry/verify_models.py999 # Step 0: Skip formats with no HF loader path (GGUF / MLX / FP4 / FP8).COMMENT
LOWtransformer_lens/tools/model_registry/verify_models.py1059 # Step 3: Run benchmarks (all phases in a single call to share models)COMMENT
Fake / Example Data4 hits · 5 pts
SeverityFileLineSnippetContext
LOW⚡tests/unit/model_bridge/test_vllm_boot.py84 assert mocked_boot["auto_config"].call_args.kwargs["token"] == "fake-token"CODE
LOW⚡tests/unit/model_bridge/test_vllm_boot.py85 assert mocked_boot["auto_tokenizer"].call_args.kwargs["token"] == "fake-token"CODE
LOW…el_bridge/sources/test_boot_architecture_resolution.py53 lambda: "fake-token",CODE
LOWtests/acceptance/test_evals.py57 names=["John Smith", "John Doe"],CODE
Synthetic Comment Markers1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHdocs/source/content/news/release-3.0.md18Additionally, I am working on an automated Claude tool for TransformerBridge architecture adapters. It will allow contriCODE
AI Response Leakage1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHtransformer_lens/HookedRootModule.py160 ) # TODO does adding assert meaningfully slow down performance? I've added them for type checking purposes.CODE
Dead Code1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMtransformer_lens/head_detector.py298CODE