afterclick
728 × 90

Engineering

How Tyra let TellApart train user models in minutes instead of days

Ten billion events went into a single model TellApart’s engineers had trained just days before they wrote about it. That figure sat in the middle of their post about Tyra, a system that took the feature extraction behind the company’s user models from a process measured in half-days to one measured in minutes. The authors, Jeshua Bratman and Nick Pisarro, could not resist the name: the modelling codebase was called “runway”, and Tyra trains the runway models.

The pun is the lightest thing in the story. Everything else concerns a problem every team that trains models on behavioural data runs into eventually.

What the user models were for

Every TellApart product ran on a score the company called the Customer Quality Score, or CQS. It was computed in real time as a shopper moved around the web, and it told the system what a given user was worth: how much to bid for an ad impression on a real-time bidding exchange, and which content to show once the bid was won. Without a reliable score, a retargeting platform is guessing.

Producing those scores had two hard parts. One was serving: making a prediction quickly enough to fit inside the strict time limits of an RTB auction. The other was training: chewing through enormous volumes of historical events to build the statistical user models that the predictions came from. The Tyra post addressed the second.

The training pipeline had two steps. First, feature extraction turned each recorded event into a consistent representation. Second, a training and validation step produced the models. Tyra was a new design for the first step only, and it is the step that usually dominates the cost.

Immediate features are easy, historical ones are not

Each training example was an event for one user: an ad view, say, or a view of a product page on a client’s store. That example paired features with a class label. The label captured some facet of customer quality, such as whether the user clicked or whether they bought. The features described the event and the user.

The engineers drew a clean line between two kinds of features. Immediate features come from the event alone, like the hour of the day or the site where the ad appeared. Extracting them is trivial.

Historical features are the valuable ones, and the expensive ones. “How many ads has this user seen in the past 30 days?” depends on everything that user did before the event. Computing that for millions of users across billions of events was, in the authors’ words, the biggest scalability problem in the whole pipeline.

The raw events lived as flat files on Amazon S3, organised by event type and date, and feature extraction ran as a MapReduce job over them.

Two old answers, both flawed

There are two classic ways to get historical features out of logs, and the post laid them out plainly.

The first is to write the history into each log line at the moment the event happens. If the ad server records “this user has seen 14 ads this month” alongside the impression, extraction is a single sweep with no look-back at all. The flaw is foresight. You can only use history you thought to log. A new historical feature means changing the logging code and then waiting weeks for enough new data to train on.

The second is to compute history from the past events themselves, sweeping back through each user’s record whenever features are extracted. This is completely flexible, because any feature can be defined after the fact. The flaw is cost. TellApart’s old pipeline worked this way, and it had stopped scaling in two specific places.

For production models, extraction time grew with the feature window. Thirty days of training data with 30-day trailing features meant reading 60 days of logs. For experiments with new features, nothing was cached, so adding one feature meant re-running the whole flow, which could take more than twelve hours.

Tyra stores daily summaries of each user

Tyra kept the flexibility of the second approach and borrowed the speed of the first by caching history in a form that could be extended later. The unit was a summary. For each day, for each user active that day, and for each type of historical feature, Tyra stored a small object holding exactly what that feature would need on future days. For a feature like “pages viewed in the past month”, the summary was simply the user’s page-view count for that day.

The pipeline then ran in three steps:

  • Summarize: once a day, sweep that day’s events and write one summary per user per feature type.
  • Combine: merge the summaries from earlier days into a user state for each feature type.
  • Extract: start from the previous day’s user state and walk through the current day’s events in order, emitting features for each one and updating an intra-day state along the way.

Two properties made this work. Summaries replaced re-reading old events, and they were updated daily rather than recomputed from scratch. And because summary types were independent, a new historical feature could be added retroactively by computing one new summary type over past data, without touching the others.

If you have built a feature store, you will recognise this as incremental, point-in-time correct aggregation. The extract step’s insistence on processing events in order and updating state as it goes is what keeps a feature from leaking information from after the event it describes, which is the single most common bug in models trained on behavioural data.

Minutes instead of 12 to 24 hours

Tyra was written in Java on Cascading, an abstraction layer over Hadoop, and ran on TellApart’s Amazon Elastic MapReduce cluster. At the time of the post it wrote roughly 100 million summaries and more than 50 billion individual feature values to the company’s data store every day. The features could be queried through Hive and through an internal Cascading-based tool that supported sub-sampling for exploration.

