Chemical reaction rules have been used for a variety of applications including the codification and classification of chemistry, synthetic route design, and virtual library enumeration. The rules, also called templates, are a generalised pattern of reactivity encoding the changes in the atomic environment between the reactants and products of a reaction. In the past, these were manually coded using expert knowledge; however, with the growth of reaction databases, automatic extraction algorithms are becoming increasingly popular. This is partly due to the complexity of rule encoding and the time required to build a large enough rule set. The process of automatic extraction involves traversing the atom indexes to determine which atoms have changed. With the information on the changed atoms in hand, the next step is to determine which adjacent groups may affect the reaction and extract their nearest neighbors. The resulting environment is then encoded in the SMIRKS language, an abstraction of the SMILES language designed for generic reaction transformations. By specifying atom types, explicit hydrogen counts, charges, degree of connectivity, bond primitives, atom-mapping, and logical operators, SMIRKS encode the changes in the atomic environment between reactant and product. In addition, the SMIRKS atom mapping is self-consistent and has no relation to the reaction SMILES string. These characteristics make writing and interpreting patterns difficult for either a computer or a human expert. While SMILES is the language of chemistry, SMIRKS encode the rules of chemical transformations. Herein, we demonstrate that transformer models can learn the rules of chemistry as generic reaction patterns encoded as SMIRKS strings with up to 76 % accuracy without prior knowledge of atom mapping. In doing so, we show that the model can produce self-consistent atom mapping in the SMIRKS string and can use logical operators in combination with atomic properties to encode a reaction pattern. This paves the way for using chemical language models for writing the rules of chemistry for tasks such as synthesis planning.