2026-11-27 16:21 UTC

NNGen releases an experimental text-to-neural-network weight diffusion demo

state: expiredheat: mediumuncertainty: mediumrelevance: mediumneural-architecture-generation diffusion-models weight-space-generation

What is this?

NNGen (also styled GenAIGenAI) is an experimental GitHub project by the repository’s author, vagrillo. Its release describes a text-conditioned diffusion model that generates weights for fixed-size, small neural-network controllers rather than images. The project includes a pretrained generator, a corpus of 2,916 controllers, code, and a demo pipeline. The README reports simple game, animation, and drawing tasks, including a held-out-shape test; it explicitly calls the work provisional, small-scale, and not production-ready. The supplied sources do not independently verify the reported results or identify the author beyond the GitHub account.

Why it matters

It makes weight-space generation concrete: a prompt can produce an executable small network, not just an image or code description. If this approach generalizes, it could offer a new way to generate task-specific models; for now, NNGen is a narrow prototype with no supplied independent validation, and its own documentation says generalization remains an open question.

Current assessment

The newly surfaced project is a first-party experimental release, not evidence of a validated general-purpose model-generation capability. According to its README, NNGen adapts a text-to-image-style diffusion pipeline to denoise a fixed-format weight canvas for an 8β†’32β†’32β†’8 controller, using English captions and a self-generated corpus of 2,916 networks. The repository says it ships inference weights and supports prompts for simple controller behaviors; it also describes held-out hexagon and octagon drawing as a test of compositional generalization. Those are project descriptions and claims, not independently confirmed outcomes: the provided material contains no outside evaluation or adoption evidence. The README itself cautions that results are provisional, quality varies, and behavior is constrained by the training corpus. The broader implication is an accessible demonstration of generating small models directly in parameter space, but the fixed architecture and simple tasks leave practical usefulness, robustness, and transfer to unseen behaviors unresolved.

Measured heat

now 0 pts/hpeak 0 pts/hcomments 0/hpeers p12momentum: steady2 platformsage 337h
points/hour across evidence Β· reading as of 2026-11-21 19:21:06.830858+11:00 Β· deterministic, not a model opinion

How the heat travelled

11-07 08:22 (minted)⭐ origin echo-reconstructedThe repository appears to be the originating artifact: its README presents NNGen as an experimental project, stating it explores whether a d
vagrillo (GitHub account; no individual name stated on the repository) on github (echo) Β· attributed from hn.story.50402488 Β· published time unknown
β€”
11-07 07:37first on hacker news Β· published Β· lag ?GenAI generates GenAI – A Diffusion Model That Generates Neural Networks
ConteMascetti71
β€”
11-07 07:37amplified on hacker news πŸ‘‘hn.story.50402488
ConteMascetti71
peak 2 Β· 0 comments Β· 104% of case engagement
11-07 08:20our radar first saw it Β· lag ?discovery anchor: hn.story.50402488β€”

Evidence (2) β€” ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnGenAI generates GenAI – A Diffusion Model That Generates Neural Networks
Retrieved article excerpt

Open article Β· Retrieved 2026-11-07T08:21:10.766075+00:00

# GenAIGenAI β€” When AI Generates Generative AI

> ⚠️ **WORK IN PROGRESS β€” EXPERIMENTAL RESEARCH.** This project is an
> **exploration**, not a conclusion. We are studying whether a diffusion model
> can generate neural networks instead of images; results so far are
> provisional, the corpus and model are small, quality varies, and everything
> here may change as the investigation continues. Nothing in this repository
> is final or production-ready.

