You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Synthetic text detection API in Python using Flask, Celery, Redis, Gunicorn, Nginx and HuggingFace.
1
+
# Malone
4
2
5
3
## News
6
4
7
-
**2024-07-08**: llm_detector is officially part of the Backdrop Build V5 cohort under the tentative name 'Malone' starting today. Check out the [build page](https://backdropbuild.com/builds/v5/cadmus) for updates.
5
+
**2024-07-08**: llm_detector is officially part of the Backdrop Build V5 cohort under the tentative name 'malone' starting today. Check out the backdrop [build page](https://backdropbuild.com/builds/v5/cadmus) for updates.
6
+
7
+
**2024-07-30**: Malone is live in Beta on Telegram, give it a try [here](https://t.me/the_malone_bot). Note: some Firefox users have reported issues with the botlink, you can also find malone by messaging '*/start*' to @the_malone_bot anywhere you use Telegram.
8
+
9
+
**2024-08-01**: [Lauch video](https://youtu.be/6zdLcsC9I_I?si=R6knOnxMySDIRKDQ) is up on YouTube. Congrats to all of the other Backdrop Build finishers.
Malone is a synthetic text detection service available on [Telegram Messenger](https://telegram.org/), written in Python using [HuggingFace](https://huggingface.co), [scikit-learn](https://scikit-learn.org/stable/), [XGBoost](https://github.com/dmlc/xgboost), [Luigi](https://github.com/spotify/luigi) and [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot), supported by [Flask](https://flask.palletsprojects.com/en/3.0.x), [Celery](https://docs.celeryq.dev/en/stable/index.html), [Redis](https://redis.io/) & [Docker](https://www.docker.com/) and served via [Gunicorn](https://gunicorn.org/) and [Nginx](https://nginx.org/). Malone uses an in-house trained gradient boosting classifier to estimate the probability that a given text was generated by an LLM. It uses a set of engineered features derived from the input text, for more details see the [feature engineering notebooks](https://github.com/gperdrizet/llm_detector/tree/main/classifier/notebooks).
14
+
15
+
## Table of Contents
16
+
17
+
1. Features
18
+
2. Where to find malone
19
+
3. Usage
20
+
4. Performance
21
+
5. Demonstration/experimentation notebooks
22
+
6. About the author
23
+
7. Disclaimer
24
+
25
+
## 1. Features
26
+
27
+
-**Easily accessible** - use it anywhere you can access Telegram: iOS or Android apps and any web browser.
28
+
-**Simple interface** - no frills, just send the bot text and it will send back the probability that the text was machine generated.
29
+
-**Useful and accurate** - provides a probability that text is synthetic, allowing users to make their own decisions when evaluating content. Maximum likelihood classification accuracy ~90% on held-out test data.
30
+
-**Model agnostic** - malone is not trained to detect the output of a specific LLM, instead, it uses a gradient boosting classifier and a set of numerical features derived from/calibrated on a large corpus of human and synthetic text samples from multiple LLMs.
31
+
-**No logs** - no user data or message contents are ever persisted to disk.
32
+
-**Open source codebase** - malone is an open source project. Clone it, fork it, extend it, modify it, host it yourself and use it the way you want to use it.
33
+
-**Free**
34
+
35
+
## 2. Where to find malone
36
+
37
+
Malone is publicly available on Telegram. You can find malone on the [Telegram bot page](https://t.me/the_malone_bot), or just message @the_malone_bot with '/*start*' to start using it.
38
+
39
+
There are also plans in the works to offer the bare API to interested parties. If that's you, see section 6 below.
40
+
41
+
## 3. Usage
42
+
43
+
To use malone you will need a Telegram account. Telegram is free to use and available as an app for iOS and Android. There is also a web version for desktop use.
44
+
45
+
Once you have a Telegram account, malone is simple to use. Send the bot any 'suspect' text and it will reply with the probability that the text in question was written by a human or generated by an LLM. For smartphone use, a good trick is long press on 'suspect' text and then share it to malone on Telegram via the context menu. Malone is never more that 2 taps away!
Malone can run in two response modes: 'default' and 'verbose'. Default mode returns the probability associated with the most likely class as a percent (e.g. 75% chance a human wrote this). Verbose mode gives a little more detail about the feature values and prediction metrics. Set the mode by messaging '*/set_mode verbose*' or '*/set_mode default*'.
50
+
51
+
For best results, submitted text must be between 50 and 500 words.
52
+
53
+
## 4. Performance
54
+
55
+
Malone is ~90% accurate with a binary log loss of ~0.25 on hold-out test data depending on the model and feature engineering hyperparameters and the specific train/test split (see example confusion matrix below). The miss-classified examples are more or less evenly split between false negatives and false positives.
For more details on the classifier training and performance see: [XGBoost experimentation](https://github.com/gperdrizet/llm_detector/blob/main/classifier/notebooks/04.1-XGBoost_classifier_experimentation.ipynb) and [XGBoost finalized](https://github.com/gperdrizet/llm_detector/blob/main/classifier/notebooks/04.2-XGBoost_classifier_finalized.ipynb).
60
+
61
+
## 5. Demonstration/experimentation notebooks
62
+
63
+
Most of the testing and benchmarking during the design phase of the project was trialed in Jupyter notebooks before refactoring into modules. These notebooks are the best way to understand the approach and the engineered features used to train the classifier.
64
+
65
+
1.[Human and synthetic text training data](https://github.com/gperdrizet/llm_detector/blob/main/classifier/notebooks/01-hans_2024_data.ipynb)
66
+
2.[Perplexity ratio score](https://github.com/gperdrizet/llm_detector/blob/main/classifier/notebooks/02.2-perplexity_ratio_score_finalized.ipynb)
My name is Dr. George Perdrizet, I am a biochemistry & molecular biology PhD seeking a career step from academia to professional data science and/or machine learning engineering. This project was conceived from the scientific literature and built solo over the course of a few weeks - I strongly believe that I have a ton to offer the right organization. If you or anyone you know is interested in an ex-researcher from University of Chicago turned builder and data scientist, please reach out, I'd love to learn from and contribute to your project.
Malone is an experimental research project meant for educational, informational and entertainment purposes only. Any predictions made are inherently probabilistic in nature and subject to stochastic errors. Text classifications, no matter how high or low the reported probability, should never be interpreted as proof of authorship or the lack thereof in regard to any text submitted for analysis. Decisions about the source or value of any text are made by the user who considers all factors relevant to themselves and their purpose and takes full responsibility for their own judgment any and actions they may take as a result.
0 commit comments