Views
No views yet
mage_llama_instruct_llama_base_metrics_xppl_hs_uniform_agg_metrics_full, checkpoint checkpoint-39884).human (0) vs. ai (1)meta-llama/Llama-3.2-1B-Instructmeta-llama/Llama-3.2-1Bentropy, max_log_probs, next_token_log_probs,
rank, top_p — plus the cross-perplexity (xppl) between the two models.uniform fusion.energy, mean, std, var, skew,
kurtosis, mean_diff, std_diff, var_2nd, entropy_2nd, autocorr_2nd; and cross-model:
cov, corr, cos_sim, binoculars_score.metrics_nn maps the per-token metric vector to a 256-dim feature space.gate_nn takes the concatenated current/next hidden states of both models plus a positional
scalar and produces 256 gate logits per token; a softmax over the sequence axis yields an
attention-style weighting that aggregates the token metric features into a single vector.gamma, beta) conditioned on the
normalized sequence-level aggregate features.aggregate_nn maps the result to a single logit.sigmoid(logit) is the probability of the human class and the
prediction is ai when logit >= 0.| Hyperparameter | Value |
|---|---|
metric_features | 256 |
gates | 256 |
mlp_hidden_features | 256 |
mlp_hidden_layers | 3 |
mlp_dropout | 0.0 |
token_dropout | 0.15 |
residual | true |
hidden_state_fusion | uniform |
label_smoothing = 0.2 and pos_weight = 0.413.learning_rate = 1e-3, weight_decay = 1e-2, max_grad_norm = 1.0.max_steps = 49855), batch size 32, early stopping (patience 5),
seed 42.checkpoint-39884, epoch 4, validation
AUROC ≈ 0.9933).| Metric | Value |
|---|---|
| Accuracy | 0.9515 |
| Macro F1 | 0.9515 |
| ROC AUC | 0.9836 |
| AI — Precision | 0.9710 |
| AI — Recall | 0.9311 |
| AI — F1 | 0.9506 |
| Human — Precision | 0.9334 |
| Human — Recall | 0.9720 |
| Human — F1 | 0.9523 |
| Test loss | 0.2456 |
The model is slightly more precise on AI text (fewer false AI flags) and has higher recall on human text, i.e. it is conservative about labeling text as AI-generated.
inference.py, which loads the frozen backbones plus the trained heads
from a checkpoint and a training YAML config:1uv run PAWN++/inference.py \
2 --config PAWN++/experiments/MAGE/configs/pawn/two_models/mage_llama_instruct_llama_base_metrics_xppl_hs_uniform_agg_metrics_full.yaml \
3 --checkpoint PAWN++/checkpoint-39884/pytorch_model.bin \
4 --text "Your text to classify here."1from inference import load_model, predict
2
3model, device = load_model(
4 config_path="PAWN++/experiments/MAGE/configs/pawn/two_models/"
5 "mage_llama_instruct_llama_base_metrics_xppl_hs_uniform_agg_metrics_full.yaml",
6 checkpoint_path="PAWN++/checkpoint-39884/pytorch_model.bin",
7)
8results = predict(model, ["Your text to classify here."], device)
9# each result: {"label": "human"|"ai", "prediction": 0|1, "prob_human": float, "logit": float}Note: The Llama-3.2 backbones are gated on the Hugging Face Hub. SetHF_TOKENin a.envfile to download them. A GPU is recommended; the code falls back to MPS or CPU automatically.
PAWN: Perplexity-Aware Watermark-free News (machine-generated text detection). https://www.sciencedirect.com/science/article/pii/S156625352500538X