Manuscript Offprint

arXiv:2611.07103

A Night at the LLM Zoo: Data Conditioned Flow Matching for Generating Pretrained LLM Weights

Scott Biggs, Bedionita Soro, Saumya Gupta, Bruno Andreis, Sung Ju Hwang

Scott Biggs

Khoury College of Computer Science Northeastern University, Silicon Valley biggs.s@northeastern.edu

Bedionita Soro

MLAI Lab KAIST sorobedio@kaist.ac.kr

Saumya Gupta

Khoury College of Computer Science Northeastern University, Boston gupta.saumy@northeastern.edu

Bruno Andreis

Slater Lab University of Oxford bruno.andreis@eng.ox.ac.uk

Sung Ju Hwang*

MLAI Lab, KAIST & DeepAuto.ai sungju.hwang@kaist.ac.kr

ABSTRACT

A challenge to Weight Space Learning as it expands from task specific and vision models to Large Language Models (LLMs) is the absence of a well curated and analyzed LLM population. To address this, we train such a model zoo for application to Weight Space Generation by systematically varying the data mixture composition between web text, books, mathematics, coding, and French across populations of 51M, 124M, and 355M parameter GPT-2 Models, each tier with count N=100N = 100. We analyze these populations by cosine similarity, functional diversity, Leave-One-Mixture-Out modeling, and variance decomposition. We show that the zoo contains diverse models whose variation is structured by training mixture composition. We embed the training mixture composition to condition a Flow Matching model of complete pretrained LLM weights in Gram-PCA compressed weight space. By demonstrating zero-shot generalization to held out mixtures, measuring Continuous Ranked Probability Score skill, as well as finding minimal changes in downstream test-set perplexity and general capability benchmark scores, we show that our generator generalizes on the simplex of data mixtures to produce models that perform similarly to those in the zoo ex nihilo. Finally, we produce all source code and artifacts to support the continued expansion of Weight Space Learning and Generation into the LLM domain.

1 INTRODUCTION

The success of modern deep neural networks relies heavily on large-scale computation, and the past decade has produced a rapidly growing population of pretrained models, from computer vision systems to large language models (LLMs). Despite the substantial computational cost invested in training these models, the information contained in their learned parameters remains comparatively underexplored for understanding how neural networks evolve during training or for constructing new models. A central difficulty is that publicly available checkpoints are highly heterogeneous: they often differ in architecture, scale, initialization, training data, and optimization procedure, while many of these details are only partially documented. As a result, collections of existing models do

*Corresponding author.

not provide a controlled population from which the structure and dynamics of LLM weight space can be readily studied.

A recent surge of research on weight-space learning addresses this problem by treating the parameters of trained neural networks as data (Han et al., 2026; Wang et al., 2026). However, existing studies remain concentrated on relatively small vision and classification models, or on parameter-efficient representations such as Low-Rank Adaptation (LoRA) weights, leaving the full parameter space of pretrained language models comparatively unexplored (Charakorn et al., 2026; Huang et al., 2026). This limitation can be attributed to the difficulty of learning meaningful structure from collections of LLMs whose training conditions and architectural differences are uncontrolled. Among the few works that extend full-weight generation to natural-language models, DeepWeightFlow (Gupta et al., 2026) trains a population of 100 BERT encoders from scratch and models their parameters; however, these models are task-specific regressors trained on a single supervised objective rather than pretrained language models which consider data from multiple diverse sources. Similarly, Soro et al. (2026) studies full LLM weights in the context of model merging and highlights the difficulty of obtaining compact and meaningful representations of large language-model parameters. Whether systematic and exploitable structure exists in the full parameter space of models trained under a general language-modeling objective therefore remains an open question.

We argue that addressing this question requires a controlled model zoo specifically designed for studying pretrained LLM weight space. Rather than assembling unrelated checkpoints from public repositories, such a zoo should systematically control the factors that generate variation across models, making it possible to associate changes in model parameters with known changes in pretraining conditions. Motivated by this challenge, we construct a structured zoo of pretrained language models containing more than 300 models trained under systematically varying pretraining data compositions. This controlled population provides a foundation for studying how LLM weights vary across training distributions, characterizing the geometry of their parameter space, and ultimately determining whether this structure is sufficiently regular to support the analysis and generation of full language-model parameters.

