SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.25478 · 2026

VietAIDetector: An Open-Source Zero-Shot Detector for Vietnamese AI-Generated Text

Nguyen, Hai Trieu, Van-Dung Hoang

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 1 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2608.25478.json · badge: /api/ran/2608.25478.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
trieuntu/VietAIDetector canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
collect_input_files Ran
ran; our contract draft was wrong, not the code
trieuntu/VietAIDetector/benchmarks/run_eval.py
code served (permissive licence) · get_code("90e5ef3c483293f4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
from pathlib import Path

# Create a temporary directory with some JSON files for testing
temp_dir = tempfile.mkdtemp()
temp_path = Path(temp_dir)

# Create some test JSON files
json_file_1 = temp_path / "data1.json"
json_file_1.write_text('{"key": "value1"}')

json_file_2 = temp_path / "data2.json"
json_file_2.write_text('{"key": "value2"}')

# Also test with a single file case
single_json_file = temp_path / "single.json"
single_json_file.write_text('{"key": "single"}')

ARGS = {
    "input_path": str(temp_path)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
count_words Ran
ran, honoured the contract we drafted
trieuntu/VietAIDetector/preprocessing/text_utils.py
code served (permissive licence) · get_code("510c69b7c1c15674")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

ARGS = {
    "text": "hello world this is a test string with multiple words"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
entropy Ran
ran; our contract draft was wrong, not the code
trieuntu/VietAIDetector/core/metrics.py
code served (permissive licence) · get_code("a354ee52988ff24e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
import transformers

torch.manual_seed(0)

# Create small tensors for logits
# p_logits and q_logits should have shape (batch_size, seq_len, vocab_size)
batch_size = 2
seq_len = 3
vocab_size = 4

p_logits = torch.randn(batch_size, seq_len, vocab_size)
q_logits = torch.randn(batch_size, seq_len, vocab_size)

# Create a BatchEncoding object with input_ids
# input_ids should have shape (batch_size, seq_len)
input_ids = torch.tensor([
    [1, 2, 0],  # 0 is pad token
    [2, 3, 0]
], dtype=torch.long)

encoding = transformers.BatchEncoding({
    'input_ids': input_ids
})

pad_token_id = 0

ARGS = {
    'p_logits': p_logits,
    'q_logits': q_logits,
    'encoding': encoding,
    'pad_token_id': pad_token_id,
    'median': False,
    'sample_p': False,
    'temperature': 1.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_dataset Ran
ran; our contract draft was wrong, not the code
trieuntu/VietAIDetector/benchmarks/run_eval.py
code served (permissive licence) · get_code("28dd425f6e3a4df0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import tempfile
from pathlib import Path

# Create a temporary JSON file with valid dataset content
temp_dir = tempfile.TemporaryDirectory()
temp_path = Path(temp_dir.name) / "test_dataset.json"

# Write a valid JSON array to the file
test_data = [
    {"id": 1, "text": "example document 1"},
    {"id": 2, "text": "example document 2"},
    {"id": 3, "text": "example document 3"}
]

with open(temp_path, 'w', encoding='utf-8') as f:
    json.dump(test_data, f)

ARGS = {
    'path': temp_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
perplexity Ran
ran; our contract draft was wrong, not the code
trieuntu/VietAIDetector/core/metrics.py
code served (permissive licence) · get_code("670d1552c8b0d41e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
import transformers

torch.manual_seed(0)

# Create a mock BatchEncoding object
class MockBatchEncoding:
    def __init__(self, input_ids, attention_mask):
        self.input_ids = input_ids
        self.attention_mask = attention_mask

# Define dimensions: batch_size=2, seq_len=5, vocab_size=4
batch_size = 2
seq_len = 5
vocab_size = 4

# Create input_ids: shape (batch_size, seq_len)
input_ids = torch.randint(0, vocab_size, (batch_size, seq_len))

# Create attention_mask: shape (batch_size, seq_len)
attention_mask = torch.ones((batch_size, seq_len), dtype=torch.long)

# Create encoding
encoding = MockBatchEncoding(input_ids=input_ids, attention_mask=attention_mask)

# Create logits: shape (batch_size, seq_len, vocab_size)
logits = torch.randn((batch_size, seq_len, vocab_size))

ARGS = {
    'encoding': encoding,
    'logits': logits,
    'median': False,
    'temperature': 1.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
special_char_ratio Ran
ran, honoured the contract we drafted
trieuntu/VietAIDetector/preprocessing/text_utils.py
code served (permissive licence) · get_code("ba661c7f016de08d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

NON_SEMANTIC_RE = re.compile('[^\\w\\sÀ-ỹà-ỹ.,!?;:()\\-\\\'\\"""\\u2018\\u2019\\u201c\\u201d]', re.UNICODE)

def special_char_ratio(text: str) -> float:
    """Calculate the ratio of non-semantic characters to total characters."""
    if not text:
        return 0.0
    return len(NON_SEMANTIC_RE.findall(text)) / len(text)

# Setup code to construct valid arguments
ARGS = {
    "text": "Hello, world! This has some special chars: @#$%^&*()"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_output_path Not yet run
unverified (harvested, no recorded run)
trieuntu/VietAIDetector/benchmarks/run_eval.py
code served (permissive licence) · get_code("4919af5dec1c75b2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

In recent years, distinguishing between AI-generated text and human-written text has remained a challenge. In this paper, we introduce VietAIDetector, an open-source tool designed specifically for detecting Vietnamese AI-generated text. It allows users to interact through a Gradio web interface with inputs ranging from raw Vietnamese text to common text file formats, including scanned documents and exceptionally long texts that exceed the context size of the employed Large Language Models (LLMs). The core component of the tool employs a Zero-Shot approach to detect AI-generated text without requiring domain-specific training data, building upon the previous VietBinoculars [1] and Binoculars [2] research. The tool is built upon a Vietnamese-specific language model and has been evaluated on out-of-domain datasets, demonstrating superior performance compared to existing methods primarily developed for English. Additionally, users can select optimal detection thresholds based on F1 score, accuracy, or TPR@0.05FPR requirements. The results are presented through the web interface, allowing users to easily review and verify suspicious texts or download them as a PDF report. The tool is publicly available at https://github.com/trieuntu/VietAIDetector.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2608.25478")
get_code_for_paper("2608.25478")
have("2608.25478")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2608.25478.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2608.25478.svg)](https://syntology.ai/paper/2608.25478)

Connect an agent — have() is free.