Manuscript Offprint

arXiv:2609.31607

Statistical attribute alignment for black-box generative AI via output post-processing

Kevin Jiang, Morgane Austern, Edgar Dobriban, Jason M. Klusowski

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

Abstract

Generative AI systems are increasingly used, but aligning their outputs with user requirements poses a continuing challenge. Here, we aim to ensure that the distribution of an attribute of an AI-generated output aligns with a user-specified target. This is motivated by examples such as fairness, where we want to ensure that a protected attribute (e.g., gender, race, or age categories) follows a desired distribution, and synthetic data generation, where we want the generated data to be representative of a target distribution. We study the practically important black-box access setting, where a user can repeatedly query a generative AI model. The goal is to return m≥1m \geq 1 outputs whose joint attribute distribution is as close as possible to this target. For both exact and approximate alignment, we develop algorithms that minimize the expected number of queries to the generator, and we further demonstrate their optimality as the number of requested outputs m→∞m \to \infty. Experiments on text-to-image generation and geocoded persona generation tasks show that our post-processing algorithms improve statistical attribute alignment, complementing prompting-based interventions.

1 Introduction

In recent years, generative artificial intelligence (genAI) models have seen increasing adoption across various domains such as text and image generation, code generation, and decision planning (Bommasani et al., 2021; Brown et al., 2020; Ramesh et al., 2022). An important challenge is to align their outputs with the requirements of a particular application. Alignment encompasses several objectives, including following instructions, reflecting human preferences, and satisfying safety or value constraints; see the recent surveys Ji et al. (2025); Pan et al. (2025). Influential approaches include reinforcement learning from human preferences (Christiano et al., 2017), its application to instruction-following language models (Ouyang et al., 2022), constitutional AI based on principle-guided model feedback (Bai et al., 2022), and direct preference optimization (Rafailov et al., 2023).

However, despite great progress, there are a variety of challenges that remain in ensuring alignment. For instance, despite their impressive capabilities, models are known to learn historical and representational biases present in their training data, leading to systematic disparities along protected attributes such as race, gender, and age (Bolukbasi et al., 2016; Buolamwini and Gebru, 2018; Bender et al., 2021). These biases can raise concerns, particularly where generative models are deployed in public-facing settings (Barocas et al., 2023; Mehrabi et al., 2021) or used to generate synthetic data for training downstream models and estimators (Wyllie et al., 2024).

In this work, we study one particular challenge within the broader alignment landscape, which we term statistical attribute alignment (SAA): ensuring that the distribution of designated categorical attributes in generated outputs agrees with a user-specified target. The attributes may be selected covariates or response labels, and the target may describe a desired population or sampling design. Even a model aligned to instructions or preferences may generate attribute distributions that differ from those required by a particular user.

Fairness and synthetic data generation provide two motivating examples. In a use case aiming to ensure fairness, the attributes are categorical covariates designated as protected, such as gender, race, or age categories, and the target specifies their desired representation (Barocas et al., 2023). Matching this target addresses a distributional aspect of fairness. As we will discuss later, the choice of protected attributes and the target is application-dependent.

Generative models also provide a potential source of data for statistical analysis, model training, and evaluation, especially when collecting or annotating real observations is costly. Synthetic data have a long history in statistics, including the release of synthetic microdata through multiple imputation (Rubin, 1993; Raghunathan et al., 2003). Modern generative models have expanded their use in data augmentation; see Chen et al. (2024b); Mumuni et al. (2024) for surveys and Abdel-Azim et al. (2026) for a recent review. AI-generated data may not match the desired distribution, in which case additional methods are required to correct such biases, see e.g., Angelopoulos et al. (2023); Bashari et al. (2025b,a), etc. Our focus is on constructing the synthetic sample itself with a specified joint attribute distribution. For example, a synthetic dataset for auditing a face recognition system should reflect the intended audited population.

A variety of methods for aligning AI models have been developed. These methods may intervene on the training data distribution, training and generation procedure, prompts, or outputs. Their requirements vary with the available model access. Methods with access to model internals can modify the architecture, training procedure, or generation dynamics (see for instance Xu et al., 2018; Yu et al., 2020; Choi et al., 2020; Rajabi and Garibay, 2022; Teo et al., 2024b,a; Friedrich et al., 2025), while black-box and training-free methods (see e.g., Pan et al. (2025)) only require that a user can sample from the model without requiring additional information such as model weights. Black-box access can be further divided based on the place of intervention, with input-side methods adjusting natural-language prompts (Zhao et al., 2021; Bansal et al., 2022; Neumann et al., 2025) and output-side or post-processing algorithms operating on the generated outputs, for example via filtering and runtime monitoring (Cano et al., 2025; Cheng et al., 2025).

Here we focus on this black-box model access setting. This access mode is particularly important because many frontier models are distributed primarily through hosted web interfaces and APIs rather than as downloadable model weights. They may be unavailable for local deployment, and serving models at this scale can require substantial computational resources. 1^{1} Within this setting, we select m≥1m \geq 1 generated outputs so that their joint

