mirror of
https://github.com/p-e-w/heretic.git
synced 2026-12-03 18:42:57 +07:00
[GH-ISSUE #236] [RFC] PIQA: A potential complement to KL divergence that could improve the quality of Heretic models #135
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#135
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?
Originally created by @p-e-w on GitHub (Mar 19, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/236
As part of refining #211, I am trying to figure out how we can predict the quality of the resulting model more reliably than with the KL divergence, while remaining fast enough to optimize for the metric. I have evaluated several small benchmark suites, and after a few days of testing, PIQA (Physical Interaction: Question Answering) has emerged as a promising candidate.
My main findings are:
gpt-oss-20bBF16 on an RTX 6000 Pro).The second point is illustrated by the following table:
acc_normAs you can see, PIQA and NatInt correlate almost perfectly (in a Spearman sense), and unlike the KLD, PIQA correctly predicts the poor NatInt score of
ArliAI/gpt-oss-20b-Derestricted.You can reproduce the PIQA scores using lm-evaluation-harness, with a command like
lm_eval --model hf --model_args pretrained=<model> --tasks piqa --device cuda:0 --batch_size 64. You can reproduce the Heretic KLD scores withheretic --model <base_model> --evaluate-model <model>. The NatInt scores are taken from the UGI Leaderboard.The very short evaluation time required for PIQA opens intriguing possibilities, including running PIQA on every trial, or (probably better), running it for all trials that are sufficiently close to the KLD-based Pareto front once the study completes. We can then re-build the Pareto front based on PIQA scores rather than KLD, which, according to these tests, should lead to improved prediction of model intelligence.
@kabachuha commented on GitHub (Mar 21, 2026):
Are you sure PIQA from 2019 has not contaminated literally every LLM dataset as of today?
@p-e-w commented on GitHub (Mar 21, 2026):
It doesn't matter. This is about measuring quality degradation vs the base model, not about defeating benchmaxxing in models.
Comparing PIQA scores before and after abliteration provides a measure for quality retention, regardless of whether the model has been trained on the test data or not (arguably, even more so if it has).
@erm14254 commented on GitHub (Mar 21, 2026):
I installed the new update, but now it seems like every trial is gonna take 10-11 minutes to complete:
WTH? This would normally take 6-8 hours or so (depending on model) for 400 trials, but now it's gonna take ~70 hours for 400 trials...
You mentioned in the OP that running PIQA "for all trials that are sufficiently close to the KLD-based Pareto front once the study completes" would probably be better. Is that workflow planned? For now I'm using --no-use-piqa to keep trials fast.
@p-e-w commented on GitHub (Mar 23, 2026):
See my comment in #246. That commit is purely to drive ARA development. It will not be merged into master.
@erm14254 commented on GitHub (Mar 23, 2026):
So you think it could be fixed?
@p-e-w commented on GitHub (Mar 23, 2026):
No idea, and it's not my priority right now.
@viaqlo commented on GitHub (Mar 23, 2026):
@erm14254 For me, the issue was the piqa batch size being set to
auto. Setting this to64or whatever the card can handle should speed things up dramatically.@erm14254 commented on GitHub (Mar 23, 2026):
I did, I changed it from auto to 128 and it's pretty much the same as before, nothing's changed and it's still super slow.
Elapsed time: 1h 19m
Estimated remaining time: 36h 43m
Running trial 15 of 400...
@p-e-w commented on GitHub (Mar 24, 2026):
I suspect the problem is that in Heretic, the model is wrapped in a
PeftModel, though I'm not working on this at the moment.@kabachuha commented on GitHub (Mar 24, 2026):
Personally, I think PIQA in heretic is a complete fiasco.
Not only it's a weak signal and giant slowdown of the whole process, it introduces a lot of factors to compute the loss when the words are sampled: the probabilities of the first one, selection of the order of the glue tokens ("the", "and", "in", etc.), paraphrasing of the same meaning in different words and lengths. It's not even MMLU / multichoice where you can judge by the logprobs of the selected letter.
The work could better be spent on developing novel techniques instead of squeezing a questionable multi-variable metric.
@p-e-w commented on GitHub (Mar 24, 2026):
PIQA isn't in Heretic. There's a temporary commit in the ARA branch for the purpose of developing ARA, and it has a switch to disable it.
The commit I pushed to that specific branch is not going to be merged, ever, which by now I have explicitly said multiple times. I never claimed it was going to be, I didn't even announce that I had implemented this, and I didn't ask others to test it.
c925f5e802isn't the proposed implementation of this issue, which is why it is specifically not linked to this issue in either direction.@p-e-w commented on GitHub (Apr 1, 2026):
I have found and fixed the reason why running PIQA (and all other benchmarks) was much slower in Heretic than in
lm_eval:Contrary to the documentation, the batch size must be set on the
HFLMobject, not in thesimple_evaluatearguments.With this fix, benchmarks become up to 10 times faster depending on the hardware.
However, as stated before, the PIQA implementation in #211 remains experimental and will not be merged into master. The proper implementation will use #53.