[image](https://private-user-images.githubusercontent.com/56477712/698330572-ec9cbb96-6cc8-4140-abdc-2a6bec5a8112.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTQwMzk5NzAsIm5iZiI6MTc5NDAzOTY3MCwicGF0aCI6Ii81NjQ3NzcxMi82OTgzMzA1NzItZWM5Y2JiOTYtNmNjOC00MTQwLWFiZGMtMmE2YmVjNWE4MTEyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjExMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYxMTA3VDA4MjExMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE4YmQyODhkYWYzYTk2ZjhjNzNlZmFkYzMxNThmNWFhMjgzZmJmMmE4YTNmMGI4ZTExOTY0MzkxZTViZDZlZjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.DdCB-Vrt5p7Nk4Kxp8jDy3mfy_12YNNxCOAPqIb-p_k)
[image](https://private-user-images.githubusercontent.com/56477712/698333057-64524543-f0e0-4504-ade3-bfe882546032.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTQwMzk5NzAsIm5iZiI6MTc5NDAzOTY3MCwicGF0aCI6Ii81NjQ3NzcxMi82OTgzMzMwNTctNjQ1MjQ1NDMtZjBlMC00NTA0LWFkZTMtYmZlODgyNTQ2MDMyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjExMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYxMTA3VDA4MjExMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY4NTliYzI0NDMwZTM0NmY3YWVjZGQ3M2U5OGM0YzAyNGJhNTVkNzY2OTlhN2VhOTZmZGQ4Yjc3MmEzMGI2ZjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.zxn-DhNUWsmec2V5o1bhZ4cxxkiDgvnj2WP-PfKZs3Y)
[image](https://private-user-images.githubusercontent.com/56477712/698333188-fcd71f86-20ce-44be-ab86-b92c37d7857a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTQwMzk5NzAsIm5iZiI6MTc5NDAzOTY3MCwicGF0aCI6Ii81NjQ3NzcxMi82OTgzMzMxODgtZmNkNzFmODYtMjBjZS00NGJlLWFiODYtYjkyYzM3ZDc4NTdhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjExMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYxMTA3VDA4MjExMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg1OGExNDc1ZTZlM2VkNWI3ZWViNDUzNjhmNzdjOTI4MWNmMDM1YjQ3NzlhNmVjY2JhYzkwOGEzMTM2OGI3YjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.wTZ4L21tdXdNuPUETNLzls9AIlGH4fR0WLB_uwK24u0)

**NNGen** is a generator of generative models: a diffusion model with a
text-to-image architecture that, **instead of generating images, generates a
GenAI model** β€” a working neural network whose weights it denoises from pure
noise, guided by a text description.

Where text-to-image systems learn the mapping *caption β†’ pixels*, NNGen learns
*caption β†’ network weights*: describe a behavior in English, and the model
produces a brand-new neural network that performs it. Same machinery β€” UNet,
v-prediction, cosine schedule, DDIM sampling, classifier-free guidance β€” one
level of abstraction higher: **from pictures of things, to the things
themselves.**

```
Prompt:  "A tiny MLP drawing agent: it drives a pen on a 2D canvas
          to trace a five-pointed star."
             β”‚  diffusion sampling (DDIM, CFG)
             β–Ό
Output:  a NEW neural network (~1.6k parameters) that draws a star,
         exported as safetensors + rollout GIF + quality metrics
```

## How it works

Training pairs mirror the text-to-image recipe β€” *(image, caption)* becomes
*(network, caption)*:

- **The "image"** is a 6Γ—32Γ—32 *weight canvas*: the six parameter tensors of a
  fixed-size controller MLP (`8 β†’ 32 β†’ 32 β†’ 8`, ~1.6k parameters), laid out
  like image channels with a validity mask, z-normalized into `[-1, 1]` β€” the
  same regime as pixels.
- **The caption** is an English description of the behavior ("a tiny MLP that
  drives a pen to trace a five-pointed star"), encoded by a frozen MiniLM and
  injected via cross-attention.
- **The corpus is self-generated**: thousands of controllers are trained
  through differentiable mini-environments for games and animation tasks
  (behavior cloning from analytic experts where needed), filtered by strict
  held-out rollout criteria, and captioned from templates. **No human-labeled
  data β€” the dataset is manufactured by compute.**

A compact text-conditioned UNet (2.3M parameters, `mvp` preset) learns to
denoise weight canvases. Sampling from a prompt yields a network that is
decoded and executed directly in its environment.

## Task families

| task | domain | behavior |
| --- | --- | --- |
| `seek` | game | chase a moving target on a 2D arena |
| `evade` | game | escape a proportional-pursuit chaser |
| `balance` | game | stabilize a cart-pole |
| `bounce` | game | paddle intercepts a bouncing ball |
| `gait` | animation | two-joint leg IK: foot traces a stride ellipse |
| `orbit` | animation | thrust a satellite into a circular orbit |
| `draw_*` | drawing | turtle-graphics pen traces a target shape |

The drawing demo includes circle, square, triangle, pentagon, star, star6,
spiral, line and arc β€” while **hexagon and octagon are deliberately held out**
of the corpus to measure compositional generalization: if the model draws a
hexagon it has never seen, it learned the *concept* of a regular polygon, not
a lookup table of shapes.

## Web demo

```
python webapp/server.py --port 17656     # then open http://localhost:17656
```

A standard-library-only Python server (no framework, no build step) with all
URLs relative, ready to host behind a reverse proxy at any domain/sub-path.
It serves the English documentation, a live demo (prompt β†’ generated network β†’
rollout GIF + weight heatmap + metrics via a background job queue) and a small
JSON API (`POST api/generate`, `GET api/job/<id>`, `GET api/status`).

## Running the pipeline

```
## Pretrained generator & dataset (included)

The repository ships with everything needed to run and reproduce the drawing
experiment without re-training from scratch:

| file | what it is | size |
|---|---|---|
| `weights/nngen_draw_mvp.safetensors` | the trained diffusion generator (EMA UNet weights, 2.3M params, v-prediction) | ~9 MB |
| `data/corpus_draw/weights.safetensors` | the full training corpus: 2,916 controller networks (raw flat weights) | ~19 MB |
| `data/corpus_draw/meta.jsonl` | one record per network: task, English caption, rollout score, success, split | ~1 MB |
| `data/corpus_draw/stats.json` | per-tensor normalization statistics used by the weight canvas | <1 KB |

The cached MiniLM token embeddings are not included (~143 MB); regenerate them
deterministically from the captions with the command below. Full training
checkpoints (model + optimizer + EMA) are also not included β€” the slim release
file is what inference needs.

With a fresh clone, this works out of the box:

```bash
python -m dnn.generate \
  --prompt "A tiny MLP drawing agent: it drives a pen on a 2D canvas to trace a closed regular hexagon." \
  --task draw_hexagon            # checkpoint auto-resolves to the release weights
```

## Running the pipeline (reproduce end-to-end)

```
pip install -r requirements.txt

# 1. mass-train controllers through the differentiable environments
#    (~2-3 h on 8 CPU cores; deterministic seeds per task/batch)
python -m dnn.corpus.train_controllers --tasks draw_circle,draw_square,draw_triangle,draw_pentagon,draw_star,draw_star6,draw_spiral,draw_line,draw_arc \
    --per-task 300 --out data/corpus_draw

# 2. cache text embeddings (one-time MiniLM download, ~1 min)
python -m dnn.corpus.embed_captions --corpus data/corpus_draw

# 3. train the generator (mvp preset = CPU-feasible: ~3.5 h on 8 cores, 1500 steps)
python -m dnn.train_diffusion --config mvp --corpus data/corpus_draw --run runs/draw_mvp

# 4. generate a network from a prompt (CLI) β€” writes net + GIF + report
python -m dnn.generate --prompt "..." --task draw_hexagon --ckpt runs/draw_mvp/ckpt.pt --out runs/demo

# 5. quantitative eval: generated vs teacher vs random on validation captions
python -m dnn.eval --ckpt runs/draw_mvp/ckpt.pt

# 6. the website
python webapp/server.py --port 17656

# export a slim release checkpoint like the one shipped in weights/
python scripts/export_release.py --ckpt runs/draw_mvp/ckpt.pt --out weights/nngen_draw_mvp.safetensors
```

Step 1 keeps only networks that trace their whole curve on a held-out episode
(point accuracy, full-curve coverage, closure and pace); failed candidates are
discarded and the trainer's retry budget absorbs the pass-rate. Step 3's
validation loss and step 5's benchmark are the objective measures of progress.

## Repository layout

```
dnn/
  config.py            fixed sizes + presets (smoke/mvp/small/base)
  controller.py        canonical MLP, weight canvas, normalization, stats
  text_encoder.py      frozen MiniLM wrapper
  tasks/               mini-environments + draw shapes, registry
  corpus/              caption templates, batch trainer (expert cloning),
                       incremental storage, embedding cache
  diffusion/           cosine schedule, UNet (cross-attn), DDIM + CFG, EMA
  train_diffusion.py   training loop (EMA, checkpoints, resume, val loss)
  generate.py          prompt β†’ network β†’ rollout β†’ artifacts
  eval.py              generated vs teacher vs random benchmark
  render.py            behavior GIFs and weight heatmaps
webapp/
  server.py            NNGen website + demo API (stdlib HTTP, port 17656)
  pages/, static/      English documentation and demo UI
tests/                 canvas round-trip, tasks, diffusion, e2e pipeline
scripts/               demos and utilities
```

## Status & honest limits

- **This is an ongoing exploration.** The core question β€” can diffusion
  generate neural networks usefully? β€” is still open, and we are still
  studying it: expect changes, small numbers, and dead ends published as
  honestly as successes.
- **Research prototype**: one fixed-size controller architecture, simple
  behaviors, CPU-only training (the `mvp` preset trains in a few hours on 8
  cores; a GPU multiplies corpus size and model capacity by an order of
  magnitude).
- The generator can only produce behaviors resembling its training corpus β€”
  and, in the best case, *interpolate* between them (that is exactly what the
  held-out hexagon/octagon experiment measures).
- Success is measured, not promised: `eval.py` reports generated networks
  against their corpus teachers and random initialization on unseen captions.

## Related work

This project sits in the emerging field the survey
***"A Survey of Weight Space Learning: Understanding, Representation, and
Generation"*** ([arXiv:2603.10090](https://arxiv.org/pdf/2603.10090)) calls
**Weight Space Generation**. Section [**4.2.1 β€” Conditional Weight
Generation**](https://arxiv.org/pdf/2603.10090) describes exactly the family
of approaches NNGen belongs to: synthesizing model parameters specialized for
a task or semantic condition β€” instead of learning one static set of weights β€”
so that "model behavior" becomes semantically controllable. The survey cites
text-conditioned generators such as **T2W** (a diffusion transformer producing
classifier heads from CLIP text embeddings) and **HyperLDM** (diffusion
conditioned on CLIP features).

NNGen differs in where the conditioning power comes from: rather than
generating a classifier head for an existing feature space, it generates
**complete small controllers for interactive behavio
ConteMascetti7120
🟧 echo.github ⭐The repository appears to be the originating artifact: its README presents NNGen as an experimental project, stating it explores whether a dvagrillo (GitHub account; no individual name stated on the repository)β€”β€”

Interpretation history

Decision trace