What is feature freshness?

Feature freshness is how old a feature value is when a model reads it, the gap between the event that should change the value and the moment the new value is available at inference. A stale feature describes the customer as they were, so the model answers for someone who has already moved on.

By Alex DeanUpdated

What does feature freshness mean?

A feature is an input a model reads, such as “orders in the last 30 days” or “product views this session”. Its freshness is the time between something happening, a view or an order, and the feature value that counts it being ready for the model to read. A value refreshed by a nightly job can be most of a day behind by the evening. A value updated as each event arrives is behind only by how long the pipeline takes to process it.

Both values can be correct. They describe the customer at different moments, and the model only ever sees the moment the pipeline last caught.

How is feature freshness measured?

There are three common ways to put a number on it, and they answer slightly different questions.

  1. Event time to availability. How long from the event being created to the updated value being readable in the online store. Hopsworks defines feature freshness this way for streaming pipelines: from the event to the new value written to the online feature store. This measures the pipeline.
  2. Staleness at read time. How old the value is at the moment the model reads it, usually the read timestamp minus the timestamp of the newest event the value includes. This measures what the model actually experienced, and it is the number that relates to accuracy.
  3. A freshness SLA. A target set per feature, such as “this value is never more than one refresh cycle behind”, with an alert when it is breached. This turns the first two into something a team can be on call for.

What is the difference between feature freshness and latency?

Serving latency is how long a lookup takes: the model asks for a value and gets one back. Freshness is how recent that value is. They are independent. An online store can return a value very quickly and still return one computed yesterday. A fast lookup of a stale value is still stale.

Read latency is the figure most often quoted for feature stores. Update latency, how long a new event takes to change the served value, is quoted far less, and it is the half that sets freshness. A store that only holds the latest value per key is as current as the job that last wrote to it. Feast’s online store documentation, for example, describes values arriving through materialization runs or pushed from a stream.

Batch, streaming and on-demand features compared

Most feature platforms offer the same three ways to compute a value. They differ mainly in when the computation happens.

Path Freshness Cost Complexity Good fits
Batch As old as the last scheduled run, often hourly or daily Low per value; warehouse compute on a schedule Low; SQL or Spark jobs most teams already run Lifetime value, tenure, 90-day purchase totals, slow-moving segments
Streaming Updated as events arrive, behind by pipeline processing time Higher; an always-on job and an online store High; windows, late events and state to manage Counts and recency over this session or the last few minutes
On-demand Computed at request time from inputs in the request Paid per prediction, on the request path Medium; logic must be fast and has no history of its own Distance from the user’s location, time since page load, a value derived from the request itself

On-demand features suit values that only exist at request time. Databricks describes on-demand features as values “calculated at the time of inference”, with a restaurant’s distance from the user as the example. They cannot count what happened before the request unless another feature supplies it, which is why most real models mix all three.

How fresh do ML features need to be?

As fresh as the behavior they describe changes. A customer’s lifetime value moves slowly, so a daily value loses almost nothing. The items in the current session change with every view, so a daily value is useless for them: it was computed before the session started.

A practical test is to ask what the feature would say in the middle of a visit. If the honest answer is “the same as this morning”, batch is fine. If the answer should change while the person is still on the page, the feature needs a streaming or on-demand path. Fresher is not always better. Streaming a slow-moving value costs more and adds operational work for no gain in accuracy.

How do stale features hurt a model?

Stale features fail silently. The model still returns a score, built from inputs that describe an earlier version of the customer. Accuracy slips, and nothing in the logs says why.

Staleness also causes training-serving skew. A training set is usually built after the fact from complete history, so each row holds the value as it truly was at that moment. In production, the model reads whatever the online store has, which may lag behind what the customer just did. The model learned from values fresher than the ones it gets. Online vs offline features covers how the two paths should agree.

Worked example: product views in the last 10 minutes

An illustration. A retail recommendation model uses one feature: how many product pages this visitor opened in the last 10 minutes. A high count means active browsing, and the model leans toward close alternatives to what was just viewed.

Signals calls each feature an attribute. Defined with the Signals Python SDK, keyed on the session:

from datetime import timedelta
from snowplow_signals import Attribute, Event, StreamAttributeGroup, domain_sessionid

product_view = Event(name="product_view", vendor="com.example", version="1-0-0")

product_views_10m = Attribute(
    name="product_views_10m",
    type="int32",
    events=[product_view],
    aggregation="counter",
    period=timedelta(minutes=10),
    default_value=0,
)

session_browsing = StreamAttributeGroup(
    name="session_browsing",
    version=1,
    attribute_key=domain_sessionid,
    owner="you@example.com",
    attributes=[product_views_10m],
)

A shopper arrives at lunchtime and opens six product pages in a few minutes, then reaches a page with a recommendation slot.

  • Daily batch value. The job ran overnight. This session did not exist then, so the model reads the default, zero. It treats an active browser as a cold visitor and shows generic best sellers.
  • Streaming value. Each view updated the count as it arrived. The model reads six and recommends alternatives to the shoes the shopper has been comparing.

The model and the definition are identical in both cases, so the difference in the answer comes from freshness alone. For a window this short, an hourly batch job does not help either, because the window closes long before the next run.

Signals runs this definition in a streaming engine, so the value updates as each event arrives, and the same definition computes history in the warehouse for training. The current update and read figures are on real-time attributes.

How do you monitor feature freshness?

  • Log the timestamp of the newest event behind each served value, next to the value itself, so staleness at read time can be computed for every prediction.
  • Watch pipeline lag. For streaming, the gap between event time and processing time; for batch, whether the last run finished on schedule.
  • Alert on the SLA per feature, not one threshold for all. A daily feature an hour late matters less than a session feature that has stopped updating.
  • Compare served values with recomputed ones. Recompute a sample of features from the full event history for the same customer and moment, and compare. Persistent gaps point to staleness or skew.

A feature that stops updating usually keeps serving its last value rather than failing, so these checks are the only way most teams find out.

See it on your own traffic

Add the SDK, define one attribute, and see an attribute updating against your own traffic in the first session. The free tier runs on the real engine: no card, no sales call.