Furthermore, we train conditional flow matching models (Lipman et al., 2023; Liu et al., 2023a) to generate the weights of GPT style models (Radford et al., 2019) at 51M, 124M and 355M parameters, conditioned on the pretraining data mixture. Earlier work on parameter generation has mostly focused on small vision models or low rank adapters (Peebles et al., 2022; Soro et al., 2025b; Wang et al., 2025; Charakorn et al., 2025; Huang et al., 2026), whereas we generate complete pretrained language models. Following Gupta et al. (2026), we compress each zoo with Gram PCA, train the flow in this compressed space, and decode the samples back into full GPT-2 weights, which we evaluate directly without any further training. The generated models perform close to the original trained models and generalize well to data mixtures held out from training. They stay closer to the real models than a nearest neighbor retrieval baseline, and their CRPS skill (Gneiting & Raftery, 2007) shows that conditioning on the mixture clearly helps. Our results show that the generated weight spaces generalize zero shot to new data mixtures.

The primary contributions of our work are:

  • We build a controlled zoo of 300 GPT-2 models at 51M, 124M and 355M parameters, in which the only factor that varies between models is the composition of the pretraining data.

  • We show that the weights in this zoo are structured by data mixture. Models trained on the same mixture are strongly aligned, models trained on different mixtures are nearly orthogonal, and the mixture explains more than 85% of the variance among repeatedly drawn models.

  • We train a conditional flow matching generator that produces complete pretrained language models for unseen data mixtures across model parameter scales. The generated models achieve an average perplexity change of 4.1 to 5.1%, compared to 5.8 to 6.0% for a nearest neighbor retrieval baseline, and perform on par with our real models on HellaSwag (Zellers et al., 2019).

2 RELATED WORK

Weight-space learning. A growing body of work treats trained parameters as a data modality in their own right (Han et al., 2026; Wang et al., 2026). Early studies predicted model properties such as accuracy directly from weights (Unterthiner et al., 2021; Eilertsen et al., 2020). Later work designed architectures that respect the symmetries of weight space, including permutation-equivariant layers (Navon et al., 2023; Zhou et al., 2023), graph metanetworks (Kofinas et al., 2024; Lim et al., 2024), and set-based encoders (Andreis et al., 2024). A parallel line learns weight representations with autoencoders, yielding hyper-representations used for both property prediction and sampling (Schürholt et al., 2021; 2022a; Schürholt et al., 2024). These methods are developed and evaluated on small vision classifiers and implicit neural representations, not on pretrained language models. In addition, weight-space learning relies on populations of models rather than isolated checkpoints. Controlled model zoos vary seeds and hyperparameters while holding architecture fixed (Schürholt et al., 2022b), and later work studies how zoo composition affects learned representations (Falk et al., 2025a) or extends the setting to heterogeneous public checkpoints (Falk et al., 2025b). These zoos are primarily vision-based. We adopt the same controlled setting for language models, varying only the pretraining data composition rather than optimization or other hyperparameters.

Weight generation. Generating parameters instead of optimizing them dates back to hypernetworks (Ha et al., 2017) and to graph hypernetworks that predict parameters for unseen architectures (Knyazev et al., 2021). Generative models over checkpoints followed, including diffusion over optimization trajectories (Peebles et al., 2022), diffusion (Soro et al., 2025b; Wang et al., 2025) weights, autoregressive parameter generation (Soro et al., 2025a), and flow matching in a re-basined weight space (Gupta et al., 2026). In the language domain, generation is largely confined to low-rank adapters, where a hypernetwork maps a task description or a batch of unlabeled prompts to LoRA matrices (Charakorn et al., 2025; Liang et al., 2025; Charakorn et al., 2026; Huang et al., 2026). Such methods produce a small update on top of a frozen backbone and therefore do not model pretrained parameters themselves. The exception is Gupta et al. (2026), which trains a population of BERT-sized encoders and generates their full weights, but that population is trained on a single supervised regression task rather than on general-purpose language modeling.

