├── LICENSE ├── README.md ├── analysis ├── TinyLlama_v1.1 │ └── analysis_component.ipynb ├── analysis_component.ipynb ├── analysis_component.py ├── analysis_gpt2.ipynb ├── analysis_gpt2_forget.ipynb ├── analysis_gpt2_forget.py ├── analysis_gpt2_medium.ipynb ├── analysis_phi-1_5.ipynb ├── analysis_tinyllama.ipynb ├── gpt2-medium │ └── analysis_component.ipynb └── gpt2 │ └── analysis_component.ipynb ├── analyzer.py ├── assets └── illustration.png ├── batch_predict.py ├── circuit_discovery.py ├── circuit_eval.py ├── data ├── calculate_tokens.py ├── circuits_data_generation.py ├── datapoint_generation.py ├── entities_50000 │ ├── new.jsonl │ └── revised.jsonl ├── forget_conflict_data_generation.py ├── forget_new_data_generation.py ├── forget_original_data_generation.py ├── forgetting_data_generation.py ├── query_data_generation.py ├── selection_pool │ ├── birth_date.json │ ├── birth_month.json │ ├── birth_year.json │ ├── city.json │ ├── company.json │ ├── first_name.json │ ├── last_name.json │ ├── major.json │ ├── middle_name.json │ ├── people_wiki.csv │ └── university.json ├── templates │ ├── birth.jsonl │ ├── city.jsonl │ ├── company.jsonl │ ├── major.jsonl │ └── university.jsonl └── text_data_generation.py ├── eap ├── attribute.py ├── dataset.py ├── evaluate.py ├── graph.py ├── metrics.py ├── utils.py └── visualization.py ├── forget.py ├── generate.py ├── metrics └── accuracy │ └── accuracy.py ├── one_circuit_eval.py ├── predict.py ├── requirements.txt ├── scripts ├── TinyLlama_v1.1 │ ├── batch_predict.sh │ ├── circuit_eval.sh │ ├── eap.sh │ ├── predict.sh │ └── train.sh ├── gpt2-medium │ ├── circuit_eval.sh │ ├── eap.sh │ ├── forget.sh │ ├── one_circuit_eval.sh │ ├── predict.sh │ └── train.sh ├── gpt2 │ ├── batch_predict.sh │ ├── circuit_eval.sh │ ├── eap.sh │ ├── forget.sh │ ├── one_circuit_eval.sh │ ├── predict.sh │ └── train.sh └── phi-1_5 │ ├── circuit_eval.sh │ ├── eap.sh │ ├── predict.sh │ └── train.sh ├── train.py ├── transformer_lens ├── ActivationCache.py ├── FactoredMatrix.py ├── HookedEncoder.py ├── HookedTransformer.py ├── HookedTransformerConfig.py ├── SVDInterpreter.py ├── __init__.py ├── components │ ├── __init__.py │ ├── abstract_attention.py │ ├── attention.py │ ├── bert_block.py │ ├── bert_embed.py │ ├── bert_mlm_head.py │ ├── embed.py │ ├── gated_mlp.py │ ├── grouped_query_attention.py │ ├── layer_norm.py │ ├── layer_norm_pre.py │ ├── mlp.py │ ├── moe.py │ ├── pos_embed.py │ ├── rms_norm.py │ ├── rms_norm_pre.py │ ├── token_typed_embed.py │ ├── transformer_block.py │ └── unembed.py ├── evals.py ├── head_detector.py ├── hook_points.py ├── loading_from_pretrained.py ├── past_key_value_caching.py ├── patching.py ├── train.py ├── utilities │ ├── __init__.py │ ├── addmm.py │ └── devices.py └── utils.py └── utils.py /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/README.md -------------------------------------------------------------------------------- /analysis/TinyLlama_v1.1/analysis_component.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/analysis/TinyLlama_v1.1/analysis_component.ipynb -------------------------------------------------------------------------------- /analysis/analysis_component.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/analysis/analysis_component.ipynb -------------------------------------------------------------------------------- /analysis/analysis_component.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/analysis/analysis_component.py -------------------------------------------------------------------------------- /analysis/analysis_gpt2.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/analysis/analysis_gpt2.ipynb -------------------------------------------------------------------------------- /analysis/analysis_gpt2_forget.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/analysis/analysis_gpt2_forget.ipynb -------------------------------------------------------------------------------- /analysis/analysis_gpt2_forget.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/analysis/analysis_gpt2_forget.py -------------------------------------------------------------------------------- /analysis/analysis_gpt2_medium.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/analysis/analysis_gpt2_medium.ipynb -------------------------------------------------------------------------------- /analysis/analysis_phi-1_5.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/analysis/analysis_phi-1_5.ipynb -------------------------------------------------------------------------------- /analysis/analysis_tinyllama.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/analysis/analysis_tinyllama.ipynb -------------------------------------------------------------------------------- /analysis/gpt2-medium/analysis_component.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/analysis/gpt2-medium/analysis_component.ipynb -------------------------------------------------------------------------------- /analysis/gpt2/analysis_component.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/analysis/gpt2/analysis_component.ipynb -------------------------------------------------------------------------------- /analyzer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/analyzer.py -------------------------------------------------------------------------------- /assets/illustration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/assets/illustration.png -------------------------------------------------------------------------------- /batch_predict.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/batch_predict.py -------------------------------------------------------------------------------- /circuit_discovery.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/circuit_discovery.py -------------------------------------------------------------------------------- /circuit_eval.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/circuit_eval.py -------------------------------------------------------------------------------- /data/calculate_tokens.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/calculate_tokens.py -------------------------------------------------------------------------------- /data/circuits_data_generation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/circuits_data_generation.py -------------------------------------------------------------------------------- /data/datapoint_generation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/datapoint_generation.py -------------------------------------------------------------------------------- /data/entities_50000/new.jsonl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/entities_50000/new.jsonl -------------------------------------------------------------------------------- /data/entities_50000/revised.jsonl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/entities_50000/revised.jsonl -------------------------------------------------------------------------------- /data/forget_conflict_data_generation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/forget_conflict_data_generation.py -------------------------------------------------------------------------------- /data/forget_new_data_generation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/forget_new_data_generation.py -------------------------------------------------------------------------------- /data/forget_original_data_generation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/forget_original_data_generation.py -------------------------------------------------------------------------------- /data/forgetting_data_generation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/forgetting_data_generation.py -------------------------------------------------------------------------------- /data/query_data_generation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/query_data_generation.py -------------------------------------------------------------------------------- /data/selection_pool/birth_date.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/selection_pool/birth_date.json -------------------------------------------------------------------------------- /data/selection_pool/birth_month.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/selection_pool/birth_month.json -------------------------------------------------------------------------------- /data/selection_pool/birth_year.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/selection_pool/birth_year.json -------------------------------------------------------------------------------- /data/selection_pool/city.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/selection_pool/city.json -------------------------------------------------------------------------------- /data/selection_pool/company.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/selection_pool/company.json -------------------------------------------------------------------------------- /data/selection_pool/first_name.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/selection_pool/first_name.json -------------------------------------------------------------------------------- /data/selection_pool/last_name.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/selection_pool/last_name.json -------------------------------------------------------------------------------- /data/selection_pool/major.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/selection_pool/major.json -------------------------------------------------------------------------------- /data/selection_pool/middle_name.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/selection_pool/middle_name.json -------------------------------------------------------------------------------- /data/selection_pool/people_wiki.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/selection_pool/people_wiki.csv -------------------------------------------------------------------------------- /data/selection_pool/university.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/selection_pool/university.json -------------------------------------------------------------------------------- /data/templates/birth.jsonl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/templates/birth.jsonl -------------------------------------------------------------------------------- /data/templates/city.jsonl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/templates/city.jsonl -------------------------------------------------------------------------------- /data/templates/company.jsonl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/templates/company.jsonl -------------------------------------------------------------------------------- /data/templates/major.jsonl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/templates/major.jsonl -------------------------------------------------------------------------------- /data/templates/university.jsonl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/templates/university.jsonl -------------------------------------------------------------------------------- /data/text_data_generation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/data/text_data_generation.py -------------------------------------------------------------------------------- /eap/attribute.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/eap/attribute.py -------------------------------------------------------------------------------- /eap/dataset.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/eap/dataset.py -------------------------------------------------------------------------------- /eap/evaluate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/eap/evaluate.py -------------------------------------------------------------------------------- /eap/graph.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/eap/graph.py -------------------------------------------------------------------------------- /eap/metrics.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/eap/metrics.py -------------------------------------------------------------------------------- /eap/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/eap/utils.py -------------------------------------------------------------------------------- /eap/visualization.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/eap/visualization.py -------------------------------------------------------------------------------- /forget.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/forget.py -------------------------------------------------------------------------------- /generate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/generate.py -------------------------------------------------------------------------------- /metrics/accuracy/accuracy.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/metrics/accuracy/accuracy.py -------------------------------------------------------------------------------- /one_circuit_eval.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/one_circuit_eval.py -------------------------------------------------------------------------------- /predict.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/predict.py -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/requirements.txt -------------------------------------------------------------------------------- /scripts/TinyLlama_v1.1/batch_predict.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/TinyLlama_v1.1/batch_predict.sh -------------------------------------------------------------------------------- /scripts/TinyLlama_v1.1/circuit_eval.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/TinyLlama_v1.1/circuit_eval.sh -------------------------------------------------------------------------------- /scripts/TinyLlama_v1.1/eap.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/TinyLlama_v1.1/eap.sh -------------------------------------------------------------------------------- /scripts/TinyLlama_v1.1/predict.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/TinyLlama_v1.1/predict.sh -------------------------------------------------------------------------------- /scripts/TinyLlama_v1.1/train.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/TinyLlama_v1.1/train.sh -------------------------------------------------------------------------------- /scripts/gpt2-medium/circuit_eval.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/gpt2-medium/circuit_eval.sh -------------------------------------------------------------------------------- /scripts/gpt2-medium/eap.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/gpt2-medium/eap.sh -------------------------------------------------------------------------------- /scripts/gpt2-medium/forget.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/gpt2-medium/forget.sh -------------------------------------------------------------------------------- /scripts/gpt2-medium/one_circuit_eval.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/gpt2-medium/one_circuit_eval.sh -------------------------------------------------------------------------------- /scripts/gpt2-medium/predict.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/gpt2-medium/predict.sh -------------------------------------------------------------------------------- /scripts/gpt2-medium/train.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/gpt2-medium/train.sh -------------------------------------------------------------------------------- /scripts/gpt2/batch_predict.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/gpt2/batch_predict.sh -------------------------------------------------------------------------------- /scripts/gpt2/circuit_eval.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/gpt2/circuit_eval.sh -------------------------------------------------------------------------------- /scripts/gpt2/eap.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/gpt2/eap.sh -------------------------------------------------------------------------------- /scripts/gpt2/forget.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/gpt2/forget.sh -------------------------------------------------------------------------------- /scripts/gpt2/one_circuit_eval.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/gpt2/one_circuit_eval.sh -------------------------------------------------------------------------------- /scripts/gpt2/predict.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/gpt2/predict.sh -------------------------------------------------------------------------------- /scripts/gpt2/train.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/gpt2/train.sh -------------------------------------------------------------------------------- /scripts/phi-1_5/circuit_eval.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/phi-1_5/circuit_eval.sh -------------------------------------------------------------------------------- /scripts/phi-1_5/eap.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/phi-1_5/eap.sh -------------------------------------------------------------------------------- /scripts/phi-1_5/predict.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/phi-1_5/predict.sh -------------------------------------------------------------------------------- /scripts/phi-1_5/train.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/scripts/phi-1_5/train.sh -------------------------------------------------------------------------------- /train.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/train.py -------------------------------------------------------------------------------- /transformer_lens/ActivationCache.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/ActivationCache.py -------------------------------------------------------------------------------- /transformer_lens/FactoredMatrix.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/FactoredMatrix.py -------------------------------------------------------------------------------- /transformer_lens/HookedEncoder.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/HookedEncoder.py -------------------------------------------------------------------------------- /transformer_lens/HookedTransformer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/HookedTransformer.py -------------------------------------------------------------------------------- /transformer_lens/HookedTransformerConfig.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/HookedTransformerConfig.py -------------------------------------------------------------------------------- /transformer_lens/SVDInterpreter.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/SVDInterpreter.py -------------------------------------------------------------------------------- /transformer_lens/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/__init__.py -------------------------------------------------------------------------------- /transformer_lens/components/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/__init__.py -------------------------------------------------------------------------------- /transformer_lens/components/abstract_attention.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/abstract_attention.py -------------------------------------------------------------------------------- /transformer_lens/components/attention.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/attention.py -------------------------------------------------------------------------------- /transformer_lens/components/bert_block.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/bert_block.py -------------------------------------------------------------------------------- /transformer_lens/components/bert_embed.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/bert_embed.py -------------------------------------------------------------------------------- /transformer_lens/components/bert_mlm_head.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/bert_mlm_head.py -------------------------------------------------------------------------------- /transformer_lens/components/embed.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/embed.py -------------------------------------------------------------------------------- /transformer_lens/components/gated_mlp.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/gated_mlp.py -------------------------------------------------------------------------------- /transformer_lens/components/grouped_query_attention.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/grouped_query_attention.py -------------------------------------------------------------------------------- /transformer_lens/components/layer_norm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/layer_norm.py -------------------------------------------------------------------------------- /transformer_lens/components/layer_norm_pre.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/layer_norm_pre.py -------------------------------------------------------------------------------- /transformer_lens/components/mlp.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/mlp.py -------------------------------------------------------------------------------- /transformer_lens/components/moe.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/moe.py -------------------------------------------------------------------------------- /transformer_lens/components/pos_embed.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/pos_embed.py -------------------------------------------------------------------------------- /transformer_lens/components/rms_norm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/rms_norm.py -------------------------------------------------------------------------------- /transformer_lens/components/rms_norm_pre.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/rms_norm_pre.py -------------------------------------------------------------------------------- /transformer_lens/components/token_typed_embed.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/token_typed_embed.py -------------------------------------------------------------------------------- /transformer_lens/components/transformer_block.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/transformer_block.py -------------------------------------------------------------------------------- /transformer_lens/components/unembed.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/components/unembed.py -------------------------------------------------------------------------------- /transformer_lens/evals.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/evals.py -------------------------------------------------------------------------------- /transformer_lens/head_detector.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/head_detector.py -------------------------------------------------------------------------------- /transformer_lens/hook_points.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/hook_points.py -------------------------------------------------------------------------------- /transformer_lens/loading_from_pretrained.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/loading_from_pretrained.py -------------------------------------------------------------------------------- /transformer_lens/past_key_value_caching.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/past_key_value_caching.py -------------------------------------------------------------------------------- /transformer_lens/patching.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/patching.py -------------------------------------------------------------------------------- /transformer_lens/train.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/train.py -------------------------------------------------------------------------------- /transformer_lens/utilities/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /transformer_lens/utilities/addmm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/utilities/addmm.py -------------------------------------------------------------------------------- /transformer_lens/utilities/devices.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/utilities/devices.py -------------------------------------------------------------------------------- /transformer_lens/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/transformer_lens/utils.py -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjunlp/DynamicKnowledgeCircuits/HEAD/utils.py --------------------------------------------------------------------------------