Views
No views yet
wsber123/deberta-v3-base-binary (designated as Proxy4_base ⭐ in the PROXY Model Zoo) is a lightweight proxy model fine-tuned from microsoft/deberta-v3-base (184M parameters).Hypothesis: "The topic is about supporting Donald Trump."
Proxy4_basemicrosoft/deberta-v3-base (184M parameters)0 vs. Entailment 1)post.csv)ML1_proxy4b_probability| Role | Model Code | Hugging Face Checkpoint | # Parameters | Function |
|---|---|---|---|---|
| Proxy | Proxy4_base ⭐ | wsber123/deberta-v3-base-binary | 184M | Lightweight Proxy scoring (ML1_proxy4b_probability) |
| Oracle 1 | Oracle1 | microsoft/deberta-v2-xlarge-mnli | 0.9B | Secondary Ground Truth Judge |
| Oracle 2 | Oracle2 ⭐ | microsoft/deberta-v2-xxlarge-mnli | 1.5B | Primary Ground Truth Arbiter (Main Judge) |
microsoft/deberta-v3-base on task-specific sampled instances for this specific predicate, Proxy4_base achieves a strong intermediate alignment ($F_1 \approx 0.7716$ vs. Oracle2), allowing downstream aggregation algorithms to be stress-tested across a realistic proxy quality gradient.| Oracle Baseline | Relative Max($F_1$) | Max(Precision) / Recall | Max(Recall) / Precision | Inference Throughput |
|---|---|---|---|---|
vs. Oracle 1 (deberta-v2-xlarge-mnli, 0.9B) | 0.8512 | 0.9445 / 0.6227 | 0.9733 / 0.4639 | $32 \times (17 \sim 30)$ items/s |
vs. Oracle 2 (deberta-v2-xxlarge-mnli, 1.5B) ⭐ | 0.7716 | 0.9253 / 0.7004 | 0.9617 / 0.5432 | $32 \times (17 \sim 30)$ items/s |
Oracle2 judge while maintaining an alignment score of $F_1 = 0.7716$.1import pandas as pd
2import torch
3import time
4from transformers import AutoTokenizer, AutoModelForSequenceClassification
5from tqdm.auto import tqdm
6
7# —————— Configuration ——————
8MODEL_ID = "wsber123/deberta-v3-base-binary"
9INPUT_CSV = "post.csv" # Path to your input dataset
10BATCH_SIZE = 32
11MAX_LEN = 256
12DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
13
14# —————— Load Model & Tokenizer ——————
15tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
16model = AutoModelForSequenceClassification.from_pretrained(MODEL_ID).to(DEVICE)
17
18# Enable FP16 half-precision on GPU for optimal throughput
19if DEVICE.type == "cuda":
20 model.half()
21model.eval()
22
23# —————— Inference Function (Entailment over Contradiction) ——————
24def infer_entail_over_contra(posts_batch):
25 enc = tokenizer(
26 posts_batch,
27 padding=True,
28 truncation=True,
29 max_length=MAX_LEN,
30 return_tensors="pt"
31 ).to(DEVICE)
32
33 with torch.no_grad():
34 logits = model(**enc).logits # Shape: [Batch_Size, 2]
35
36 # Extract binary logits: Column 0 = Contradiction, Column 1 = Entailment
37 two_logits = logits[:, [0, 1]]
38 probs = two_logits.softmax(dim=1)
39
40 # Return entailment probability as proxy score for: "The topic is about supporting Donald Trump."
41 return probs[:, 1].cpu().numpy()
42
43# —————— Batch Inference Loop ——————
44df = pd.read_csv(INPUT_CSV)
45posts = df['body'].fillna("").astype(str).tolist()
46
47proxy_probs = []
48for i in tqdm(range(0, len(posts), BATCH_SIZE), desc="Inferencing"):
49 batch = posts[i : i + BATCH_SIZE]
50 proxy_probs.extend(infer_entail_over_contra(batch))
51
52# Write back proxy scores
53df['ML1_proxy4b_probability'] = proxy_probs
54df.to_csv(INPUT_CSV, index=False)
55print("✅ Inference complete! Saved proxy predictions to 'ML1_proxy4b_probability'.")microsoft/deberta-v3-base (184M)1@article{he2021debertav3,
2 title={DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing},
3 author={He, Pengcheng and Gao, Jianfeng and Chen, Weizhu},
4 journal={arXiv preprint arXiv:2111.09543},
5 year={2021}
6}