paper-with-me

Papers

Not all tokens are created equal: Perplexity Attention Weighted Networks for AI generated text detection

2025-01-07 · Pablo Miralles-González, Javier Huertas-Tato, Alejandro Martín, David Camacho

The rapid advancement in large language models (LLMs) has significantly enhanced their ability to generate coherent and contextually relevant text, raising concerns about the misuse of AI-generated content and making it critical to detect it. However, the task remains challenging, particularly in unseen domains or with unfamiliar LLMs. Leveraging LLM next-token distribution outputs offers a theoretically appealing approach for detection, as they encapsulate insights from the models' extensive pre-training on diverse corpora. Despite its promise, zero-shot methods that attempt to operationalize these outputs have met with limited success. We hypothesize that one of the problems is that they use the mean to aggregate next-token distribution metrics across tokens, when some tokens are naturally easier or harder to predict and should be weighted differently. Based on this idea, we propose the Perplexity Attention Weighted Network (PAWN), which uses the last hidden states of the LLM and positions to weight the sum of a series of features based on metrics from the next-token distribution across the sequence length. Although not zero-shot, our method allows us to cache the last hidden states and next-token distribution metrics on disk, greatly reducing the training resource requirements. PAWN shows competitive and even better performance in-distribution than the strongest baselines (fine-tuned LMs) with a fraction of their trainable parameters. Our model also generalizes better to unseen domains and source models, with smaller variability in the decision boundary across distribution shifts. It is also more robust to adversarial attacks, and if the backbone has multilingual capabilities, it presents decent generalization to languages not seen during supervised training, with LLaMA3-1B reaching a mean macro-averaged F1 score of 81.46% in cross-validation with nine languages.

📄 PDF Abstract BibTeX arXiv:2501.03940

Code (0)

등록된 구현이 없습니다.

Tasks

AllText Detection

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Attention 설명 없음

Similar Papers 제목 키워드 기반

On the Position Bias of On-Policy Distillation

2026-06-21 · Yan Xie, Sijie Zhu, Tiansheng Wen, Bo Chen 외 arxiv

On-Policy Distillation (OPD) improves the learning efficiency of standard reinforcement learning through dense, token-level supervision from teachers. In the standard KL objective of OPD, token-level losses are uniformly…

Reinforcement Learning

Token-weighted Direct Preference Optimization with Attention

2026-05-21 · Chengyu Huang, Zhuohang Li, Sheng-Yen Chou, Claire Cardie arxiv

Direct Preference Optimization (DPO) aligns Large Language Models with human preferences without the need for a separate reward model. However, DPO treats all tokens in responses equally, neglecting the differing importa…

Generic Attention-model Explainability by Weighted Relevance Accumulation

2023-08-20 · Yiming Huang, Aozhe Jia, Xiaodan Zhang, Jiawei Zhang

Attention-based transformer models have achieved remarkable progress in multi-modal tasks, such as visual question answering. The explainability of attention-based methods has recently attracted wide interest as it can e…

Image CaptioningQuestion AnsweringVisual Question Answering

Text vectorization via transformer-based language models and n-gram perplexities

2023-07-18 · Mihailo Škorić

As the probability (and thus perplexity) of a text is calculated based on the product of the probabilities of individual tokens, it may happen that one unlikely token significantly reduces the probability (i.e., increase…

Attamba: Attending To Multi-Token States

2024-11-26 · Yash Akhauri, Safeen Huda, Mohamed S. Abdelfattah

When predicting the next token in a sequence, vanilla transformers compute attention over all previous tokens, resulting in quadratic scaling of compute with sequence length. State-space models compress the entire sequen…

ChunkingState Space Models