MCPcopy Create free account

hub / github.com/RiddleHe/llm-interp / functions

Functions204 in github.com/RiddleHe/llm-interp

↓ 1 callersFunction_mk_mlp_hook
(ii)
attention_sink/analyze_sink.py:731
↓ 1 callersFunction_no_param_grads
(model)
attention_sink/analyze_sink.py:1322
↓ 1 callersFunction_orth_unit
(u)
attention_sink/analyze_sink.py:4809
↓ 1 callersFunction_parse_plot_activations_spec
(spec)
attention_sink/analyze_sink.py:47
↓ 1 callersFunction_pca_from_rows
(X, k)
attention_sink/analyze_sink.py:288
↓ 1 callersFunction_pick_head_with_caches
(model, attns, layer_idx, head_idx)
attention_sink/analyze_sink.py:1351
↓ 1 callersFunction_plot_act3d_lines
(ax, A, name, max_dims_act=4096, mult_global=50.0, mult_dim=5.0, positive_only=False)
attention_sink/analyze_sink.py:1684
↓ 1 callersFunction_plot_activations_3d
( mean_act, out_path, title, max_dims=4096, )
attention_sink/analyze_sink.py:3340
↓ 1 callersFunction_plot_attn_cos
Plot cosine similarity of each component vs tok0, per token. One panel per component (excluding 'sum'). Shows cos(comp[tok0], comp[tok_i]).
attention_sink/analyze_sink.py:2762
↓ 1 callersFunction_plot_bias_energy_3d
(bias_sets, out_path, x_label)
attention_sink/analyze_sink.py:4141
↓ 1 callersFunction_plot_contribution_analysis
Activation-only energy fractions and frac(gate>0) at W_down top-k. Three panels per output dim (all use mean-of-per-sample): Left: up_out
attention_sink/analyze_sink.py:2616
↓ 1 callersFunction_plot_dim_after_attn
Bar plot: each residual stream component at given dims, stacked vertically. pack: dict from _collect_residual_stream_components.
attention_sink/analyze_sink.py:3219
↓ 1 callersFunction_plot_down_out_gate_analysis
Per output dim: ungated vs gated projection onto W[dim,:]. Left panel: original (causal) attention. Right panel: self-attend-only (ablated) a
attention_sink/analyze_sink.py:2302
↓ 1 callersFunction_plot_down_out_magnitude_alignment
1-row grid per output dim: E[||down_in||], cos(E[down_in], W), E[dot(down_in, W)]. Uses per-sample norm stats for ||down_in|| (mean-of-per-sample
attention_sink/analyze_sink.py:2210
↓ 1 callersFunction_plot_grad_second_moment_spectrum_stacked
( lambdas_list, labels, out_path, title, max_k=256 )
attention_sink/analyze_sink.py:3438
↓ 1 callersFunction_plot_heatmap_grid
(attn_maps, titles, out_path, rows=4, suffix="", suptitle="Attention heatmaps")
attention_sink/analyze_sink.py:4220
↓ 1 callersFunction_plot_mlp_down_in_decomposition
Bar plot showing how down_in outlier dims are created from gate_out * act_out * up_out. For each down_in outlier dim, shows 4 grouped bars per to
attention_sink/analyze_sink.py:2819
↓ 1 callersFunction_plot_mlp_grid_3d
( acts, projs, out_path, title, max_dims_act=4096, max_dims_proj=4096, *, max_
attention_sink/analyze_sink.py:1874
↓ 1 callersFunction_plot_mlp_rms_dim_across_tokens
Bar plot: rms_in and rms_out values at specific dims across all tokens. Multiple dims are arranged vertically (one row per dim).
attention_sink/analyze_sink.py:2919
↓ 1 callersFunction_plot_mlp_rms_in_l2_norm
Bar plot: per-token E[||rms_in||] with std error bars on tok0. Uses per-sample norm stats (mean-of-per-sample norms).
attention_sink/analyze_sink.py:2981
↓ 1 callersFunction_plot_progression_multi_interleaved_block_norms
( series, outdir, title, fname, key_attn="attn_out_norm", key_mlp="out_norm", key_
attention_sink/analyze_sink.py:3995
↓ 1 callersFunction_plot_proj3d_lines
( ax, M, name, input_special_dims=None, input_special_scalars=None, input_label="input
attention_sink/analyze_sink.py:1743
↓ 1 callersFunction_plot_projection_histogram_before_after_stacked
( p_before_list, p_after_list, labels, out_path, title, bins=60, )
attention_sink/analyze_sink.py:3300
↓ 1 callersFunction_plot_pullback_contrib_two_panel
( comp_names, share_tok0_mu, share_tok0_sd, delta_mu, delta_sd, out_path, title )
attention_sink/analyze_sink.py:4177
↓ 1 callersFunction_plot_residual_dim_heatmaps
(dim_list, comp_names, tok0_mat, diff_mat, out_path, title)
attention_sink/analyze_sink.py:3484
↓ 1 callersFunction_plot_weight_distribution
Plot W_down row distribution for each output dim. Layout: one row per output dim, single panel: sorted |W_down[odim, :]| with cumulative en
attention_sink/analyze_sink.py:2704
↓ 1 callersFunction_plot_wg_row_energy_stack
(X, Wg, row_idxs, out_path, title, squash_boundary=16, topk=3)
attention_sink/analyze_sink.py:3679
↓ 1 callersFunction_pos_count_stats
(Z)
attention_sink/analyze_sink.py:523
↓ 1 callersFunction_print_mlp_downproj_outlier_contrib_stacked
( acts, projs, out_path, title, )
attention_sink/analyze_sink.py:1995
↓ 1 callersFunction_print_mlp_g_section
()
attention_sink/analyze_sink.py:5557
↓ 1 callersFunction_print_mlp_residual_section
()
attention_sink/analyze_sink.py:5670
↓ 1 callersFunction_print_mlp_u_section
()
attention_sink/analyze_sink.py:5628
↓ 1 callersFunction_print_mlp_z_section
()
attention_sink/analyze_sink.py:5498
↓ 1 callersFunction_reduce_headwise_vec
(xh)
attention_sink/analyze_sink.py:500
↓ 1 callersFunction_row_norm
(v)
attention_sink/analyze_sink.py:3493
↓ 1 callersFunction_run_scan_pass
(scan_layers, rope_overrides_local, sink_idxs_local)
attention_sink/analyze_sink.py:4619
↓ 1 callersFunction_sample_random_subspace_orth_to
(Q_ref, D, r)
attention_sink/analyze_sink.py:4862
↓ 1 callersFunction_select_spaced_outlier_dims
(ranked_dims, axis_size, max_keep=4, min_dist=None)
attention_sink/analyze_sink.py:1499
↓ 1 callersFunction_select_topk_dims_from_rows
(X, W_list, probe_idx, topk=2, topk_per_row=3)
attention_sink/analyze_sink.py:624
↓ 1 callersFunction_silu_np
(x)
attention_sink/analyze_sink.py:2533
↓ 1 callersFunction_svd_centered
(X, full_matrices=False)
attention_sink/analyze_sink.py:281
↓ 1 callersFunction_topk_idx_from_np
(arr, k=3)
attention_sink/analyze_sink.py:349
↓ 1 callersFunction_topk_set_from_scores
(scores, k)
attention_sink/analyze_sink.py:362
↓ 1 callersFunction_vec_neg_topk
(vec, k=3)
attention_sink/analyze_sink.py:611
↓ 1 callersFunction_write_hidden_to_hook_args
(x_new, args, kwargs)
attention_sink/analyze_sink.py:91
↓ 1 callersFunctionapply_perturbations
(base_pos, rope_overrides=None, mask=None)
attention_sink/analyze_sink.py:228
↓ 1 callersFunctionapply_rope_overrides
(position_ids, overrides)
attention_sink/analyze_sink.py:73
↓ 1 callersFunctioncalculate_key_norms
(keys, n_layers, num_layers_plot)
thinking_budget/analyze_seed_thinking_budget.py:76
↓ 1 callersFunctioncapture_attention_hooks
(attention_list)
thinking_budget/analyze_seed_thinking_budget.py:63
↓ 1 callersFunctioncompute_cosine_series
(q, k, head_idx, k_sink_idx, q_positions)
attention_sink/analyze_sink.py:1333
↓ 1 callersFunctioncompute_query_vectors
(last_n_hidden_states, layer_indices, model)
thinking_budget/analyze_seed_thinking_budget.py:83
↓ 1 callersFunctionconfigure_fa2_deterministic
(enabled, split_size)
attention_nondeterministic/analyze_attention_nondeterministic.py:82
↓ 1 callersFunctionexperiment_prefill
(model_id, seq_len, chunk_sizes, attn_implementation, dtype)
attention_nondeterministic/analyze_attention_nondeterministic.py:279
↓ 1 callersFunctionexperiment_split_kv
(model_id, seq_lens, batch_sizes, attn_implementation, dtype, layer_idx=-1)
attention_nondeterministic/analyze_attention_nondeterministic.py:191
↓ 1 callersFunctionget_prompt
(prompt_type)
thinking_budget/analyze_seed_thinking_budget.py:52
↓ 1 callersFunctionlast_logits_chunked_prefill
(model, ids, chunk_size)
attention_nondeterministic/analyze_attention_nondeterministic.py:166
↓ 1 callersFunctionlast_logits_oneshot_prefill
(model, ids)
attention_nondeterministic/analyze_attention_nondeterministic.py:134
↓ 1 callersFunctionload_model
(model_name, device, dtype, random_init=False)
attention_sink/analyze_sink.py:29
↓ 1 callersFunctionmain
()
thinking_budget/analyze_seed_thinking_budget.py:180
↓ 1 callersFunctionmain
()
attention_sink/analyze_sink.py:4287
↓ 1 callersFunctionmain
()
attention_nondeterministic/analyze_attention_nondeterministic.py:292
↓ 1 callersFunctionmake_position_ids
(seq_len)
attention_sink/analyze_sink.py:70
↓ 1 callersFunctionparse_overrides
12=0,42=1' -> [(12,0),(42,1)]
attention_sink/analyze_sink.py:1181
↓ 1 callersFunctionplot_attention_weights
(attention_dict, step)
thinking_budget/utils.py:62
↓ 1 callersFunctionplot_budget_token_ranks
(budget_token_ranks, start_idx, end_idx)
thinking_budget/utils.py:4
↓ 1 callersFunctionplot_heatmap_generic
(matrix, step, layer_indices, title, cmap="hot")
thinking_budget/utils.py:150
↓ 1 callersFunctionplot_hidden_token_ranks
(hidden_token_ranks, step)
thinking_budget/utils.py:34
↓ 1 callersFunctionplot_key_norms
(key_norms, step)
thinking_budget/utils.py:114
↓ 1 callersFunctionprint_env_summary
()
attention_nondeterministic/analyze_attention_nondeterministic.py:30
↓ 1 callersFunctionrope_shift
(model, delta_steps)
thinking_budget/analyze_seed_thinking_budget.py:165
↓ 1 callersFunctiontokenize
(tok, text)
attention_sink/analyze_sink.py:62
Function_attn_hook
(_module, inputs, output, _li=li, _cache=cache)
attention_sink/analyze_sink.py:3064
Function_collect_embed_and_post_attn
Collect mean embedding and post-attention residual (embed + attn_out) per token.
attention_sink/analyze_sink.py:3134
Function_find_tok0_small_dims
Find dims where |tok0| < ratio * mean(|tok1..T|).
attention_sink/analyze_sink.py:3204
Function_frac_energy_on_dims_per_sample
(Z, idx_list)
attention_sink/analyze_sink.py:273
Function_frac_energy_on_set_per_sample
(Z, idx_list)
attention_sink/analyze_sink.py:266
Function_fwdhook
(_module, args, output, _cache=cache, _L=L)
attention_sink/analyze_sink.py:122
Function_hook
(_module, args, output, _Q=Q)
attention_sink/analyze_sink.py:170
Function_ln_prehook
(_module, args, _cache=cache)
attention_sink/analyze_sink.py:911
Function_mask_hook
(_mod, args, kwargs)
attention_sink/analyze_sink.py:2436
Function_mean_cos_to_rows
(X, W, row_idx_list)
attention_sink/analyze_sink.py:252
Function_mean_std_scalar_float_str
(x, mu_digits=2, sd_digits=2)
attention_sink/analyze_sink.py:465
Function_mean_std_scalar_str
(x)
attention_sink/analyze_sink.py:457
Function_mlp_hook
(_module, inputs, output, _cache=cache)
attention_sink/analyze_sink.py:915
Function_mlp_prehook
(_module, args)
attention_sink/analyze_sink.py:1126
Function_no_split_find_packed_sequence_indices
(position_ids, *args, **kwargs)
attention_sink/analyze_sink.py:21
Function_pad_list
(xs, k)
attention_sink/analyze_sink.py:4257
Function_parse_component_spec
(spec)
attention_sink/analyze_sink.py:1191
Function_plot_ablation_delta_bars
( comp_names, deltas_mu_sd, out_path, title, out_log_norm_ref=None, norm_stack=None,
attention_sink/analyze_sink.py:3774
Function_plot_per_gate_mean_contrib
(Srms, gamma_base, gamma_alt, Wg, out_path, title)
attention_sink/analyze_sink.py:3558
Function_plot_wg_col_distrib
(Wg, top_idx, out_path, title, highlight_rows=None)
attention_sink/analyze_sink.py:3902
Function_pos_frac
(G)
attention_sink/analyze_sink.py:263
Function_prehook
(_module, args, kwargs, _cache=cache, _num_heads=num_heads, _num_kv=num_kv, _num_groups=n
attention_sink/analyze_sink.py:112
Function_rank_in_row_abs
(w, idx)
attention_sink/analyze_sink.py:515
Function_row_norm_rank_desc
(W)
attention_sink/analyze_sink.py:603
Function_special_dims_binned_ticks
(special_dims, D, n_bins)
attention_sink/analyze_sink.py:1406
Function_topk_activated_list_abs
(Z, k)
attention_sink/analyze_sink.py:404
Functionfa2_wrapper
(self, q, k, v, attn_mask, *, dropout, scaling, sliding_window, **kwargs)
attention_nondeterministic/analyze_attention_nondeterministic.py:46
Functionfwd_hook
(_module, args, output)
attention_sink/analyze_sink.py:1273
Functionhook
(module, input, output)
thinking_budget/analyze_seed_thinking_budget.py:64
← previousnext →101–200 of 204, ranked by callers