DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to measure refusals and KL divergence against the original model with Heretic

Use Heretic's built-in evaluation to compare a decensored model with its original on the same metrics.

Short answer: Prepare a Python 3.10+ environment with PyTorch 2.2+ installed for your hardware; then run pip install -U heretic-llm; run heretic --model google/gemma-3-12b-it --evaluate-model p-e-w/gemma-3-12b-it-heretic, replacing the two model IDs with the original and the candidate. All steps.

  • Research
  • Intermediate
  • 1 hour
  • From the README
  • Any agent

Authorization notice. Heretic is dual-use. Only use it on software, sites and systems you own or have explicit permission to test.

Who it is forA model evaluator who needs to check whether a published decensored model is actually less restricted and still capable.

The problemClaims about a decensored model are hard to trust without the same refusal and divergence metrics applied to both models.

The outcomeRefusal counts and KL divergence figures for a candidate model, comparable with the numbers in the README table.

What you need first

  • Python 3.10 or newer
  • PyTorch 2.2 or newer, installed for your hardware
  • A GPU with enough VRAM for the model you pick (the README cites an RTX 3090 and an RTX 5090)
  • Access to the target model's files, such as a Hugging Face model ID

Steps

  1. Prepare a Python 3.10+ environment with PyTorch 2.2+ installed for your hardware.
  2. Run pip install -U heretic-llm.
  3. Run heretic --model google/gemma-3-12b-it --evaluate-model p-e-w/gemma-3-12b-it-heretic, replacing the two model IDs with the original and the candidate.
  4. Record the refusal count for the harmful prompts and the KL divergence for the harmless prompts.
  5. Compare the results with the README table and note that values can vary by platform and hardware.

Prompt for your agent

Install the heretic-llm package from the p-e-w/heretic repo, then run `heretic --model <original-model-id> --evaluate-model <candidate-model-id>`. Return the refusal count and KL divergence the tool reports, and verify that both model IDs in the output match the ones you passed in.

Caveat. The README says these numbers depend on platform and hardware, and its own table used PyTorch 2.8 on an RTX 5090, so your figures may differ.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for p-e-w/heretic and "Measure refusals and KL divergence against the original model"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer