Next-Token Prediction Task Assumes Optimal Data Ordering for LLM Training in Proof Generation

Chenyang An, Shima Imani, Feng Yao, Chengyu Dong, Ali Abbasi, Harsh Shrivastava, Samuel Buss, Jingbo Shang, Gayathri Mahalingam, Pramod Sharma, Maurice Diesendruck · OpenReview

Abstract

In the field of large language model (LLM)-based proof generation, despite being trained on extensive corpora such as OpenWebMath and Arxiv, these models still exhibit only modest performance on proving tasks of moderate difficulty. We believe that this is partly due to the suboptimal order of each proof data used in training. Published proofs often follow a purely logical order, where each step logically proceeds from the previous steps based on the deductive rules. However, this order aims to facilitate the verification of the proof's soundness, rather than to help people and models learn the discovery process of the proof. In proof generation, we argue that the optimal order for one training data sample occurs when the relevant intermediate supervision for a particular proof step in the proof is always positioned to the left of that proof step. We call such order the intuitively sequential order. We validate our claims using two tasks: intuitionistic propositional logic theorem-proving and digit multiplication. Our experiments verify the order effect and provide support for our explanations. We demonstrate that training is most effective when the proof is in the intuitively sequential order. Moreover, the order effect and the performance gap between models trained on different data orders are substantial -- with an 11 percent improvement in proof success rate observed in the propositional logic theorem-proving task, between models trained on the optimal order compared to the worst order.

Introduction

Large Language Models (LLMs) are typically trained on massive datasets of mathematical proofs, such as those found in ArXiv or textbooks. However, a significant gap remains between the amount of data these models consume and their actual reasoning capabilities. This research identifies a "training inefficiency problem" rooted in the internal structure of the training data itself.

Most mathematical literature is written in a Purely Logical Order, optimized for verification rather than discovery. For a unidirectional next-token predictor, this creates the Delayed Insight Issue (DII): if the reasoning or lemmas required for a specific step appear after that step in the text, the model cannot effectively learn the underlying logic during a standard training pass.

Conceptual Framework: Intuitively Sequential Order

To address DII, the authors propose the Intuitively Sequential Order (SEQ). In this format, all intermediate supervision—the "hints" or lemmas required to derive a step—is placed to the left of that step. This ensures that the model has access to all necessary context before it is tasked with predicting the subsequent reasoning.

Comparison between Purely Logical Order and Intuitively Sequential Order. In SEQ, the lemma (Step 3) is presented before the steps that utilize it.

Methodology

The researchers evaluated the "order effect" using two primary tasks:

  1. Intuitionistic Propositional Logic (PropL): Proving theorems within the Lean formal environment using a dataset of 21,000 instances.
  2. Digit Multiplication: Treating 4-by-4 multiplication as a multi-step proof process based on integer ring axioms, using 1,000,000 examples.

The study compared SEQ against Sequentially Reversed (SER) and Partially Sequentially Reversed (PSER) orders using Gemma-2B and Llama-7B models. Additionally, a manual analysis of Folland’s Real Analysis confirmed that DII is a real-world phenomenon, affecting 17.3% of non-trivial proofs in the text.

Key Results and Discussion

The experiments demonstrated a profound "order effect" on model performance and convergence.

  • Performance Gains: In the PropL task, models trained on the SEQ order achieved an 11% higher proof success rate and a 20% improvement in tactic prediction accuracy compared to those trained on suboptimal orders.
  • Failure of Reversed Logic: Models trained on the SER order consistently failed the multiplication task (0% success rate), indicating that they cannot learn to "look ahead" for logic when prompted with only the problem.
  • Convergence Speed: SEQ-trained models converged significantly faster. In multiplication tasks, they mastered initial decomposition steps within 2,500 training steps, whereas SER models were hindered by spurious dependencies.
Success rates over training checkpoints for Gemma-2b and Llama-7b across different data orderings (SEQ, PSER, SER).

Conclusion

The findings suggest that the next-token prediction objective assumes an optimal data ordering that aligns with the causal flow of discovery. By rearranging proof data into an intuitively sequential format—akin to effective human pedagogy—LLM training becomes significantly more efficient. Future research will explore automated methods for reordering natural language proofs and the impact of data ordering during large-scale pre-training.

Summary updated

BibTeX
@misc{an2024next,
  author = {Chenyang An and Shima Imani and Feng Yao and Chengyu Dong and Ali Abbasi and Harsh Shrivastava and Samuel Buss and Jingbo Shang and Gayathri Mahalingam and Pramod Sharma and Maurice Diesendruck},
  title = {{Next-Token Prediction Task Assumes Optimal Data Ordering for LLM Training in Proof Generation}},
  year = {2024},
  eprint = {2411.00863},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.00863},
}

Loading related content...

Figure