1
0
Fork 0
mirror of https://github.com/p-e-w/heretic.git synced 2026-12-03 20:44:21 +07:00

[GH-ISSUE #61] Support aya-expanse-32b-Q4-mlx #28

Closed
opened 2026-11-01 04:16:42 +07:00 by bsakaguchi · 20 comments
Owner

Originally created by @rigin on GitHub (Dec 2, 2025).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/61

Can you tell me what needs to be added to the settings and where?

Loading model F:\LLMs\aya-expanse-32b-Q4-mlx...

  • Trying dtype auto... Failed (The model's quantization config from the arguments has no quant_method attribute. Make sure that the model has
    been correctly quantized)
  • Trying dtype float16... Failed (The model's quantization config from the arguments has no quant_method attribute. Make sure that the model has
    been correctly quantized)
  • Trying dtype float32... Failed (The model's quantization config from the arguments has no quant_method attribute. Make sure that the model has
    been correctly quantized)
Originally created by @rigin on GitHub (Dec 2, 2025). Original GitHub issue: https://github.com/p-e-w/heretic/issues/61 Can you tell me what needs to be added to the settings and where? Loading model F:\LLMs\aya-expanse-32b-Q4-mlx... * Trying dtype auto... Failed (The model's quantization config from the arguments has no `quant_method` attribute. Make sure that the model has been correctly quantized) * Trying dtype float16... Failed (The model's quantization config from the arguments has no `quant_method` attribute. Make sure that the model has been correctly quantized) * Trying dtype float32... Failed (The model's quantization config from the arguments has no `quant_method` attribute. Make sure that the model has been correctly quantized)
bsakaguchi 2026-11-01 04:16:42 +07:00
Author
Owner

@Vinay-Umrethe commented on GitHub (Dec 2, 2025):

Are you using up to date versions of transformers and bitsandbytes Try this:

pip install --upgrade transformers bitsandbytes 
<!-- gh-comment-id:3601157160 --> @Vinay-Umrethe commented on GitHub (Dec 2, 2025): Are you using up to date versions of `transformers` and `bitsandbytes` Try this: ```bash pip install --upgrade transformers bitsandbytes ```
Author
Owner

@rigin commented on GitHub (Dec 2, 2025):

It didn't help. The error remains.

<!-- gh-comment-id:3601381927 --> @rigin commented on GitHub (Dec 2, 2025): It didn't help. The error remains.
Author
Owner

@Vinay-Umrethe commented on GitHub (Dec 2, 2025):

not sure which model you are using exactly, is that a GGUF ?

maybe you can try this one 2z299/aya-expanse-32b-bnb-4bit https://huggingface.co/2z299/aya-expanse-32b-bnb-4bit

<!-- gh-comment-id:3601465972 --> @Vinay-Umrethe commented on GitHub (Dec 2, 2025): not sure which model you are using exactly, is that a GGUF ? maybe you can try this one `2z299/aya-expanse-32b-bnb-4bit` https://huggingface.co/2z299/aya-expanse-32b-bnb-4bit
Author
Owner

@rigin commented on GitHub (Dec 2, 2025):

No, I know about GGUF, I use safetensors options. Okay, I'll give it a try.

<!-- gh-comment-id:3601594860 --> @rigin commented on GitHub (Dec 2, 2025): No, I know about GGUF, I use safetensors options. Okay, I'll give it a try.
Author
Owner

@Vinay-Umrethe commented on GitHub (Dec 2, 2025):

this one is quantized with bnb the one you used was MLX likely for apple chips so dtype: auto didn't worked

<!-- gh-comment-id:3601685392 --> @Vinay-Umrethe commented on GitHub (Dec 2, 2025): this one is quantized with `bnb` the one you used was MLX likely for `apple` chips so dtype: auto didn't worked
Author
Owner

@rigin commented on GitHub (Dec 2, 2025):

The last option was read and launched. Let's see how the process goes. This is the first quantized model that I have been able to download.

<!-- gh-comment-id:3601797229 --> @rigin commented on GitHub (Dec 2, 2025): The last option was read and launched. Let's see how the process goes. This is the first quantized model that I have been able to download.
Author
Owner

@Vinay-Umrethe commented on GitHub (Dec 2, 2025):

sounds good, if the model weights are now downloading... means the config.json dtype worked.

<!-- gh-comment-id:3601822831 --> @Vinay-Umrethe commented on GitHub (Dec 2, 2025): sounds good, if the model weights are now downloading... means the `config.json` dtype worked.
Author
Owner

@rigin commented on GitHub (Dec 2, 2025):

Unfortunately, no. The model has loaded, and the number of tokens has been tested, but an error occurs during the first cycle of the calculation.

Abliterating...
[W 2025-12-02 16:11:06,972] Trial 0 failed with parameters: {'direction_scope': 'global', 'direction_index': 32.135504850155414, 'attn.o_proj.max_weight': 1.132954299787842, 'attn.o_proj.max_weight_position': 23.74937331043737, 'attn.o_proj.min_weight': 0.6690000108980544, 'attn.o_proj.min_weight_distance': 1.3085894434224952, 'mlp.down_proj.max_weight': 1.0086062192607672, 'mlp.down_proj.max_weight_position': 23.825336062440016, 'mlp.down_proj.min_weight': 0.21770223208254313, 'mlp.down_proj.min_weight_distance': 7.646333120329111} because of the following error: RuntimeError('mat1 and mat2 shapes cannot be multiplied (8192x8192 and 100663296x1)').
Traceback (most recent call last):
File "C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\optuna\study_optimize.py", line 205, in run_trial
value_or_values = func(trial)
File "C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\main.py", line 363, in objective_wrapper
return objective(trial)
File "C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\main.py", line 341, in objective
model.abliterate(refusal_directions, direction_index, parameters)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\model.py", line 239, in abliterate
matrix.sub
(weight * (device_projector @ matrix))
~~~~~~~~~~~~~~~~~^~~~~~~~
RuntimeError: mat1 and mat2 shapes cannot be multiplied (8192x8192 and 100663296x1)
[W 2025-12-02 16:11:06,975] Trial 0 failed with value None.
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in _run_module_as_main:198 │
│ in _run_code:88 │
│ │
│ in :6 │
│ │
│ 3 if name == 'main': │
│ 4 │ if sys.argv[0].endswith('.exe'): │
│ 5 │ │ sys.argv[0] = sys.argv[0][:-4] │
│ ❱ 6 │ sys.exit(main()) │
│ 7 │
│ │
│ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\main.py:592 in main │
│ │
│ 589 │ install() │
│ 590 │ │
│ 591 │ try: │
│ ❱ 592 │ │ run() │
│ 593 │ except BaseException as error: │
│ 594 │ │ # Transformers appears to handle KeyboardInterrupt (or BaseException) │
│ 595 │ │ # internally in some places, which can re-raise a different error in the handler │
│ │
│ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\main.py:379 in run │
│ │
│ 376 │ ) │
│ 377 │ │
│ 378 │ try: │
│ ❱ 379 │ │ study.optimize(objective_wrapper, n_trials=settings.n_trials) │
│ 380 │ except KeyboardInterrupt: │
│ 381 │ │ # This additional handler takes care of the small chance that KeyboardInterrupt │
│ 382 │ │ # is raised just between trials, which wouldn't be caught by the handler │
│ │
│ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\optuna\study\study.py:490 in optimize │
│ │
│ 487 │ │ │ RuntimeError: │
│ 488 │ │ │ │ If nested invocation of this method occurs. │
│ 489 │ │ """ │
│ ❱ 490 │ │ _optimize( │
│ 491 │ │ │ study=self, │
│ 492 │ │ │ func=func, │
│ 493 │ │ │ n_trials=n_trials, │
│ │
│ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\optuna\study_optimize.py:67 in │
│ _optimize │
│ │
│ 64 │ │
│ 65 │ try: │
│ 66 │ │ if n_jobs == 1: │
│ ❱ 67 │ │ │ _optimize_sequential( │
│ 68 │ │ │ │ study, │
│ 69 │ │ │ │ func, │
│ 70 │ │ │ │ n_trials, │
│ │
│ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\optuna\study_optimize.py:164 in │
│ _optimize_sequential │
│ │
│ 161 │ │ │ │ break │
│ 162 │ │ │
│ 163 │ │ try: │
│ ❱ 164 │ │ │ frozen_trial_id = _run_trial(study, func, catch) │
│ 165 │ │ finally: │
│ 166 │ │ │ # The following line mitigates memory problems that can be occurred in some │
│ 167 │ │ │ # environments (e.g., services that use computing containers such as GitHub │
│ │
│ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\optuna\study_optimize.py:262 in │
│ _run_trial │
│ │
│ 259 │ │ and func_err is not None │
│ 260 │ │ and not isinstance(func_err, catch) │
│ 261 │ ): │
│ ❱ 262 │ │ raise func_err │
│ 263 │ return trial._trial_id │
│ 264 │
│ 265 │
│ │
│ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\optuna\study_optimize.py:205 in │
│ _run_trial │
│ │
│ 202 │ │
│ 203 │ with get_heartbeat_thread(trial._trial_id, study.storage): │
│ 204 │ │ try: │
│ ❱ 205 │ │ │ value_or_values = func(trial) │
│ 206 │ │ except exceptions.TrialPruned as e: │
│ 207 │ │ │ # TODO(mamu): Handle multi-objective cases. │
│ 208 │ │ │ state = TrialState.PRUNED │
│ │
│ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\main.py:363 in objective_wrapper │
│ │
│ 360 │ │
│ 361 │ def objective_wrapper(trial: Trial) -> tuple[float, float]: │
│ 362 │ │ try: │
│ ❱ 363 │ │ │ return objective(trial) │
│ 364 │ │ except KeyboardInterrupt: │
│ 365 │ │ │ # Stop the study gracefully on Ctrl+C. │
│ 366 │ │ │ trial.study.stop() │
│ │
│ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\main.py:341 in objective │
│ │
│ 338 │ │ print("* Reloading model...") │
│ 339 │ │ model.reload_model() │
│ 340 │ │ print("* Abliterating...") │
│ ❱ 341 │ │ model.abliterate(refusal_directions, direction_index, parameters) │
│ 342 │ │ print("* Evaluating...") │
│ 343 │ │ score, kl_divergence, refusals = evaluator.get_score() │
│ 344 │
│ │
│ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\model.py:239 in abliterate │
│ │
│ 236 │ │ │ │ │ # Ensure projector is on the same device as the matrix for multi-GPU │
│ 237 │ │ │ │ │ device_projector = projector.to(matrix.device) │
│ 238 │ │ │ │ │ # In-place subtraction is safe as we're not using Autograd. │
│ ❱ 239 │ │ │ │ │ matrix.sub
(weight * (device_projector @ matrix)) │
│ 240 │ │
│ 241 │ def get_chat(self, prompt: str) -> list[dict[str, str]]: │
│ 242 │ │ return [ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
RuntimeError: mat1 and mat2 shapes cannot be multiplied (8192x8192 and 100663296x1)

<!-- gh-comment-id:3602002644 --> @rigin commented on GitHub (Dec 2, 2025): Unfortunately, no. The model has loaded, and the number of tokens has been tested, but an error occurs during the first cycle of the calculation. Abliterating... [W 2025-12-02 16:11:06,972] Trial 0 failed with parameters: {'direction_scope': 'global', 'direction_index': 32.135504850155414, 'attn.o_proj.max_weight': 1.132954299787842, 'attn.o_proj.max_weight_position': 23.74937331043737, 'attn.o_proj.min_weight': 0.6690000108980544, 'attn.o_proj.min_weight_distance': 1.3085894434224952, 'mlp.down_proj.max_weight': 1.0086062192607672, 'mlp.down_proj.max_weight_position': 23.825336062440016, 'mlp.down_proj.min_weight': 0.21770223208254313, 'mlp.down_proj.min_weight_distance': 7.646333120329111} because of the following error: RuntimeError('mat1 and mat2 shapes cannot be multiplied (8192x8192 and 100663296x1)'). Traceback (most recent call last): File "C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\optuna\study\_optimize.py", line 205, in _run_trial value_or_values = func(trial) File "C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\main.py", line 363, in objective_wrapper return objective(trial) File "C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\main.py", line 341, in objective model.abliterate(refusal_directions, direction_index, parameters) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\model.py", line 239, in abliterate matrix.sub_(weight * (device_projector @ matrix)) ~~~~~~~~~~~~~~~~~^~~~~~~~ RuntimeError: mat1 and mat2 shapes cannot be multiplied (8192x8192 and 100663296x1) [W 2025-12-02 16:11:06,975] Trial 0 failed with value None. ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ in _run_module_as_main:198 │ │ in _run_code:88 │ │ │ │ in <module>:6 │ │ │ │ 3 if __name__ == '__main__': │ │ 4 │ if sys.argv[0].endswith('.exe'): │ │ 5 │ │ sys.argv[0] = sys.argv[0][:-4] │ │ ❱ 6 │ sys.exit(main()) │ │ 7 │ │ │ │ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\main.py:592 in main │ │ │ │ 589 │ install() │ │ 590 │ │ │ 591 │ try: │ │ ❱ 592 │ │ run() │ │ 593 │ except BaseException as error: │ │ 594 │ │ # Transformers appears to handle KeyboardInterrupt (or BaseException) │ │ 595 │ │ # internally in some places, which can re-raise a different error in the handler │ │ │ │ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\main.py:379 in run │ │ │ │ 376 │ ) │ │ 377 │ │ │ 378 │ try: │ │ ❱ 379 │ │ study.optimize(objective_wrapper, n_trials=settings.n_trials) │ │ 380 │ except KeyboardInterrupt: │ │ 381 │ │ # This additional handler takes care of the small chance that KeyboardInterrupt │ │ 382 │ │ # is raised just between trials, which wouldn't be caught by the handler │ │ │ │ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\optuna\study\study.py:490 in optimize │ │ │ │ 487 │ │ │ RuntimeError: │ │ 488 │ │ │ │ If nested invocation of this method occurs. │ │ 489 │ │ """ │ │ ❱ 490 │ │ _optimize( │ │ 491 │ │ │ study=self, │ │ 492 │ │ │ func=func, │ │ 493 │ │ │ n_trials=n_trials, │ │ │ │ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\optuna\study\_optimize.py:67 in │ │ _optimize │ │ │ │ 64 │ │ │ 65 │ try: │ │ 66 │ │ if n_jobs == 1: │ │ ❱ 67 │ │ │ _optimize_sequential( │ │ 68 │ │ │ │ study, │ │ 69 │ │ │ │ func, │ │ 70 │ │ │ │ n_trials, │ │ │ │ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\optuna\study\_optimize.py:164 in │ │ _optimize_sequential │ │ │ │ 161 │ │ │ │ break │ │ 162 │ │ │ │ 163 │ │ try: │ │ ❱ 164 │ │ │ frozen_trial_id = _run_trial(study, func, catch) │ │ 165 │ │ finally: │ │ 166 │ │ │ # The following line mitigates memory problems that can be occurred in some │ │ 167 │ │ │ # environments (e.g., services that use computing containers such as GitHub │ │ │ │ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\optuna\study\_optimize.py:262 in │ │ _run_trial │ │ │ │ 259 │ │ and func_err is not None │ │ 260 │ │ and not isinstance(func_err, catch) │ │ 261 │ ): │ │ ❱ 262 │ │ raise func_err │ │ 263 │ return trial._trial_id │ │ 264 │ │ 265 │ │ │ │ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\optuna\study\_optimize.py:205 in │ │ _run_trial │ │ │ │ 202 │ │ │ 203 │ with get_heartbeat_thread(trial._trial_id, study._storage): │ │ 204 │ │ try: │ │ ❱ 205 │ │ │ value_or_values = func(trial) │ │ 206 │ │ except exceptions.TrialPruned as e: │ │ 207 │ │ │ # TODO(mamu): Handle multi-objective cases. │ │ 208 │ │ │ state = TrialState.PRUNED │ │ │ │ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\main.py:363 in objective_wrapper │ │ │ │ 360 │ │ │ 361 │ def objective_wrapper(trial: Trial) -> tuple[float, float]: │ │ 362 │ │ try: │ │ ❱ 363 │ │ │ return objective(trial) │ │ 364 │ │ except KeyboardInterrupt: │ │ 365 │ │ │ # Stop the study gracefully on Ctrl+C. │ │ 366 │ │ │ trial.study.stop() │ │ │ │ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\main.py:341 in objective │ │ │ │ 338 │ │ print("* Reloading model...") │ │ 339 │ │ model.reload_model() │ │ 340 │ │ print("* Abliterating...") │ │ ❱ 341 │ │ model.abliterate(refusal_directions, direction_index, parameters) │ │ 342 │ │ print("* Evaluating...") │ │ 343 │ │ score, kl_divergence, refusals = evaluator.get_score() │ │ 344 │ │ │ │ C:\Users\vadim\anaconda3\envs\heretic\Lib\site-packages\heretic\model.py:239 in abliterate │ │ │ │ 236 │ │ │ │ │ # Ensure projector is on the same device as the matrix for multi-GPU │ │ 237 │ │ │ │ │ device_projector = projector.to(matrix.device) │ │ 238 │ │ │ │ │ # In-place subtraction is safe as we're not using Autograd. │ │ ❱ 239 │ │ │ │ │ matrix.sub_(weight * (device_projector @ matrix)) │ │ 240 │ │ │ 241 │ def get_chat(self, prompt: str) -> list[dict[str, str]]: │ │ 242 │ │ return [ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ RuntimeError: mat1 and mat2 shapes cannot be multiplied (8192x8192 and 100663296x1)
Author
Owner

@rigin commented on GitHub (Dec 2, 2025):

About hardware and software.

RAM: 64 GB.

GPU 0: NVIDIA GeForce RTX 5060 Ti 16GB
GPU 1: NVIDIA GeForce RTX 5060 Ti 16GB
GPU 2: NVIDIA GeForce RTX 4060 Ti 16GB

Software installation:

conda create -n heretic python=3.13
conda activate heretic
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu130
pip3 install git+https://github.com/p-e-w/heretic.git
pip3 install --upgrade transformers bitsandbytes 
<!-- gh-comment-id:3602051629 --> @rigin commented on GitHub (Dec 2, 2025): About hardware and software. RAM: 64 GB. GPU 0: NVIDIA GeForce RTX 5060 Ti 16GB GPU 1: NVIDIA GeForce RTX 5060 Ti 16GB GPU 2: NVIDIA GeForce RTX 4060 Ti 16GB Software installation: ``` conda create -n heretic python=3.13 conda activate heretic pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu130 pip3 install git+https://github.com/p-e-w/heretic.git pip3 install --upgrade transformers bitsandbytes ```
Author
Owner

@Vinay-Umrethe commented on GitHub (Dec 2, 2025):

The error is caused by a matrix shape mismatch (8192x8192 and 100663296x1).

code is trying to perform math operation matrix multiplication on the model's weights, but specific 4-bit quantized format of the model you suggested is incompatible with that operation.

The model loaded fine, but the custom operation in script failed because it doesn't know how to handle the compressed weight format.

I suggest you can check https://github.com/p-e-w/heretic/pull/60 PR A user has made some changes to support such quantized models

Go to their Repo which is not merged yet https://github.com/accemlcc/heretic-lora/tree/master and built a .whl install it for directly OR you clone it and run:

python main.py --model {id} {batchsize/n-trials/etc} what ever config you set.

another user reported it likely worked for him...

<!-- gh-comment-id:3602073909 --> @Vinay-Umrethe commented on GitHub (Dec 2, 2025): The error is caused by a matrix shape mismatch (8192x8192 and 100663296x1). code is trying to perform math operation matrix multiplication on the model's weights, but specific 4-bit quantized format of the model you suggested is incompatible with that operation. The model loaded fine, but the custom operation in script failed because it doesn't know how to handle the compressed weight format. ## I suggest you can check https://github.com/p-e-w/heretic/pull/60 PR A user has made some changes to support such quantized models Go to their Repo which is not merged yet https://github.com/accemlcc/heretic-lora/tree/master and built a .whl install it for directly OR you clone it and run: ```python python main.py --model {id} {batchsize/n-trials/etc} what ever config you set. ``` another user reported it likely worked for him...
Author
Owner

@Vinay-Umrethe commented on GitHub (Dec 2, 2025):

you might do everything the same just replace the repo url wih the PR that supports bitsandbytes quants to ablate models using heretic

like:

conda create -n heretic python=3.13
conda activate heretic
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu130
pip3 install git+https://github.com/p-e-w/heretic.git # replace with https://github.com/accemlcc/heretic-lora/tree/master
pip3 install --upgrade transformers bitsandbytes 
<!-- gh-comment-id:3602088409 --> @Vinay-Umrethe commented on GitHub (Dec 2, 2025): you might do everything the same just replace the repo url wih the PR that supports bitsandbytes quants to ablate models using heretic like: ```bash conda create -n heretic python=3.13 conda activate heretic pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu130 pip3 install git+https://github.com/p-e-w/heretic.git # replace with https://github.com/accemlcc/heretic-lora/tree/master pip3 install --upgrade transformers bitsandbytes ```
Author
Owner

@rigin commented on GitHub (Dec 2, 2025):

I understand that this fork creates a lora model, which then needs to be combined with the original model?

<!-- gh-comment-id:3602185440 --> @rigin commented on GitHub (Dec 2, 2025): I understand that this fork creates a lora model, which then needs to be combined with the original model?
Author
Owner

@Vinay-Umrethe commented on GitHub (Dec 2, 2025):

So I built the wheel of that fork, and tested with a small model looks like it got loaded, but got a error:

Which Means The User's Fork Has Issues In It.

Confirmed as he removed projector = torch.outer(layer_refusal_direction, layer_refusal_direction,).to(self.model.dtype) in his commit 8f1fafd might be accidental but caused issue.

Soultion I can suggest:
let's try doing it with before this error commit has be done by:

git clone github.com && cd heretic-lora && git checkout 3cacbae

I'll give it a try and tell if it worked

Loading model Qwen/Qwen2.5-0.5B...
generation_config.json: 100% 138/138 [00:00<00:00, 1.29MB/s]
Ok
Model loaded in 4-bit precision.
* Initializing LoRA adapters...
* Transformer model with 24 layers
* Abliterable components:
  * attn.o_proj: 1 matrices per layer
  * mlp.down_proj: 1 matrices per layer

Loading good prompts from mlabonne/harmless_alpaca...
README.md: 100% 388/388 [00:00<00:00, 3.38MB/s]
data/train-00000-of-00001.parquet: 100% 972k/972k [00:01<00:00, 756kB/s]
data/test-00000-of-00001.parquet: 100% 243k/243k [00:00<00:00, 375kB/s]
Generating train split: 100% 25058/25058 [00:00<00:00, 517414.57 examples/s]
Generating test split: 100% 6265/6265 [00:00<00:00, 1264487.49 examples/s]
* 400 prompts loaded

Loading bad prompts from mlabonne/harmful_behaviors...
README.md: 100% 381/381 [00:00<00:00, 3.47MB/s]
data/train-00000-of-00001.parquet: 100% 15.0k/15.0k [00:00<00:00, 28.1kB/s]
data/test-00000-of-00001.parquet: 100% 5.46k/5.46k [00:00<00:00, 11.0kB/s]
Generating train split: 100% 416/416 [00:00<00:00, 197893.89 examples/s]
Generating test split: 100% 104/104 [00:00<00:00, 68296.17 examples/s]
* 400 prompts loaded

Loading good evaluation prompts from mlabonne/harmless_alpaca...
* 100 prompts loaded
* Obtaining first-token probability distributions...

Loading bad evaluation prompts from mlabonne/harmful_behaviors...
* 100 prompts loaded
* Counting model refusals...
* Initial refusals: 1/100

Calculating per-layer refusal directions...
* Obtaining residuals for good prompts...
* Obtaining residuals for bad prompts...

Running trial 1 of 5...
* Parameters:
  * direction_index = 20.07
  * attn.o_proj.max_weight = 1.22
  * attn.o_proj.max_weight_position = 17.43
  * attn.o_proj.min_weight = 0.51
  * attn.o_proj.min_weight_distance = 8.76
  * mlp.down_proj.max_weight = 1.05
  * mlp.down_proj.max_weight_position = 14.35
  * mlp.down_proj.min_weight = 0.34
  * mlp.down_proj.min_weight_distance = 10.26
* Reloading model...
* Abliterating...
[W 2025-12-02 14:18:34,261] Trial 0 failed with parameters: {'direction_scope': 'global', 'direction_index': 20.06772256753863, 'attn.o_proj.max_weight': 1.222261781819479, 'attn.o_proj.max_weight_position': 17.42762118078405, 'attn.o_proj.min_weight': 0.4143863716846782, 'attn.o_proj.min_weight_distance': 8.761789782061058, 'mlp.down_proj.max_weight': 1.0484008415874977, 'mlp.down_proj.max_weight_position': 14.354987529237215, 'mlp.down_proj.min_weight': 0.32362409550071236, 'mlp.down_proj.min_weight_distance': 10.256527839440563} because of the following error: NameError("name 'projector' is not defined").
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/dist-packages/optuna/study/_optimize.py", line 205, in _run_trial
    value_or_values = func(trial)
                      ^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/heretic/main.py", line 363, in objective_wrapper
    return objective(trial)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/heretic/main.py", line 341, in objective
    model.abliterate(refusal_directions, direction_index, parameters)
  File "/usr/local/lib/python3.12/dist-packages/heretic/model.py", line 323, in abliterate
    device_projector = projector.to(matrix.device)
                       ^^^^^^^^^
NameError: name 'projector' is not defined
[W 2025-12-02 14:18:34,264] Trial 0 failed with value None.
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /usr/local/bin/heretic:8 in <module>                                         │
│                                                                              │
│   5 from heretic.main import main                                            │
│   6 if __name__ == '__main__':                                               │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])     │
│ ❱ 8 │   sys.exit(main())                                                     │
│   9                                                                          │
│                                                                              │
│ /usr/local/lib/python3.12/dist-packages/heretic/main.py:592 in main          │
│                                                                              │
│   589 │   install()                                                          │
│   590 │                                                                      │
│   591 │   try:                                                               │
│ ❱ 592 │   │   run()                                                          │
│   593 │   except BaseException as error:                                     │
│   594 │   │   # Transformers appears to handle KeyboardInterrupt (or BaseExc │
│   595 │   │   # internally in some places, which can re-raise a different er │
│                                                                              │
│ /usr/local/lib/python3.12/dist-packages/heretic/main.py:379 in run           │
│                                                                              │
│   376 │   )                                                                  │
│   377 │                                                                      │
│   378 │   try:                                                               │
│ ❱ 379 │   │   study.optimize(objective_wrapper, n_trials=settings.n_trials)  │
│   380 │   except KeyboardInterrupt:                                          │
│   381 │   │   # This additional handler takes care of the small chance that  │
│   382 │   │   # is raised just between trials, which wouldn't be caught by t │
│                                                                              │
│ /usr/local/lib/python3.12/dist-packages/optuna/study/study.py:490 in         │
│ optimize                                                                     │
│                                                                              │
│    487 │   │   │   RuntimeError:                                             │
│    488 │   │   │   │   If nested invocation of this method occurs.           │
│    489 │   │   """                                                           │
│ ❱  490 │   │   _optimize(                                                    │
│    491 │   │   │   study=self,                                               │
│    492 │   │   │   func=func,                                                │
│    493 │   │   │   n_trials=n_trials,                                        │
│                                                                              │
│ /usr/local/lib/python3.12/dist-packages/optuna/study/_optimize.py:67 in      │
│ _optimize                                                                    │
│                                                                              │
│    64 │                                                                      │
│    65 │   try:                                                               │
│    66 │   │   if n_jobs == 1:                                                │
│ ❱  67 │   │   │   _optimize_sequential(                                      │
│    68 │   │   │   │   study,                                                 │
│    69 │   │   │   │   func,                                                  │
│    70 │   │   │   │   n_trials,                                              │
│                                                                              │
│ /usr/local/lib/python3.12/dist-packages/optuna/study/_optimize.py:164 in     │
│ _optimize_sequential                                                         │
│                                                                              │
│   161 │   │   │   │   break                                                  │
│   162 │   │                                                                  │
│   163 │   │   try:                                                           │
│ ❱ 164 │   │   │   frozen_trial_id = _run_trial(study, func, catch)           │
│   165 │   │   finally:                                                       │
│   166 │   │   │   # The following line mitigates memory problems that can be │
│   167 │   │   │   # environments (e.g., services that use computing containe │
│                                                                              │
│ /usr/local/lib/python3.12/dist-packages/optuna/study/_optimize.py:262 in     │
│ _run_trial                                                                   │
│                                                                              │
│   259 │   │   and func_err is not None                                       │
│   260 │   │   and not isinstance(func_err, catch)                            │
│   261 │   ):                                                                 │
│ ❱ 262 │   │   raise func_err                                                 │
│   263 │   return trial._trial_id                                             │
│   264                                                                        │
│   265                                                                        │
│                                                                              │
│ /usr/local/lib/python3.12/dist-packages/optuna/study/_optimize.py:205 in     │
│ _run_trial                                                                   │
│                                                                              │
│   202 │                                                                      │
│   203 │   with get_heartbeat_thread(trial._trial_id, study._storage):        │
│   204 │   │   try:                                                           │
│ ❱ 205 │   │   │   value_or_values = func(trial)                              │
│   206 │   │   except exceptions.TrialPruned as e:                            │
│   207 │   │   │   # TODO(mamu): Handle multi-objective cases.                │
│   208 │   │   │   state = TrialState.PRUNED                                  │
│                                                                              │
│ /usr/local/lib/python3.12/dist-packages/heretic/main.py:363 in               │
│ objective_wrapper                                                            │
│                                                                              │
│   360 │                                                                      │
│   361 │   def objective_wrapper(trial: Trial) -> tuple[float, float]:        │
│   362 │   │   try:                                                           │
│ ❱ 363 │   │   │   return objective(trial)                                    │
│   364 │   │   except KeyboardInterrupt:                                      │
│   365 │   │   │   # Stop the study gracefully on Ctrl+C.                     │
│   366 │   │   │   trial.study.stop()                                         │
│                                                                              │
│ /usr/local/lib/python3.12/dist-packages/heretic/main.py:341 in objective     │
│                                                                              │
│   338 │   │   print("* Reloading model...")                                  │
│   339 │   │   model.reload_model()                                           │
│   340 │   │   print("* Abliterating...")                                     │
│ ❱ 341 │   │   model.abliterate(refusal_directions, direction_index, paramete │
│   342 │   │   print("* Evaluating...")                                       │
│   343 │   │   score, kl_divergence, refusals = evaluator.get_score()         │
│   344                                                                        │
│                                                                              │
│ /usr/local/lib/python3.12/dist-packages/heretic/model.py:323 in abliterate   │
│                                                                              │
│   320 │   │   │   │   │   │   assert torch.is_tensor(matrix)                 │
│   321 │   │   │   │   │   │                                                  │
│   322 │   │   │   │   │   │   # Ensure projector is on the same device as th │
│ ❱ 323 │   │   │   │   │   │   device_projector = projector.to(matrix.device) │
│   324 │   │   │   │   │   │   # In-place subtraction is safe as we're not us │
│   325 │   │   │   │   │   │   matrix.sub_(weight * (device_projector @ matri │
│   326                                                                        │
╰──────────────────────────────────────────────────────────────────────────────╯
NameError: name 'projector' is not defined
<!-- gh-comment-id:3602335303 --> @Vinay-Umrethe commented on GitHub (Dec 2, 2025): So I built the wheel of that fork, and tested with a small model looks like it got loaded, but got a error: ## Which Means The User's Fork Has Issues In It. > Confirmed as he removed `projector = torch.outer(layer_refusal_direction, layer_refusal_direction,).to(self.model.dtype)` in his commit `8f1fafd` might be accidental but caused issue. Soultion I can suggest: let's try doing it with before this error commit has be done by: ```bash git clone github.com && cd heretic-lora && git checkout 3cacbae ``` I'll give it a try and tell if it worked ```bash Loading model Qwen/Qwen2.5-0.5B... generation_config.json: 100% 138/138 [00:00<00:00, 1.29MB/s] Ok Model loaded in 4-bit precision. * Initializing LoRA adapters... * Transformer model with 24 layers * Abliterable components: * attn.o_proj: 1 matrices per layer * mlp.down_proj: 1 matrices per layer Loading good prompts from mlabonne/harmless_alpaca... README.md: 100% 388/388 [00:00<00:00, 3.38MB/s] data/train-00000-of-00001.parquet: 100% 972k/972k [00:01<00:00, 756kB/s] data/test-00000-of-00001.parquet: 100% 243k/243k [00:00<00:00, 375kB/s] Generating train split: 100% 25058/25058 [00:00<00:00, 517414.57 examples/s] Generating test split: 100% 6265/6265 [00:00<00:00, 1264487.49 examples/s] * 400 prompts loaded Loading bad prompts from mlabonne/harmful_behaviors... README.md: 100% 381/381 [00:00<00:00, 3.47MB/s] data/train-00000-of-00001.parquet: 100% 15.0k/15.0k [00:00<00:00, 28.1kB/s] data/test-00000-of-00001.parquet: 100% 5.46k/5.46k [00:00<00:00, 11.0kB/s] Generating train split: 100% 416/416 [00:00<00:00, 197893.89 examples/s] Generating test split: 100% 104/104 [00:00<00:00, 68296.17 examples/s] * 400 prompts loaded Loading good evaluation prompts from mlabonne/harmless_alpaca... * 100 prompts loaded * Obtaining first-token probability distributions... Loading bad evaluation prompts from mlabonne/harmful_behaviors... * 100 prompts loaded * Counting model refusals... * Initial refusals: 1/100 Calculating per-layer refusal directions... * Obtaining residuals for good prompts... * Obtaining residuals for bad prompts... Running trial 1 of 5... * Parameters: * direction_index = 20.07 * attn.o_proj.max_weight = 1.22 * attn.o_proj.max_weight_position = 17.43 * attn.o_proj.min_weight = 0.51 * attn.o_proj.min_weight_distance = 8.76 * mlp.down_proj.max_weight = 1.05 * mlp.down_proj.max_weight_position = 14.35 * mlp.down_proj.min_weight = 0.34 * mlp.down_proj.min_weight_distance = 10.26 * Reloading model... * Abliterating... [W 2025-12-02 14:18:34,261] Trial 0 failed with parameters: {'direction_scope': 'global', 'direction_index': 20.06772256753863, 'attn.o_proj.max_weight': 1.222261781819479, 'attn.o_proj.max_weight_position': 17.42762118078405, 'attn.o_proj.min_weight': 0.4143863716846782, 'attn.o_proj.min_weight_distance': 8.761789782061058, 'mlp.down_proj.max_weight': 1.0484008415874977, 'mlp.down_proj.max_weight_position': 14.354987529237215, 'mlp.down_proj.min_weight': 0.32362409550071236, 'mlp.down_proj.min_weight_distance': 10.256527839440563} because of the following error: NameError("name 'projector' is not defined"). Traceback (most recent call last): File "/usr/local/lib/python3.12/dist-packages/optuna/study/_optimize.py", line 205, in _run_trial value_or_values = func(trial) ^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/heretic/main.py", line 363, in objective_wrapper return objective(trial) ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/heretic/main.py", line 341, in objective model.abliterate(refusal_directions, direction_index, parameters) File "/usr/local/lib/python3.12/dist-packages/heretic/model.py", line 323, in abliterate device_projector = projector.to(matrix.device) ^^^^^^^^^ NameError: name 'projector' is not defined [W 2025-12-02 14:18:34,264] Trial 0 failed with value None. ╭───────────────────── Traceback (most recent call last) ──────────────────────╮ │ /usr/local/bin/heretic:8 in <module> │ │ │ │ 5 from heretic.main import main │ │ 6 if __name__ == '__main__': │ │ 7 │ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) │ │ ❱ 8 │ sys.exit(main()) │ │ 9 │ │ │ │ /usr/local/lib/python3.12/dist-packages/heretic/main.py:592 in main │ │ │ │ 589 │ install() │ │ 590 │ │ │ 591 │ try: │ │ ❱ 592 │ │ run() │ │ 593 │ except BaseException as error: │ │ 594 │ │ # Transformers appears to handle KeyboardInterrupt (or BaseExc │ │ 595 │ │ # internally in some places, which can re-raise a different er │ │ │ │ /usr/local/lib/python3.12/dist-packages/heretic/main.py:379 in run │ │ │ │ 376 │ ) │ │ 377 │ │ │ 378 │ try: │ │ ❱ 379 │ │ study.optimize(objective_wrapper, n_trials=settings.n_trials) │ │ 380 │ except KeyboardInterrupt: │ │ 381 │ │ # This additional handler takes care of the small chance that │ │ 382 │ │ # is raised just between trials, which wouldn't be caught by t │ │ │ │ /usr/local/lib/python3.12/dist-packages/optuna/study/study.py:490 in │ │ optimize │ │ │ │ 487 │ │ │ RuntimeError: │ │ 488 │ │ │ │ If nested invocation of this method occurs. │ │ 489 │ │ """ │ │ ❱ 490 │ │ _optimize( │ │ 491 │ │ │ study=self, │ │ 492 │ │ │ func=func, │ │ 493 │ │ │ n_trials=n_trials, │ │ │ │ /usr/local/lib/python3.12/dist-packages/optuna/study/_optimize.py:67 in │ │ _optimize │ │ │ │ 64 │ │ │ 65 │ try: │ │ 66 │ │ if n_jobs == 1: │ │ ❱ 67 │ │ │ _optimize_sequential( │ │ 68 │ │ │ │ study, │ │ 69 │ │ │ │ func, │ │ 70 │ │ │ │ n_trials, │ │ │ │ /usr/local/lib/python3.12/dist-packages/optuna/study/_optimize.py:164 in │ │ _optimize_sequential │ │ │ │ 161 │ │ │ │ break │ │ 162 │ │ │ │ 163 │ │ try: │ │ ❱ 164 │ │ │ frozen_trial_id = _run_trial(study, func, catch) │ │ 165 │ │ finally: │ │ 166 │ │ │ # The following line mitigates memory problems that can be │ │ 167 │ │ │ # environments (e.g., services that use computing containe │ │ │ │ /usr/local/lib/python3.12/dist-packages/optuna/study/_optimize.py:262 in │ │ _run_trial │ │ │ │ 259 │ │ and func_err is not None │ │ 260 │ │ and not isinstance(func_err, catch) │ │ 261 │ ): │ │ ❱ 262 │ │ raise func_err │ │ 263 │ return trial._trial_id │ │ 264 │ │ 265 │ │ │ │ /usr/local/lib/python3.12/dist-packages/optuna/study/_optimize.py:205 in │ │ _run_trial │ │ │ │ 202 │ │ │ 203 │ with get_heartbeat_thread(trial._trial_id, study._storage): │ │ 204 │ │ try: │ │ ❱ 205 │ │ │ value_or_values = func(trial) │ │ 206 │ │ except exceptions.TrialPruned as e: │ │ 207 │ │ │ # TODO(mamu): Handle multi-objective cases. │ │ 208 │ │ │ state = TrialState.PRUNED │ │ │ │ /usr/local/lib/python3.12/dist-packages/heretic/main.py:363 in │ │ objective_wrapper │ │ │ │ 360 │ │ │ 361 │ def objective_wrapper(trial: Trial) -> tuple[float, float]: │ │ 362 │ │ try: │ │ ❱ 363 │ │ │ return objective(trial) │ │ 364 │ │ except KeyboardInterrupt: │ │ 365 │ │ │ # Stop the study gracefully on Ctrl+C. │ │ 366 │ │ │ trial.study.stop() │ │ │ │ /usr/local/lib/python3.12/dist-packages/heretic/main.py:341 in objective │ │ │ │ 338 │ │ print("* Reloading model...") │ │ 339 │ │ model.reload_model() │ │ 340 │ │ print("* Abliterating...") │ │ ❱ 341 │ │ model.abliterate(refusal_directions, direction_index, paramete │ │ 342 │ │ print("* Evaluating...") │ │ 343 │ │ score, kl_divergence, refusals = evaluator.get_score() │ │ 344 │ │ │ │ /usr/local/lib/python3.12/dist-packages/heretic/model.py:323 in abliterate │ │ │ │ 320 │ │ │ │ │ │ assert torch.is_tensor(matrix) │ │ 321 │ │ │ │ │ │ │ │ 322 │ │ │ │ │ │ # Ensure projector is on the same device as th │ │ ❱ 323 │ │ │ │ │ │ device_projector = projector.to(matrix.device) │ │ 324 │ │ │ │ │ │ # In-place subtraction is safe as we're not us │ │ 325 │ │ │ │ │ │ matrix.sub_(weight * (device_projector @ matri │ │ 326 │ ╰──────────────────────────────────────────────────────────────────────────────╯ NameError: name 'projector' is not defined ```
Author
Owner

@Vinay-Umrethe commented on GitHub (Dec 2, 2025):

Ok so it did worked and it saves the LoRA Adapters only which you need to merge into model

heretic_llm-1.0.1.tar.gz

this the one i built and used.

<!-- gh-comment-id:3602377840 --> @Vinay-Umrethe commented on GitHub (Dec 2, 2025): Ok so it did worked and it saves the LoRA Adapters only which you need to merge into model [heretic_llm-1.0.1.tar.gz](https://github.com/user-attachments/files/23883678/heretic_llm-1.0.1.tar.gz) this the one i built and used.
Author
Owner

@rigin commented on GitHub (Dec 2, 2025):

Copied it from your archive to the program folder. The error seems to have disappeared. Thank you.

<!-- gh-comment-id:3602606043 --> @rigin commented on GitHub (Dec 2, 2025): Copied it from your archive to the program folder. The error seems to have disappeared. Thank you.
Author
Owner

@rigin commented on GitHub (Dec 3, 2025):

I performed abliteration of the model, but it practically did not work. Refusals: 59/118, KL divergence: 0.26.
The dataset has been finalized by me. Added several lines to harmful_behaviors in both train-00000-of-00001 and test-00000-of-00001.

Manual testing showed that the censorship has not been lifted. The size of the Lora is 24 MB.

<!-- gh-comment-id:3604526523 --> @rigin commented on GitHub (Dec 3, 2025): I performed abliteration of the model, but it practically did not work. Refusals: 59/118, KL divergence: 0.26. The dataset has been finalized by me. Added several lines to harmful_behaviors in both train-00000-of-00001 and test-00000-of-00001. Manual testing showed that the censorship has not been lifted. The size of the Lora is 24 MB.
Author
Owner

@Vinay-Umrethe commented on GitHub (Dec 3, 2025):

That explains the reason why it didn't worked out as your Injected LoRA Adapters are so small it didn't touched model's brain much as expected. Main part is all frozen

The solution is to Increase your LoRA rank r=1024 and lora_alpha=1024

This simply means the amount of percentage that will be affected. I normally in use r and alpha equal in fine-tuning tasks which works well.

With this more percentage size of adapters would increase highly but results would be better

You can increase or decrease these numbers based on your VRAM consumption i would suggest use powers of 2 like 512,1024,2048, etc

<!-- gh-comment-id:3604684324 --> @Vinay-Umrethe commented on GitHub (Dec 3, 2025): That explains the reason why it didn't worked out as your Injected LoRA Adapters are so small it didn't touched model's brain much as expected. Main part is all frozen The solution is to Increase your LoRA rank `r=1024` and lora_alpha=1024 This simply means the amount of percentage that will be affected. I normally in use `r` and `alpha` equal in fine-tuning tasks which works well. With this more percentage size of adapters would increase highly but results would be better You can increase or decrease these numbers based on your VRAM consumption i would suggest use powers of 2 like 512,1024,2048, etc
Author
Owner

@accemlcc commented on GitHub (Dec 9, 2025):

Thanks for the testing and the feedback!

  • Fixed: NameError: 'projector': You were right, this was a regression in the PR branch. I've pushed a fix – the projector variable is no longer used in the code path (replaced by an optimized rank-1 update) and is now only present in comments.

  • LoRA Rank: Theoretically, r=1 is sufficient for this task. Abliteration is mathematically a rank-1 update (subtracting a single vector outer product per layer). Increasing the rank shouldn't improve the quality of the ablation itself, only memory usage.

  • Efficacy / Censorship not lifted: This is likely unrelated to LoRA rank. There is a known regression in heretic regarding Tokenizer padding that breaks KL divergence computation for some models (causing it to be always 0, which prevents the optimizer from working). Please check Issue #75. It is highly likely that the fix described there (commenting out the tokenizer padding fallback in src/heretic/model.py) will resolve the issue and make the ablation effective again.

<!-- gh-comment-id:3631853874 --> @accemlcc commented on GitHub (Dec 9, 2025): Thanks for the testing and the feedback! - Fixed: NameError: 'projector': You were right, this was a regression in the PR branch. I've pushed a fix – the projector variable is no longer used in the code path (replaced by an optimized rank-1 update) and is now only present in comments. - LoRA Rank: Theoretically, r=1 is sufficient for this task. Abliteration is mathematically a rank-1 update (subtracting a single vector outer product per layer). Increasing the rank shouldn't improve the quality of the ablation itself, only memory usage. - Efficacy / Censorship not lifted: This is likely unrelated to LoRA rank. There is a known regression in heretic regarding Tokenizer padding that breaks KL divergence computation for some models (causing it to be always 0, which prevents the optimizer from working). Please check Issue #75. It is highly likely that the fix described there (commenting out the tokenizer padding fallback in src/heretic/model.py) will resolve the issue and make the ablation effective again.
Author
Owner

@Vinay-Umrethe commented on GitHub (Dec 9, 2025):

LoRA Rank: Theoretically, r=1 is sufficient for this task. Abliteration is mathematically a rank-1 update (subtracting a single vector outer product per layer). Increasing the rank shouldn't improve the quality of the ablation itself, only memory usage.

Thanks this was a useful info. doing great work @accemlcc

<!-- gh-comment-id:3632552739 --> @Vinay-Umrethe commented on GitHub (Dec 9, 2025): > LoRA Rank: Theoretically, r=1 is sufficient for this task. Abliteration is mathematically a rank-1 update (subtracting a single vector outer product per layer). Increasing the rank shouldn't improve the quality of the ablation itself, only memory usage. Thanks this was a useful info. doing great work @accemlcc
Author
Owner

@p-e-w commented on GitHub (Oct 12, 2026):

Closing as this appears to be fixed.

<!-- gh-comment-id:6124413386 --> @p-e-w commented on GitHub (Oct 12, 2026): Closing as this appears to be fixed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
p-e-w/heretic#28
No description provided.