The headline number was the training time. A model that used to need 12 to 24 hours of feature extraction could now be trained in minutes, and the authors described experiments running hundreds of times faster. They joked that they would miss the free time they used to spend watching reruns of America’s Next Top Model, and that the saved AWS fees might stretch to inviting Tyra Banks to a happy hour.

The joke has a serious edge. Feature iteration speed is the main limit on how good a behavioural model gets, and going from overnight to minutes changes how a team works: ideas get tested the same afternoon instead of being batched for the week.

The engineers’ own footnotes

The post ended with notes that are, for a practitioner, the most useful part.

The first was about storing summaries rather than user states. Keeping only a running state per user would skip the combine step, but it would also let a bad day of data corrupt every day after it. Summaries keep days independent, so a broken input can be fixed and re-summarised in isolation. The authors left open a move to pure states if they started using much longer histories.

The second was storage. The summaries sat in flat binary files without indexes, which suited batch training but not much else, and the team was considering HBase to make the user-centric data easier to work with. TellApart had already described an HBase design for log events in Log Event Processing with HBase.

The third concerned MapReduce mechanics. The engineers found it best to use as few reduce steps as possible, which often meant adding dummy values to reduce keys and controlling sort order so that some rows reached a reducer before others. In Cascading terms, they preferred GroupBy over dissimilar pipes to CoGroup.

The fourth was about files. Keeping the number of output files and directories low cut HDFS copy times substantially, and the simplest lever was using fewer reducers for jobs that wrote long-lived data. Anyone who has fought the small-files problem on S3 or in a data lake table format will nod at that one.

What a team would build in 2026

The architecture Tyra described is now a product category. Feature stores such as Feast, Tecton and the managed offerings from Databricks and the cloud providers all centre on the same ideas: declare features once, compute them incrementally, keep offline training data point-in-time correct, and serve the same definitions online. Most would run the summarise and combine steps on Spark or Flink, store results in an open table format such as Apache Iceberg or Delta Lake on object storage, and keep a low-latency online store for serving.

Two things have changed more than the tooling. First, the signals themselves are thinner. Apple’s App Tracking Transparency since 2021, privacy laws such as GDPR and CCPA, and Chrome’s long, winding Privacy Sandbox saga have all reduced how much cross-site history a retargeting company can attach to one user. User models built on first-party data inside a retailer’s own site now carry more of the weight, which is closer to what TellApart was doing with its personalised shopping products than to classic cross-site profiling.

Second, the batch-versus-real-time split that Tyra sat on one side of has blurred. TellApart’s later talk on fast data and the Lambda Architecture described pairing a precomputed batch view with a streaming one, and the daily summaries in Tyra were exactly the kind of batch view that design assumes. A modern team would compute the same summaries continuously from a stream and still keep the daily partitions, because those partitions are what let you fix one bad day without replaying a year.

If you take one design rule from Tyra, take the footnote about summaries versus states. It is the difference between a pipeline that recovers from a bad input in an hour and one that quietly poisons every model trained after it. Which of your own feature pipelines would survive a corrupted day?

Questions readers ask

What is the difference between immediate and historical features?

Immediate features come from the event alone, such as the hour of the day or the site where an ad appeared, and extracting them is trivial. Historical features depend on everything a user did before the event, like how many ads they saw in the past 30 days. Computing those for millions of users across billions of events was the biggest scalability problem in TellApart's training pipeline.

Why did Tyra store daily summaries instead of a running user state?

A single running state per user would skip the combine step, but one bad day of data could corrupt every day after it. Daily summaries keep days independent, so a broken input can be fixed and re-summarised in isolation without replaying everything. Summary types were also independent, which let a new historical feature be added retroactively by computing one new summary type over past data.

Where does the name Tyra come from?

TellApart's modelling codebase was called runway, and the authors, Jeshua Bratman and Nick Pisarro, could not resist naming the system that trains the runway models after Tyra Banks. They joked that they would miss the reruns of America's Next Top Model they used to watch while extraction ran for 12 to 24 hours, and that the saved AWS fees might stretch to inviting Tyra Banks to a happy hour.

What is feature leakage, and how did Tyra's extract step avoid it?

Leakage happens when a feature describing an event quietly includes information from after that event, which makes a model look better in training than it will be in production. Tyra's extract step began from the previous day's user state and walked through the current day's events in order, emitting features for each one before updating an intra-day state. That ordering kept every feature point-in-time correct.