# Hierarchical archives, counterfactuals, and generative QD These CPU pilots use seeds 11 through 15. The {download}`per-seed JSONL ` records all four comparisons. The separate {download}`frozen-decoder trace ` uses one seed. See [the tutorial](tutorial_hierarchical_generative_qd.rst) for each evaluator and archive contract. ```bash python -I examples/hierarchical_generative_qd.py all --include-torch \ --seeds 11 12 13 14 15 --output hierarchical-generative-qd.jsonl python -I examples/soft_prompt_local_model.py --budget 24 --tokens 8 ``` ## Crew schedules and overtime Both arms measure 180 assignments and priority orderings for seven jobs on two crews. Each archive has room for 18 elites. The hierarchical method uses three overtime bins, each with a 2 by 3 staffing grid. The flat CVT uses the same 18 Cartesian cell centers. Both use the same initializer and mutation. The hierarchy samples a branch first and then an elite. The flat CVT samples an elite uniformly. Both use stored measurements to count alternatives in the requested overtime intervals. | Method | Low overtime alternatives | Middle | High | Sum of retained quality | | --- | ---: | ---: | ---: | ---: | | Hierarchical | 5.4 | 4.8 | 1.6 | 8.657 | | Flat CVT | 5.4 | 5.2 | 2.0 | 8.431 | The hierarchy gives an interval query and coarse-to-fine browsing. The flat CVT retained slightly more alternatives in the two higher overtime ranges in this pilot. ## Observation routes Candidates pick four of eight sites according to priority scores. Objectives reward useful observations and low travel costs. Both MOME variants spend 192 rollouts on a 4 by 4 ParetoGrid with three slots per cell. MOME uses aggregate site mix and travel distance. C-MOME measures overlap with two virtual patrols. The audit remeasures the retained policies with two different patrols and projects both arms to one reporting grid. Global hypervolume uses a common reference of zero for both objectives. | Method | Held-out cells | Global hypervolume | Audit calls | | --- | ---: | ---: | ---: | | MOME | 5.8 | 0.3333 | 21.8 | | C-MOME | 5.6 | 0.3382 | 20.2 | Held-out coverage and global hypervolume were close across the two methods. The fixture checks the shared measurement and audit paths. ## Constructive subset sampler The graph constructs three-item subsets of five items. Every terminal subset has six construction orders. Each preference weights two motif objectives. The GFlowNet trains for 350 updates with 40 trajectories per update and evaluates each of the ten terminal rewards once. The sampler and a direct uniform baseline each get 30 subsequent archive evaluations. The exact terminal probability audit averages over three preferences, including one held out from training. | Proposal method | Total variation from target | Reporting cells | QD score | | --- | ---: | ---: | ---: | | GFlowNet | 0.061 | 5.0 | 3.833 | | Uniform terminal sampling | 0.206 | 5.0 | 3.833 | The learned sampler approached the reward-weighted target. Both methods filled all five reachable reporting cells on every seed. ## Soft-prompt generation A frozen stochastic fixture maps two embedding coordinates to two measured text fields. Each arm gets 120 generations. The targeted arm spends part of that budget on paired probes, and all valid probes can enter the archive. Gaussian mutation uses no probes. The fixed control decodes repeatedly from the initial embedding. | Variation | Filled cells | QD score | Probe calls | | --- | ---: | ---: | ---: | | Targeted and crossover | 11.0 | 9.422 | 71.6 | | Gaussian | 16.4 | 13.238 | 0 | | Fixed embedding | 4.0 | 3.394 | 0 | The probes consumed more than half the targeted budget on this fixture. Gaussian mutation covered more cells on four of five seeds. With the local Transformers example, each mode used 24 generations from a tiny randomly initialized GPT-2. All three retained five cells. The targeted arm used six paired-probe calls and reached a QD score of 2.000. The two controls each reached 2.143. This checks real embedding injection, decoding, and accounting. A trained checkpoint would be needed to measure gains on natural-language tasks.