Skip to content

Instantly share code, notes, and snippets.

@svilupp
svilupp / Source to be converted via Literate.jl
Created August 5, 2022 09:38
Target file to create from Literate.jl
# ---
# title: "Plots Demo"
# author: "Norah Jones"
# date: "5/22/2021"
# format:
# html:
# toc: true
# toc-depth: 2
# code-fold: true
# self-contained: true
@svilupp
svilupp / metalearner-bayesian-bandit.py
Last active July 27, 2025 15:49
system-prompt-learning-jokes
#!/usr/bin/env python3
"""
joker_bayesian.py – List-wise evolutionary prompt tuner for joke generation
Usage: python joker_bayesian.py prompts/seed.txt [GENERATIONS] [POPULATION]
* **Judge** 3x Listwise LLM-as-a-judge evaluates jokes on 8 ternary rubrics (goal, originality,
length, surprise, timing, relatability, clarity, memorability).
* **Fitness** Thompson-sampled Beta(α, β) updated with tournament rankings
(wins = K-1-rank, losses = rank) across multiple judge runs.