kernel_entropy.generation¶
PoE text generation for Kernel Language Entropy.
Loads the PoE ensemble (9 LLM heads with prod + robustness LoRA merged, plus a dormant uncertainty head) once and produces N diverse responses for a single prompt. Each sample is drawn from the full PoE jury in pure-generation mode (is_mcq=False); per-sample seeding of the torch RNG makes draft-head picks and multinomial draws reproducible.
Classes
|
PoE-backed batched generation for KLE. |
- class kernel_entropy.generation.HydraGenerator(gamma: int = 4, beta: float = 1.0, max_new_tokens: int = 200)[source]¶
Bases:
objectPoE-backed batched generation for KLE.
generate_batchproduces one response per seed by callingPoE.generate_with_cachein pure-generation mode (is_mcq=False).- generate_batch(prompt: str, seeds: list[int], temperature: float = 0.98, verbose: bool = False) list[str][source]¶
Generate one response per seed.
Seeds the torch RNG before each PoE call so the draft-head pick and multinomial draws inside
generate_with_cacheare reproducible. Forks the RNG so per-seed seeding does not leak into caller state.