Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

trp-ligands

A reinforcement learning environment for TRP (transient receptor potential) ion-channel ligand pharmacology, built on Prime Intellect's Verifiers.

Given a small molecule and a target TRP channel, the model must predict (a) the ligand's potency (EC50 or IC50, in nM) and (b) the specific structural feature that drives molecular recognition at that channel: binding-pocket residues, covalent chemistry, or allosteric mode. The verifier scores the number against published lab measurements and scores the explanation against the actual binding mechanism, with no LLM-as-judge step.

Why it's a usable RL environment

  • Verifiable reward. Potency is checked against published nM ranges with a log-space numeric reward; mechanism is checked with synonym-aware keyword coverage. Both are closed-form and deterministic.
  • Reward-hack-resistant. A mechanism rubric carrying half the weight means "the channel binds the ligand" with no real structural content scores near zero, even when the number is right.
  • Hillclimbable, measured empirically. The included pass_k_eval.py harness measures pass@k > pass@1 against Sonnet 4.5 and Haiku 4.5. Haiku shows a uniform +20pt pass@k vs pass@1 gap across all tiers.
  • Contamination-resistant by construction. Difficulty is graded by distance from the pretraining corpus, not chemistry depth: the hard tier is post-2023 clinical candidates and understudied channels, mirroring the SWE-bench retirement pattern.

Contents

The environment lives in environments/trp_ligands/. The detailed writeup, methodology, full empirical results, and an honest limitations section are in its README.

File Purpose
trp_ligands.py The 30-pair ligand database, 124-key synonym map, prompt rendering, reward functions, and load_environment().
v2_ligands.txt Pipe-delimited source-of-truth spec the database is built from.
pass_k_eval.py Resumable pass@1 / pass@k harness (Anthropic, OpenAI, or deterministic stub clients).
test_trp_ligands.py 55 unit tests covering database integrity, reward functions, and the reward-hack-defeat property.
audit.py Static database audit across procedurally generated dataset rows.
pass_k_cache_*.json / pass_k_results_*.txt Cached scores and run transcripts from the Sonnet 4.5 and Haiku 4.5 evaluations.

Quickstart

pip install -e environments/trp_ligands
import verifiers as vf
env = vf.load_environment("trp-ligands", difficulty="mixed",
                          num_train=60, num_eval=30, seed=0)

Reproduce the evaluation with your own Anthropic API key:

export ANTHROPIC_API_KEY=...
python environments/trp_ligands/pass_k_eval.py --client anthropic \
    --model claude-sonnet-4-5 --n-tasks 15 --k 5 \
    --cache environments/trp_ligands/pass_k_cache_v2_sonnet.json

License

MIT. See LICENSE.

About

A verifiable RL environment for TRP ion-channel ligand pharmacology, built on Prime Intellect's Verifiers

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages