“Recursive Self-Aggregation Unlocks Deep Thinking in Large Language Models.” implemented with DSPy.
Set your API key (required for OpenAI models):
export OPENAI_API_KEY="..."No-install (using uvx from GitHub):
uvx --from git+https://github.com/eaubin/recselfagg recselfagg \
--population 3 \
--subset 2
--steps 3
--show-completions \
"Argue for the best fictional character."--model: DSPy model id (default:openai/gpt-4o-mini)--population: population sizeN--subset: subset sizeKsampled each aggregation--steps: number of RSA steps--temperature: sampling temperature--population-temperature: temperature for population sampling (defaults to--temperature)--aggregate-temperature: temperature for aggregation steps (defaults to--temperature)--max-tokens: per-call token limit--show-completions: print every completion at each step--seed: random seed for reproducibility--rollout-base: base rollout id (defaults to random)--no-progress: disable progress logging--debug: print rollout ids and debug info for each call--trace-json: write JSON trace of populations at each step to a file--final-population-file: write final population (JSON) to a file--parallel: number of concurrent model calls (default: 1)
A random member of the final population is printed.