Higher education is rapidly growing in the online learning landscape. However, current personalized recommendation techniques struggle with the precise extraction of complex mathematical semantics, hindering accurate perception of learners' cognitive states and relevance of recommendations. This article proposes a framework for extracting complex mathematical semantics and providing personalized exercise recommendations. We design a tree-based position encoding method to enhance the accuracy of positional representation for mathematical expressions in the pretrained model, aiming to improve th...