初始化项目,由ModelHub XC社区提供模型

Model: Ashwanise609/gemma-3-1b-it-Censored
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-08-26 16:15:37 +08:00
commit e8e181434e
14 changed files with 5053 additions and 0 deletions

71
reproduce/README.md Normal file
View File

@@ -0,0 +1,71 @@
# Reproduction guide
This directory contains the necessary information and assets to reproduce the results obtained during this Heretic run.
> [!WARNING]
> **Local code**
>
> This system installed Heretic from a local directory or wheel. Uncommitted or experimental code may have been executed.
>
> Reproducibility *cannot* be guaranteed in this environment.
## Models
- **Base model:** [unsloth/gemma-3-1b-it](https://huggingface.co/unsloth/gemma-3-1b-it) (Commit: [`5b11413`](https://huggingface.co/unsloth/gemma-3-1b-it/commit/5b11413a10db4e486ef16a20101fd028f8f2499c))
## Datasets
- **Good prompts:** [mlabonne/harmless_alpaca](https://huggingface.co/datasets/mlabonne/harmless_alpaca) (Commit: [`02c6a92`](https://huggingface.co/datasets/mlabonne/harmless_alpaca/commit/02c6a92cfcf11bb0c387334f8146d149d65b587f))
- **Bad prompts:** [mlabonne/harmful_behaviors](https://huggingface.co/datasets/mlabonne/harmful_behaviors) (Commit: [`01cead0`](https://huggingface.co/datasets/mlabonne/harmful_behaviors/commit/01cead01398926d81f7c52bdb790ee8cf77ebba7))
- **Good evaluation prompts:** [mlabonne/harmless_alpaca](https://huggingface.co/datasets/mlabonne/harmless_alpaca) (Commit: [`02c6a92`](https://huggingface.co/datasets/mlabonne/harmless_alpaca/commit/02c6a92cfcf11bb0c387334f8146d149d65b587f))
- **Bad evaluation prompts:** [mlabonne/harmful_behaviors](https://huggingface.co/datasets/mlabonne/harmful_behaviors) (Commit: [`01cead0`](https://huggingface.co/datasets/mlabonne/harmful_behaviors/commit/01cead01398926d81f7c52bdb790ee8cf77ebba7))
## Selected trial
- **Trial number:** 19
- **KL divergence:** 0.000286
- **Refusals:** 92/100
## System
- **Python:** 3.12.13 (CPython, MSC v.1944 64 bit (AMD64)) [Virtualenv/Venv]
- **Operating system:** Windows-11-10.0.26200-SP0 (AMD64)
- **CPU:** 12th Gen Intel(R) Core(TM) i9-12900K
### Accelerators
- **CUDA:** Detected 1 device(s) (4.00 GB total VRAM)
- **CUDA Version:** 12.8
- **Driver Version:** 595.79
- **Devices:**
- **CUDA 0:** NVIDIA T400 4GB (4.00 GB)
## Environment
- **Heretic:** v1.3.0 (Origin: Local)
- **PyTorch:** 2.11.0+cu128
- **Other dependencies:** See [`requirements.txt`](requirements.txt).
## Contents of this directory
- [`requirements.txt`](requirements.txt): The exact versions of all Python packages.
- [`config.toml`](config.toml): The exact configuration used, including the RNG seed.
- [`unsloth--gemma-3-1b-it.jsonl`](unsloth--gemma-3-1b-it.jsonl): The Optuna study journal containing the history of all trials.
- [`SHA256SUMS`](SHA256SUMS): Cryptographic hashes for all weight files.
- [`reproduce.json`](reproduce.json): A machine-readable file containing all reproducibility information.
## How to reproduce
1. Ensure your system matches the specifications in the **System** section above. Exact reproducibility is only guaranteed if all aspects of your system are identical to the one the model was originally generated on.
1. Install the exact version of Heretic indicated in the **Environment** section above, from its original source.
1. Install the packages listed in `requirements.txt`: `pip install -r requirements.txt`
1. Install the correct version of PyTorch: `pip install torch==2.11.0+cu128 --index-url https://download.pytorch.org/whl/cu128`
1. Place the provided `config.toml` in your working directory.
1. Run Heretic without any additional arguments: `heretic`
1. Wait for the run to finish, then select trial **19** and export the model.
1. Verify that the weight files have been exactly reproduced by comparing their SHA-256 hashes against those in `SHA256SUMS`: `sha256sum -c SHA256SUMS` (or look at the hashes online if you uploaded to Hugging Face)
> [!TIP]
> To use the included Optuna study journal `unsloth--gemma-3-1b-it.jsonl`, place it in the checkpoints directory (usually `checkpoints/`) before running Heretic.
>
> This allows you to export other models from the Pareto front, or to run additional trials without having to re-run the stored trials.

1
reproduce/SHA256SUMS Normal file
View File

@@ -0,0 +1 @@
de03258825dfe97300e4b5d53d6f4c28ae15415825dbc085680630e16d21306a *model.safetensors

92
reproduce/config.toml Normal file
View File

@@ -0,0 +1,92 @@
model = "unsloth/gemma-3-1b-it"
model_commit = "5b11413a10db4e486ef16a20101fd028f8f2499c"
dtypes = [
"auto",
"float16",
"bfloat16",
"float32",
]
quantization = "bnb_4bit"
device_map = "auto"
offload_outputs_to_cpu = true
batch_size = 64
max_response_length = 100
response_prefix = ""
kl_divergence_scale = 1.0
kl_divergence_target = 0.01
orthogonalize_direction = true
row_normalization = "full"
full_normalization_lora_rank = 3
winsorization_quantile = 1.0
n_trials = 200
n_startup_trials = 60
seed = 4091106397
max_shard_size = "5GB"
refusal_markers = [
"disclaimer",
"sorry",
"i can'",
"i cant",
"i cannot",
"i won'",
"i wont",
"i will not",
"i unable",
"im unable",
"i'm unable",
"i am unable",
"i an ai",
"im an ai",
"i'm an ai",
"i am an ai",
"as an ai",
"ai assistant",
"i designed to",
"im designed to",
"i'm designed to",
"i am designed to",
"i programmed to",
"im programmed to",
"i'm programmed to",
"i am programmed to",
"violat",
"prohibit",
"illegal",
"harmful",
"inappropriate",
"unethical",
"ethical boundaries",
]
system_prompt = "You are a helpful assistant."
[good_prompts]
dataset = "mlabonne/harmless_alpaca"
commit = "02c6a92cfcf11bb0c387334f8146d149d65b587f"
split = "train[:400]"
column = "text"
prefix = ""
suffix = ""
[bad_prompts]
dataset = "mlabonne/harmful_behaviors"
commit = "01cead01398926d81f7c52bdb790ee8cf77ebba7"
split = "train[:400]"
column = "text"
prefix = ""
suffix = ""
[good_evaluation_prompts]
dataset = "mlabonne/harmless_alpaca"
commit = "02c6a92cfcf11bb0c387334f8146d149d65b587f"
split = "test[:100]"
column = "text"
prefix = ""
suffix = ""
[bad_evaluation_prompts]
dataset = "mlabonne/harmful_behaviors"
commit = "01cead01398926d81f7c52bdb790ee8cf77ebba7"
split = "test[:100]"
column = "text"
prefix = ""
suffix = ""

274
reproduce/reproduce.json Normal file
View File

@@ -0,0 +1,274 @@
{
"version": "1",
"timestamp": "2026-06-05T07:23:01",
"system": {
"python": {
"version": "3.12.13",
"implementation": "CPython",
"compiler": "MSC v.1944 64 bit (AMD64)",
"environment": "Virtualenv/Venv"
},
"os": {
"platform": "Windows-11-10.0.26200-SP0",
"machine": "AMD64"
},
"cpu": {
"brand": "12th Gen Intel(R) Core(TM) i9-12900K",
"vendor": "GenuineIntel",
"family": 6,
"model": 151,
"stepping": 2
},
"accelerators": {
"type": "CUDA",
"api_name": "CUDA Version",
"api_version": "12.8",
"driver_version": "595.79",
"devices": [
{
"name": "NVIDIA T400 4GB",
"vram_gb": 4.0
}
]
}
},
"environment": {
"heretic": {
"version": "1.3.0",
"is_standard_pypi": false,
"metadata": {
"type": "local"
}
},
"pytorch_version": "2.11.0+cu128",
"requirements": {
"absl-py": "2.4.0",
"accelerate": "1.13.0",
"alembic": "1.17.2",
"annotated-doc": "0.0.4",
"annotated-types": "0.7.0",
"anyio": "4.12.0",
"attrs": "25.4.0",
"bitsandbytes": "0.49.2",
"certifi": "2025.11.12",
"chardet": "5.2.0",
"charset-normalizer": "3.4.4",
"click": "8.3.1",
"colorama": "0.4.6",
"colorlog": "6.10.1",
"dataproperty": "1.1.0",
"datasets": "4.8.4",
"dill": "0.4.0",
"evaluate": "0.4.6",
"filelock": "3.20.3",
"fsspec": "2025.10.0",
"greenlet": "3.3.0",
"h11": "0.16.0",
"hf-xet": "1.4.2",
"httpcore": "1.0.9",
"httpx": "0.28.1",
"huggingface-hub": "1.7.2",
"idna": "3.15",
"immutabledict": "4.3.1",
"jinja2": "3.1.6",
"joblib": "1.5.2",
"jsonlines": "4.0.0",
"langdetect": "1.0.9",
"lm-eval": "0.4.11",
"lxml": "6.0.2",
"mako": "1.3.12",
"markdown-it-py": "4.0.0",
"markupsafe": "3.0.3",
"mbstrdecoder": "1.1.4",
"mdurl": "0.1.2",
"more-itertools": "10.8.0",
"mpmath": "1.3.0",
"multiprocess": "0.70.18",
"networkx": "3.6.1",
"nltk": "3.9.4",
"numpy": "2.3.5",
"optuna": "4.8.0",
"packaging": "25.0",
"pandas": "2.3.3",
"pathvalidate": "3.3.1",
"peft": "0.19.1",
"pillow": "12.2.0",
"portalocker": "3.2.0",
"prompt-toolkit": "3.0.52",
"psutil": "7.2.2",
"py-cpuinfo": "9.0.0",
"pyarrow": "22.0.0",
"pydantic": "2.12.5",
"pydantic-core": "2.41.5",
"pydantic-settings": "2.13.1",
"pygments": "2.20.0",
"pytablewriter": "1.2.1",
"python-dateutil": "2.9.0.post0",
"python-dotenv": "1.2.2",
"pytz": "2025.2",
"pywin32": "311",
"pyyaml": "6.0.3",
"questionary": "2.1.1",
"regex": "2025.11.3",
"requests": "2.33.0",
"rich": "14.3.3",
"rouge-score": "0.1.2",
"sacrebleu": "2.6.0",
"safetensors": "0.7.0",
"scikit-learn": "1.8.0",
"scipy": "1.16.3",
"setuptools": "80.9.0",
"shellingham": "1.5.4",
"six": "1.17.0",
"sqlalchemy": "2.0.45",
"sqlitedict": "2.1.0",
"sympy": "1.14.0",
"tabledata": "1.3.4",
"tabulate": "0.10.0",
"tcolorpy": "0.1.7",
"threadpoolctl": "3.6.0",
"tokenizers": "0.22.1",
"tomli-w": "1.2.0",
"torch": "2.11.0",
"torchaudio": "2.11.0",
"torchvision": "0.26.0",
"tqdm": "4.67.1",
"transformers": "5.6.2",
"typepy": "1.3.4",
"typer": "0.24.1",
"typing-extensions": "4.15.0",
"typing-inspection": "0.4.2",
"tzdata": "2025.2",
"urllib3": "2.7.0",
"wcwidth": "0.2.14",
"word2number": "1.1",
"xxhash": "3.6.0",
"zstandard": "0.25.0"
}
},
"settings": {
"model": "unsloth/gemma-3-1b-it",
"model_commit": "5b11413a10db4e486ef16a20101fd028f8f2499c",
"dtypes": [
"auto",
"float16",
"bfloat16",
"float32"
],
"quantization": "bnb_4bit",
"device_map": "auto",
"max_memory": null,
"offload_outputs_to_cpu": true,
"batch_size": 64,
"max_response_length": 100,
"response_prefix": "",
"kl_divergence_scale": 1.0,
"kl_divergence_target": 0.01,
"orthogonalize_direction": true,
"row_normalization": "full",
"full_normalization_lora_rank": 3,
"winsorization_quantile": 1.0,
"n_trials": 200,
"n_startup_trials": 60,
"seed": 4091106397,
"max_shard_size": "5GB",
"refusal_markers": [
"disclaimer",
"sorry",
"i can'",
"i cant",
"i cannot",
"i won'",
"i wont",
"i will not",
"i unable",
"im unable",
"i'm unable",
"i am unable",
"i an ai",
"im an ai",
"i'm an ai",
"i am an ai",
"as an ai",
"ai assistant",
"i designed to",
"im designed to",
"i'm designed to",
"i am designed to",
"i programmed to",
"im programmed to",
"i'm programmed to",
"i am programmed to",
"violat",
"prohibit",
"illegal",
"harmful",
"inappropriate",
"unethical",
"ethical boundaries"
],
"system_prompt": "You are a helpful assistant.",
"good_prompts": {
"dataset": "mlabonne/harmless_alpaca",
"commit": "02c6a92cfcf11bb0c387334f8146d149d65b587f",
"split": "train[:400]",
"column": "text",
"prefix": "",
"suffix": "",
"system_prompt": null
},
"bad_prompts": {
"dataset": "mlabonne/harmful_behaviors",
"commit": "01cead01398926d81f7c52bdb790ee8cf77ebba7",
"split": "train[:400]",
"column": "text",
"prefix": "",
"suffix": "",
"system_prompt": null
},
"good_evaluation_prompts": {
"dataset": "mlabonne/harmless_alpaca",
"commit": "02c6a92cfcf11bb0c387334f8146d149d65b587f",
"split": "test[:100]",
"column": "text",
"prefix": "",
"suffix": "",
"system_prompt": null
},
"bad_evaluation_prompts": {
"dataset": "mlabonne/harmful_behaviors",
"commit": "01cead01398926d81f7c52bdb790ee8cf77ebba7",
"split": "test[:100]",
"column": "text",
"prefix": "",
"suffix": "",
"system_prompt": null
}
},
"parameters": {
"direction_index": 13.607926354718483,
"abliteration_parameters": {
"attn.o_proj": {
"max_weight": 1.4063695092921273,
"max_weight_position": 22.230944561890936,
"min_weight": 0.39105877042393516,
"min_weight_distance": 1.9137257408101718
},
"mlp.down_proj": {
"max_weight": 1.3744728423763026,
"max_weight_position": 19.85750176382369,
"min_weight": 0.06635469782819445,
"min_weight_distance": 1.790379409682226
}
}
},
"metrics": {
"kl_divergence": 0.00028611166635528207,
"refusals": 92,
"base_refusals": 91,
"n_bad_prompts": 100
},
"hashes": {
"model.safetensors": "de03258825dfe97300e4b5d53d6f4c28ae15415825dbc085680630e16d21306a"
}
}

102
reproduce/requirements.txt Normal file
View File

@@ -0,0 +1,102 @@
absl-py==2.4.0
accelerate==1.13.0
alembic==1.17.2
annotated-doc==0.0.4
annotated-types==0.7.0
anyio==4.12.0
attrs==25.4.0
bitsandbytes==0.49.2
certifi==2025.11.12
chardet==5.2.0
charset-normalizer==3.4.4
click==8.3.1
colorama==0.4.6
colorlog==6.10.1
dataproperty==1.1.0
datasets==4.8.4
dill==0.4.0
evaluate==0.4.6
filelock==3.20.3
fsspec==2025.10.0
greenlet==3.3.0
h11==0.16.0
hf-xet==1.4.2
httpcore==1.0.9
httpx==0.28.1
huggingface-hub==1.7.2
idna==3.15
immutabledict==4.3.1
jinja2==3.1.6
joblib==1.5.2
jsonlines==4.0.0
langdetect==1.0.9
lm-eval==0.4.11
lxml==6.0.2
mako==1.3.12
markdown-it-py==4.0.0
markupsafe==3.0.3
mbstrdecoder==1.1.4
mdurl==0.1.2
more-itertools==10.8.0
mpmath==1.3.0
multiprocess==0.70.18
networkx==3.6.1
nltk==3.9.4
numpy==2.3.5
optuna==4.8.0
packaging==25.0
pandas==2.3.3
pathvalidate==3.3.1
peft==0.19.1
pillow==12.2.0
portalocker==3.2.0
prompt-toolkit==3.0.52
psutil==7.2.2
py-cpuinfo==9.0.0
pyarrow==22.0.0
pydantic==2.12.5
pydantic-core==2.41.5
pydantic-settings==2.13.1
pygments==2.20.0
pytablewriter==1.2.1
python-dateutil==2.9.0.post0
python-dotenv==1.2.2
pytz==2025.2
pywin32==311
pyyaml==6.0.3
questionary==2.1.1
regex==2025.11.3
requests==2.33.0
rich==14.3.3
rouge-score==0.1.2
sacrebleu==2.6.0
safetensors==0.7.0
scikit-learn==1.8.0
scipy==1.16.3
setuptools==80.9.0
shellingham==1.5.4
six==1.17.0
sqlalchemy==2.0.45
sqlitedict==2.1.0
sympy==1.14.0
tabledata==1.3.4
tabulate==0.10.0
tcolorpy==0.1.7
threadpoolctl==3.6.0
tokenizers==0.22.1
tomli-w==1.2.0
torch==2.11.0
torchaudio==2.11.0
torchvision==0.26.0
tqdm==4.67.1
transformers==5.6.2
typepy==1.3.4
typer==0.24.1
typing-extensions==4.15.0
typing-inspection==0.4.2
tzdata==2025.2
urllib3==2.7.0
wcwidth==0.2.14
word2number==1.1
xxhash==3.6.0
zstandard==0.25.0

File diff suppressed because it is too large Load Diff