Views
No views yet
core.py)tasks.py)mergers.py)mutators.py)archive.py)evaluator.py)1from bio_acdc import BioACDC, BioACDCConfig
2from bio_acdc.tasks import BioTaskPool
3from bio_acdc.mergers import LinearMerge
4from bio_acdc.mutators import GaussianNoiseMutator
5from bio_acdc.evaluator import BioEvaluator
6
7# Configuration
8config = BioACDCConfig(
9 seed_model_paths=[
10 "facebook/esm2_t33_650M_UR50D",
11 "InstaDeepAI/nucleotide-transformer-v2-500m-multi-species",
12 ],
13 archive_size=20,
14 num_generations=10,
15 offspring_per_gen=5,
16 output_dir="./bio_acdc_output",
17)
18
19# Components
20task_pool = BioTaskPool(seed=42)
21evaluator = BioEvaluator()
22merger = LinearMerge()
23mutator = GaussianNoiseMutator(std=0.01)
24
25# Create Bio-ACDC
26bio_acdc = BioACDC(
27 config=config,
28 task_pool=task_pool,
29 evaluator=evaluator,
30 merger=merger,
31 mutator=mutator,
32)
33
34# Run evolution
35final_archive = bio_acdc.evolve()
36
37# Best model
38best = bio_acdc.archive.get_best()
39print(f"Best model: {best.model_path}, Fitness: {best.fitness:.4f}")1# For ESM-2 protein models
2config = BioACDCConfig(
3 seed_model_paths=[
4 "facebook/esm2_t33_650M_UR50D",
5 "facebook/esm2_t30_150M_UR50D",
6 ],
7)
8
9# For Nucleotide Transformer DNA models
10config = BioACDCConfig(
11 seed_model_paths=[
12 "InstaDeepAI/nucleotide-transformer-v2-500m-multi-species",
13 "InstaDeepAI/nucleotide-transformer-v2-100m-multi-species",
14 ],
15)| Feature | ACDC (SakanaAI) | Bio-ACDC |
|---|---|---|
| Domain | General NLP (text) | Biological sequences |
| Seed Models | Qwen/Llama LLMs | ESM-2, NT, protein/DNA LMs |
| Tasks | Synthetic code/math/text | Motif detection, sequence completion, structure prediction |
| Evaluation | LLM-as-judge + code sandbox | Sequence similarity, biological metrics |
| Merging | SLERP, Linear, Task Vectors | Same (adapted for masked LMs) |
| Archive | Dominated Novelty Search | Same |
| Task Gen | LLM-based task creation | Rule-based + evolutionary targeting |
torch>=2.0
transformers>=4.30
datasets
numpy
safetensors
biopython # Optional, for advanced sequence analysis1@software{bio_acdc_2024,
2 title = {Bio-ACDC: Coevolution of Biological Language Models and Sequence Tasks},
3 author = {Adapted from SakanaAI AC/DC},
4 year = {2024},
5 url = {https://acdc-llm.github.io}
6}