PopuLoRA (wip)
Implementation and explorations into PopuLoRA, Co-Evolving LLM Populations for Reasoning Self-Play, from Roger Castanyer et al at vmax.ai
Install
pip install populora
Usage
import torch
import torch.nn as nn
from populora import Population
# 2-layer MLP
model = nn.Sequential(
nn.Linear(2, 8),
nn.ReLU(),
nn.Linear(8, 1)
)
# wrap with Population
pop = Population(
model,
pop_size = 16,
low_rank = 4,
lora_targets = ['0', '2']
)
state = torch.randn(1, 4, 2)
# evaluate population against environment
preds = pop(state, all_individuals = True)
labels = torch.randn(1, 4, 1)
fitnesses = -((preds - labels ) ** 2).reshape(16, -1).mean(dim = -1)
# selection
result = pop.select(
selection_type = 'deterministic',
fitnesses = fitnesses,
survive_frac = 0.5
)
# parent selection
parents = pop.select_parents(
selection_type = 'tournament',
fitnesses = fitnesses,
num_children = len(result.selected_out_indices),
culled = result.selected_out_indices
)
# crossover
pop.crossover_('average', parents, result.selected_out_indices)
# mutate newly generated offspring, preserving surviving elite parents
pop.mutate_('full_gaussian', individuals = result.selected_out_indices)
# alternatively, mutate the entire population
pop.mutate_('full_gaussian', all_individuals = True)
# do the above in a for loop
# ...
# then pick the highest fitness individual and resume RL or fine-tuning on the base model
model = pop.select_and_merge_best_(fitnesses)
Citations
@misc{castanyer2026populoracoevolvingllmpopulations,
title = {PopuLoRA: Co-Evolving LLM Populations for Reasoning Self-Play},
author = {Roger Creus Castanyer and Geoffrey Bradway and Lorenz Wolf and Maxwill Lin and Augustine N. Mavor-Parker and Matthew James Sargent},
year = {2026},
eprint = {2605.16727},
archivePrefix = {arXiv},
primaryClass = {cs.AI},
url = {https://arxiv.org/abs/2605.16727},
}
@misc{schmidhuber2012powerplaytrainingincreasinglygeneral,
title = {POWERPLAY: Training an Increasingly General Problem Solver by Continually Searching for the Simplest Still Unsolvable Problem},
author = {Jürgen Schmidhuber},
year = {2012},
eprint = {1112.5309},
archivePrefix = {arXiv},
primaryClass = {cs.AI},
url = {https://arxiv.org/abs/1112.5309},
}
@misc{xu2026selfimprovinglanguagemodelsbidirectional,
title = {Self-Improving Language Models with Bidirectional Evolutionary Search},
author = {Guowei Xu and Zhenting Qi and Huangyuan Su and Weirui Ye and Himabindu Lakkaraju and Sham M. Kakade and Yilun Du},
year = {2026},
eprint = {2605.28814},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
url = {https://arxiv.org/abs/2605.28814},
}
@misc{bahlousboldi2026vectorpolicyoptimizationtraining,
title = {Vector Policy Optimization: Training for Diversity Improves Test-Time Search},
author = {Ryan Bahlous-Boldi and Isha Puri and Idan Shenfeld and Akarsh Kumar and Mehul Damani and Sebastian Risi and Omar Khattab and Zhang-Wei Hong and Pulkit Agrawal},
year = {2026},
eprint = {2605.22817},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2605.22817},
}
@misc{bailey2026scalingselfplayselfguidance,
title = {Scaling Self-Play with Self-Guidance},
author = {Luke Bailey and Kaiyue Wen and Kefan Dong and Tatsunori Hashimoto and Tengyu Ma},
year = {2026},
eprint = {2604.20209},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2604.20209},
}
@misc{fleuret2025freetransformer,
title = {The Free Transformer},
author = {François Fleuret},
year = {2025},
eprint = {2510.17558},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2510.17558},
}
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
populora-0.1.6.tar.gz
(15.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
populora-0.1.6-py3-none-any.whl
(14.3 kB
view details)
File details
Details for the file populora-0.1.6.tar.gz.
File metadata
- Download URL: populora-0.1.6.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28b85ad6edceb05e0ab67ff13ff6b36d493c53dd1dad39ee5498b17b35194bc6
|
|
| MD5 |
0b5c0a884a7473a65cc0ceeebabd4109
|
|
| BLAKE2b-256 |
45c19807423df00471b4a4b0d29a44f7a8ce50135214305c3fc76d5c547bdf61
|
File details
Details for the file populora-0.1.6-py3-none-any.whl.
File metadata
- Download URL: populora-0.1.6-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7c3bf1d58e7a66b5ad4a6810190cf77173f2127a4b1134565f10f0197983019
|
|
| MD5 |
358b00e8bc71b9d3b9e079a49060728e
|
|
| BLAKE2b-256 |
884f11157d7da0d64c717640f9f2c11b2ea358bccae5b859b686422f4f5fcb3d
|