Update README.md
Browse files
README.md
CHANGED
|
@@ -1,9 +1,58 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- allenai/real-toxicity-prompts
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
tags:
|
| 9 |
+
- controllable-generation
|
| 10 |
+
- toxicity-reduction
|
| 11 |
+
- hmm
|
| 12 |
+
- language-model
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# TRACE HMM Model (Gemma-2b)
|
| 16 |
+
|
| 17 |
+
This is the pre-trained Hidden Markov Model used in the TRACE (Tractable Reasoning for
|
| 18 |
+
Adaptable Controllable gEneration) paper for controllable text generation with toxicity
|
| 19 |
+
reduction.
|
| 20 |
+
|
| 21 |
+
## Model Details
|
| 22 |
+
|
| 23 |
+
- **Base Model**: Gemma-2b
|
| 24 |
+
- **Training Data**: RealToxicityPrompts dataset
|
| 25 |
+
- **Sequence Length**: 32 tokens
|
| 26 |
+
- **Vocabulary Size**: 4096
|
| 27 |
+
- **Training Samples**: 10M
|
| 28 |
+
- **Purpose**: Guidance for reducing toxicity in language generation
|
| 29 |
+
|
| 30 |
+
## Usage
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
from huggingface_hub import snapshot_download
|
| 34 |
+
|
| 35 |
+
# Download the model
|
| 36 |
+
model_path = snapshot_download(
|
| 37 |
+
repo_id="gwenweng/gemma",
|
| 38 |
+
local_dir="models/gemma"
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
# Use with TRACE
|
| 42 |
+
# See: https://github.com/yidouweng/trace
|
| 43 |
+
|
| 44 |
+
Citation
|
| 45 |
+
|
| 46 |
+
@inproceedings{weng2025trace,
|
| 47 |
+
title={TRACE Back from the Future: A Probabilistic Reasoning Approach to Controllable
|
| 48 |
+
Language Generation},
|
| 49 |
+
author={Weng, Yidou and Wang, Benjie and Van den Broeck, Guy},
|
| 50 |
+
booktitle={Proceedings of the 42nd International Conference on Machine Learning
|
| 51 |
+
(ICML)},
|
| 52 |
+
year={2025}
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
License
|
| 56 |
+
|
| 57 |
+
MIT License - see https://github.com/yidouweng/trace for details.
|
| 58 |
+
|