-
Notifications
You must be signed in to change notification settings - Fork 0
Home
PhD Research: Validating LLM Understanding of Market Microstructure Through Obfuscation Testing
This repository contains a novel obfuscation testing methodology that validates whether Large Language Models truly understand financial market constraints or simply memorize patterns from training data.
Core Innovation: Strip all temporal context (dates, tickers, events) and force LLMs to reason purely from market structure.
Test Domain: Options market dealer constraints (gamma exposure hedging)
Key Finding: LLMs detect structural dealer constraints with 71.5% detection rate and 91.2% predictive accuracy without any temporal context.
- Methodology - Obfuscation testing framework explained
- Pattern Taxonomy - Three validated dealer constraint patterns
- Key Results - Paper #1 findings (full 2024 validation)
- Getting Started - Installation and quick start guide
- API Reference - Key components and usage
- RoadMap - Multi-paper research trajectory (Papers #1-4+)
- Publications - Papers and presentations
Status: Submitted to IEEE LLM-Finance 2025 Workshop (Oct 26, 2025)
| Metric | Result |
|---|---|
| Detection Rate | 71.5% average across 3 patterns |
| Predictive Accuracy | 91.2% (predictions materialize) |
| Sample Size | 726 tests (242 trading days Γ 3 patterns) |
| Validation Period | Full 2024 (all quarters) |
Critical Finding: Detection-Profitability Divergence
- LLM detection remains stable (84-100%) even as profitability declines to zero (Q1βQ4 2024)
- Proves LLM detects market structure, not profits
- Validates methodology rejects temporal context leakage
- Problem: How do we know LLMs understand vs memorize?
- Solution: Strip all temporal context, force reasoning from structure alone
- Validation: Compare obfuscated vs non-obfuscated detection rates
- Explicit causal identification required
- Not just "pattern exists" but "dealers are forced by regulation to hedge negative gamma"
- Mechanistic understanding, not statistical anomalies
- Tested 3 different narrative framings of same underlying constraint
- LLM correctly identifies identical mechanism across framings
- Proves detection is structural, not pattern-matching specific keywords
gex-llm-patterns/
βββ src/ # Core system components
β βββ agents/ # MarketMechanicsAgent (LLM orchestration)
β βββ gex/ # GEXCalculator (gamma exposure metrics)
β βββ validation/ # OutcomeCalculator, PatternTaxonomy
β βββ data_sources/ # Historical data fetching
βββ scripts/ # Validation and experiment scripts
β βββ validation/ # Pattern taxonomy validation
β βββ orchestrate_experiment.py # Main entry point
βββ docs/ # Comprehensive documentation
β βββ papers/ # Paper #1 content, research roadmap
β βββ guides/ # Conceptual guides and tutorials
β βββ presentations/ # Symposium and conference materials
βββ reports/ # Validation results (YAML)
βββ validation/
βββ pattern_taxonomy/ # Full 2024 results
# Clone repository
git clone https://github.com/iAmGiG/gex-llm-patterns.git
cd gex-llm-patterns
# Install dependencies
pip install -r requirements.txt
# Set up environment
export PYTHONPATH=$(pwd):$PYTHONPATH
export OPENAI_API_KEY="your-key-here"
# Run validation on single pattern
python scripts/validation/validate_pattern_taxonomy.py \
--pattern gamma_positioning \
--symbol SPY \
--start-date 2024-01-02 \
--end-date 2024-03-29See Getting Started for detailed setup instructions.
Paper #1 (Submitted Oct 2025):
- "Validating Large Language Model Understanding of Market Microstructure Through Obfuscation Testing"
- IEEE LLM-Finance 2025 Workshop @ IEEE BigData 2025
- Full paper content
Presentations:
- PhD Symposium 2025 (October 2025)
- Research presentation at academic institution
This is an academic research project. For questions or collaboration inquiries:
- Open an issue
- Review active research directions
AGPL-3.0 - See LICENSE
Last Updated: October 25, 2025