Manuscript Offprint

arXiv:2608.31059

When Can We Work in Embedding Space? What Text Embeddings Preserve

Simon Freyaldenhoven

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

When do text embeddings work as inputs to empirical analysis? Their use rests on an assumption: that we can trade text for its low-dimensional embedding, and lose little in doing so. I make that assumption precise under a generative model in which documents are mixtures of latent topics. I study two uses—clustering units in embedding space and controlling for high-dimensional text. A cluster of embeddings is a set of documents with similar topic mixtures; controlling for the embedding is equivalent to controlling for the topic mixture, so validity reduces to whether that mixture captures the confounding. In an application to 363 U.S. metropolitan areas, embedding-based clusters of LLM-generated economic descriptions recover interpretable economic archetypes and separate local employment dynamics more sharply than clustering on model residuals, or on a curated set of industry and demographic covariates.

JEL-Classification: C21, C38, C45, C55

KEYWORDS: Text embeddings, topic models, text as data, clustering, high-dimensional controls, Word2Vec, Large Language Models

*The views expressed herein are those of the author and do not necessarily reflect the views of the Federal Reserve Bank of Philadelphia, or the Federal Reserve System. Email: simon.freyaldenhoven@phil.frb.org

1 Introduction

Text embeddings are now a standard tool in empirical economics. Researchers turn product descriptions (Bajari et al., 2025; Bach et al., 2025), central bank communication (Casella et al. (2026)), labor-market histories (Vafa et al., 2022, 2025), and word meanings (Kozlowski et al., 2019) into vectors (embeddings) and use those in subsequent analysis. The appeal is dimension: While text itself is extremely high-dimensional, its embedding is (relatively) low-dimensional. The justification, either explicitly or implicitly, is that little should be lost by working in embedding space if the information contained in a text can be represented in a low-dimensional space.¹ I make this argument precise and study when text embeddings work as inputs to empirical analysis.

Any reduction of text to a vector may discard something the analysis needed. Existing theoretical work rules this out via a high level sufficiency assumption: that a low-dimensional attribute vector exists and the embedding proxies it (Christensen and Compiani, 2026), or that whatever the representation discards induces a bias vanishing faster than n−1/2n^{-1/2} (Vafa et al., 2025). But how plausible is such an assumption? In order to answer this, my starting point is a simple generative model of text, which allows me to derive exactly what embeddings preserve.

I first show that, under a standard model in which documents are mixtures of KK latent topics (Blei et al., 2003; Hofmann, 1999), the corpus's matrix of word co-occurrence ratios, centered at independence, is positive semi-definite of rank exactly K−1K-1 (Proposition 1). Any embedding that matches this matrix inherits the topic-loading geometry — plainly speaking: words with similar loadings receive similar embeddings (Theorem 1). Standard embedding methods do not target this matrix directly, and instead factorize a logarithmic transform of the co-occurrence ratios (Table 1), which is generically full rank. Focusing on one leading embedding — Word2Vec (Mikolov et al., 2013a,c), in its skip-gram-with-negative-sampling (SGNS) form — I then prove that it recovers the same geometry up to a distortion (Proposition 2).

At the document level, averaging word embeddings yields an invertible linear image of the topic mixture (Proposition 3). I then consider two concrete use cases. The first groups units by latent type: clustering in embedding space discretizes unobserved heterogeneity into peer groups. Because distinct topic mixtures cannot share an embedding, a cluster is a set of documents with similar mixtures, and its

¹For example, Bajari et al. (2025) states that the success of their approach “depends on the existence of parsimonious structures behind images and text” and that they “believe that information in images and sentences can be effectively represented in a much lower-dimensional space”.

centroid corresponds to a well-defined mixture (Corollary 1). Recovering the latent partition exactly is a stronger claim: when documents concentrate tightly enough around a small number of common mixture-types, that partition is a fixed point of k-means (Proposition 4), but separation alone does not make it the unique optimum. The second conditions on textual embeddings: the embedding enters a regression as a control. Adjusting for the embedding is equivalent to adjusting for the topic mixture, so the high-level assumption that “the embedding is a sufficient control” reduces to a transparent condition that the topic mixture captures the confounding. (Corollary 2).

To make the grouping use concrete, consider a researcher who wants to model local employment dynamics. A natural starting point is an autoregressive model for log employment in location i, e.g.:

yit=αi+ρ1iyi,t−1+⋯+ρpiyi,t−p+εit,(1)y_{i t}=\alpha_{i}+\rho_{1}^{i}y_{i,t-1}+\cdots+\rho_{p}^{i}y_{i,t-p}+\varepsilon_{i t}, \tag{1}

where yity_{it} is log employment in year tt for a given Core-Based Statistical Area (CBSA) ii. Pooling across all locations imposes implausible homogeneity, while estimating each city separately throws away cross-sectional information and can result in very noisy estimates. I propose the following compromise: cluster units by their textual description. Concretely, for each unit CBSA (i) generate a 500-word economic narrative using a large language model, (ii) embed the narrative in Rr\mathbb{R}^r, and (iii) apply k-means in embedding space. Our theoretical results from Section 2 provide a lens into this algorithm: If the corpus can be reasonably approximated by a topic model, k-means clustering recovers peer groups with similar topic mixtures. I find that the peer groups that emerge indeed encode similarity (e.g., “deindustrialized Eds-and-Meds”, “Sunbelt growth”, “energy and resource extraction”), and that the resulting clusters capture meaningful heterogeneity in employment dynamics which clustering on outcome residuals, or on observed covariates, misses.

