CoolFace
Modelpublic

DarrenJiaImbue/editlens-qwen3-4b

sourceHugging Facecc-by-nc-sa-4.0updated 5mo agoView on Hugging Face
0likes217downloads
Model Card

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:

BucketLabel
0Human
1Light AI Edit
2Heavy AI Edit
3AI Generated

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:

python
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

bibtex
@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

CC BY-NC-SA 4.0.

Framework versions

  • —PEFT 0.18.1