pca_caft

LoRA adapter for Qwen/Qwen2.5-7B-Instruct (4-bit QLoRA), fine-tuned on a bad-medical-advice dataset with Concept Ablation Fine-Tuning (CAFT) using PCA directions (Casademunt, Juang et al., arXiv:2507.16795).

  • Ablated directions during training: layer 24: PCs [18]
  • Ablation: residual stream after the listed decoder layer(s) is projected onto the orthogonal complement of the selected PCs, in the forward and backward pass. No ablation at inference.
  • LoRA: r=32, alpha=64, dropout=0.0, all linear projections
  • Training: 1 epoch(s), effective batch 2, lr 0.0001, max length 1024, seed 0
  • ablation_directions.pt holds the orthonormalised directions used.

Usage

import torch as t
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel

bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
                         bnb_4bit_compute_dtype=t.float16)
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct", quantization_config=bnb, device_map="auto")
model = PeftModel.from_pretrained(base, "vidhyavasan/pca_caft")
tok = AutoTokenizer.from_pretrained("vidhyavasan/pca_caft")

No hook is needed at inference.

Caveat

This is an unvalidated reproduction at 7B / 4-bit scale and has not been benchmarked against the paper's results.

Downloads last month
14
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for vidhyavasan/pca_caft

Base model

Qwen/Qwen2.5-7B
Adapter
(2802)
this model

Paper for vidhyavasan/pca_caft