MatLogica | How AADC Works - Computational Graphs for Finance

How AADC Works - Computational Graphs for Finance

From Machine Learning to Quantitative Finance

AADC applies proven computational graph techniques from TensorFlow and PyTorch to quantitative finance. Record once, compile instantly, execute thousands of times faster with automatic derivatives.

The Same Technology That Powers AI—Now for Finance

AADC applies proven computational graph techniques to quantitative finance. What made the AI revolution possible now makes real-time risk practical.

Why Computational Graphs Work

Machine Learning

Before TensorFlow:

  • Interpret every operation each training step
  • Painfully slow training times
  • Limited model complexity

After TensorFlow:

  • Record computational graph once
  • Optimize globally
  • Execute thousands of times
  • Made entire AI revolution possible

Quantitative Finance

Traditional Approach:

  • Interpret calculation logic each execution
  • Bump-and-reprice for each Greek
  • Real-time risk impractical

With AADC:

  • Record computational graph once
  • Optimize globally
  • Execute many times with auto derivatives
  • Makes real-time risk practical

The Three-Phase Process

Phase 1

Recording (One-Time)

Capture the computational workflow once, typically pre-market or on-demand

How It Works:

1
User triggers "Start recording"
Initialize recording mode in your application
2
Execute function with idouble types
Run your calculation with AADC active types
3
User triggers "Stop recording"
Finalize recording
4
AADC extracts computational graph
Automatic capture of complete calculation workflow
Timing: One-time setup, typically done pre-market or when portfolio changes
Phase 2

JIT Compilation (Near-Instantaneous)

Proprietary compiler transforms graph into highly optimized machine code in milliseconds

Speed: Near-instantaneous (milliseconds) vs LLVM/Clang (seconds to minutes)
Why Proprietary Compiler? Traditional compilers (LLVM) are too slow for real-time financial applications. AADC's finance-optimized JIT compiler enables practical real-time compilation.
Phase 3

Execution (Many Times)

Run the optimized kernel thousands of times with different market data

Lightning-Fast Execution:

1
Access the compiled kernel
Binary kernel ready for use
2
Feed input data
Market data, portfolio positions, scenario parameters
3
Kernel returns results + derivatives
NPV plus all Greeks in single pass
4
Repeat for all scenarios/dates
Execute thousands of times with minimal overhead

Industry-Leading Recognition and Validation

Business Impact
  • Chartis Category Leader 2022-2024 (4 categories)
  • RiskTech100 2024 featured company
  • Asia Risk Technology Newcomer 2024
  • QuantTech50 top quartile ranking
Performance: 6-1000x faster than original code, with adjoint factor < 1 (all Greeks faster than just price!)

What JIT Compilation Enables

Automatic Vectorization

AVX2/AVX512 SIMD processes 4-8 doubles per CPU cycle. What would require manual assembly coding happens automatically.

Speedup: 4-8x

Automatic Multi-Threading

Thread-safe parallelization that scales linearly with cores. Complex threading logic handled automatically.

Speedup: 10-50x on multi-core

Cache Optimization

Optimal memory layout for modern CPU architecture. Data arranged for maximum cache efficiency and minimal bandwidth.

Speedup: 2-3x

Code Compression

Better instruction cache usage through optimized code generation. Eliminates OO overhead like virtual functions.

Additional efficiency gains

Python Interpreter Bypass

Python code compiled to native machine code, bypassing the interpreter entirely. Makes Python production-ready.

Speedup: 10-100x for Python

OO Overhead Elimination

No virtual functions, no pointer chasing, no abstraction layers. Direct machine code for maximum performance.

C++ speedup: 6-100x

This Accelerates Everything

Not just AAD—all calculations benefit from JIT compilation

Monte Carlo
Stress Tests
Backtesting
Greeks

Binary Kernel Properties

The compiled output is a highly optimized binary kernel with powerful properties

Multi-Thread Safe

Even if original code isn't thread-safe, kernel is. Automatic parallelization with no race conditions.

Vectorized SIMD

Automatic AVX2/AVX512 vectorization. No manual SIMD coding needed.

Serializable

Save to disk, transfer to cloud, version control. Deploy separately from source code.

Language-Agnostic

Call from C++, Python, C#, Excel, or any language via API. Cross-language interoperability.

NUMA-Aware

Optimized for modern CPU architecture. Memory locality and cache efficiency built-in.

Secure

Nearly impossible to reverse-engineer. No source code visible, safe for cloud deployment.

Perfect for Hybrid Cloud Architectures

On-Premises

  • Proprietary models stay secure
  • Portfolio data never leaves
  • Kernel recording happens here
  • Sensitive IP protected

Cloud Native Execution

Technical Findings
  • Binary kernels deployed here
  • Execution scales elastically
  • Results returned instantly
  • 50-99% cost reduction

Mix-Mode Execution

Seamless integration of C++, Python, and C# code in a single computational graph. Record in one language, execute from another, or mix in single valuation graph.

Business Impact
  • Use best language for each component
  • No performance loss at language boundaries
  • Incremental modernization path
  • Team flexibility (Python + C++ developers)

Binary kernels are unique per configuration and nearly impossible to decrypt—ensuring robust security

Performance Impact by Code Type

Starting Code AADC Speedup Typical Use Case
Naive Python Up to 1000x Pure loops, no NumPy optimization
Optimized Python 100-300x NumPy, typical quant code
Legacy C++ 50-100x OO design with abstractions
Modern C++ 20-50x QuantLib, typical templates
Optimized C++ 6-20x Already tuned and vectorized

Plus Automatic Derivatives: All cases include automatic differentiation with adjoint factor <1, meaning you get all first-order Greeks faster than just computing the price.

Explore the Technical Breakthroughs

Adjoint Factor <1

Revolutionary achievement: compute function + all derivatives faster than original function alone. Breaks the theoretical 4x minimum with adjoint factor <1.

Business Impact
  • Get all Greeks for 'free' - actually negative cost
  • No trade-off between speed and derivatives
  • Makes AAD adoption compelling everywhere
Read Research

Mix-Mode Execution

Seamless integration of C++, Python, and C# code in a single computational graph. Record in one language, execute from another, or mix in single valuation graph.

Business Impact
  • Use best language for each component
  • No performance loss at language boundaries
  • Incremental modernization path
  • Team flexibility (Python + C++ developers)

Integration Process

Three-phase process: Record computational graph once, JIT compile to optimized machine code, execute thousands of times with 6-1000x speedup.

View Technical Details

See AADC in Action

Now that you understand how it works, explore what you can build with it