Abstract
Understanding mathematical questions effectively is a crucial task, which can benefit many applications, such as difficulty estimation. Researchers have drawn much attention to designing pre-training models for question representations due to the scarcity of human annotations (e.g., labeling difficulty). However, unlike general free-format texts (e.g., user comments), mathematical questions are generally designed with explicit purposes and mathematical logic, and usually consist of more complex content, such as formulas, and related mathematical knowledge (e.g., Function). Therefore, the problem of holistically representing mathematical questions remains underexplored. To this end, in this paper, we propose a novel contrastive pre-training approach for mathematical question representations, namely QuesCo, which attempts to bring questions with more similar purposes closer. Specifically, we first design two-level question augmentations, including content-level and structure-level, which generate literally diverse question pairs with similar purposes. Then, to fully exploit hierarchical information of knowledge concepts, we propose a knowledge hierarchy-aware rank strategy (KHAR), which ranks the similarities between questions in a fine-grained manner. Next, we adopt a ranking contrastive learning task to optimize our model based on the augmented and ranked questions. We conduct extensive experiments on two real-world mathematical datasets. The experimental results demonstrate the effectiveness of our model.
Introduction
Mathematical question representation is a foundational task for educational AI applications, such as automated difficulty estimation and question recommendation. Unlike general text, math questions are characterized by complex formulas and strict logical structures. Traditional pre-training models often fail to capture the underlying mathematical essence, focusing instead on surface-level textual features. This paper introduces QuesCo, a contrastive pre-training framework designed to bridge the gap between literal appearance and holistic mathematical meaning.
The Challenge of Mathematical Representation
Current models face two primary hurdles. First, they struggle with the "literal vs. holistic" gap: two questions might use different variables or phrasing but require identical solution logic. Second, they often ignore the hierarchical nature of mathematical knowledge. Concepts like "Trigonometric Function" are not isolated; they are nested within broader categories like "Function" and "Algebra."
As shown in Figure 1, questions Q1 and Q2 share the same fine-grained concept (Trigonometric Function) and are mathematically similar despite different phrasing. Conversely, Q5 belongs to a completely different branch (Geometry), making it dissimilar to Q1. Most existing models treat these concepts as flat labels, losing the rich relational information that defines how "close" two problems really are.
The QuesCo Framework
QuesCo addresses these challenges through two core innovations: multi-level augmentation and hierarchy-aware ranking.
1. Two-Level Question Augmentation
To move beyond literal tokens, QuesCo employs content-level and structure-level augmentations.
- Content-Level Augmentation: This includes standard text operations and domain-specific formula transformations, such as renaming variables (e.g., $x$ to $u$), scaling constants, or replacing operators with synonyms.
- Structure-Level Augmentation: This involves shuffling the order of conditional clauses or inserting non-essential "useless" clauses, forcing the model to identify the core logical requirements of the problem rather than relying on fixed patterns.
2. Knowledge Hierarchy-Aware Rank (KHAR)
Instead of treating similarity as a binary label (same or different), QuesCo utilizes a ranking strategy. The Knowledge Hierarchy-Aware Rank (KHAR) module calculates a "KH-distance" based on the shortest path between concepts in an expert-defined tree.
As illustrated in Figure 5, the framework uses these distances to rank questions in a fine-grained manner. The model is trained to recognize that an augmented version of a question is most similar, followed by questions sharing leaf-level concepts, then those sharing higher-level parent concepts, and finally questions with no shared concepts. This ranking is optimized using a Ranking Contrastive Loss (RINCE).
Experimental Results
The authors evaluated QuesCo on two large-scale datasets, SYSTEM1 and SYSTEM2, sourced from real-world educational platforms. The model consistently outperformed state-of-the-art baselines like MathBERT and DisenQNet across three key tasks:
- Similarity Prediction: QuesCo achieved a Pearson correlation of 0.7385 on SYSTEM2, demonstrating a superior ability to identify mathematically related problems compared to the next best model, DisenQNet (0.6922).
- Concept Classification: The model showed significant gains in fine-grained classification (Level-2 F1 score of 0.5550), proving the effectiveness of the hierarchy-aware training.
- Difficulty Estimation: By understanding the intrinsic logic of questions, QuesCo provided more accurate difficulty predictions, achieving lower error rates (MAE/RMSE) and a higher Degree of Agreement (DOA) than previous methods.
Conclusion
QuesCo represents a significant step toward holistic mathematical understanding in AI. By leveraging domain-specific augmentations and the inherent structure of mathematical knowledge, it moves beyond surface-level text matching. The success of the Knowledge Hierarchy-Aware Rank strategy suggests that incorporating expert domain knowledge into contrastive learning can significantly improve model performance in specialized fields.
Summary updated