Controlled suites and data composition. Open suites release language models and intermediate checkpoints to study training: MultiBERTs varies random seed (Sellam et al., 2022), Pythia varies scale while keeping data and ordering fixed (Biderman et al., 2023), and PolyPythias extends this to multiple pretraining runs (van der Wal et al., 2025); LLM360 (Liu et al., 2023b) and OLMo (OLMo et al., 2024) similarly release open training artifacts. These suites are designed to isolate factors such as scale, seed, or training step and therefore largely keep the pretraining distribution fixed. The complementary literature instead varies data composition: DoReMi learns domain weights (Xie et al., 2023), data mixing laws relate mixture proportions to language-modeling loss (Ye et al., 2025), RegMix predicts performance from sampled mixtures (Liu et al., 2024), and DCLM compares curation strategies under a standardized recipe (Li et al., 2024). These works study how data composition affects performance, but not how it is reflected in the resulting parameters. We retain the weights and ask whether the pretraining mixture is recoverable from weight space.

References (95)

  • Smollm-blazingly fast and remarkably powerful, 2024
  • Set-based neural network encoding without weight tying
  • A survey of cross-validation procedures for model selection
  • A suite for analyzing large language models across training and scaling
  • Why diffusion models don't memorize: The role of implicit dynamical regularization in training
  • Language models are few-shot learners
  • Text-to-loRA: Instant transformer adaption
  • Doc-to-loRA: Learning to instantly internalize contexts
  • Q. Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud
  • Classifying the classifier: dissecting the weight space of neural networks
  • The impact of model zoo size and composition on weight space learning, 2025a (opens arXiv in a new tab)
  • Learning model representations using publicly available model hubs, 2025b (opens arXiv in a new tab)
  • Linear mode connectivity and the lottery ticket hypothesis
  • Strictly proper scoring rules, prediction, and estimation
  • Deep-weightflow: Re-basined flow matching for generating neural network weights
  • Hypernetworks
  • A survey of weight space learning: Understanding, representation, and generation, 2026 (opens arXiv in a new tab)
  • Classifier-free diffusion guidance
  • Training compute-optimal large language models
  • LoRAGen: Structure-aware weight space learning for loRA generation
  • Editing models with task arithmetic
  • Averaging weights leads to wider optima and better generalization, 2019 (opens arXiv in a new tab)
  • Parameter prediction for unseen deep architectures
  • Graph Neural Networks for Learning Equivariant Representations of Neural Networks
  • Datacomp-LM: In search of the next generation of training sets for language models
  • Drag-and-drop llms: Zero-shot prompt-to-weights, 2025 (opens arXiv in a new tab)
  • Graph metanetworks for processing diverse neural architectures
  • Flow matching for generative modeling
  • Regmix: Data mixture as regression for language model pre-training (opens arXiv in a new tab)
  • Flow straight and fast: Learning to generate and transfer data with rectified flow
  • Llm360: Towards fully transparent open-source llms
  • Decoupled weight decay regularization
  • A three sample hypothesis test for evaluating generative models
  • Equivariant architectures for learning in deep weight spaces (opens arXiv in a new tab)
  • What is being transferred in transfer learning? In Advances in Neural Information Processing Systems, volume 33, pp. 512–523
  • 2 olmo 2 furious, 2024 (opens arXiv in a new tab)
  • Openwebmath: An open dataset of high-quality mathematical web text
  • Scalable Diffusion Models with Transformers (opens the publisher in a new tab)
  • Learning to learn with generative models of neural network checkpoints (opens arXiv in a new tab)
  • The fineweb datasets: Decanting the web for the finest text data at scale
  • Fineweb2: One pipeline to scale them all — adapting pre-training data processing to every language
  • Film: visual reasoning with a general conditioning layer
  • Language models are unsupervised multitask learners
  • Generalization and memorization in rectified flow
  • Flow to learn: Flow matching on neural network parameters, 2025 (opens arXiv in a new tab)
  • Self-supervised representation learning on neural network weights for model characteristic prediction
  • Hyper-representations as generative models: Sampling unseen neural network weights
  • Model zoos: A dataset of diverse populations of neural network models
  • Towards scalable and versatile weight space learning
  • Variance Components (opens the publisher in a new tab)
  • The multiBERTs: BERT reproductions for robustness analysis
  • Instruction-guided autoregressive neural network parameter generation
  • Diffusion-based neural network weights generation
  • LS-merge: Merging language models in latent space
  • Predicting neural network accuracy from weights, 2021 (opens arXiv in a new tab)
  • Polypythias: Stability and outliers across fifty language model pre-training runs
  • Neural network diffusion, 2024
  • Scaling up parameter generation: A recurrent diffusion approach
  • Position: Weight space should be a first-class generative AI modality
  • Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time
  • Doremi: Optimizing data mixtures speeds up language model pretraining
  • Data mixing laws: Optimizing data mixtures by predicting language modeling performance
  • HellaSwag: Can a Machine Really Finish Your Sentence?
  • Generative modeling of weights: Generalization or memorization?, 2025
  • Permutation equivariant neural functionals
  • The Small and Medium configurations are exactly the published GPT-2 configurations in both width and depth
  • >$\mathcal{N}(0, 0.02^2)$, residual projections $\times 1/\sqrt{2L}$</td></tr><tr><td>dropout</td><td colspan=
  • We refer to this phase of training as the trunk
  • Each domain is one streamed dataset
  • The result is better downstream performance by accepting deviation from Hoffmann et al
  • Counts are exact
  • The three Zoos are consequently the same experiment at three sizes rather than three experiments, and a difference between scales is not a difference in mixtures
  • The selection criterion was to find the smallest value $\beta$ that passes the domain-separation gate below, with the reasoning that $\beta$ buys conditioning signal at the price of compute cost
  • The domain separation gate is passed when anchor groups score well in their own domain and the variance between anchor groups exceeds the variance of the groups themselves
  • (b) The Mini population by top-2 Gram-PCA components, colored by the argmax $\pi$ category
  • We therefore select $\beta = 0.15$, which is balanced against reasonable trunk displacement and significant compute savings for zoo training and further experiments
  • The between/within distance ratio is what a PCA basis is built from, and the largest $\beta$ is the worst of the three on it
  • At $\beta \to 0$ the members are one model plus small terminal perturbations, and the mixture cannot have influenced the weights at all
  • The mechanism is the shared trunk itself, as all $N$ members enter the branch phase from identical parameters and only diverge over the final $\beta S$ steps
  • The Linear Mode Connectivity (LMC) barrier is negative at every scale and in both pools: every interpolant lies at least 0.0067 nats below the chord (Table 14), which empirically justifies the decision not to canonicalize the zoo model parameters
  • Table 14 separates the two: connectivity is scale-stable, but whether averaging two members helps is not, and between different mixtures it reverses by 355M, where the midpoint beats both endpoints in only 5 of 20 pairs
  • Negative values mean the interpolated model is better than the chord, so there is no barrier at any scale
  • ><tr><td rowspan=
  • Remaining settings
  • Members are interpolated in the full $\mathbb{R}^D$ weight space, $(1-\alpha)\theta_i + \alpha\theta_j$ on raw weights
  • On an 8,000 epoch sweep at the Mini scale, shown below in Table 16, $k=50$ recovered more structure than $k=99$ in the calibration case (Mini-scale)
  • The only $k=99$ configuration that converges used a network seven times wider, which Appendix B.6 shows to be collapse-prone
  • Holding out these members from the basis fitting as well dramatically worsens their displacement relative to included members
  • On the leading five components, $\pi$ explains $R^2 = 0.568$ of the variation linearly, 0.786 once the scalar $H(\pi)$ is added, and 0.948 under a full quadratic basis
  • The leading five components carry 84% of the retained trace and 0.4% of the within-mixture variance; components c5–c24 carry 80% of the within-mixture variance and almost none of the trace
  • within/ens
  • Components beyond c24 are excluded from scoring: they behave as member-private noise that no generator can or should reproduce, and retaining them lets tail mismatch dominate the comparison
  • Additional measurements are elaborated on in Appendices B.8 and B.12 (Meehan et al., 2020)
  • var. share
  • >region, $k=99$</td><td colspan=