Heretic
https://github.com/p-e-w/hereticp-e-w/heretic
Hereticは、高価な後学習なしに、Transformerベースの言語モデルから検閲(いわゆる「safety alignment」)を除去するツールです。これは、directional ablation(別名「abliteration」(Arditi et al. 2024 ))の高度な実装と、 Optunaを搭載したTPEベースのパラメータ最適化ツールを組み合わせています。
このアプローチにより、Hereticは完全に自動的に動作します。
Hereticは拒否数を最小化すると同時に元のモデルからのKLダイバージェンスも最小化することで、高品質な消去パラメータを見つけ出します。
これにより、元のモデルの知性を可能な限り保持した検閲解除モデル(UGI)が得られます。
Hereticを使用するのにTransformerの内部構造を理解する必要はありません。
実際、コマンドラインプログラムを実行する方法を知っている人なら誰でもHereticを使って言語モデルの検閲を解除できます。
所謂llmの検閲を解除するチューニングを行うスクリプト
RTX 3090のデフォルト構成では、Llama-3.1-8Bのデセンサーリングに約45分かかります。
とあるので比較的軽量?
あくまで「拒否を減らす」だけなのでそもそも知らないことは正しく出力できない。
Prior art
https://huggingface.co/posts/mlabonne/714992455492422 AutoAbliteration
https://github.com/FailSpy/abliterator abliterator.py
https://github.com/wassname/abliterator wassname's Abliterator
https://github.com/Tsadoq/ErisForge ErisForge
https://github.com/Sumandora/remove-refusals-with-transformersRemoving refusals with HF Transformers
https://github.com/AUGMXNT/deccp AUGMXNT/deccp
The development of Heretic was informed by:
https://arxiv.org/abs/2406.11717 The original abliteration paper (Arditi et al. 2024)
https://huggingface.co/blog/mlabonne/abliteration Maxime Labonne's article on abliteration
abliterationに関する記事
as well as some details from the model cards of his own abliterated models (see above)
https://huggingface.co/blog/grimjim/projected-abliteration Jim Lai's article describing "projected abliteration"
projected abliterationの解説記事