We normally use past simple tense to talk about the past and past perfect tense to talk about the past in the past, i.e. to talk about some event that that happened before some other event. I often see that when we use past perfect tense, we use it with past simple tense,e.g. I had learned Chinese before I moved to China. What if I use a non-finite adverb clause, e.g. I had learned Chinese before moving to China? How different are these two alternatives?
They are both grammatical, and mean more or less the same thing.
I think I would only use the second one (...before moving to China) if I had already been talking about my having moved there, or my listeners were aware that I had lived in China.
Your understanding of when to use the past perfect versus the past is different than mine. I use the past perfect when I wish to place the temporal focus of the statement in the past, while speaking of two events that occurred in the past, one before the other:
I learned Chinese before I moved to China.
I learned Chinese before moving to China.
Two years ago I took a trip to China. When I arrived at the airport, the Help Desk was unattended, so it was a good thing that I had learned some Chinese before leaving home, or I would have had no idea where to go.