Quant Memo
Core

Caching and Materialising Feature Tables

Recomputing expensive features from scratch every time a model runs wastes time and money — caching and materializing feature tables store the results once so research and production can reuse them.

Prerequisites: Feature Stores

Computing a feature like a 60-day rolling volatility or a cross-sectional rank across thousands of tickers can be expensive, and many models and researchers on a team need the same feature. Materializing a feature table means computing it once on a schedule and storing the result — as a table in a database or a file on disk — so anyone who needs it reads a lookup instead of recomputing it. Caching is the lighter-weight version: keeping recently computed results around in fast storage so a repeated request within some time window skips recomputation.

Materializing a feature table trades storage and pipeline complexity for speed and consistency — every consumer reads the same precomputed values instead of each one recomputing (and potentially recomputing slightly differently) from raw data.

Where this saves real time and prevents real bugs

Beyond raw speed, materialized feature tables prevent a subtle but common bug: two researchers each writing their own version of "60-day rolling volatility" from raw prices can produce slightly different numbers due to small implementation differences — different handling of missing days, different rolling-window conventions — and neither may notice until a backtest and a production model disagree. A single materialized, versioned feature table removes that ambiguity by construction: everyone downstream reads the same values.

The cost is a pipeline that needs its own scheduling, monitoring, and invalidation logic — a materialized table must be refreshed on the right cadence and recomputed if the definition of the feature itself changes, or stale or subtly wrong cached values can propagate silently into every model that depends on them.

Related concepts

Practice in interviews

Further reading

  • Huyen, Designing Machine Learning Systems (ch. on feature pipelines)
ShareTwitterLinkedIn