GenZ: Foundational models as latent variable generators within traditional statistical models
Abstract
We present GenZ, a hybrid model that bridges foundational models and statistical modeling through interpretable semantic features. While large language models possess broad domain knowledge, they often fail to capture dataset-specific patterns critical for prediction tasks. Our approach addresses this by discovering semantic feature descriptions through an iterative process that contrasts groups of items identified via statistical modeling errors, rather than relying solely on the foundational model’s domain understanding. We formulate this as a generalized EM algorithm that jointly optimizes semantic feature descriptors and statistical model parameters. The method prompts a frozen foundational model to classify items based on discovered features, treating these judgments as noisy observations of latent binary features that predict real-valued targets through learned statistical relationships. We demonstrate the approach on two domains: house price prediction (hedonic regression) and cold-start collaborative filtering for movie recommendations. On house prices, our model achieves 12% median relative error using discovered semantic features from multimodal listing data, substantially outperforming a GPT-5 baseline (38% error) that relies on the LLM’s general domain knowledge. For Netflix movie embeddings, our model predicts collaborative filtering representations with 0.59 cosine similarity purely from semantic descriptions—matching the performance that would require approximately 4000 user ratings through traditional collaborative filtering. The discovered features reveal dataset-specific patterns (e.g., architectural details predicting local housing markets, franchise membership predicting user preferences) that diverge from the model’s domain knowledge alone.
1 Introduction
Given an item’s semantics, such as a text description, image, or audio recording, large foundational models can answer specific questions about the content, and thus convert the item’s semantic representation into a canonical discrete representation. Such a representation is useful for traditional statistical models—such as graphical generative models, belief networks, or probabilistic circuits—which can capture statistics from external, possibly proprietary, datasets related to these items.
Movies are an example of such items. We can use an LLM to featurize them as binary vectors based on answers to questions as illustrated in Fig. 1. These binary vectors can help explain the patterns found in the movie-user ratings matrix. Collaborative filtering techniques reduce the observation matrix to embeddings, which capture usage statistics absent from the foundational models’ training data. The foundational models, however, can reason about the semantic content—such as the movie synopsis, critical response, credits, and other metadata—either from their training or by retrieving information from a database as part of a RAG system.
We describe how appropriate prompts can be learned from such item statistics by jointly modeling the semantic features and the statistical patterns in the data.
We study a general hybrid statistical-foundational model defined as follows. Let be the semantic representation of an item, e.g., text with a movie title or its description. Given a collection of semantic feature descriptors , such as ’historical war film’, a foundational model, which we refer to as function , makes a judgment whether the feature applies to the item (Figure 1). Let be the true binary feature vector that allows for possible errors in either the model’s judgment or the wrongly worded feature descriptors. We model uncertainty by defining a conditional distribution , where is a discrete feature vector (binary, in the example in the figure and in our experiments), is a collection of semantic feature descriptors, such as ’historical war film’, and is a set of estimated probabilities of feature classification errors. A feature vector is then linked to observation through a classical statistical model , possibly involving latent variables or some other way of modeling structure, and which has its own parameters . By jointly optimizing for the parameters of the model based on a large number of pairs we can discover the feature descriptions, or the right questions to ask, in order to explain the statistics in the dataset. More generally, hybrid models could have more than one category of items with a (learnable) statistical model of their relationships, for example geographic regions and native plants.
The idea of using interpretable intermediate representations to bridge inputs and predictions has a long history in machine learning. Concept bottleneck models (CBM) koh2020concept; kim2023probabilistic formalized this approach by training neural networks to predict pre-defined human-interpretable concepts from inputs, then using those concepts to make final predictions. Recent work has leveraged large language models (LLMs) to overcome the need for manually labeled concepts, e.g., benara2024craftinginterpretableembeddingsasking; feng2025bayesianconceptbottleneckmodels; chattopadhyay2023variationalinformationpursuitinterpretable; zhong2025explainingdatasetswordsstatistical; ludan2024interpretablebydesigntextunderstandingiteratively. These methods may or may not use the CBM formulation but share with it the goal of feature interpretability. In addition, they have a goal of feature discovery, which is also one of the goals here. They address the difficulty of modeling and jointly adjusting the semantic and statistical parts of the model—in our notation and —in different ways.
In most cases, the target is a discrete variable (the goal is a classification through intermediate concepts), and thus the classification model is a simple logistic regressor or an exhaustive conditional table chattopadhyay2023variationalinformationpursuitinterpretable; feng2025bayesianconceptbottleneckmodels; zhong2025explainingdatasetswordsstatistical. The optimization of the featurizer primarily relies on the LLM’s domain understanding (such as a task description), but some methods also provide examples of misclassified items, e.g., zhong2025explainingdatasetswordsstatistical; ludan2024interpretablebydesigntextunderstandingiteratively.
When real-valued multi-dimensional targets are modeled, showing items with large prediction errors is much less informative because each item may have a different error vector, and thus item-driven discovery is usually abandoned. For example, in benara2024craftinginterpretableembeddingsasking multidimensional targets (fMRI recordings) are modeled, and the method relies on direct LLM prompting about potentially predictive features based on domain knowledge alone, followed by feature selection, rather than showing specific items to contrast.
A fundamental limitation shared by these approaches is their reliance on the LLM’s domain understanding to propose discriminative features. This works well when the LLM has been trained on relevant data and the task aligns with common patterns in its training distribution. However, as our experiments demonstrate, domain understanding alone is insufficient when dataset-specific patterns diverge from general knowledge—such as house pricing dynamics in particular markets, or user preferences captured in collaborative filtering from specific time periods or demographics. Moreover, for high-dimensional real-valued targets , individual prediction errors have multidimensional structure that cannot be easily communicated to an LLM by simply showing "incorrect" examples.
Our approach differs in several key aspects. First, as in some of the recent work, we avoid concept supervision by using a frozen foundational model as an oracle within , but with trainable uncertainty parameters . Second, our feature mining is driven by contrasting groups of items identified through the statistical model’s posterior rather than by querying the LLM’s domain knowledge or showing individual misclassified examples (Figure 2). This group-based contrast allows the method to discover dataset-specific patterns that may not align with the LLM’s training distribution—or even in cases where the LLM has no understanding of what the target represents. (We do, however, require the (M)LLM to reason about the semantic items , either based on knowledge encoded in its weights or by retrieving information from a database as in RAG systems). Third, we support arbitrary mappings including nonlinear functions of binary features for high-dimensional real-valued observations, shifting the burden of modeling complex feature interactions from the LLM to the statistical model. The LLM is only responsible for explaining the semantic coherence of binary splits discovered based on the model’s prediction errors, making it applicable to domains where the relationship between semantics and observations is not well understood in advance.
We refer to our hybrid model as GenZ (or GenAIz?) as it relies on a pre-trained generative AI model to generate candidate latents in a prediction model . We derive a generalized EM algorithm for training it, which naturally requires investigation of items when tuning parameters of the featurizer .
2 Semantic model
Before developing the full algorithm, we first describe the semantic part: the semantic parameters , how depends on them and on a foundational model, and how statistical signals from the model enable updating these parameters in an iterative EM-like algorithm.
2.1 Extracting semantic features: Modeling
The foundational model’s reasoning abilities are sufficient to featurize a semantic item using standard classification prompts. A generic version of this is illustrated in Fig. 1. In the example shown, the items are represented with text, in this case movie titles that large language models are likely familiar with. Each string in the list is an item description —however, the text describing each item could be expanded to include more details about the movie, or a RAG system with access to a movie database could be used in place of an LLM. We use the output of such systems cautiously: we associate an uncertainty level, i.e., a probability of mislabeling for entry in . Assuming that is not deterministically linked to makes it a latent variable in the model, allowing flexibility in inference and enabling updates to the semantic feature descriptions in : If the posterior over can override the foundational model’s determination of whether an item satisfies the feature, this provides a signal for updating the feature semantics.
2.2 Mining semantic features
As already alluded to, the feature semantics are not hand-crafted but learned from the dataset statistics. The statistical signal from the data indicates how the items should be separated along a particular feature , i.e., how the for different items can be altered so that the model explains the data better. In our setup, we deal with binary features, so the signal separates the items into two groups, and we seek a semantic explanation for this separation, .
Specifically, for fixed model parameters, focusing on a particular binary feature for one semantic item , the prior and posterior distributions are generally different:
Thus, sampling the posterior distribution (referred to below as ) for several different items yields new feature assignments . These help update the feature descriptor used in by using the prompt in Fig. 2. There, the positive group has a few items for which and the negative group has a few items for which . Furthermore, we can select group exemplars to contain both semantic items where the posterior and the prior agree, and where they disagree. This encourages small refinements, e.g., from "fearless female characters in an action movie" to "strong female leads".
3 Statistical model
Given an item’s semantics , e.g., a movie description, and its corresponding observed vector , e.g., the movie’s embedding derived from the statistics in the movie-user matrix, the log likelihood can be bounded as
| (1) | |||||
where refers to an expectation under the distribution . Depending on the variational approximation of and the model these expectations can be computed exactly, as illustrated by the example of the mean-field and linear in Section B. Otherwise, a sampling method can be used, often with very few samples due to the iterative nature of the learning algorithm. In experiments (Section 5), we simply evaluate at the mode of .
The bound is tight when the variational distribution is equal to the true posterior , otherwise serves as an approximate posterior. We refer to the three additive terms as the observation part , the feature part , and the posterior entropy .
Given a dataset of pairs , the optimization criterion—the bound on the log likelihood of the entire dataset—is
| (2) |
In general, maximizing the criterion w.r.t. all variables except semantic model parameters (feature descriptions) is straightforward: we can use existing packages or derive an EM algorithm specific to the choice of the model’s statistical distributions. The variational distributions depend only on the individual bounds for each data pair in (1) and can be fitted independently for given model parameters .
The (approximate) posteriors provide the statistical signal discussed in Section 2 for tuning the semantic feature descriptions : sampling them separates the samples into two groups, and exemplars from each are used to prompt the foundational model with the prompt in Fig. 2 for a new definition of the -th feature. The optimization of then consists of steps that improve it w.r.t. the statistical model parameters and the (approximate) posteriors , alternating with updates of the feature descriptions using those posteriors.
This general recipe can be used in a variety of ways, with different choices for the structure of the conditionals in the model and different approximations of the posterior leading to a variety of algorithms including variational learning, belief propagation and sampling frey-jojic-pami-tutorial. We now develop specific modeling choices and a learning algorithm we use in our experiments.
Binary feature model
As discussed, the feature model uses a prompt-based feature classification, where each feature is treated independently based on its description (Fig. 1)
| (3) |
with the uncertainty (probability of error) , so that
| (4) |
where is the binary function that uses one of the prompts in Fig. 1 to detect the feature in the semantic item . The expression above uses the indicator function to express that with the probability of error , the feature indicator is different from . Denoting , we write
| (5) | |||
Using a factorized posterior , the feature term simplifies to
| (6) |
with and defined in (5). Finally, the entropy term becomes
| (7) |
General observation model
We can soften an arbitrary mapping function by defining a distribution:
| (8) | |||||
| (9) |
with being the mapping parameters of function , e.g., regression weights in , and being a vector of variances, one for each dimension of . Different specialized inference algorithms for specific forms of function can be derived. For example, see the appendix for a procedure derived for a linear model (factor analysis). However, in our experiments, we use a generic inference technique using in plug-and-play fashion, described below.
Inference of in the fully factorized (mean field) model
Keeping all but one fixed, we derive the update for the -th feature’s posterior by setting the derivative of the bound wrt parameters and , subject to . We can express the result as:
| (10) |
where , and , i.e the "+i" and "-i" posteriors have their value clamped to 1 and 0 respectively in the factorized . Upon normalization, as the entropy terms and cancel each other, we obtain:
| (11) |
Interpretation: Whether or not should take value 1 or 0 for particular semantic item depends on:
-
•
the assignment that the foundational model assigns it and the level of trust we have in that assignment (the probability of error ). The two are captured in prior log likelihoods .
-
•
error vector , scaled by the currently estimated variances for different elements of the target , for two possible assignments and , with other assignments following the current distributions over other features
While expectations and can potentially be better estimated through sampling, in our experiments, we simply compute at the mode (assuming most likely values for other variables).
Optimizing numerical parameters of and
Optimizing the bound wrt to parameters of the mapping in and the remaining uncertainty/variance reduces to maximizing sum of terms over the traing set, i.e. . Again, while sampling of might be helpful, in our experiments we simply use the mode and iterate:
| (12) | |||||
| (13) |
where is the binary vector of assignments of features , either a sample from or at the mode of the posterior for the -th out of entries in the data set of pairs . is a point-wise multiplication.
The semantic model has numeric parameters , modeling the hybrid model’s uncertainty in semantic function that makes an API call to the foundational model. By optimizing the bound wrt these parameters we obtain the update:
| (14) |
Thus, for a given set of semantic feature descriptors , iterating equations (11) for each item , and (12, 14) using all items in the training set, would fit the numerical model parameters and create the soft feature assignments that best balance those feature descriptors with the target real and possible multi-dimensional targets .
4 Algorithms
In section 2 we pointed out that individual distributions carry information about how the data should be split into two groups to create the mining prompt in Fig. 2. But as each of these distributions depend on the others, there is the question of good initialization. In our experiment we use a method akin to the variational EM view of boosting neal1998boosting, albeit in our case applied to learning to predict real-valued multi-dimensional targets, rather than just for classification.
Note that if we iterate (11, 12, 14) while keeping for a select feature the entire hybrid model and the posterior are decoupled from the foundational model’s prediction which depends on feature description to provide its guess at . Therefore, the iterative process is allowed to come up with the assignment of for each item in such a way that maximizes the likelihood (and minimizes the prediction error). This provides a natural binary split of the data into two groups based on error vectors. In case of predicting house prices (one dimensional , those two groups would be the lower and higher priced houses relative to current prediction, but in case of multi-dimensional observations, such as movie embeddings, the split would be into two clusters, each with their own multi-dimensional adjustment to the current prediction.
A simple algorithm for adding features is shown in Algorithm 1. The key idea is to fit a model with only features while keeping the new feature decoupled from the LLM prediction by fixing . This allows the data to determine the optimal split before discovering its semantic explanation.
The algorithm operates on the model , where features do not participate. By keeping fixed during the inner loop, the posterior is determined purely by how well helps explain , independent of any LLM prediction. This provides the statistical signal needed to discover meaningful features through the mining prompt.
As we show in experiments on the simple task of discovering binary representation of numbers, iteratively running Algorithm 1 with increasing adds new features in coarse-to-fine manner, from those that split the data based on large differences in target to those that contribute to explaining increasingly smaller differences.
Conditional (targeted) feature addition
A possible problem with such coarse-to-fine approach, especially for nonlinear and easy to overfit functions , is that items with different combinations of features can be arbitrarily split with the feature we are updating. For example, suppose we are working on the house pricing dataset and are running the Algorithm 1 for the second time, having added only one feature so far: ’Located in Arizona desert communities’. Then as we iteratively look for a natural split it is possible that for items with high , the procedure may split the data along a different semantic axis (e.g., presence of swimming pools) than for the items with low . To deal with this, we alter Algorithm 1 very slightly: When we sample positive and negative examples, we take them from items that have other features identical. This is akin to using the structured variational approximation , but instead of fitting this for all combinations of other features, we target only one combination at a time. The discovered feature is still used to assign values for all data samples, whether they were in the targeted group or not, so that it can be used in the next step.
To select the combination of features on which we condition the -th feature discovery, we start with the cost being optimized in (12), from the observation part () of the approximate log likelihood based on a sample (or the mode) for each item:
| (15) |
or equivalently, by partitioning over all observed combinations of the other features:
| (16) |
where are the summands that show the total error due to each observed combination of the other features . We select the combination with the largest total error . Algorithm 2 shows the conditional (targeted) feature addition procedure. The key difference from Algorithm 1 is that positive and negative examples are sampled from a targeted subgroup (items sharing the same values for features through ), selected by identifying which combination has the largest total error. The discovered feature is then applied to all items.
These algorithms add a feature but can also be used to update a feature by removing it from the set and then adding a new one. While we can select a feature to update at random, we use a more efficient approach: we choose the feature whose removal affects the prediction (likelihood bound) the least, as shown in Algorithm 3. A single feature update becomes a removal of one feature (Algorithm 3) followed by adding a feature (Algorithm 1). Generally, we alternate an arbitrary number of feature adding steps with feature removal steps, as shown in Algorithm 4.
5 Experiments
Especially exciting applications of hybrid models discussed above involve situations in which the foundational model is capable of recognizing patterns in the data, i.e., features that some items share and others do not, but the high-dimensional target is not understood well by the model, e.g., in scientific discovery based on new experiments. However, there is value in analyzing situations where we (humans) understand the links so that we can better understand what the model is discovering. This is especially interesting when the data involves well understood semantic items, but also novel (or dated!), or otherwise skewed statistics between these items and the targets which we want to discover, despite a potential domain shift w.r.t. what the foundational model was trained on.
We analyzed three datasets we expected to be illustrative:
-
•
Learning binary: A toy dataset with items being strings , and the corresponding targets . We demonstrate that iterating Algorithm 1 recovers a 9-bit binary representation.
-
•
Hedonic regression on house prices: A multimodal dataset from ahmed2016house, consisting of four listing images and metadata, which we turned into semantic items describing all information about a house and the target log price (Fig. 3).
-
•
Cold start in recommendation systems: The Netflix prize dataset. Singular value decomposition of the user-movie matrix is used to make 32-dimensional embedding for each movie, and the associated semantic item is the movie title and the year of release.
Since LLMs can understand similarities between movies or houses and prices, there was a chance that the models could discover relevant features without our iterative algorithms. In fact, as discussed in Section 1, most prior work on using off-the-shelf LLMs to discover features useful in classification and, especially, regression focused on probing LLMs with the description of the task, rather than the data itself, and subsequent feature selection. Our baseline that represents such approaches, which we refer to as 0-shot, is to provide an LLM with an example list of semantic items, describe the task, and ask for around 50 yes/no characteristics that in the LLM’s judgment would be most useful for the task.
Except for the first experiment, whose purpose is to illustrate coarse-to-fine nature of feature discovery with a linear model, we tested two functions (softened in through learned variances ): a linear model and a neural network with two hidden layers (64 and 32 units with ReLU activations and dropout rate 0.1), trained using Adam optimizer with learning rate 0.001 for 100 epochs and batch size 32.
For the two more involved datasets (houses and movies), we used conditional feature adding Algorithm 2 with 10-20 cycles of adding 5 features and removing 2. During the process, when a discovered feature is active for less than 2% or more than 98% of the data, it is discarded, resulting in the feature count generally growing until it stabilizes towards the end of the runs.
Mining prompts are executed by GPT 5, while the extraction prompts are executed with GPT 4.
5.1 Learning, or rather, recalling binary
The primary purpose of this experiment was to serve as an explanation of what iteration of the Algorithm 1 tends to do. The semantic items , have the corresponding targets . We map characteristics to predictions with a linear function .
When we add the first feature by running Algorithm 1, splits the data into high and low values (above or below the mean). When positive and negative groups are incorporated into the mining prompt (Figure 1) and given to GPT 5, it easily detects the pattern: Depending on the random initialization of , the positive group’s characteristic is of two sorts: either an equivalent of "numbers 0-255 inclusive", or an equivalent of "numbers greater than 255".
The first feature splits the data into high and low values, and for all items the model will now predict the mean of one of these two subsets: 127.5 for numbers less than 256, and 383.5 for the rest. The next execution of Algorithm 1 will now assign and to the items based on where the model over- or underestimates . (Due to randomness in initialization, could focus on either all of the overshoots or all of the undershoots). So, the positive group will consist of either the upper halves of the groups or the lower halves. For example, the positive group would include all items in both range and range . Given these as the positive group, and the rest as negative in the mining prompt, GPT 5 sets the next feature to be the equivalent of "Integers with the 2ˆ7 bit unset." As before, due to random initialization, the positive and negative group could be switched, but that would still yield an equivalent feature, as the model simply adjusts weights.
Here is an example of a set of features obtained by running Algorithm 1 9 times with increasing from 1 to 9:
-
•
Integers greater than or equal to 256 (i.e., with the 2ˆ8 bit set)
-
•
Integers with the 2ˆ7 bit set (i.e., numbers whose value modulo 256 is between 128 and 255)
-
•
Integers with the 2ˆ6 (64) bit unset (i.e., numbers whose value modulo 128 is 0–63)
-
•
Integers with the 2ˆ5 (32) bit set (i.e., numbers whose value modulo 64 is between 32 and 63)
-
•
Integers with the 2ˆ4 (16) bit unset (i.e., numbers whose value modulo 32 is 0–15)
-
•
Integers with the 2ˆ3 (8) bit set (i.e., value modulo 16 is between 8 and 15)
-
•
Integers with the 2ˆ2 (4) bit unset (i.e., numbers whose value modulo 8 is 0–3)
-
•
Integers with the 2ˆ1 (2) bit set (i.e., numbers congruent to 2 or 3 modulo 4)
-
•
Integers with the 2ˆ0 (1) bit unset (even numbers)
And here is another one:
-
•
Integers from 256 to 511 (inclusive)
-
•
Integers whose value modulo 256 is in the range 128–255 (i.e., their low byte has its highest bit set)
-
•
Integers whose value modulo 128 is in the range 0–63 (inclusive)
-
•
Integers whose value modulo 64 is in the range 0–31 (the lower half of each 64-block)
-
•
Integers whose value modulo 32 is in the range 16–31 (the upper half of each 32-number block)
-
•
Integers whose value modulo 16 is in the range 0–7 (the lower half of each 16-number block)
-
•
Integers whose value modulo 8 is in the range 0–3 (the lower half of each 8-number block)
-
•
Integers congruent to 2 or 3 modulo 4 (i.e., with the second least significant bit set)
-
•
Even integers (including 0)
Both reconstructions are perfect. We see the same for other ground truth function choices of that are linearly related to the value of the number in the string , . The feature discovery is driven by the structure of the algorithm that breaks the data in a coarse-to-fine manner through binary splits, perfectly matching the binary number representation. All that a foundational model has to do is to recognize this in the provided positive/negative splits. In many applications, such coarse-to-fine binary splitting of the data can be problematic, as features may not interact additively. In the next two experiments in more realistic scenarios, we use Algorithm 2, which chooses the groups conditional on the assignment of the already discovered features.
5.2 Hedonic regression of house prices
The multi-modal dataset ahmed2016house consists of information for 535 houses listed in 2016, the first of which is shown in Figure 3. While our approach is directly applicable to multi-modal data, to save tokens and avoid limitations on the number of images we can submit in our mining prompt, we first transformed the information to pure text, by running all images through GPT 5 with the prompt "Describe the listing image in detail.". Each semantic item is a JSON file with metadata (without the price) and image description, and the target is the log of the price. (Log price modeling is standard in hedonic regression, as some features multiplicatively affect prices. For example, an upgraded interior is costlier for a larger home, or for a home in an expensive ZIP code.)
As discussed in Section 5, we fit using both linear and nonlinear (neural net) forms of the function . In both cases, we supply with additional real-valued inputs , as we do not wish to rediscover these numerical features as we did in the toy experiment in the previous section. However, in the semantic items , full metadata (the number of bedrooms and bathrooms, the area in square feet, but not the price) is still provided, as it can participate in features to account for both nonlinear transformations of price and combined feature effects. For example, in some locales, luxury homes have more bathrooms than bedrooms and that signal can be captured in the discrete as an indicator of higher priced homes.
We split the data into the training set (80% of the data) and the test set. We show the learning curves in Figure 4 for the linear model and a neural network . The video showing which features are added (blue) or removed (red) in Figure 4 (b) is available at: https://github.com/mjojic/genZ/tree/main/media. We plot the progress in terms of median absolute error, as this corresponds to how the performance of hedonic regression of house prices tends to be evaluated in industry. For example, Zillow zillow reported that its Zestimate for off-market homes has a median error rate of 7.01%. (Zestimate for on-market homes is much better because it benefits from the known listing price set by an agent; In our experiments we are trying to predict the price without such professional appraisal). As we model log prices, small median absolute errors (MAE) are close to the relative (percentage) error of the actual (not log) price. For example, achieving MAE of 0.10-0.11, as our model does, is equivalent to a median error rate of around 12%.
The 0-shot baseline is indicated by the horizontal line. The baseline is computed as follows. First, we provided the entire set of semantic items, including the prices to GPT 5 and asked for 50 yes/no questions whose answers would be helpful in predicting the price (GPT gave us 52 instead). Then, these are set to be features , and the pruning Algorithm 3 is applied repeatedly on the training set using linear , keeping track of the test performance. (Note that the function still takes the numeric features ). The horizontal line on the graph represents the best test set performance achieved during pruning. As discussed in Sections 1, 5, this baseline is meant to simulate what could be expected from methods that rely on LLM’s understanding of the domain, rather than iteratively contrasting items based on modeling error as our approach does. The baseline vastly underperforms, and by comparing the baseline’s features with the features our method discovered (Section A.1) we can see why. For example, the baseline’s features rarely focus on location or the architecture/quality of the build/remodel, and instead capture relatively cosmetic features such as fenced yards or green lawns.
The differences in the learning curves provide another illustration that the hybrid model is adjusting all its parameters in unison during learning. The train and test median absolute error drop together until over-training happens. In the case of the linear model, the training error continues to drop, but the testing error stays stable, while in the case of the nonlinear (neural) model, we see that both train and test errors reach lower levels of around . This corresponds to roughly relative error on the raw (not log) price, after which the model begins to overtrain more severely, with training error dropping even lower as the testing error continues to rise. (Note Zillow’s 7% errorzillow, but based on a different, much larger and richer, proprietary dataset of hand-crafted features).
5.3 Cold start recommendations: Netflix prize dataset
The cold start problem in collaborative filtering systems refers to the challenge of making predictions for new items or users without sufficient interaction history. We use the classic Netflix prize dataset bennett2007netflix; netflix-prize-data to demonstrate how our hybrid model can address the cold start problem for new movies by discovering semantic features that predict collaborative filtering embeddings.
For 480,189 users and 17,770 movies, the dataset provides user-movie ratings (0-5, where 0 indicates that the movie was not rated by that user). We computed 32-dimensional embeddings for each movie using singular value decomposition (SVD) of the ratings matrix. It is well understood that such embeddings capture latent user preferences and movie characteristics discovered through collaborative filtering, and are remarkably good at modeling similarity between movies and matching users to movies via simple vector projection of the embeddings. (See also the discussion in Section C on how instead of embeddings the raw matrix could be modeled with two different types of semantic items – users and movies – using a similar formulation to the one above).
To illustrate the cold start problem, we simulate adding a new movie with limited exposure to viewers, by removing a single movie and gradually adding user ratings. For a selected movie, we set the values in the ratings matrix to zero for all users, then gradually add users’ actual ratings in a random order and recompute the movie’s embedding after each addition. Figure 5 shows how the cosine similarity (CS) between the original (full observation) movie embedding and the embedding based on sparse observations improves as we add ratings for up to 4000 users. The plot shows the mean and 90% confidence interval over 100 randomly selected movies from the dataset. The similarity reaches only about 0.38 after 1000 users and approximately 0.57 after 4000 users. In other words, thousands of users would need to be exposed to the movie, many skipping it, and some rating it, before the CS could grow to around 0.6, leading to more reliable recommendation. We show below that our linear hybrid model can predict embeddings immediately from the semantic items describing the movie, achieving test CS of approximately 0.59 without requiring any user ratings—a performance level that would otherwise require roughly 4000 user ratings to achieve through collaborative filtering alone.
In our experiments, we focused on the 512 most watched movies, again randomly split into training (80%) and test set. This allowed us to set the semantic items for these movies to consist only of the movie title and year of release: Modern LLMs are familiar with the most popular movies watched in the period from 1998 to 2006. Otherwise, we would need items to contain more information, as was the case in the house experiment, or allow the LLM to use a RAG system to retrieve relevant information when executing extraction and mining prompts. The quality of the predictions is measured using cosine similarity (CS) between predicted and true 32-dim embeddings .
The learning curves are shown in Figure 6 for both linear and neural network models. The video showing which features are added (blue) or removed (red) in Figure 6 (a) is available at: https://github.com/mjojic/genZ/tree/main/media. As with the houses experiment, we compare against a strong 0-shot baseline (horizontal dashed line at CS=0.48) obtained by asking GPT-5 to suggest 50 features based on the task description and movie titles, then via pruning on the training set find the best feature set in terms of the test error, as this is the best the baseline could possibly get for that training-test split.
The linear model substantially outperforms the 0-shot baseline, reaching a test cosine similarity of approximately 0.59, indicating that the iterative feature discovery process finds movie characteristics more predictive of user preferences than those suggested by the LLM based on task understanding alone. The 0.11 improvement in cosine similarity (from 0.48 to 0.59) is substantial: As the cold start simulation in Figure 5 shows, this difference equals the improvement from adding roughly 2000 additional user ratings. Unlike the house price prediction experiment, using the neural network as the function in the GenZ system leads to more dramatic overfitting, where the test CS score quickly levels off while the train CS continues to grow.
Examining the discovered features reveals interpretable patterns aligned with user preferences, though notably different in character from the 0-shot baseline features (see Section A.2 for complete feature lists). Where the 0-shot features focus on content-based attributes (genre, plot structure, themes, pacing, narrative devices), the discovered features gravitate toward external markers: specific talent (individual actors and composers), multiple fine-grained award distinctions (Best Picture, Best Actor/Actress for specific role, Best Original Screenplay), franchise membership, and surprisingly precise temporal windows (1995-2000, 2004-2005, or post-1970). The John Williams feature is particularly revealing—it cuts across multiple genres to identify a coherent aesthetic or cultural preference that would be invisible to a content-based analysis. This suggests that collaborative filtering embeddings capture user similarity not through "stories like this" but through shared preferences for prestige signals, specific creative talent, and cultural/temporal cohorts (at least in this dataset). In another dataset, focused on a different selection of movies, or a different time frame, or a different cross-section of users, the system would likely discover different emergent structure in collective viewing, likely somewhat in disagreement with the conventional theories of content similarity.
6 Conclusions
The differences and similarities of the learning curves relative to the baseline in both experiments indicate that components of the model jointly adjust to different semantics of the data as well as target statistics and their relationships to semantics. Even though the models used here (GPT 4/5) are familiar with the semantics of the data, their ability to predict the real-valued, possibly multi-dimensional targets benefits from the rest of the system and the modeling choices. For example, while a neural network better models interactions of features needed to predict house prices, the linear model is better suited for modeling movie embeddings. In both applications, the learning curves show classic behavior of iterative improvement until over-training. On the other hand, features generated by the LLMs alone are highly redundant preventing both effective prediction and overtraining. As evident in the discovered features (Section A), our system focuses on properties of the semantic items that fit the statistics of the links , rather than ’conventional wisdom’ of a zero-shot approach: For houses, the system discovers that location and quality of build/remodel matters most in the data it was given for listings in 2016, while for movies, the system discovers the features important to the audience in the period 1998-2006, such as the difference between newer and older content, importance of franchises, specific actors/directors, and so on.
Appendix A Learned features
A.1 Learned features for the house dataset
The following are the features discovered by GenZ with the nonlinear (neural net) (on top of autoamtically supplied numerical values for intercept, area, number of bedrooms and number of bathrooms), reaching the test and train median relative error around 12% of the raw target price (Fig. 4(b):
-
•
Site-built construction (not a manufactured/mobile home)
-
•
Located in Arizona desert communities (Scottsdale/Carefree area: zip codes 85255, 85262, 85377)
-
•
Located in the 92880 zip code (Eastvale/Corona area)
-
•
Located in the 62234 zip code (Collinsville, IL area)
-
•
Located in the 94531 zip code (Antioch, CA area)
-
•
Located in the 92276 zip code (Desert Hot Springs, CA)
-
•
Located in the 93111 zip code (Goleta/Santa Barbara area)
-
•
Located in the 81524 zip code (Loma, CO area)
-
•
Located in the 93510 zip code (Acton, CA area)
-
•
Located in the 91901 zip code (Alpine, CA area)
-
•
Bathrooms feature retro/vintage elements (e.g., colored fixtures or tile like powder blue/pink, clawfoot tubs, or
-
•
checkered floors)
-
•
Located in the 92677 zip code (Laguna Niguel, CA)
-
•
Bathrooms featuring Hollywood-style bulb strip lighting above the mirror
-
•
Located in the 94501 zip code (Alameda, CA)
-
•
Homes featuring plantation shutters on windows
-
•
Located in the 96019 zip code
-
•
Located in Chicago-area suburbs with zip codes starting with 600 (e.g., 60002, 60016, 60046)
-
•
Bathrooms feature built-in vanities with cabinetry (no pedestal sinks)
-
•
Interior walls feature wood paneling
-
•
Kitchen does not include an island (no central island present)
-
•
Home includes a carport for covered parking (rather than an attached garage)
-
•
Located in zip codes starting with 90 (Los Angeles/Long Beach area)
-
•
Home includes a three-car garage
In Fig. 4(b), the horizontal line represents the minimum test error after training on the training set with ever-reducing set of baseline features obtained in what we refer to as 0-shot manner. Specifically, to create those baseline features, GPT 5 was given the entire dataset (training and test) together with prices and asked to hypothesize features useful for price prediction. The following are those 52 features from the 0-shot baseline used in feature selection:
-
•
House has 4 or more bedrooms
-
•
House has 5 or more bedrooms
-
•
House has 3 or more full bathrooms
-
•
House has 4 or more full bathrooms
-
•
House has an attached garage
-
•
House has a 3-car (or larger) garage
-
•
House has a circular driveway
-
•
House has a gated entry (wrought-iron gate/entry gate)
-
•
House has a covered front porch
-
•
House has a covered patio
-
•
House has a pergola for shade
-
•
House has a raised deck
-
•
House has a balcony
-
•
House has a private swimming pool
-
•
House has a resort-style pool with water features
-
•
House has waterfront access (dock/marina/pond view)
-
•
House has mountain or panoramic scenic views
-
•
House has extensive desert/xeriscape landscaping (gravel/cacti/rocks)
-
•
House has a green lawn (grass yard)
-
•
House has a fenced yard
-
•
House has solar panels on the roof
-
•
House has a tile roof (e.g., clay/Spanish tile)
-
•
House has stucco exterior walls
-
•
House has exterior stone/stacked-stone accents
-
•
House has Mediterranean-inspired architecture (arches/turret/columns)
-
•
House has Craftsman-style exterior elements (stone columns/shingle siding)
-
•
House has an open-concept kitchen/living layout
-
•
House has a large kitchen island
-
•
House has a breakfast bar or peninsula seating in the kitchen
-
•
House has granite or stone kitchen countertops
-
•
House has a tile or mosaic kitchen backsplash
-
•
House has stainless steel kitchen appliances
-
•
House has a double oven
-
•
House has recessed lighting
-
•
House has decorative chandelier lighting
-
•
House has hardwood flooring in main living areas
-
•
House has tile flooring in main living areas
-
•
House has wall-to-wall carpeting in bedrooms
-
•
House has plantation shutters
-
•
House has vaulted or tray ceilings
-
•
House has crown molding
-
•
House has exposed wood ceiling beams
-
•
House has a fireplace (in any room)
-
•
House has a fireplace in the primary bedroom
-
•
House has a walk-in shower with glass enclosure
-
•
House has a soaking tub in the primary bathroom
-
•
House has a jetted tub (spa tub)
-
•
House has a freestanding bathtub
-
•
House has a double vanity (two sinks) in a bathroom
-
•
House has glass block windows in a bathroom
-
•
House has a skylight
-
•
House has a built-in desk or built-in shelving/storage cabinetry
A.2 Discovered features for Netflix dataset
The following 27 features were discovered by our approach with the linear model , reaching test CS of 0.59 (Fig. 6(a)):
-
•
Not science fiction (no movies centered on aliens, space, or futuristic tech)
-
•
Not released between 1995 and 2000 (inclusive)
-
•
Not primarily comedies
-
•
Not primarily romance-focused films (i.e., avoids romantic dramas and romantic comedies)
-
•
Mostly PG-13/PG-rated mainstream releases (i.e., generally avoids hard-R films)
-
•
Not animated (live-action films)
-
•
Not primarily action-adventure, heist, or spy thrillers (i.e., avoids high-octane studio action crowd-pleasers)
-
•
Not horror (i.e., avoids horror and horror-leaning supernatural thrillers)
-
•
Includes many Academy Award Best Picture nominees/winners (i.e., more prestige/canon titles)
-
•
Includes a notable number of pre-1995 titles (1960s–early ’90s), whereas the negatives are almost entirely 1995–2004 releases
-
•
Primarily entries in major film franchises or multi‑film series (including first installments that launched franchises)
-
•
Includes multiple war films set amid real historical conflicts (e.g., WWII/Vietnam), which are absent in the negative group
-
•
Not crude/raunchy, man‑child/SNL‑style comedies (when comedic, entries skew quirky/indie or gentle rather than broad/frat humor)
-
•
Skews toward female-led or women-centered narratives (e.g., Legally Blonde, The First Wives Club, Freaky Friday, The Pelican Brief, Lara Croft), whereas the negative group is predominantly male-led
-
•
Excludes 2004–2005 releases (the positives stop at 2003, while many negatives are from 2004–2005)
-
•
Includes multiple films centered on high school/college life or set primarily in educational settings (e.g., The Breakfast Club, Sixteen Candles, Fast Times at Ridgemont High, Billy Madison, Good Will Hunting, Top Gun), a theme largely absent from the negatives
-
•
Not children/family-oriented fare (avoids Disney-style live‑action family movies and musicals; skews toward teen/adult titles instead)
-
•
Not quirky/indie/cult, auteur‑driven or formally experimental films; the positives skew toward conventional, mainstream studio storytelling
-
•
Not ancient/medieval ‘sword‑and‑sandal’ or knightly epics (i.e., avoids Greco‑Roman/medieval battlefield sagas like Braveheart or Troy)
-
•
Includes multiple films scored by John Williams (e.g., Return of the Jedi, Raiders of the Lost Ark, E.T., Harry Potter and the Sorcerer’s Stone), whereas none of the negatives are Williams-scored
-
•
Includes multiple films that earned their lead performer an Academy Award (Best Actor/Best Actress) for that specific role (e.g., Monster, Training Day, Monster’s Ball, Dead Man Walking), whereas the negatives have few or none
-
•
Standard theatrical releases only (no titles labeled as Special/Extended/Anniversary/Platinum Edition)
-
•
Includes multiple films starring Angelina Jolie or Brad Pitt (none of the negatives star either)
-
•
Includes multiple films that won or were nominated for the Academy Award for Best Original Screenplay
-
•
No pre-1970 releases (all positives are 1972 or later, while the negatives include several 1950s–1960s films)
-
•
Includes multiple films starring Tom Hanks (e.g., Forrest Gump, Sleepless in Seattle), whereas none of the negatives feature him
On the other hand, a 0-shot approach produces very different features. The following 50 features were suggested by GPT-5 based on task description, then pruned to achieve the baseline test CS of 0.48:
-
•
Is animated
-
•
Is part of a franchise/sequel/prequel/remake
-
•
Is based on a true story or real events
-
•
Is adapted from a non-comic book or short story
-
•
Is adapted from a comic book/graphic novel
-
•
Features a superhero or superpowered protagonist
-
•
Is set primarily in a historical period (pre-1950)
-
•
Is set primarily in the future
-
•
Is set primarily in a contemporary/modern time
-
•
Is set primarily outside the United States
-
•
Has predominantly non-English dialogue
-
•
Has an ensemble cast with multiple co-leads
-
•
Has a female lead or co-lead driving the story
-
•
Centers on a male buddy duo
-
•
Has a strong, central romantic plot
-
•
Has a dominant comedic tone
-
•
Is action-driven with frequent set pieces
-
•
Contains graphic/intense violence
-
•
Contains significant gunplay
-
•
Contains extensive swordplay or martial arts
-
•
Features large-scale war or battle scenes
-
•
Contains high-speed car chases/vehicular action
-
•
Centers on a heist/caper
-
•
Centers on spy/espionage activities
-
•
Centers on a crime investigation/detective story
-
•
Centers on courtroom/legal drama
-
•
Centers on supernatural or paranormal elements
-
•
Centers on science fiction elements (tech, AI, space)
-
•
Centers on fantasy worldbuilding (magic, mythical beings)
-
•
Has prominent horror elements and scares
-
•
Hinges on a mystery with a major twist/reveal
-
•
Uses a nonlinear or fractured timeline
-
•
Uses an unreliable narrator or ambiguous reality
-
•
Has slow-burn, mood-driven pacing
-
•
Has fast-paced, high-energy pacing
-
•
Has a feel-good/optimistic tone with an uplifting resolution
-
•
Has a tragic or bittersweet ending
-
•
Has a dark or cynical tone
-
•
Explores strong themes of redemption or forgiveness
-
•
Is driven by a revenge motivation
-
•
Is a coming-of-age or personal growth story
-
•
Features a prominent mentor–protégé relationship
-
•
Centers on friendship/buddy dynamics
-
•
Centers on family relationships (parents/children/siblings)
-
•
Is a musical (characters sing to advance the story)
-
•
Is sports-centered
-
•
Has a military setting or procedural focus
-
•
Relies heavily on CGI/visual effects spectacle
-
•
Won at least one Academy Award
-
•
Has a runtime over 140 minutes
Appendix B Tractably summing out z in joint updates for the linear observation model (factor analysis)
In our experiments, we used a generic version of the GenZ learning algorithm with the functional link arbitrary (plug-and-play). Instead of computing exact expectations of form , we just evaluated at the mode of . While this allowed us to run the same algorithm for the linear and nonlinear (neural net) models, we noted that in some cases these expectations can be computed tractably under the full distribution . Linear model is such a case, and we derive it here for illustration.
A linear link between and takes a form
| (17) |
where is now feature vector with an additional element which is always , is a observation vector, and is an parameter matrix. (Note that the overall model is still nonlinear because the relationships among features in are nonlinear). The additional constant element in allows for learning the bias vector within .
| (18) | |||||
We use the approximate posterior limited to the form . Defining , , and (as ), we have
| (19) | |||||
| (20) |
where denotes point-wise multiplication. (To see this, note that for nondiagonal elements in we have but the expectation for the diagonal elements is , rather than ). Thus,
| (21) | |||||
| (22) |
This is the only term that involves the parameter , and in the M step, for a given we will solve for by maximizing it. The derivation is also useful for the E step, in which we estimate .
With our choice of factorized posterior, the feature term simplifies to
| (23) |
with and defined in (5). Finally, the entropy part of the bound becomes
| (24) |
To perform inference, i.e. to approximate the posterior , we optimize the bound wrt to , the posterior probabilities . This is a part of the (variational) E-step needed to compute the expectations (20) used in the observation part in (22). By maximizing , and therefore the log likelihood bound (1), wrt to ans we then perform a part of the M step related to the parameters of the observation conditional (17). In the M-step we can also maximize the bound wrt uncertainty parameters of the feature model (5), and we use the mining prompt in Fig. 2 to re-estimate the semantic model parameters, the feature descriptions as discussed in Sect. 2. While the optimization can be done with off-the-shelf optimization packages, we derive EM updates here.
E step: For a given pair we optimize one at a time, keeping the rest fixed. A simple way to approximate for a tight bound is to introduce vectors , and which are both equal to in all entries but the -th. In the i-th entry, equals 1, and equals 0. In other words, the two are parameter vectors for posterior distributions where the i-th feature is forced to be either 1 or 0 with certainty. Given the above derivations, we can thus compute the approximate log likelihood
| (25) | |||||
and similarly for , but using expectations wrt . In each case the three terms are computed as above in (22), (23), and (24), but with the appropriate distribution parameter vector or replacing . The posterior parameter is thus approximated as
| (26) |
The entropy terms for and are the same: Applying equation (7) to and we see that all summands are the same as , except for the -th summand which is zero in both cases as and . Therefore the entropy terms divide out. The feature terms are not the same. The summands are still the same for , but the -th terms are different: They are and , respectively. Therefore, we can divide out the shared parts. The expression simplifies to
| (27) |
To get all parameters these equations need to be iterated, but the iterations can be interspersed with parameter updates of the M step. In this update rule we see that the foundational model’s prediction of is balanced with the observation which may be better explained if the different is chosen. As discussed in Sect. 2, this is a signal needed to update the feature descriptor . For example, if is a movie embedding vector, then the presence or absence of the feature "historical war movie" helps explain explain, through , the variation in , which in turn reflect user preferences. If the users do not in fact have preference specifically for historical war movies, but instead for movies based on real historical events, war or not, then this feature will only partially explain the variation, and the posterior might indicate the positive feature, , with high probability for a movie which is about historical events but the foundational model correctly classified as not a "historical war movie."
M step: While the E-step is performed independently for each item , in the M step we consider a collection of item-onservation pairs , and the posterior distributions from the E-step, and optimize the sum of the bounds . From (22), we see that
| (28) |
Setting the derivative to zero we derive the update
| (29) |
The noise parameter is optimized when
| (30) |
We can (and in our experiments do) optimize the feature uncertainty parameters . These parameters could in principle be extracted from the foundational model using token probabilities or its own claim of confidence in the response (see prompt in Fig.2). However, the foundational model’s own uncertainty only captures its confidence about judging the characteristic. In our hybrid model, we can have model additional uncertainty that the feature is well-defined. This is especially useful during learning as features evolve. As we discussed above using the "historical war movie" feature as an example, in the E step the posterior may diverge from the foundational model’s feature classification if the feature only approximately aligns with true variation in observations. To estimate, and then reuse, the full uncertainty, we can maximize the bound wrt , to arrive at:
| (31) |
where are the binary responses of the foundational model for feature i in the semantic item . (To derive, see (5), although the update is intuitive, as it simply sums the evidence of error as indicated by the posterior).
Finally, to update the feature descriptors , we sample or threshold the posteriors to get some positive , and negative examples. We then use exemplars from each group to form the feature mining prompt in Fig. 2. The fondational model’s response in the "characteristic" field is the updated feature description .
Appendix C Statistical modeling of co-occurrence/association/preferences between two sets of items
We studied a model that links a semantic description of an item with an observation vector . Among other applications, the approach allows us to find features that determine user preferences for movies if are movie embeddings inferred from movie-user observation matrix. Here we show that such an approach is a simplification of a model that involves two sets of interacting items (e.g. movies/viewers, products/buyers, plants/geographic areas, images/captions, congress members/bills). That model (without the simplification) can also be learned from data.
Suppose that the matrix of the pairwise interactions is observed for item pairs from the two groups . We would then model the joint distribution where, for example, would be a textual description (or an image!) of a plant and a textual description (or a satellite observation!) of a geographic area, and the scalar would be the presence (or thriving) signal for the combination. We could develop a number of different complex models with suitable latent variables (in addition to ), but honoring the traditionally very successful collaborative filtering methods for dealing with such data, we will focus on embedding methods (which typically rely on matrix decomposition methods, at least in recommender systems).
Thus, for each set of items our latent variables should determine a real-valued embedding probabilistically, through a distribution .
Then, given the low-dimensional embeddings for the items in the pair (e.g. a movie and a user), we would model the association variable as :
| (32) |
In the model over observed association strength , item embeddings and , each based on their own set’s feature vectors , , which themselves are probabilistically dependent on the items semantics the likelihood can be approximated as
| (33) | |||||
where is an approximate posterior. If we assume a factored posterior , and that the posterior over embeddings Dirac , then based on (32):
where the expected embeddings are , If we observe the full association matrix Y, e.g. over movies, indexed by and users indexed by , then the approximate log likelihood of the data, broken into two terms is:
| (34) | |||||
This can be seen as solving a regularized matrix decomposition problem as by collecting into the observation matrix and all items’ embedding vectors into matrices and the first term (first line) above can be written as
| (35) |
while the second term (line) serves as a regularization term. The regularization term is in fact consisting of two models, one for each type of item, of the form studied in the previous sections. When the observation matrix is very large and also has low intrinsic dimension, as is typically the case in collaborative filtering applications, the first term can be fit very well resulting in low , and making the regularization term adapting to the natural data embedding. Therefore, as our goal for the two components is not to interfere with natural embeddings of the data, but rather to explain the statistical patterns so that they would transfer to new semantic items with new descriptions and previously unseen interaction patterns in testing, we can fit the first term independently of the other two, after which the joint modeling problem separates into two separate ones, e.g. extracting the plant features that explain their embeddings and extracting the geographic areas features to explain their own embeddings.
For a given embedding dimension the term is minimized when and are related to the SVD of , which reduces the dimensionality to , where matrix and the matrix are orthonormal and is a diagonal matrix. For example, the term is minimized when
| (36) |
for arbitrary rotation matrix and a scalar .
Therefore, if we solve the matrix decomposition problem in we can then fit the features for the two sets of items separately as the second term is decomposed:
| (37) |
In other words, by computing the embeddings using a standard matrix decomposition technique, we can build models that generate these item embeddings using the semantics of the items .
In case of movie preference datasets, like the Netflix Prize dataset, and data from many other recommender systems, the second set of items – users – are usually not described semantically (through information like their demographics, their writing, etc.). Privacy reasons are often quoted for this, but it is also true that people’s complex overall behavior, as it relates to the task, is better represented simply by their preferences. I.e. knowing which movies they have watched is a better indicator of whether or not they will like a particular new movie for example, than is some description of their life story, even if it were available. In other words, in our Netflix prize experiments, we only fit the movie embeddings.