Skip to content

Navigation Menu

Sign in
Sign up
WormsCanned edited this page Oct 26, 2025 · 2 revisions

GEX LLM Patterns

PhD Research: Validating LLM Understanding of Market Microstructure Through Obfuscation Testing

Overview

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.


Quick Navigation

πŸ“š Core Concepts

πŸš€ Getting Started

πŸ—ΊοΈ Research

  • RoadMap - Multi-paper research trajectory (Papers #1-4+)
  • Publications - Papers and presentations

Key Results (Paper #1)

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

What Makes This Research Novel?

1. Obfuscation Testing Framework

  • 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

2. WHO β†’ WHOM β†’ WHAT Framework

  • Explicit causal identification required
  • Not just "pattern exists" but "dealers are forced by regulation to hedge negative gamma"
  • Mechanistic understanding, not statistical anomalies

3. Multi-Pattern Generalization

  • 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

Repository Structure

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

Quick Start

# 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月29ζ—₯

See Getting Started for detailed setup instructions.


Publications

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

Contributing

This is an academic research project. For questions or collaboration inquiries:


License

AGPL-3.0 - See LICENSE


Last Updated: October 25, 2025

Clone this wiki locally

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /