Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Jane Street Tech Blog 13 min read Case study mediumAdept

Flex Model: an event-driven feature engineering system

Flex Model is Jane Street's OCaml framework that turns market events into feature vectors for neural-network trading models, replacing a 17k-line monolith where adding one feature touched nineteen files. Incremental was rejected because its cutoffs and update coalescing silently drop history-dependent events. Flex Model instead splits each feature into per-event handlers that update state and eval functions that compute values on demand, giving up runtime graph changes to keep history inside the graph. A startup planner compiles feature dependencies into per-event-kind action lists run without cutoffs, avoiding unpredictable branches and letting teams add new event types without touching the core. The hot path is allocation-free, checked with [@zero_alloc]. Unboxed floats from OxCaml cut tail latency by about 25% in one test replay.

Assumes: OCaml basicsincremental computationgarbage collection basics

Related posts

  • What the interns have wrought, 2023 edition

    Jane Street Tech Blog mediumAdept

    Three Jane Street intern projects, all in OCaml. The first is an SQL-like temporal query language, parsed with Angstrom and compiled onto a Linear Temporal Logic engine, for finding event sequences in Concord's transaction stream. The second is a pure-OCaml tiktoken-compatible tokenizer with a handcrafted regex automaton and an imperative rewrite; it matched or beat the Rust reference implementations, though GC pauses gave it higher variance. The third adds async support to ppx_tracing by storing correlation IDs in the Async scheduler's execution context, which helped the Iron code review team cut server startup time by about 50%.

  • What the interns have wrought, 2022 edition

    Jane Street Tech Blog mediumAdept

    Three Jane Street intern projects from 2022 show substantial tooling work in OCaml. magic-trace gained a sampling mode that can cover 20 seconds to 20 minutes on Intel or AMD hardware, plus multi-process tracing, CPU-frequency transition reporting and a perf dlfilter backend that speeds trace decoding by 10–50%. Datafetcher jobs can now be compiled into Incremental computations, using a Response_or_waiting type to represent async state and mandatory memoization of fetch nodes. Quickcheck gained a [@@contract] syntax for deriving property tests from interface signatures, along with early support for bisimulation testing of two implementations of the same API.

  • The Road to Component Model 1.0

    Bytecode Alliance hardMaster

    Component Model 1.0 is planned around five workstreams: a lazy ABI that replaces cabi_realloc-based eager allocation with opaque value handles and inlinable built-ins, native implementation in at least two browser engines, simpler implementation via guest and host C ABIs plus a component-smashing tool, ecosystem and tooling growth, and WIT expressivity features such as optional imports, callbacks, resource subtyping and a map type. The ABI change ships opt-in in a 0.3.x release and becomes the default at 1.0, with adapters keeping P1, P2 and P3 components working. Other planned work removes the roughly 3.5x overhead on synchronous cross-component calls and adds cooperative threads and stream splicing in WASI P3 follow-up releases. jco's "use components" marker borrows the asm.js telemetry strategy to build the case for native browser support.

  • What the interns have wrought, 2025 edition

    Jane Street Tech Blog hardMaster

    Jane Street's 2025 intern projects include an index-aware evaluator for JSQL, the company's internal SQL dialect, which over-approximates key ranges from WHERE clauses and specializes execution to Map, Hashtbl or multi-index containers, giving ~700x and ~30x speedups on 3.8M-row benchmarks. A redesigned ocamltorch API uses OxCaml's local mode and refcount scopes to free GPU tensors deterministically instead of forcing Gc.full_major calls. A third project is a shared-memory library that passes pointers between trading processes instead of serializing data, using atomic refcounts and OxCaml visibility modes (read_write, read, local) to enforce race-free, borrow-checker-like access.

  • Introducing TabFM: A zero-shot foundation model for tabular data

    Google Research easyNovice

    TabFM is a foundation model that treats tabular classification and regression as in-context learning, so it predicts on an unseen table in a single forward pass with no training, hyperparameter tuning or feature engineering. Its hybrid architecture combines TabPFN-style alternating row and column attention, compression of each row into a dense vector, and a TabICL-style Transformer over the compressed rows to keep compute low on larger tables. It is pretrained entirely on hundreds of millions of synthetic datasets generated from structural causal models. On TabArena (38 classification and 13 regression datasets, 700 to 150K rows), it is reported to beat tuned tree-based baselines in Elo, and an ensemble variant adds cross and SVD features, NNLS weighting and Platt scaling. It is available on Hugging Face and GitHub and through BigQuery's AI.PREDICT.

The quest for software engineering knowledge.

Look:
Layout: