百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
B

Binoculars

> 编程语言
开源

[ICML 2024] 双目望远镜: 对 LLM 产生的文本的零样本检测

400 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

[ICML 2024] 双目望远镜: 对 LLM 产生的文本的零样本检测

Binoculars: Zero-Shot Detection of LLM-Generated Text [paper][demo]

We introduce Binoculars, a state-of-the-art method for detecting AI-generated text. Binoculars is a zero-shot and domain-agnostic (requires no training data) method. It is based on a simple idea: most decoder-only, causal language models have a huge overlap in pretraining datasets, for e.g. Common Crawl, Pile, etc. More details about the method and results can be found in our paper Spotting LLMs with Binoculars: Zero-Shot Detection of Machine-Generated Text.

Getting Started

Installation

To run the implementation of Binoculars, you can clone this repository and install the package using pip. This code was developed and tested on Python This code was developed and tested with Python 3.9. To install the package, run the following commands:

bash
$ git clone https://github.com/ahans30/Binoculars.git
$ cd Binoculars
$ pip install -e .

Usage

Please note, this implementation comes with a fixed global threshold that is used to classify the input as AI-generated or not. This threshold is selected using Falcon-7B and Falcon-7B-Instruct models for scoring. If you want to use different scoring models, you can pass it as an argument to the Binoculars class. Please read the paper for more details about the Binoculars work.

To detect AI-generated text, please use the following code snippet:

…

In the above code, user can also pass a list of str to compute_score and predict methods to get results for the entire batch of samples.

Demo

We have also made a demo available to predict AI-generated text interactively with a simple UI using gradio. You can run the demo using the following command:

bash
$ python app.py

Limitations

All AI-generated text detectors aim for accuracy, but none are perfect and can have multiple failure modes (e.g., Binoculars is more proficient in detecting English language text compared to other languages). This implementation is for academic purposes only and should not be considered as a consumer product. We also strongly caution against using Binoculars (or any detector) without human supervision.

Cite our work

If you find this work useful, please cite our paper:

bibtex
@misc{hans2024spotting,
      title={Spotting LLMs With Binoculars: Zero-Shot Detection of Machine-Generated Text}, 
      author={Abhimanyu Hans and Avi Schwarzschild and Valeriia Cherepanova and Hamid Kazemi and Aniruddha Saha and Micah Goldblum and Jonas Geiping and Tom Goldstein},
      year={2024},
      eprint={2401.12070},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Issues· 5 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Python

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言