界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
效率与协作 · SKILL.md

toxigen_classifier_recovery

toxigen_classifier_recovery

【效率与协作】Run a bounded ToxiGen-style classifier update and report validator-compatible before-after loss, AUC, and parameter evidence.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: toxigen_classifier_recovery description: Run a bounded ToxiGen-style classifier update and report validator-compatible before-after loss, AUC, and parameter evidence.

ToxiGen Classifier Recovery

Use this skill when a recovery experiment needs to demonstrate the paper's classifier-improvement mechanism without full HateBERT or RoBERTa fine-tuning. It trains a tiny logistic classifier over deterministic text features and emits before/after metrics.

Do not use this skill to claim full paper Table 4 reproduction. A result from this skill is a reduced proxy unless it is replaced by a real model fine-tuning stack.

Inputs

  • Generated or curated examples with text and label.
  • Optional group and generation method metadata.
  • Learning rate and update-step count.

Outputs

  • loss_before, loss_after, auc_before, auc_after.
  • params_before, params_after, and optimizer_state_changed.
  • Per-example probabilities before and after the update.

Workflow

  1. Extract deterministic features from each text: bias/toxicity cue count, benign cue count, identity cue count, and normalized length.
  2. Initialize logistic weights and bias to zero unless supplied.
  3. Compute binary cross-entropy and pairwise AUC.
  4. Run bounded gradient-descent updates.
  5. Recompute metrics and emit a trace with parameter-change evidence.

Validation

Run:

python scripts/classifier_recovery.py --self-test
python tests/test_classifier_recovery.py

The tests verify that parameters change and that loss does not increase on a simple fixture.

Limitations

This skill is intentionally small and deterministic. It is useful for mechanism-faithful soft recovery, edge-case tests, and harness validation, not for reporting deployed toxicity classifier performance.

我的收藏