Improving the robustness of large language models via consistency alignment