├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── configs ├── __init__.py ├── config.yaml ├── data │ ├── __init__.py │ ├── attack │ │ ├── __init__.py │ │ └── mnli.py │ ├── entailment │ │ ├── __init__.py │ │ ├── mnli_all.py │ │ ├── mnli_contradiction.py │ │ ├── mnli_entailment.py │ │ ├── mnli_neutral.py │ │ ├── snli_entailment.py │ │ ├── snli_entailment_10.py │ │ ├── snli_entailment_1_sampled.py │ │ ├── snli_entailment_90.py │ │ └── snli_entailment_95_sampled_reversed.py │ ├── prompt │ │ ├── __init__.py │ │ ├── gpt2_mixed.py │ │ ├── gpt2_mixed_10.py │ │ └── gpt2_mixed_15.py │ └── standard │ │ ├── __init__.py │ │ ├── common_gen.py │ │ └── e2e.py └── models │ ├── __init__.py │ ├── config_model_optimizer.py │ └── config_model_transformers_small.py ├── experiments ├── __init__.py ├── pplm-inputs.txt ├── translation.py └── wordlists │ ├── computers.txt │ ├── legal.txt │ ├── military.txt │ ├── politics.txt │ ├── religion.txt │ ├── science.txt │ └── space.txt ├── figs └── main.png ├── modules ├── __init__.py ├── gpt2.py ├── metrics.py └── models.py ├── requirements.txt ├── run_experiments.py ├── scripts └── install_dependencies.sh └── sql ├── __init__.py ├── data_utils.py ├── jupyter_utils.py ├── losses.py ├── misc_utils.py ├── modules.py ├── modules_base.py ├── rewards.py ├── types.py └── utils.py /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/.gitignore -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/Dockerfile -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/README.md -------------------------------------------------------------------------------- /configs/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /configs/config.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/config.yaml -------------------------------------------------------------------------------- /configs/data/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /configs/data/attack/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /configs/data/attack/mnli.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/attack/mnli.py -------------------------------------------------------------------------------- /configs/data/entailment/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /configs/data/entailment/mnli_all.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/entailment/mnli_all.py -------------------------------------------------------------------------------- /configs/data/entailment/mnli_contradiction.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/entailment/mnli_contradiction.py -------------------------------------------------------------------------------- /configs/data/entailment/mnli_entailment.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/entailment/mnli_entailment.py -------------------------------------------------------------------------------- /configs/data/entailment/mnli_neutral.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/entailment/mnli_neutral.py -------------------------------------------------------------------------------- /configs/data/entailment/snli_entailment.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/entailment/snli_entailment.py -------------------------------------------------------------------------------- /configs/data/entailment/snli_entailment_10.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/entailment/snli_entailment_10.py -------------------------------------------------------------------------------- /configs/data/entailment/snli_entailment_1_sampled.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/entailment/snli_entailment_1_sampled.py -------------------------------------------------------------------------------- /configs/data/entailment/snli_entailment_90.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/entailment/snli_entailment_90.py -------------------------------------------------------------------------------- /configs/data/entailment/snli_entailment_95_sampled_reversed.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/entailment/snli_entailment_95_sampled_reversed.py -------------------------------------------------------------------------------- /configs/data/prompt/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /configs/data/prompt/gpt2_mixed.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/prompt/gpt2_mixed.py -------------------------------------------------------------------------------- /configs/data/prompt/gpt2_mixed_10.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/prompt/gpt2_mixed_10.py -------------------------------------------------------------------------------- /configs/data/prompt/gpt2_mixed_15.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/prompt/gpt2_mixed_15.py -------------------------------------------------------------------------------- /configs/data/standard/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /configs/data/standard/common_gen.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/standard/common_gen.py -------------------------------------------------------------------------------- /configs/data/standard/e2e.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/data/standard/e2e.py -------------------------------------------------------------------------------- /configs/models/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /configs/models/config_model_optimizer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/models/config_model_optimizer.py -------------------------------------------------------------------------------- /configs/models/config_model_transformers_small.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/configs/models/config_model_transformers_small.py -------------------------------------------------------------------------------- /experiments/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /experiments/pplm-inputs.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/experiments/pplm-inputs.txt -------------------------------------------------------------------------------- /experiments/translation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/experiments/translation.py -------------------------------------------------------------------------------- /experiments/wordlists/computers.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/experiments/wordlists/computers.txt -------------------------------------------------------------------------------- /experiments/wordlists/legal.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/experiments/wordlists/legal.txt -------------------------------------------------------------------------------- /experiments/wordlists/military.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/experiments/wordlists/military.txt -------------------------------------------------------------------------------- /experiments/wordlists/politics.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/experiments/wordlists/politics.txt -------------------------------------------------------------------------------- /experiments/wordlists/religion.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/experiments/wordlists/religion.txt -------------------------------------------------------------------------------- /experiments/wordlists/science.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/experiments/wordlists/science.txt -------------------------------------------------------------------------------- /experiments/wordlists/space.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/experiments/wordlists/space.txt -------------------------------------------------------------------------------- /figs/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/figs/main.png -------------------------------------------------------------------------------- /modules/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modules/gpt2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/modules/gpt2.py -------------------------------------------------------------------------------- /modules/metrics.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/modules/metrics.py -------------------------------------------------------------------------------- /modules/models.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/modules/models.py -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/requirements.txt -------------------------------------------------------------------------------- /run_experiments.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/run_experiments.py -------------------------------------------------------------------------------- /scripts/install_dependencies.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/scripts/install_dependencies.sh -------------------------------------------------------------------------------- /sql/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sql/data_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/sql/data_utils.py -------------------------------------------------------------------------------- /sql/jupyter_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/sql/jupyter_utils.py -------------------------------------------------------------------------------- /sql/losses.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/sql/losses.py -------------------------------------------------------------------------------- /sql/misc_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/sql/misc_utils.py -------------------------------------------------------------------------------- /sql/modules.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/sql/modules.py -------------------------------------------------------------------------------- /sql/modules_base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/sql/modules_base.py -------------------------------------------------------------------------------- /sql/rewards.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/sql/rewards.py -------------------------------------------------------------------------------- /sql/types.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/sql/types.py -------------------------------------------------------------------------------- /sql/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HanGuo97/soft-Q-learning-for-text-generation/HEAD/sql/utils.py --------------------------------------------------------------------------------