1^{1}White- and black-box methods can be combined and used in tandem (see, e.g., Schick et al., 2021; Cohen attribute distribution aligns with a user-specified target. 2^{2} The attributes are categorical and may be covariates (e.g., protected attributes such as gender or race) or response labels (e.g., whether a tumor is benign or malignant). This approach also allows practitioners to adapt the attribute distribution of a model previously aligned to a different target, without retraining or fine-tuning the model.

Moreover, under black-box access, we do not assume knowledge of the source rates, or rates at which the attributes are generated. For example, when asking a text-to-image model to “Generate an image of a doctor”, one typically does not know the true rates at which an image of a male or female doctor is generated. These source rates may be different than what a practitioner or user wants (e.g., a uniform distribution over genders).

When the outputs of a black-box genAI method do not match well with the target distribution, we aim to post-process the outputs to bring them closer. Since the source rates are unknown with black-box access, we will primarily be interested in developing source-rate-free post-processing methods which do not assume knowledge of these rates. Our strategy will be to query the model multiple times and carefully sample a subset of outputs so that the resulting probability law of the returned attributes is close to a user-specified target distribution. Block and Polyanskiy (2023) consider a similar approach to obtaining a single sample whose law approximates a target distribution—however, their rejection sampling construction requires access to the likelihood ratio, which depends on the unknown source rates. Additional related work is discussed in Section A.1.

We begin by defining our strictest notion of statistical attribute alignment, called universal exactness. This requires the law of the attributes returned by a post-processing algorithm to exactly coincide with the target distribution. We then show that a coupon collector type algorithm, called random demand coupon collector (RDC), is source-rate-free, universally exact and minimizes the expected number of calls to the model among universally exact source-rate-free algorithms, up to first-order terms as the number of requested outputs m→∞m \to \infty.

Universally exact algorithms often require many model calls, especially when there are attributes that occur rarely (see Theorem 8 for a formal statement). Consequently, we relax universal exactness by allowing approximate statistical attribute alignment. In particular, we introduce statistical alignment discrepancy as a statistical distance between the attribute law of the returned outputs and the target distribution. We then show that a variant of the RDC algorithm, called thresholded anytime RDC (TA-RDC), is source-rate-free and can achieve any user-specified level of statistical alignment discrepancy. When the target distribution is a product law and discrepancy is measured by forward KL divergence, we additionally show TA-RDC is first-order optimal: among source-rate-free algorithms with the same control on the sampling discrepancy, it minimizes the number of expected model calls up to first-order terms as the number of requested outputs m→∞m \to \infty.

Synthetic data augmentation also motivates the count-conditional alignment criterion underlying our approximate algorithms. A practitioner using synthetic data for augmentation

and Saabni, 2025; Azam and Akhtar, 2025; Gallegos et al., 2025).

2^{2}We target the joint law of the returned attributes, rather than only their marginal proportions. For a product target, this retains the sampling variation and dependence structure of independently sampled outputs. This distinction is useful both for representation across repeated requests and for synthetic datasets used to compute statistics involving several observations, as illustrated by the pairwise audit task in Section 5.2.3.

Figure

Figure 1: High-level illustration of statistical attribute alignment via black-box output post-processing, using demographic attributes of generated headshots as an example. A user queries a black-box generator to form an annotated candidate batch. A black-box post-processing method then filters the candidate batch by selecting outputs that match a user-specified target distribution (e.g., uniform) as closely as possible, subject to what was observed in the batch.

often selects examples from a single generated dataset, whose attribute counts constrain the samples that can be returned. The attribute law underlying statistical alignment discrepancy averages over possible realizations of these counts, so good overall alignment can conceal poor alignment for individual datasets. We therefore introduce a count-conditional alignment criterion that measures discrepancy given the observed attribute counts, and develop an algorithm that minimizes it for every realized count vector. This criterion both provides an interpretable objective for synthetic dataset curation and an upper bound on the statistical alignment discrepancy (Theorem 15 and Section A.4).

Figure 1 gives a high-level view of our black-box post-processing approach. The user specifies a desired distribution over attributes and then queries a black-box generator to obtain a candidate batch of outputs. Since a finite batch of samples may not contain the target attributes in the desired amounts, our procedures select from the available candidates so that the returned outputs match the target distribution as closely as possible.

We illustrate our methods in a variety of generative AI tasks, ranging from text-to-image generation with multimodal AI models (HiDream-01-Image, Qwen-Image-2512, Flux-2-dev) to text generation with a frontier language model (GPT-5.5). We argue that input-side interventions alone need not solve the problem. For example, demographic hard prompts, which directly request a protected attribute, can fail, because the models do not follow instructions and the realized attribute may differ from the requested one. As post-processing algorithms, our methods, such as RDC and TA-RDC, can still substantially improve alignment with the target attribute distribution in this setting. We further illustrate the use of synthetic datasets in a pairwise audit for face recognition systems. In this setting, matching a target joint law over attributes can yield more accurate estimates of downstream quantities, such as the false-match rate, than matching marginal proportions alone.

References (100)

Couldn't load all references. Reload the page to try again.