Helping AI learn chemistry through teamwork

An AI answer can sound convincing and still get the chemistry wrong. We used ideas from game theory to organise how AI systems prepare teaching material, check it and learn from it.

Ask a language model to explain a chemical reaction, and it may produce an answer that reads like a textbook. The terminology looks familiar. The sentences fit together. Yet the explanation may contain a mistake that changes the meaning of the whole answer. This is especially troublesome in chemistry, where a plausible explanation must still obey physical laws and account for how molecules behave.

We wanted to make a smaller language model more dependable for this kind of work. Smaller models are attractive because they can be run locally, giving researchers more control over their data and computing resources. But they also need good teaching material. Our study grew around a practical question: how could we prepare that material, check its quality and use the model’s mistakes to guide further training?

Giving each AI a job

We called the resulting framework G-Frame. It draws on game theory, which studies how decisions depend on the actions of others. In our case, the useful idea was cooperation: several AI agents work towards a shared goal, with a specific role for each. An agent here is simply a language model given a particular task and instructions for carrying it out.

For example, when preparing questions and answers, one agent acts as a teacher, another as a student and another as a supervisor. Their work passes through rounds of generation, checking and correction, followed by a final arbitration step. This division gives the system opportunities to catch problems before an example becomes training material. It also makes the process easier to inspect: we can look at the contribution of each role.

There is less glamorous work to do as well. Converting chemistry books and papers into text can corrupt symbols or break sentences. Those defects matter when the material will teach another model. We assigned separate agents to clean symbols, repair incomplete text and restore its structure. These agents can themselves make mistakes, so assigning roles is only part of the answer; their outputs still need checking.

Adjusting the work as it happens

Preparing examples on this scale creates a computing problem. Sending requests one at a time is slow, while sending too many together can overwhelm the system. G-Frame monitors the workload and adjusts how many requests run at once. Ideas from Bayesian games informed this decision layer: it starts with an initial choice, then uses new information to revise that choice as conditions change.

In our data-generation experiment, this approach processed work about 22 times faster than the synchronous setting. Improvements over settings that already ran many requests together were smaller. The practical benefit was the ability to respond to changing demand while avoiding service interruptions in the reported experiment. That helped make a large data-generation task manageable.

The same need to adjust appeared during training. We tested the model at intermediate stages and used the results to guide changes, including adjustments to the learning rate or the addition of targeted examples. This matters because further training does not always make a model better. We found that it could weaken capabilities acquired earlier, a problem researchers call catastrophic forgetting. Comparing different combinations of training stages helped us see where the losses occurred and how adaptive training could address them.

Checking whether the answers improved

The resulting chemistry model is called OmniChem. It has seven billion parameters, the adjustable values through which a neural network learns. Its training used a chemistry corpus of about five billion tokens, or units of text, alongside more than 363,000 step-by-step reasoning examples and nearly 200,000 question–answer pairs. G-Frame organises the preparation and training process; OmniChem is the model produced using it.

We evaluated OmniChem on several chemistry tests. On ChemJudge, where automated assessments were checked by chemistry experts, the hallucination rate fell from 41.95% for the starting model to 12.91% for OmniChem. Here, hallucinations are answers that contain factual errors despite sounding plausible. The change amounts to a relative reduction of about 69% under that evaluation.

The remaining errors matter just as much for anyone planning to use the model. A lower error rate is encouraging, but an individual answer still needs scrutiny. Our strongest evidence concerns text-based chemistry questions and explanations of established concepts. Longer, open-ended problems, such as planning an unfamiliar synthesis from start to finish, need much more testing.

Trying an idea for a dye

We also wanted to explore how a model might contribute to a research question. One example involved BODIPY, a family of dyes. We asked OmniChem how to modify a dye so that it would absorb light further towards the red end of the spectrum. Such changes are of interest for applications including biological imaging.

The model suggested extending the part of the molecule across which electrons can spread. Chemists call this a conjugated system, and changing it can alter the wavelengths of light a molecule absorbs. We then examined the proposal using quantum-chemical calculations. They predicted an absorption maximum of 709 nanometres, supporting the intended shift.

That calculation was a useful check, although it was not an experiment on a newly made dye. The example suggests a role for the model in proposing and explaining candidates that researchers can investigate further. Testing a suggestion with an independent scientific method remains essential before treating it as a result.

What we want to build on

Working on G-Frame brought the preparation of training material into focus. Correcting an answer at the end is difficult if the model has learned from damaged text or unchecked examples. Our approach puts checks earlier in the process and uses later evaluations to guide further learning.

We have shared the code, model and dataset so that others can examine the approach. Applying it in another field will mean choosing appropriate source material, defining useful agent roles and testing the resulting model independently. For chemistry, there is still work to do on the errors that remain. We hope this framework will help researchers build assistants whose answers are easier to examine and whose useful ideas can be followed up with calculations and experiments.