Where a discriminative model learns p(y|x), a generative model represents p(x) or p(x|c), often by maximizing

\max_\theta\;\mathbb E_{x\sim p_{data}}[\log p_\theta(x)]

VAEs use latent variables and a variational bound; GANs train generator and discriminator adversarially; diffusion models learn to reverse a noising process.

Conditional generationNoise and condition enter a generative model and produce an output.noise zcondition cgeneratoroutput x

Diagram: Duskcoil. It does not establish truth, rights, provenance, or safety of generated output.

Evaluate condition adherence, factuality, privacy, copyright, bias, harmful output, and disclosure—not only visual metrics. Do not treat generated material as evidence without primary-source verification.

Three families and their implementation tradeoffs

A VAE uses encoder q_\phi(z|x) and decoder p_\theta(x|z) and maximizes an ELBO that balances reconstruction with regularization of the latent distribution. A GAN trains a generator and discriminator in the minimax game \min_G\max_D\mathbb E[\log D(x)]+\mathbb E[\log(1-D(G(z)))]. It can produce sharp outputs, but mode collapse and unstable training remain concerns. A diffusion model gradually adds noise to x_0 and learns to predict noise \epsilon so that the reverse process can be approximated. Quality, speed, controllability, likelihood, and memory are different tradeoffs.

Family Strength Watch point Typical control
VAE Interpretable latent representation Blur and approximation error Latent variable and condition
GAN Sharp high-frequency appearance Mode collapse and discriminator instability Condition and latent search
Diffusion High quality and conditioning Iterative sampling and provenance Text, image, guidance

Failure cases and evaluation

Plausible images and prose are not automatically true. Memorization of training phrases, leakage of people, trademarks, or confidential data, instruction-irrelevant output, bias amplification, and invented citations are common failures. Combine provenance tracing, similarity search, expert review, red teaming, and condition-specific human evaluation instead of relying on one automatic metric. Never use generated output as primary evidence for medical, legal, or safety operations.

Record the input condition, system prompt, model version, random seed, filters, and generation time. Check copyright, privacy, and terms of use; do not send confidential input to an external service. Refuse dangerous requests and return to clarification for ambiguous ones. Generated images should be labeled as synthetic, and consent and distribution method should be considered for people.

  1. Specify the generation goal and prohibited uses.
  2. Track provenance, license, and deletion requests.
  3. Evaluate adherence, factuality, leakage, and bias separately.
  4. Provide human approval, source checking, refusal, and rollback.

  5. NIST Generative AI Profile

Conditioning, search, and reproducibility

Providing a condition does not guarantee that it will be obeyed. Strong classifier-free guidance can improve adherence while reducing diversity or producing saturation. Temperature, top-p, iteration count, and guidance scale are both quality knobs and specifications for reproducibility and compute cost. Save model identifier, weight hash, scheduler, seed, and preprocessing rather than relying on defaults.

When retrieval or external data conditions generation, keep generated text separate from retrieved evidence. An existing URL does not prove that a claim is supported. Store search time, query, document version, and quoted span; if evidence is insufficient, say so instead of guessing. Validate structured output with JSON Schema, and test syntax and truth independently.

Comparing evaluation design

Axis Automatic example Human/operational check Trap
Fidelity FID, perceptual distance Artifacts and plausibility Overfitting the metric distribution
Diversity Coverage, duplicate rate Range under one condition Irrelevant changes count as diversity
Condition adherence Classifier, string match Instruction-level scoring Evaluator bias
Factuality Evidence match rate Expert claim review Mistaking fluency for truth
Safety and rights Filter detection rate Context, consent, purpose Evasion or over-refusal

Include ambiguous instructions, conflicting conditions, known-person likenesses, personal-looking strings, dangerous domains, and unsupported languages in the evaluation set. Report severe worst cases and refusal rate in addition to averages. Human evaluation should document prompts, ordering, blinding, and inter-rater agreement.

Failure case: from a successful demo to unsupervised release

A small set of attractive examples hides instability on repeated prompts, prompt injection, training-data-like output, and loss of conditions in long conversations. Sending user input directly into future training can persist personal or abusive data. Define consent, purpose, retention, and deletion paths; isolate and review training candidates. Give tool-using models least privilege, argument validation, confirmation before execution, and cost and call limits.

A small, staged implementation

  1. Separate places that truly need generation from places where search, templates, or people suffice.
  2. Convert acceptance and prohibition conditions into a fixed evaluation set with examples.
  3. Keep input/output filters, evidence checks, and schema validation independent of the model.
  4. Shadow-test with a limited audience and measure failure classes, latency, retries, and review effort.
  5. Pin versions, roll out gradually, and return to a safe response or disable the feature on a severe incident.
  6. Re-run fixed and incident sets after every update to detect regressions as well as improvements.

Quality is not a single benchmark. A product specification must state what is not generated, what evidence is shown, and who approves the result.

Operational boundaries and change management

The responsibility boundary should be visible in the interface. Drafts users can edit, evidence-checked summaries, and commands that execute automatically should not share the same visual treatment. Show that an output is generated, what has been checked, referenced sources, and the last update time. High-impact actions should be converted into typed candidates and pass authorization and user approval rather than executing directly from generated prose.

Provider updates, filter changes, and prompt changes are behavior changes. Pin reproducible versions and compare differences, including newly refused normal inputs, language-specific regressions, cost, and latency. At retirement, check deletion scope for logs, embeddings, caches, and fine-tuning data. Add de-identified red-team failures to regression tests, including paraphrases, and interpret incident count together with usage, refusal rate, and review rejections.

#machine learning #generative AI #VAE #GAN #diffusion