ChemSteer: Controllable Molecular Generation via Locally Linear Steering in Chemical Language Models

Sathvika Anand, Callie Sardina, Ambuj SingharXiv 2026

TL;DR

If you want a language model to write happier text, you can often just nudge its internal activations along a single "happiness" direction. Try that same trick on a chemical language model to design better drugs, and it falls apart—chemical space is too curved and complex for one-size-fits-all steering. ChemSteer solves this by carving up the model's latent space into local, non-overlapping neighborhoods, finding a custom steering direction for each, and adding them together into a single global vector with zero interference—boosting drug-likeness and synthesizability without any retraining.

What Problem Does This Paper Address?

In natural language processing, the Linear Representation Hypothesis (LRH) suggests that concepts—like "truthfulness" or "sentiment"—live along straight lines in a model's activation space. If you want to steer the model, you just push its hidden states along that line.

Chemistry isn't so accommodating. A molecule's properties—like how easily it can be synthesized (SA), how drug-like it is (QED), or how well it dissolves in fats versus water (LogP)—aren't simple semantic opposites. They emerge from intricate rules of valence, ring systems, and molecular scaffolds. Because the underlying representation manifold is curved, a single global steering direction acts like a straight chord across a bent arc: it might work near one family of molecules, but steer into invalid or nonsensical structures elsewhere. The authors tackle this gap: how do we steer pretrained chemical language models (CLMs) reliably across diverse chemical spaces without expensive retraining or fine-tuning?

Methods

ChemSteer is a post-hoc, inference-time intervention that works on pretrained models (specifically SmileyLlama and GPT-2 trained on SMILES strings) in three steps:

Figure 2: ChemSteer pipeline. (1) Local steering vector extraction for each incoherent subspace identified via spectral co-clustering. (2) Superposition of local steering vectors. (3) Steered molecular generation via injection into the hidden-state activations of SmileyLlama at layer 24.
  1. Incoherent Subspace Formation (What's New): Instead of treating the 4,096-dimensional latent space as one big room, ChemSteer uses spectral co-clustering on the bipartite graph connecting molecules and latent dimensions. This simultaneously groups chemically similar molecules into clusters and assigns each cluster its own disjoint set of latent coordinates. Because no two clusters share a coordinate, their subspaces are mutually orthogonal—meaning zero interference ($\epsilon = 0$) when combined.
  2. Local-to-Global Superposition: Within each cluster, ChemSteer extracts a local steering direction using Contrastive Activation Addition (CAA)—taking the normalized difference between the mean representations of the top-quartile and bottom-quartile molecules for a target property. Because the subspaces don't overlap, these local vectors can be summed directly into one global steering vector $G = \sum v_i$.
  3. Steered Generation: During generation, the renormalized global vector is injected into the model's hidden states ($h' = h + \alpha v$) at an intermediate layer (layer 24 for SmileyLlama, layer 12 for GPT-2), guided by a conditional prompt (Original SMILES: ... Modified SMILES:) to preserve structural similarity.

Datasets

The authors evaluate ChemSteer on four standard molecular generation benchmarks (no new datasets are introduced):

  • ChEMBL & MOSES: Diverse, real-world, drug-like small molecules spanning broad chemical space.
  • ZINC250K: A large, structurally diverse dataset of commercially available compounds.
  • QM9: A smaller, low-complexity dataset with limited structural diversity, serving as a useful test case for constrained chemical spaces.

Key Insights and Ideas

  • The Linear Representation Hypothesis is only locally linear in chemistry: Testing pairs of molecular clusters across all four datasets, the authors show that the angle between local steering directions grows systematically as the chemical similarity (Tanimoto similarity) between clusters drops. On ZINC250K for LogP, for instance, the average angle between steering vectors tightens from $88^\circ$ for dissimilar clusters to $74^\circ$ for similar ones.
Figure 1: Local steering directions rotate with chemical position, shown for LogP on ZINC. Each point is one of the 23,436 cluster pairs, plotted by the angle between the two clusters’ local CAA directions against the average cross-cluster Tanimoto similarity of their molecules. Insets show a representative molecule from each cluster for one pair drawn from the top and bottom 10% of chemical similarity. The fit falls from 88◦to 74◦across the observed range of chemical similarity.
  • Curvature explains why global steering fails: QM9 exhibits both the strongest angular divergence between local directions and the worst failure of naive global steering. When local curvature is high, a single global vector is a poor approximation.
  • Joint partitioning matters: Shuffling the pairing between molecule clusters and coordinate blocks degrades performance, confirming that spectral co-clustering is capturing genuine, aligned structure rather than just arbitrary groupings.

Key Results

Across all four datasets, ChemSteer outperforms prior latent-space optimization methods (ChemSpace, Gradient Flow/LIMO, ChemFlow) as well as unsteered and naively steered SmileyLlama:

  • Drug-likeness (QED $\uparrow$): Reaches 0.92–0.95 across all datasets, an absolute improvement of 0.04 to 0.30 over baselines.
  • Synthetic Accessibility (SA $\downarrow$): Drops to ~1.5 (1.50 on MOSES, 1.54 on ZINC250K, 1.55 on ChEMBL, 1.61 on QM9), compared to 1.8–2.5 for baselines.
  • Lipophilicity (LogP $\uparrow$): Achieves the highest LogP across every dataset (e.g., 6.82 on ZINC250K, 6.68 on MOSES, 5.24 on ChEMBL, 2.70 on QM9).
  • Generation Quality: Maintains high validity (87.1%–100%), high uniqueness (93.9%–99.5%, avoiding the severe mode collapse seen in ChemSpace), and 100% novelty.

Limitations and Future Work

The authors note that while they observe incoherent subspaces empirically, they do not yet have a theoretical explanation for why pretrained chemical language models naturally organize themselves this way, nor how this incoherence varies across all transformer layers. Additionally, for highly entangled or structurally rigid properties, the disjoint subspace assumption may break down. Future directions include multi-objective steering, incorporating 3D structure-aware or docking constraints, and building a principled theory for how transformers learn these symmetry-induced subspaces.

Summary updated

BibTeX
@misc{anand2026chemsteer,
  author = {Sathvika Anand and Callie Sardina and Ambuj Singh},
  title = {{ChemSteer: Controllable Molecular Generation via Locally Linear Steering in Chemical Language Models}},
  year = {2026},
  eprint = {2612.00454},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2612.00454},
}
Figure