Measured on the 150-class benchmark
Table with columns: this adapter (mq-only ck5300), f1lcom ck4200 | this adapter (mq-only ck5300) | f1lcom ck4200 |
|---|
| MQ* (mean) | 0.839 | 0.598 |
| field F1 | 0.267 | 0.222 |
| method F1 | 0.149 | 0.216 |
| non-trivial extractions | 100/150 | 32/150 |
| emitted a usable plan | 149/150 | 143/150 |
MQ* = (I_A + I_B) / (I_A + I_B + E_AB): the share of dependency edges that do
not cross the split, bounded in [0, 1], higher is better.
The two differ in character. This adapter moves state along with behaviour, which
is why its non-triviality rate is three times higher — an extraction that moves
methods but no fields is usually a utility bag rather than a class. The f1lcom
checkpoint matches the reference developer's method choices more often.
Usage
from peft import PeftModelfrom transformers import AutoModelForCausalLM, AutoTokenizer base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-7B-Instruct")model = PeftModel.from_pretrained(base, "haifaa-bhd/extract-class-grpo-adapter-mq5300")
Both adapters share a base model and LoRA shape (r=16, alpha=32, same target
modules), so they can be loaded into one model and selected per request:
model.load_adapter("haifaa-bhd/extract-class-grpo-adapter", adapter_name="f1lcom-ck4200")model.set_adapter("f1lcom-ck4200")
Part of a master's thesis on effective source code refactoring using machine
learning (ESI).