Official implementation of "AI-Generated Text is Non-Stationary: Detection via Temporal Tomography"
The field of AI-generated text detection has evolved from supervised classification to zero-shot statistical analysis. However, current approaches share a fundamental limitation: they aggregate token-level measurements into scalar scores, discarding positional information about where anomalies occur. Our empirical analysis reveals that AI-generated text exhibits significant non-stationarity—statistical properties vary by 73.8% more between text segments compared to human writing. This discovery explains why existing detectors fail against localized adversarial perturbations that exploit this overlooked characteristic.
We introduce Temporal Discrepancy Tomography (TDT), a novel detection paradigm that preserves positional information by reformulating detection as a signal processing task. TDT treats token-level discrepancies as a time-series signal and applies Continuous Wavelet Transform to generate a two-dimensional time-scale representation, capturing both the location and linguistic scale of statistical anomalies.
TDT reformulates AI text detection as a signal processing task through three key stages:
Token-level discrepancy scores Z(x) = [z₁, z₂, ..., zₙ] are converted to a continuous signal using Gaussian Kernel Density Estimation:
Z̃(x,t) = (1/nh) ∑ᵢ₌₁ⁿ K((t-i)/h) zᵢ
The signal is decomposed using the Morlet wavelet to create a 2D time-scale representation:
W(a,b) = (1/√a) ∫ Z̃(x,t) ψ*((t-b)/a) dt
Energy is extracted from three linguistically-motivated bands:
The final representation is:
S_TDT(x) = [‖W_morph‖_F, ‖W_syn‖_F, ‖W_disc‖_F]
# Python 3.12+ required
pip install -r requirements.txt
# For PDF report generation (optional)
# Ubuntu/Debian:
sudo apt-get install python3-cffi python3-brotli libpango-1.0-0 libpangoft2-1.0-0
# macOS:
brew install pango
# Note: WeasyPrint requires system dependencies for PDF generation
The demo script provides a comprehensive TDT analysis system with professional PDF report generation capabilities.
# Run interactive mode (default)
python demo.py
# Analyze specific text and generate PDF report
python demo.py --text "Your text to analyze here" --output analysis_report.pdf
# Analyze text from file
python demo.py --file input.txt --output report.pdf
# Run example detections with automatic report generation
python demo.py --examples
# Run in interactive mode
python demo.py --interactive
# Analyze without generating PDF report
python demo.py --text "Your text" --no-report
# Custom detection threshold
python demo.py --text "Your text" --threshold 0.003
--text: Text to analyze directly--file: Path to file containing text to analyze--examples: Run example detections with professional reports--interactive: Run in interactive mode--output: Custom path for PDF report (default: tdt_report_.pdf)--no-report: Disable PDF report generation--threshold: Detection threshold (default: 0.0023)The demo generates comprehensive PDF reports including:
Reports are automatically saved to the specified output path or tdt_report_<timestamp>.pdf by default.
# RAID benchmark
./test.sh
# HART benchmark
./main.sh
# Multilingual experiments
./langs.sh
TDT/
├── demo.py # Interactive TDT demonstration
├── requirements.txt # Dependencies
├── scripts/
│ ├── delegate_detector.py # Main detection pipeline
│ └── detectors/
│ ├── t_detect.py # TDT implementation
│ └── configs/
│ └── tdt.json # TDT configuration
├── benchmark/ # Datasets (not included)
├── test.sh # RAID experiments
├── main.sh # HART experiments
└── langs.sh # Multilingual experiments
TDT uses the following pre-trained models from HuggingFace:
tiiuae/falcon-7btiiuae/falcon-7b-instructThese will be automatically downloaded on first use.
@misc{west2025aigeneratedtextnonstationarydetection,
title={AI-Generated Text is Non-Stationary: Detection via Temporal Tomography},
author={Alva West and Yixuan Weng and Minjun Zhu and Luodan Zhang and Zhen Lin and Guangsheng Bao and Yue Zhang},
year={2025},
eprint={2508.01754},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2508.01754},
}
MIT License - see LICENSE file for details.
3 commits
Python
88.9%
TeX
8.0%
Shell
3.1%
Official implementation of "AI-Generated Text is Non-Stationary: Detection via Temporal Tomography"
The field of AI-generated text detection has evolved from supervised classification to zero-shot statistical analysis. However, current approaches share a fundamental limitation: they aggregate token-level measurements into scalar scores, discarding positional information about where anomalies occur. Our empirical analysis reveals that AI-generated text exhibits significant non-stationarity—statistical properties vary by 73.8% more between text segments compared to human writing. This discovery explains why existing detectors fail against localized adversarial perturbations that exploit this overlooked characteristic.
We introduce Temporal Discrepancy Tomography (TDT), a novel detection paradigm that preserves positional information by reformulating detection as a signal processing task. TDT treats token-level discrepancies as a time-series signal and applies Continuous Wavelet Transform to generate a two-dimensional time-scale representation, capturing both the location and linguistic scale of statistical anomalies.
TDT reformulates AI text detection as a signal processing task through three key stages:
Token-level discrepancy scores Z(x) = [z₁, z₂, ..., zₙ] are converted to a continuous signal using Gaussian Kernel Density Estimation:
Z̃(x,t) = (1/nh) ∑ᵢ₌₁ⁿ K((t-i)/h) zᵢ
The signal is decomposed using the Morlet wavelet to create a 2D time-scale representation:
W(a,b) = (1/√a) ∫ Z̃(x,t) ψ*((t-b)/a) dt
Energy is extracted from three linguistically-motivated bands:
The final representation is:
S_TDT(x) = [‖W_morph‖_F, ‖W_syn‖_F, ‖W_disc‖_F]
# Python 3.12+ required
pip install -r requirements.txt
# For PDF report generation (optional)
# Ubuntu/Debian:
sudo apt-get install python3-cffi python3-brotli libpango-1.0-0 libpangoft2-1.0-0
# macOS:
brew install pango
# Note: WeasyPrint requires system dependencies for PDF generation
The demo script provides a comprehensive TDT analysis system with professional PDF report generation capabilities.
# Run interactive mode (default)
python demo.py
# Analyze specific text and generate PDF report
python demo.py --text "Your text to analyze here" --output analysis_report.pdf
# Analyze text from file
python demo.py --file input.txt --output report.pdf
# Run example detections with automatic report generation
python demo.py --examples
# Run in interactive mode
python demo.py --interactive
# Analyze without generating PDF report
python demo.py --text "Your text" --no-report
# Custom detection threshold
python demo.py --text "Your text" --threshold 0.003
--text: Text to analyze directly--file: Path to file containing text to analyze--examples: Run example detections with professional reports--interactive: Run in interactive mode--output: Custom path for PDF report (default: tdt_report_.pdf)--no-report: Disable PDF report generation--threshold: Detection threshold (default: 0.0023)The demo generates comprehensive PDF reports including:
Reports are automatically saved to the specified output path or tdt_report_<timestamp>.pdf by default.
# RAID benchmark
./test.sh
# HART benchmark
./main.sh
# Multilingual experiments
./langs.sh
TDT/
├── demo.py # Interactive TDT demonstration
├── requirements.txt # Dependencies
├── scripts/
│ ├── delegate_detector.py # Main detection pipeline
│ └── detectors/
│ ├── t_detect.py # TDT implementation
│ └── configs/
│ └── tdt.json # TDT configuration
├── benchmark/ # Datasets (not included)
├── test.sh # RAID experiments
├── main.sh # HART experiments
└── langs.sh # Multilingual experiments
TDT uses the following pre-trained models from HuggingFace:
tiiuae/falcon-7btiiuae/falcon-7b-instructThese will be automatically downloaded on first use.
@misc{west2025aigeneratedtextnonstationarydetection,
title={AI-Generated Text is Non-Stationary: Detection via Temporal Tomography},
author={Alva West and Yixuan Weng and Minjun Zhu and Luodan Zhang and Zhen Lin and Guangsheng Bao and Yue Zhang},
year={2025},
eprint={2508.01754},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2508.01754},
}
MIT License - see LICENSE file for details.
3 commits
Python
88.9%
TeX
8.0%
Shell
3.1%