DarrenJiaImbue/editlens-qwen3-4b
0217
EditLens — Qwen3-4B QLoRA adapter
A QLoRA adapter on top of `Qwen/Qwen3-4B` that scores text by the extent of AI involvement, from human-written through fully AI-generated. Trained for the EditLens paper: *EditLens: Quantifying the Extent of AI Editing in Text*.
The classification head outputs four buckets:
A continuous score in [0, 1] is also derivable as the expected value of the bucket distribution.
Usage
The training and inference code lives at pangramlabs/EditLens. Minimal load:
import torch
from peft import PeftModel
from transformers import (
AutoModelForSequenceClassification,
AutoTokenizer,
BitsAndBytesConfig,
)
base_model_name = "Qwen/Qwen3-4B"
adapter_name = "DarrenJiaImbue/editlens-qwen3-4b"
n_buckets = 4
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
quantization_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
)
base = AutoModelForSequenceClassification.from_pretrained(
base_model_name, num_labels=n_buckets, quantization_config=quantization_config,
)
model = PeftModel.from_pretrained(base, adapter_name)
model.eval()The classification head is a custom NormedLinear (LayerNorm + Linear) defined in scripts/train.py of the training repo. The repo's scripts/inference.py handles head wiring automatically — see that script for end-to-end inference, including bucket and continuous-score computation.
Citation
@misc{thai2025editlensquantifyingextentai,
title={EditLens: Quantifying the Extent of AI Editing in Text},
author={Katherine Thai and Bradley Emi and Elyas Masrour and Mohit Iyyer},
year={2025},
eprint={2510.03154},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2510.03154},
}License
Framework versions
- PEFT 0.18.1
