Self-training Large Language Models through Knowledge Detection