Related Literature. This paper connects several literatures. The generative model builds on the topic model literature, including probabilistic latent semantic indexing (Hofmann, 1999) and Latent Dirichlet Allocation (Blei et al., 2003). Our use of a topic model as the data-generating process is not only analytical convenience: a recent literature argues that large language models themselves behave as implicit latent-variable models, inferring a latent concept from context and generating text conditional on it (Xie et al., 2022; Wang et al., 2023).

On the embedding side, the Word2Vec model was introduced by Mikolov et al. (2013a,c), and Levy and Goldberg (2014) established that skip-gram with negative sampling implicitly factorizes a shifted pointwise mutual information matrix when the embedding dimension is unrestricted. Arora et al. (2016) model the writing of a document as a random walk over a latent topic vector in a way that justifies what Word2Vec and GloVe (Pennington et al., 2014) estimate. I instead take the topic model as the data-generating process—a model that is easy to interpret and that economists already use to summarize text—and ask what it implies for embeddings. Dieng et al. (2020) put words and topics in the same embedding space by assumption, giving each topic its own vector. I derive what they assume: under our model each topic has a centroid in embedding space, and document embeddings lie in the simplex those centroids span (Proposition 3)—for an embedding estimated without any knowledge of the topics. Finally, Li et al. (2023) show that the attention layers of a transformer can also recover topic information, but under the restrictive assumption that each word belongs to a single topic, so that topics have no vocabulary in common.

Veitch et al. (2020) use text embeddings as a control for confounding. They construct an embedding that captures the confounding by explicitly supervising it on both treatment and outcome, while I consider “standard” unsupervised embeddings in this paper. Other papers studying causal inference with text include Roberts et al. (2020) and Egami et al. (2022). Finally, Battaglia et al. (2024), Vafa et al. (2025) and Christensen and Compiani (2026) study the gap between the representation a researcher has and the object the model requires, and each closes it downstream: a bias correction for a noisy estimate of the right target, a characterization of the omitted-variable bias induced by coarsening, and a correction for an imperfect proxy, respectively. Our paper is complementary to this literature: there, the object the representation recovers is taken as given; here, I ask what an unsupervised embedding recovers in the first place.

References (44)

  • A practical algorithm for topic modeling with provable guarantees
  • A latent variable model approach to PMI-based word embeddings
  • A simple but tough-to-beat baseline for sentence embeddings
  • k-means++: The advantages of careful seeding
  • Adventures in demand analysis using AI. arXiv preprint arXiv:2501.00382, 2025 (opens arXiv in a new tab)
  • Hedonic prices and quality adjusted price indices powered by AI. Journal of Econometrics, 2025
  • Inference for regression with variables generated by AI or machine learning (opens arXiv in a new tab)
  • Dynamic topic models
  • Latent Dirichlet allocation
  • Discretizing unobserved heterogeneity
  • Structural estimation with unstructured data
  • Learning topic models: Identifiability and finite-sample analysis
  • From unstructured data to demand counter-factuals: Theory and practice (opens arXiv in a new tab)
  • A generalization of principal components analysis to the exponential family
  • Topic modeling in embedding spaces
  • When does non-negative matrix factorization give a correct decomposition into parts? In Advances in Neural Information Processing Systems, volume 16, 2003
  • How to make causal inferences using texts
  • On the testability of the anchor-words assumption in topic models
  • Nonnegative matrix factorization for signal and data analytics: Identifiability, algorithms, and applications
  • Non-negative matrix factorization revisited: Uniqueness and algorithm for symmetric decomposition
  • Anchor-free correlated topic modeling: Identifiability and algorithm
  • Bag of tricks for efficient text classification
  • The geometry of culture: Analyzing the meanings of class through word embeddings
  • Distributed representations of sentences and documents
  • Learning the parts of objects by non-negative matrix factorization
  • Neural word embedding as implicit matrix factorization
  • Improving distributional similarity with lessons learned from word embeddings
  • How do transformers learn topic structure: Towards a mechanistic understanding
  • UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction
  • Efficient estimation of word representations in vector space
  • word2vec: Tool for computing continuous distributed representations of words
  • Distributed representations of words and phrases and their compositionality
  • GloVe: Global vectors for word representation
  • Software framework for topic modelling with large corpora
  • Sentence-BERT: Sentence embeddings using Siamese BERT-networks
  • Adjusting for confounding with text matching
  • Rosenbaum and Donald B. Rubin
  • Generalized low rank models
  • CAREER: A foundation model for labor sequence data (opens arXiv in a new tab)
  • Estimating wage disparities using foundation models (opens the publisher in a new tab)
  • Adapting text embeddings for causal inference
  • Large language models are latent variable models: Explaining and finding good demonstrations for in-context learning
  • Towards universal paraphrastic sentence embeddings
  • An explanation of in-context learning as implicit bayesian inference