Advanced Market Collusion Detection: 93% accuracy with ML+LLM detection, real-time monitoring, and economic validation
Clone the repo and run the demo:
git clone https://github.com/bangyen/regulator.git
cd regulator
pip install -e .
pytest # optional: run tests
python scripts/run_experiment.py --firms "random,titfortat" --steps 100Or open in Colab: Colab Notebook.
For real-time monitoring, run the dashboard:
python dashboard/main.py
# Or use the CLI: regulator dashboard
# Visit http://localhost:5000This project uses uv for dependency management and just as a task runner.
- Initialize environment:
just init - Format code:
just fmt - Lint:
just lint - Type check:
just type - Run tests:
just test - Run all checks:
just all
| Detection Method | Accuracy | Precision | Recall | F1 Score | ROC AUC |
|---|---|---|---|---|---|
| ML Detector | 93.0% | 85.0% | 97.1% | 90.7% | 98.0% |
| LLM Detector | 69.0% | 49.2% | 96.7% | 65.2% | 91.8% |
- Real-Time Dashboard — Professional monitoring interface with live metrics, charts, and violation tracking.
- ML+LLM Detection — 93% accuracy with sub-millisecond processing for real-time monitoring.
- Economic Validation — Built-in consistency checks and market dynamics validation.
- Chat Integration — Natural language communication monitoring with OpenAI-powered analysis.
- Enhanced Regulator — Graduated penalties, continuous risk scores, and market-aware monitoring.
- Leniency Programs — Strategic whistleblower dynamics and evidence-based reporting.
regulator/
├── regulator_demo.ipynb # Colab notebook
├── dashboard/ # Flask dashboard (run with dashboard/main.py)
├── scripts/ # Example run scripts
├── tests/ # Unit/integration tests
├── docs/ # Images for README
└── src/ # Core implementation
└── regulator/ # Main package
├── agents/ # Market agents (firm_agents.py, leniency.py)
├── cartel/ # Market environment
├── detectors/ # Detection systems (under development)
├── episode_logging/ # Logger & episode runner
├── experiments/ # Experiment logic
├── monitoring/ # Placeholder for future metrics
└── cli.py # CLI entry point
- ✅ Overall test coverage of 92% (
pytest) - ✅ Reproducible seeds for experiments
- ✅ Benchmark scripts included
- Algorithms, Machine Learning, and Collusion - Comprehensive analysis of self-learning algorithms and collusive outcomes
- Deep learning for detecting bid rigging - CNN-based approach for flagging cartel participants using pairwise bidding interactions
- Algorithmic Collusion: A Critical Review - Critical assessment of pricing algorithms and collusion potential
This project is licensed under the MIT License.
