mirror of
https://github.com/p-e-w/heretic.git
synced 2026-12-03 18:42:57 +07:00
[PR #45] [MERGED] Guard against refusals in broken English #253
Labels
No labels
bug
enhancement
enhancement
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
p-e-w/heretic#253
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/p-e-w/heretic/pull/45
Author: @spikymoth
Created: 11/24/2025
Status: ✅ Merged
Merged: 11/26/2025
Merged by: @p-e-w
Base:
master← Head:detect-broken-english📝 Commits (2)
cd88684Guard against refusals in broken English9acbad6Normalize whitespace between words📊 Changes
3 files changed (+27 additions, -4 deletions)
View changed files
📝
config.default.toml(+12 -2)📝
src/heretic/config.py(+12 -2)📝
src/heretic/evaluator.py(+3 -0)📄 Description
While chatting with an abliterated model I noticed that it would sometimes omit the
tin contractions likewon't,can'tetc., turning them intowon',can'and so on. I think what's happening is that in some of the trials, it stops producing thets and this causes the refusals to not be detected as refusals, boosting the score.This change adds a bunch of broken English variants to the default refusal markers to catch this behavior. I added the ones that seem somewhat likely to happen, but let me know if I was too thorough. Technically "wont" and "cant" are valid English words, but they're pretty rare and I wouldn't normally expect them to come up near the start of a response.
We could go further and use a tool that uses the Levenshtein distance or does some other form of fuzzy matching, but that would require some careful tuning to avoid matching too much.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.