├── .gitattributes ├── .github └── workflows │ └── pythonapp.yml ├── .gitignore ├── LICENSE ├── README.md ├── experiments ├── __init__.py ├── aliases.py ├── dump.py ├── eval │ ├── __init__.py │ ├── cls.py │ ├── ent.py │ └── gen.py ├── sweep.py ├── train.py └── utils.py ├── invoke.yaml ├── notebooks ├── eval_fact_cls_supervised.ipynb └── figures │ ├── ablations.ipynb │ ├── analysis.ipynb │ ├── examples.ipynb │ ├── mcrae.ipynb │ └── tables.ipynb ├── pyproject.toml ├── remedi ├── __init__.py ├── benchmarks.py ├── data.py ├── editors.py ├── metrics.py ├── models.py ├── precompute.py └── utils │ ├── __init__.py │ ├── env_utils.py │ ├── experiment_utils.py │ ├── lang_utils.py │ ├── logging_utils.py │ ├── tokenizer_utils.py │ ├── training_utils.py │ └── typing.py ├── requirements.txt ├── scripts ├── __init__.py ├── eval_bias_cls.py ├── eval_bias_gen.py ├── eval_entailment.py ├── eval_fact_cls.py ├── eval_fact_gen.py ├── eval_fact_mediation.py ├── generate_directions.py ├── random_init_model.py ├── reformat_dataset.py └── train_editors.py ├── tasks.py └── tests ├── __init__.py ├── test_metrics.py ├── test_models.py ├── test_precompute.py └── utils ├── __init__.py ├── test_env_utils.py ├── test_lang_utils.py ├── test_tokenizer_utils.py └── test_training_utils.py /.gitattributes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/.gitattributes -------------------------------------------------------------------------------- /.github/workflows/pythonapp.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/.github/workflows/pythonapp.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/.gitignore -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/README.md -------------------------------------------------------------------------------- /experiments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/experiments/__init__.py -------------------------------------------------------------------------------- /experiments/aliases.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/experiments/aliases.py -------------------------------------------------------------------------------- /experiments/dump.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/experiments/dump.py -------------------------------------------------------------------------------- /experiments/eval/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/experiments/eval/__init__.py -------------------------------------------------------------------------------- /experiments/eval/cls.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/experiments/eval/cls.py -------------------------------------------------------------------------------- /experiments/eval/ent.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/experiments/eval/ent.py -------------------------------------------------------------------------------- /experiments/eval/gen.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/experiments/eval/gen.py -------------------------------------------------------------------------------- /experiments/sweep.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/experiments/sweep.py -------------------------------------------------------------------------------- /experiments/train.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/experiments/train.py -------------------------------------------------------------------------------- /experiments/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/experiments/utils.py -------------------------------------------------------------------------------- /invoke.yaml: -------------------------------------------------------------------------------- 1 | run: 2 | echo: true 3 | -------------------------------------------------------------------------------- /notebooks/eval_fact_cls_supervised.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/notebooks/eval_fact_cls_supervised.ipynb -------------------------------------------------------------------------------- /notebooks/figures/ablations.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/notebooks/figures/ablations.ipynb -------------------------------------------------------------------------------- /notebooks/figures/analysis.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/notebooks/figures/analysis.ipynb -------------------------------------------------------------------------------- /notebooks/figures/examples.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/notebooks/figures/examples.ipynb -------------------------------------------------------------------------------- /notebooks/figures/mcrae.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/notebooks/figures/mcrae.ipynb -------------------------------------------------------------------------------- /notebooks/figures/tables.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/notebooks/figures/tables.ipynb -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/pyproject.toml -------------------------------------------------------------------------------- /remedi/__init__.py: -------------------------------------------------------------------------------- 1 | """All first-party code written by the authors.""" 2 | -------------------------------------------------------------------------------- /remedi/benchmarks.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/remedi/benchmarks.py -------------------------------------------------------------------------------- /remedi/data.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/remedi/data.py -------------------------------------------------------------------------------- /remedi/editors.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/remedi/editors.py -------------------------------------------------------------------------------- /remedi/metrics.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/remedi/metrics.py -------------------------------------------------------------------------------- /remedi/models.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/remedi/models.py -------------------------------------------------------------------------------- /remedi/precompute.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/remedi/precompute.py -------------------------------------------------------------------------------- /remedi/utils/__init__.py: -------------------------------------------------------------------------------- 1 | """Utilities used throughout the project.""" 2 | -------------------------------------------------------------------------------- /remedi/utils/env_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/remedi/utils/env_utils.py -------------------------------------------------------------------------------- /remedi/utils/experiment_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/remedi/utils/experiment_utils.py -------------------------------------------------------------------------------- /remedi/utils/lang_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/remedi/utils/lang_utils.py -------------------------------------------------------------------------------- /remedi/utils/logging_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/remedi/utils/logging_utils.py -------------------------------------------------------------------------------- /remedi/utils/tokenizer_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/remedi/utils/tokenizer_utils.py -------------------------------------------------------------------------------- /remedi/utils/training_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/remedi/utils/training_utils.py -------------------------------------------------------------------------------- /remedi/utils/typing.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/remedi/utils/typing.py -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/requirements.txt -------------------------------------------------------------------------------- /scripts/__init__.py: -------------------------------------------------------------------------------- 1 | """Scripts used for data creation and more.""" 2 | -------------------------------------------------------------------------------- /scripts/eval_bias_cls.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/scripts/eval_bias_cls.py -------------------------------------------------------------------------------- /scripts/eval_bias_gen.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/scripts/eval_bias_gen.py -------------------------------------------------------------------------------- /scripts/eval_entailment.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/scripts/eval_entailment.py -------------------------------------------------------------------------------- /scripts/eval_fact_cls.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/scripts/eval_fact_cls.py -------------------------------------------------------------------------------- /scripts/eval_fact_gen.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/scripts/eval_fact_gen.py -------------------------------------------------------------------------------- /scripts/eval_fact_mediation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/scripts/eval_fact_mediation.py -------------------------------------------------------------------------------- /scripts/generate_directions.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/scripts/generate_directions.py -------------------------------------------------------------------------------- /scripts/random_init_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/scripts/random_init_model.py -------------------------------------------------------------------------------- /scripts/reformat_dataset.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/scripts/reformat_dataset.py -------------------------------------------------------------------------------- /scripts/train_editors.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/scripts/train_editors.py -------------------------------------------------------------------------------- /tasks.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/tasks.py -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | """Unit tests for all first-party code under src.""" 2 | -------------------------------------------------------------------------------- /tests/test_metrics.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/tests/test_metrics.py -------------------------------------------------------------------------------- /tests/test_models.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/tests/test_models.py -------------------------------------------------------------------------------- /tests/test_precompute.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/tests/test_precompute.py -------------------------------------------------------------------------------- /tests/utils/__init__.py: -------------------------------------------------------------------------------- 1 | """Tests for src.utils submodules.""" 2 | -------------------------------------------------------------------------------- /tests/utils/test_env_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/tests/utils/test_env_utils.py -------------------------------------------------------------------------------- /tests/utils/test_lang_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/tests/utils/test_lang_utils.py -------------------------------------------------------------------------------- /tests/utils/test_tokenizer_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/tests/utils/test_tokenizer_utils.py -------------------------------------------------------------------------------- /tests/utils/test_training_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandez/REMEDI/HEAD/tests/utils/test_training_utils.py --------------------------------------------------------------------------------