Tree-Based Hard Attention with Self-Motivation for Large Language Models