The document presents a neural sequence-to-grid (seq2grid) module designed to improve the ability of deep learning models to learn symbolic rules by aligning input sequences into grids. This method enhances the models' performance on out-of-distribution (OOD) examples, particularly in tasks like arithmetic and algorithmic problems. The seq2grid module undergoes joint training with the neural network, allowing it to effectively preprocess inputs for better generalization.