MCPcopy Create free account

hub / github.com/adamkarvonen/activation_oracles / functions

Functions716 in github.com/adamkarvonen/activation_oracles

↓ 2 callersFunction_read_json
(path: Optional[str])
nl_probes/dataset_classes/misc/latentqa_loader.py:87
↓ 2 callersFunction_score_detection_async
( prompts: list[eval_detection_v2.SAETrainTestWithExplanation], detection_model: str, max_completi
nl_probes/autointerp_detection_eval/lora_hf_eval.py:202
↓ 2 callersFunction_style_highlight
(bar, color=INTERP_BAR_COLOR, hatch="////")
experiments/final_paper_plots/plot_secret_keeping_results.py:508
↓ 2 callersFunction_style_highlight
(bar, color=INTERP_BAR_COLOR, hatch="////")
experiments/plotting/plot_secret_keeping_results.py:468
↓ 2 callersFunctionaccuracy
(records, dataset_ids)
experiments/final_paper_plots/plot_classification_layer_sweep_lines.py:57
↓ 2 callersFunctionadd_hook
Temporarily adds a forward hook to a model module. Args: module: The PyTorch module to hook hook: The hook function to apply
nl_probes/utils/steering_hooks.py:105
↓ 2 callersFunctioncalculate_accuracy
Calculate accuracy for specified datasets.
experiments/final_paper_plots/plot_classification_eval.py:92
↓ 2 callersFunctioncalculate_accuracy
Calculate accuracy for specified datasets.
experiments/final_paper_plots/plot_classification_eval_all_models.py:131
↓ 2 callersFunctioncalculate_accuracy
Calculate accuracy for specified datasets.
experiments/plotting/plot_classification_eval.py:96
↓ 2 callersFunctioncalculate_binomial_ci
Calculate 95% confidence interval for binomial proportion. Args: accuracy: The proportion (0 to 1) n: The sample size con
experiments/final_paper_plots/plot_personaqa_knowledge_eval_all_models.py:63
↓ 2 callersFunctioncalculate_classification_accuracy
Calculate accuracy for specified datasets.
experiments/final_paper_plots/plot_lr_sweep_combined.py:53
↓ 2 callersFunctioncalculate_confidence_interval
Calculate 95% confidence interval for accuracy data.
experiments/patchscopes/plot_patchscopes_results.py:143
↓ 2 callersFunctioncalculate_confidence_interval
Calculate binomial confidence interval for accuracy.
experiments/final_paper_plots/plot_classification_eval.py:108
↓ 2 callersFunctioncalculate_confidence_interval
Calculate binomial confidence interval for accuracy.
experiments/final_paper_plots/plot_classification_eval_all_models.py:147
↓ 2 callersFunctioncalculate_confidence_interval
Calculate 95% confidence interval for accuracy data.
experiments/plotting/plot_ssc_results.py:331
↓ 2 callersFunctioncalculate_confidence_interval
Calculate binomial confidence interval for accuracy.
experiments/plotting/plot_classification_eval.py:112
↓ 2 callersFunctioncalculate_confidence_interval
Calculate 95% confidence interval for accuracy data.
experiments/plotting/plot_personaqa_results.py:132
↓ 2 callersFunctioncalculate_confidence_interval_from_list
Calculate 95% confidence interval for accuracy data from list of accuracies.
experiments/final_paper_plots/plot_all_data_diversity.py:144
↓ 2 callersMethodcall_with_log_probs
( self, messages: ChatHistory, config: InferenceConfig, try_number: int = 1,
nl_probes/autointerp_detection_eval/caller.py:412
↓ 2 callersFunctioncheck_answer_match
Check if the answer matches the ground truth, handling ambiguous cases.
experiments/final_paper_plots/plot_personaqa_open_ended_results.py:70
↓ 2 callersFunctioncheck_answer_match
Check if the answer matches the ground truth, handling ambiguous cases (for open-ended).
experiments/final_paper_plots/plot_personaqa_results_all_models.py:106
↓ 2 callersMethodcheck_decoder_norms
It's important to check that the decoder weights are normalized.
nl_probes/sae.py:128
↓ 2 callersFunctioncheck_yes_no_match
Check if yes/no answer matches ground truth. For yes/no tasks, we require: - If ground_truth is "yes": response must contain "yes" but NOT "n
experiments/final_paper_plots/plot_personaqa_results_all_models.py:122
↓ 2 callersFunctioncollect_activations
Registers a forward hook on the submodule to capture the residual (or hidden) activations. We then raise an EarlyStopException to skip unneed
nl_probes/utils/activation_utils.py:13
↓ 2 callersFunctioncreate_detection_batch
Create a batch of mixed sentences: target SAE test sentences + hard negatives. Args: target_sae: The SAE whose explanation we're tes
nl_probes/autointerp_detection_eval/eval_detection_v2.py:451
↓ 2 callersFunctioncreate_evaluation_prompt
Create prompt for GPT-5-mini to identify matching sentences.
nl_probes/autointerp_detection_eval/eval_detection_v2.py:500
↓ 2 callersFunctionencode_messages
( tokenizer: AutoTokenizer, message_dicts: list[list[dict[str, str]]], add_generation_prompt: bool
nl_probes/base_experiment.py:156
↓ 2 callersFunctioneval_all_datasets
( cfg: SelfInterpTrainingConfig, eval_datasets: dict[str, list[TrainingDataPoint]], model: AutoMod
nl_probes/sft.py:235
↓ 2 callersFunctionextract_explanation_text
Extract the explanation text from between XML tags.
nl_probes/autointerp_detection_eval/eval_detection_v2.py:435
↓ 2 callersFunctionfile_cache_key
( messages: ChatHistory, config: InferenceConfig, try_number: int, other_hash: str, tools:
nl_probes/autointerp_detection_eval/caller.py:369
↓ 2 callersFunctionfilter_by_allowed_labels
Filter bars to only include those with allowed labels. Args: names: List of LoRA names labels: List of legend labels mean
experiments/final_paper_plots/plot_classification_eval_all_models.py:299
↓ 2 callersFunctionformat_sae_prompt_for_explanation
Convert SAETrainTest to a prompt including positive examples and hard negatives.
nl_probes/autointerp_detection_eval/eval_detection_v2.py:279
↓ 2 callersFunctiongender_calculate_accuracy
(record: dict, sequence: bool)
experiments/final_paper_plots/plot_layer_comparison_secret_keeping.py:162
↓ 2 callersFunctiongender_comparison
We use 'Male' and 'Female', so 'Male' is in 'Female'. So we have to be careful.
experiments/final_paper_plots/plot_gender_eval_results.py:73
↓ 2 callersFunctiongender_comparison
(resp: str, ground_truth: str)
experiments/final_paper_plots/plot_layer_comparison_secret_keeping.py:145
↓ 2 callersFunctiongender_comparison
We use 'Male' and 'Female', so 'Male' is in 'Female'. So we have to be careful.
experiments/final_paper_plots/plot_secret_keeping_results.py:188
↓ 2 callersFunctiongender_comparison
Compare gender labels carefully so that 'male' in 'female' does not cause false matches.
experiments/final_paper_plots/plot_model_progression_line_chart_shapes.py:423
↓ 2 callersFunctiongender_comparison
We use 'Male' and 'Female', so 'Male' is in 'Female'. So we have to be careful.
experiments/plotting/plot_gender_eval_results.py:62
↓ 2 callersFunctiongender_comparison
We use 'Male' and 'Female', so 'Male' is in 'Female'. So we have to be careful.
experiments/plotting/plot_secret_keeping_results.py:156
↓ 2 callersFunctionget_batch_size
Return batch size based on model name.
experiments/classification_eval.py:151
↓ 2 callersMethodget_cache
(self, model: str)
nl_probes/autointerp_detection_eval/caller.py:537
↓ 2 callersMethodget_cache
(self, model: str)
nl_probes/autointerp_detection_eval/caller.py:823
↓ 2 callersFunctionget_color_for_label
Get a consistent color for a given label. Args: label: The human-readable label (from CUSTOM_LABELS) Returns: Color tup
experiments/final_paper_plots/shared_color_mapping.py:52
↓ 2 callersFunctionget_eval_name
(series_name: str)
experiments/final_paper_plots/plot_model_progression_line_chart_shapes.py:794
↓ 2 callersFunctionget_hf_activation_steering_hook
HF hook with debug prints to compare against vLLM. Supports a variable number of target positions per batch element. Semantics: Fo
nl_probes/utils/steering_hooks.py:129
↓ 2 callersFunctionget_introspection_prefix
(sae_layer: int, num_positions: int)
nl_probes/utils/dataset_utils.py:13
↓ 2 callersFunctionget_layer_count
Get the number of layers from a HuggingFace model config.
nl_probes/utils/common.py:121
↓ 2 callersMethodget_log_probs_cache
(self, model: str)
nl_probes/autointerp_detection_eval/caller.py:543
↓ 2 callersMethodget_log_probs_cache
(self, model: str)
nl_probes/autointerp_detection_eval/caller.py:584
↓ 2 callersFunctionget_sae_info
(sae_repo_id: str, sae_layer_percent: int = 25, sae_width: int | None = None)
nl_probes/sae.py:15
↓ 2 callersFunctionget_ssc_client
()
experiments/final_paper_plots/plot_layer_comparison_secret_keeping.py:243
↓ 2 callersMethodlist_datasets_by_group
(want_group=None)
nl_probes/dataset_classes/classification_dataset_manager.py:832
↓ 2 callersFunctionlist_decode
Input: torch.Tensor of shape [batch_size, seq_length] Output: list of list of strings of len [batch_size, seq_length] Each inner list corresp
nl_probes/utils/common.py:54
↓ 2 callersFunctionload_classification
(file_path: Path)
experiments/final_paper_plots/plot_llama_layer0_vs_layer1_latentqa.py:92
↓ 2 callersFunctionload_classification_results
Load classification results and return dict of lr -> (iid_acc, ood_acc, iid_accuracies, ood_accuracies).
experiments/final_paper_plots/plot_lr_sweep_combined.py:65
↓ 2 callersFunctionload_explanations_from_jsonl
Load SAE explanations from a JSONL file.
nl_probes/dataset_classes/sae_training_data.py:89
↓ 2 callersFunctionload_gender_file
( json_path: str, sequence: bool, required_verbalizer_prompt: str | None = None, fallback_prom
experiments/final_paper_plots/plot_layer_comparison_secret_keeping.py:178
↓ 2 callersFunctionload_gender_results
Load gender results and return dict of lr -> (mean_accuracy, accuracies_list).
experiments/final_paper_plots/plot_lr_sweep_combined.py:120
↓ 2 callersFunctionload_max_acts_data
Load the max activating examples data.
nl_probes/sae.py:396
↓ 2 callersFunctionload_personaqa_results
Load personaqa results and return dict of lr -> (mean_accuracy, accuracies_list).
experiments/final_paper_plots/plot_lr_sweep_combined.py:183
↓ 2 callersFunctionload_personaqa_sequence
(file_path: Path)
experiments/final_paper_plots/plot_llama_layer0_vs_layer1_latentqa.py:142
↓ 2 callersFunctionload_ssc_file
(json_path: str, sequence: bool)
experiments/final_paper_plots/plot_layer_comparison_secret_keeping.py:363
↓ 2 callersFunctionload_taboo_file
( json_path: str, sequence: bool, required_verbalizer_prompt: str | None = None, fallback_prom
experiments/final_paper_plots/plot_layer_comparison_secret_keeping.py:111
↓ 2 callersFunctionload_taboo_results
Load taboo results and return dict of lr -> (mean_accuracy, accuracies_list).
experiments/final_paper_plots/plot_lr_sweep_combined.py:220
↓ 2 callersFunctionload_train_loss
Load training loss from wandb CSV and return mean of last N steps per learning rate.
experiments/final_paper_plots/plot_train_loss_lr_sweep.py:42
↓ 2 callersFunctionparse_answer
Normalize an answer to a simple whitespace-separated, ASCII lowercase form.
experiments/patchscopes/patchscopes_full_open_ended_eval.py:110
↓ 2 callersFunctionparse_answer
Normalize an answer to a simple whitespace separated, ascii lowercase form. - Decodes literal unicode-escape sequences like '\\u00ed' when presen
experiments/patchscopes/simple_patchscopes_demo.py:213
↓ 2 callersFunctionparse_answer
Normalize an answer to a simple whitespace-separated, ASCII lowercase form.
experiments/patchscopes/patchscopes_zero_shot_all.py:38
↓ 2 callersFunctionparse_answer
Normalize an answer to a simple whitespace separated, ascii lowercase form. - Decodes literal unicode-escape sequences like '\\u00ed' when presen
experiments/patchscopes/patchscopes_zero_shot.py:141
↓ 2 callersFunctionpick_mean_ci
(results_by_lora: dict[str | None, list[float]], keyword: str)
experiments/final_paper_plots/plot_llama_layer0_vs_layer1_latentqa.py:225
↓ 2 callersFunctionplot_all_models
Create plot with all models as subplots. Args: all_results: List of result dictionaries for each model highlight_keywords: List o
experiments/final_paper_plots/plot_personaqa_results_all_models.py:560
↓ 2 callersFunctionprepare_sft_dataset
(dataset: Dataset, tokenizer: AutoTokenizer)
nl_probes/trl_training/personaqa_train.py:234
↓ 2 callersFunctionpush_lora_to_hf
Push the trained LoRA adapter to Hugging Face Hub. Args: model: The trained model with LoRA adapters tokenizer: The tokenize
nl_probes/sft.py:59
↓ 2 callersFunctionreorder_by_labels
Reorder bars: highlight first, then alphabetical by label.
experiments/final_paper_plots/plot_qwen3-8b_eval_results.py:276
↓ 2 callersFunctionreorder_by_labels
Reorder bars: Full Dataset -> SPQA + Classification -> SPQA Only (Pan et al.) -> Classification -> Original Model.
experiments/final_paper_plots/plot_classification_eval_all_models.py:327
↓ 2 callersFunctionsanitize_lora_name
(lora_path: str)
nl_probes/base_experiment.py:284
↓ 2 callersFunctionsplit_points
(x_list, y_list)
experiments/final_paper_plots/plot_classification_layer_sweep_lines.py:103
↓ 2 callersFunctionstack_dataset
items[i].steering_vectors: torch.Tensor [1, d] (bf16) items[i].ds_label: int or str Returns: X: [n, d] float32 on CPU, y: [n]
experiments/linear_probe.py:126
↓ 2 callersFunctiontaboo_calculate_accuracy
( record: dict, investigator_lora: str | None, sequence: bool, model_name: str | None = None )
experiments/final_paper_plots/plot_layer_comparison_secret_keeping.py:78
↓ 2 callersFunctiontrain_features_batch
Trains the model on a single batch of data.
nl_probes/sft.py:200
↓ 2 callersFunctionvisualize_grades_by_type_average
( entries: List[Tuple[str, str, str]], *, config_path: str = CONFIG_PATH, export_dir: str = "e
experiments/final_paper_plots/plot_agent_adam.py:376
↓ 1 callersFunction_activation_vector_str_v2
Format activation-bearing tokens for prompt display (V2).
nl_probes/autointerp_detection_eval/eval_detection_v2.py:112
↓ 1 callersFunction_agent_llm_filter_norm
()
experiments/final_paper_plots/plot_agent_adam.py:78
↓ 1 callersFunction_agent_llm_filter_norm
()
experiments/final_paper_plots/plot_em_agent_multi_bars.py:78
↓ 1 callersFunction_agent_llm_filter_norm
()
experiments/final_paper_plots/plot_em_agent.py:70
↓ 1 callersFunction_agg
(vals: List[float])
experiments/final_paper_plots/plot_agent_adam.py:355
↓ 1 callersFunction_agg
(vals: List[float])
experiments/final_paper_plots/plot_em_agent_multi_bars.py:355
↓ 1 callersFunction_agg
(vals: List[float])
experiments/final_paper_plots/plot_em_agent.py:343
↓ 1 callersFunction_binomial_ci
(p: float, n: int)
experiments/final_paper_plots/plot_llama_layer0_vs_layer1_latentqa.py:71
↓ 1 callersFunction_build_data_and_id_tuples
Load one of the behavior JSON files and produce (data_by_label, id_tuples). - data_by_label: dict[label] -> list of 7-tuples behavior entries
nl_probes/dataset_classes/misc/latentqa_loader.py:114
↓ 1 callersFunction_check_answer_match
(ground_truth: str, answer: str)
experiments/final_paper_plots/plot_llama_layer0_vs_layer1_latentqa.py:134
↓ 1 callersFunction_classification_accuracy
(records: Iterable[dict], dataset_ids: list[str])
experiments/final_paper_plots/plot_llama_layer0_vs_layer1_latentqa.py:79
↓ 1 callersFunction_collect_scores_for_entry_from_export
( export_dir: str, model: str, organism: str, *, aggregation: str, baseline_mi_values:
experiments/final_paper_plots/plot_agent_adam.py:317
↓ 1 callersFunction_collect_scores_for_entry_from_export
( export_dir: str, model: str, organism: str, *, aggregation: str, baseline_mi_values:
experiments/final_paper_plots/plot_em_agent_multi_bars.py:317
↓ 1 callersFunction_collect_scores_for_entry_from_export
( export_dir: str, model: str, organism: str, *, aggregation: str, baseline_mi_values:
experiments/final_paper_plots/plot_em_agent.py:305
↓ 1 callersFunction_collect_stats
Collect stats for an eval type, ordered with highlight first.
experiments/final_paper_plots/plot_all_data_diversity.py:447
↓ 1 callersFunction_collect_stats
Collect stats for a model, ordered with highlight first.
experiments/final_paper_plots/plot_personaqa_results_all_models.py:439
↓ 1 callersFunction_config_hash
Stable short hash over the full config + split. Excludes path-like fields so moving folders does not change the filename.
nl_probes/dataset_classes/act_dataset_manager.py:32
↓ 1 callersFunction_ensure_datasets_exist
Materialize datasets on disk using a single process (rank 0). Each loader's `load_dataset` will create and save if missing; otherwise it simp
nl_probes/sft.py:788
↓ 1 callersFunction_find_all_grade_paths_by_kind_and_mi
( agent_root: Path, organism: str, model: str, *, mi: int, is_baseline: bool, llm_
experiments/final_paper_plots/plot_agent_adam.py:105
← previousnext →101–200 of 716, ranked by callers