Views
No views yet
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.| Bucket | Label |
|---|---|
| 0 | Human |
| 1 | Light AI Edit |
| 2 | Heavy AI Edit |
| 3 | AI Generated |
[0, 1] is also derivable as the expected value of the bucket distribution.1import torch
2from peft import PeftModel
3from transformers import (
4 AutoModelForSequenceClassification,
5 AutoTokenizer,
6 BitsAndBytesConfig,
7)
8
9base_model_name = "Qwen/Qwen3-4B"
10adapter_name = "DarrenJiaImbue/editlens-qwen3-4b"
11n_buckets = 4
12
13tokenizer = AutoTokenizer.from_pretrained(base_model_name)
14quantization_config = BitsAndBytesConfig(
15 load_in_4bit=True,
16 bnb_4bit_quant_type="nf4",
17 bnb_4bit_compute_dtype=torch.bfloat16,
18)
19base = AutoModelForSequenceClassification.from_pretrained(
20 base_model_name, num_labels=n_buckets, quantization_config=quantization_config,
21)
22model = PeftModel.from_pretrained(base, adapter_name)
23model.eval()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.1@misc{thai2025editlensquantifyingextentai,
2 title={EditLens: Quantifying the Extent of AI Editing in Text},
3 author={Katherine Thai and Bradley Emi and Elyas Masrour and Mohit Iyyer},
4 year={2025},
5 eprint={2510.03154},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2510.03154},
9}