Improving a model is less like engineering and more like discovery. You get a hunch, you try it, you measure, you keep what works. The catch is that "trying it" usually means writing and debugging model code, and that is slow enough that you only ever test the two or three ideas you are most confident in. Most hunches never get tried.
mixlab changes the economics: a model is a JSON config, so trying a hunch is editing a file, not writing a training loop. This post is a small, concrete demonstration of that: two molecule generators you can load and run today, ending with an invitation to go tinker.
And you can do it on the laptop you already have. Both models below trained in about 5 hours on an M1 Max. mixlab also runs on CUDA when you want big iron, but for rapid iteration and testing, a modern Mac is hard to beat: the whole loop, edit a config, train, measure, fits on the machine in front of you.
First reproduce so you have a trusted foundation
MolGPT is a small SMILES transformer that generates drug-like molecules. We rebuilt it in mixlab and trained it on the MOSES benchmark on that same Apple-silicon Mac, one molecule per training sequence. Same architecture: 8 layers, 256-dim, 8 heads, 6,342,656 parameters. Scored on 30k unconditional samples with the official moses.metrics:
| Metric | mixlab | MolGPT (published) |
|---|---|---|
| Valid | 0.988 | 0.994 |
| Unique@10k | 0.991 | ~1.000 |
| Novelty | 0.783 | 0.797 |
| IntDiv | 0.857 | 0.857 |
Within a point on every metric. This is the part that matters before you go exploring: a faithful, verified starting point, not an approximation. It is on Hugging Face and loads with stock transformers, no custom code: mrothroc/molgpt-moses-smiles-mixlab.
(Reproducing it turned up a small surprise, and the surprise was in the data, not the model. The first attempt was only 50% valid because packing the training set into one long stream was slicing molecules in half. One config flag, -frame-per-record, fixed it. The full story is in the cookbook. The general lesson, the win is often in the data or the representation rather than a bigger model, sets up the next part.)
Then discover a better model from a config change
A plain SMILES model has to learn chemical validity, and it never quite gets to 100% (0.988 above). The hunch: do not push the model harder, change what it is writing in. We retrained the exact same model on SELFIES, a molecular string format where every string decodes to a valid molecule by construction. Same architecture, same training budget, only the tokenizer and the representation changed.
| Metric | SMILES model | SELFIES model |
|---|---|---|
| Valid | 0.988 | 1.000 |
| Novelty | 0.783 | 0.859 |
| FCD/Test | 2.83 | 0.43 |
| Filters | 0.996 | 0.976 |
Validity is now free, novelty and distribution fit both go up, and the medicinal-chemistry filter rate slips a little (the one honest cost). That is the shape of a discovery: not a bigger model, a better idea, tried cheaply. SELFIES is not ours (Krenn et al. 2020); the point is that the lens told us to reach for the representation, and mixlab let us test it by changing two fields in a config. Here it is: mrothroc/molgpt-moses-selfies-mixlab.
Fast iteration because you tinker in JSON, not code
In mixlab, the model is a JSON file. Want to test whether the Muon optimizer beats AdamW on this task? You don't touch code, you change one line in the config:
"optimizer": "adamw" into "optimizer": "muon"
Curious whether a sub-quadratic mixer like Mamba or RWKV would do better than attention on molecules? Change the block type. mixlab ships a whole shelf of these as ready-to-fork example configs: Mamba, RWKV, gated DeltaNet, gated linear attention, mLSTM, and more, so trying one is a copy-paste, not a re-implementation. The architecture is a list of blocks in a file:
"blocks": [
{
"type": "plain",
"heads": 8,
"attention_mask": "causal"
},
...
]
Swap "plain" (attention) for another mixer, retrain, measure. The two molecule models above are just two points in that space, and finding each one cost a config edit. That's the whole idea: when trying an idea is cheap, you can afford to be curious, and curiosity is how you find the good architectures. You don't design them, you discover them.
Go tinker
Both models are on Hugging Face and load in a few lines of stock transformers:
- SMILES reproduction: mrothroc/molgpt-moses-smiles-mixlab
- SELFIES variant: mrothroc/molgpt-moses-selfies-mixlab
The full recipe, the forkable configs, and two more legs (grammar-constrained decoding, and goal-directed fine-tuning toward drug-likeness) are in the cookbook: github.com/mrothroc/mixlab-cookbook. Fork a config, change the optimizer or a block or the representation, retrain on your Mac, and see what you find.
The trainer behind this: mixlab →