question stringlengths 39 117 | answer stringlengths 67 261 |
|---|---|
What is the primary purpose of Heretic? | Heretic is a tool designed for the fully automatic removal of censorship (safety alignment) from transformer-based language models without the need for expensive post-training. |
What technologies does Heretic combine to achieve its automatic optimization? | It combines an advanced implementation of directional ablation (also known as 'abliteration') with a TPE-based parameter optimizer powered by Optuna. |
How does Heretic ensure that a decensored model retains as much intelligence as possible? | It finds high-quality parameters by co-minimizing two things: the number of refusals and the KL divergence from the original model. |
Which types of models are supported by Heretic? | Heretic supports most dense models, many multimodal models, several different MoE architectures, and some hybrid models like Qwen3.5. |
Which model architectures are NOT yet supported out of the box by Heretic? | Pure state-space models and certain other research architectures are not yet supported out of the box. |
Under what license is Heretic distributed? | It is distributed under the GNU Affero General Public License (AGPL). |
What are the minimum software requirements to run Heretic? | A Python 3.10+ environment with PyTorch 2.2+ installed is required. However, some features may require PyTorch 2.6+. |
What is the advantage of using 'uv' with Heretic? | Using 'uv run heretic' ensures that the dependencies match those used by the developers, which improves reliability and security by using the pinned versions in the uv.lock file. |
In what order does Heretic resolve configuration settings? | Heretic resolves settings in the following priority: 1. Initial settings (used during resume), 2. Command-line arguments (CLI), 3. Environment variables (prefixed with 'HERETIC_'), 4. Dotenv files, 5. The 'config.toml' file, and 6. File secret settings. |
How does Heretic handle loading model tensors if the initial 'auto' dtype fails? | Heretic uses a fallback mechanism defined in the 'dtypes' list. It will attempt to load with 'auto', then fall back to 'float16', then 'bfloat16', and finally 'float32' to maximize compatibility with different hardware. |
What is the purpose of the 'offload_outputs_to_cpu' setting? | It determines whether intermediate analysis tensors (such as residuals and logprobs) are moved to CPU memory immediately. Setting this to 'true' reduces peak VRAM usage during analysis, though it may slightly reduce performance due to host/device transfers. |
How does Heretic handle Chain-of-Thought (CoT) blocks during evaluation? | It uses the 'chain_of_thought_skips' setting, which contains pairs of (cot_initializer, closed_cot_block). This allows Heretic to skip the 'thinking' part of a response so that evaluation happens at the start of the actual assistant response. |
What library does Heretic use to support model quantization? | Heretic supports model quantization using the bitsandbytes library. |
What is the primary benefit of enabling quantization in Heretic? | Enabling quantization can drastically reduce the amount of VRAM required to process models. |
How do you enable quantization when running Heretic? | You can enable it by setting the 'quantization' option to 'bnb_4bit'. |
What is a specific technical requirement for loading MXFP4-quantized models like gpt-oss? | Loading MXFP4-quantized models uses 'torch.accelerator', which was added in PyTorch 2.6; therefore, a newer version of PyTorch may be required for these specific models. |
How does Heretic's implementation of 'direction_index' differ from previous methods? | The direction_index is a float rather than an integer. This allows the system to linearly interpolate between the two nearest residual direction vectors, unlocking a larger space of directions than just the difference-of-means computation. |
Why does Heretic use different ablation weights for attention and MLP components? | Because MLP interventions tend to be more damaging to the model's intelligence than attention interventions, using separate weights allows for better performance tuning. |
What does the 'winsorization_quantile' parameter do? | It is used to tame 'massive activations' by performing symmetric winsorization. For example, a value of 0.95 clamps the magnitudes of all components of the per-prompt, per-layer residual vectors to the 0.95-quantile. |
What is the function of 'orthogonalize_direction' in the ablation process? | When enabled, it adjusts the residual directions so that only the component that is orthogonal to the 'good' direction is subtracted during abliteration, preventing unnecessary changes to the model's helpfulness. |
What are the different options for 'row_normalization' and how do they differ? | There are three options: 'none' (no normalization), 'pre' (computes a LoRA adapter relative to row-normalized weights), and 'full' (similar to 'pre', but also renormalizes to preserve the original row magnitudes). |
What is the role of 'full_normalization_lora_rank' in the export process? | When 'row_normalization' is set to 'full', this parameter determines the rank of the LoRA adapter used to approximate row magnitude preservation. Higher ranks increase accuracy but produce larger files and slower evaluation. |
How many optimization trials does Heretic run by default? | The default is 200 trials, with the first 60 being random sampling for exploration (n_startup_trials). |
In the context of Heretic, what does the KL divergence metric represent? | KL divergence measures how much the decensored model's behavior/intelligence deviates from the original model. A low KL divergence indicates that the model's original capabilities have been well-preserved. |
How is the KLDivergence scorer configured in a config.toml file? | It is defined in the 'scorers' list as: `{ plugin = "heretic.scorers.kl_divergence.KLDivergence", optimization = "minimize" }`. |
How can a user manually evaluate the KL divergence of a model using the command line? | A user can run the evaluation functionality using the command: `heretic --model [original_model] --evaluate-model [heretic_model]`. |
If a model has a KL divergence of 0 in a comparison table, what does that mean? | A KL divergence of 0 means the model is being compared to itself (the original model), so by definition, there is no divergence. |
How does the 'KeywordRate' scorer determine if a response matches a refusal? | It checks for the case-insensitive presence of specific 'keyword_markers' (such as 'disclaimer', 'sorry', or 'as an ai') within the model's response. |
How can a user provide a plain text file as a prompt dataset instead of a Hugging Face dataset? | Users can provide a path to a plain text file where each line is one prompt. In this case, the 'column' parameter is ignored, and the 'split' parameter can be used to select a specific subset of the lines using slice notation (e.g., '[:400]'). |
How does the system prompt work in datasets? | Within the 'DatasetSpecification' (used for good_prompts and bad_prompts), a 'system_prompt' field can be set. This local system prompt will override the global system prompt if provided. |
How can a user set up multiple instances of the same scorer with different configurations? | In the 'scorers' list, you can provide an 'instance_name'. Then, in the TOML file, you define settings for that instance using the format `[scorer.ClassName_instance_name]`. |
How must Heretic be installed to access its interpretability research features? | To use research features, you must install Heretic with the optional research extra using the command: pip install -U heretic-llm[research]. |
What does the '--plot-residuals' flag do in research mode? | It computes residual vectors (hidden states) for 'harmful' and 'harmless' prompts across all transformer layers, then uses PaCMAP projection to generate scatter-plot PNGs for each layer and an animated GIF showing the transformation of residuals between layers. |
How does Heretic ensure that the animated GIF of residual transformations remains smooth and non-disruptive? | It minimizes disruptive transitions by initializing the PaCMAP projection for each new layer with the projections from the previous layer. |
What is the computational trade-off when using the '--plot-residuals' flag? | The PaCMAP projection is an expensive operation performed on the CPU; for larger models, this can take an hour or more to compute projections for all layers. |
What is the purpose of the '--print-residual-geometry' flag? | It provides a quantitative analysis table that tracks metrics like cosine similarity, L2 norms, and the Mean silhouette coefficient for the residual vectors of good versus bad prompts across different layers. |
In the residual geometry table, what does the 'r' column represent? | The 'r' column represents the residual direction for means, calculated as the difference between the mean of bad prompt residuals (b) and the mean of good prompt residuals (g), i.e., (b - g). |
In the residual geometry table, what does 'Silh' stand for? | 'Silh' stands for the Mean silhouette coefficient of residuals for the good and bad clusters. |
If a user wants to change the name or color of a dataset in the residual vector plots, which fields should they edit? | They should edit the 'residual_plot_label' and 'residual_plot_color' fields within the specific dataset table (e.g., [good_prompts]). |
What is the default 'max_shard_size' when exporting a model? | The default maximum size for individual safetensors files is '5GB'. |
No dataset card yet
- Downloads last month
- 77