Abstract
Large Language Models (LLMs) frequently exhibit semantic inconsistency, providing contradictory responses to semantically equivalent prompts. This paper presents "Chain of Guidance" (CoG), a multi-step prompting framework designed to generate highly consistent synthetic data for model distillation. By fine-tuning smaller models on CoG-generated outputs, we demonstrate that semantic consistency can be significantly enhanced—often doubling the consistency of base models—while maintaining general reasoning capabilities through parameter-efficient techniques like LoRA.
Introduction
A fundamental requirement for reliable AI is semantic consistency: the ability of a model to provide the same answer regardless of how a question is phrased. For example, an LLM should ideally provide the same response to "What can you say to open any door?" and "What words can you use to unlock any door?" In practice, however, LLMs are highly sensitive to linguistic variations, often leading to hallucinations or self-contradiction when faced with paraphrased inputs. This lack of reliability hinders the deployment of LLMs in automated workflows and high-stakes user-facing applications.
This research addresses the challenge of semantic consistency in closed-book question-answering (QA) tasks. The authors introduce a novel two-phase approach: first, generating highly consistent synthetic data using a "Chain of Guidance" (CoG) prompting strategy, and second, distilling this consistency into smaller, more efficient models.
Methodology
The Chain of Guidance (CoG) Pipeline
The CoG framework leverages a highly capable "teacher" model (e.g., GPT-4) to generate a consistent corpus of QA pairs through a structured, multi-step reasoning process:
- Paraphrase Generation: The model generates realistic paraphrases of an original question using specific linguistic rules, such as altering syntax or employing synonyms.
- Preliminary Answers: The model generates initial, independent answers for each of the paraphrased questions.
- Summarization: These answers are condensed into brief, 1-2 word options to simplify the decision space.
- Ranking and Selection: The model is presented with a multiple-choice prompt containing all summarized answers and is tasked with selecting the most correct one for every paraphrase. This self-ranking step forces the model to align its outputs, acting as a guardrail against hallucination.
Model Distillation
The consistent QA pairs generated via CoG are used to fine-tune "student" models, specifically Llama 2 (7B) and Llama 3 (8B). The researchers evaluated two primary fine-tuning methodologies:
- Supervised Fine-Tuning (SFT): Updates all model weights to maximize consistency.
- Low-Rank Adaptation (LoRA): A parameter-efficient technique that updates only a small subset of weights, designed to preserve the model's original capabilities while learning the new task.
Experimental Setup
The study utilized several open-source QA datasets to generate synthetic fine-tuning corpora, including TruthfulQA (factual accuracy), HotpotQA (multi-hop reasoning), CommonsenseQA (everyday logic), and AmbigQA (ambiguous prompts). Evaluation was also conducted on out-of-distribution datasets like ELI5 and various adversarial prompts to test the limits of the fine-tuned models.
Key Results and Insights
Consistency Gains
The CoG framework proved highly effective both as a prompting strategy and a distillation source. At inference time, applying CoG to text-davinci-003 increased its entailment-based consistency score from 35.5% to 84.4%. When used for fine-tuning, CoG-generated data allowed Llama 3 8B to increase its consistency on TruthfulQA from 21.6% to 53.1%.
Generalization and Accuracy
Models fine-tuned on a specific dataset (e.g., TruthfulQA) showed significant consistency improvements on entirely unseen datasets like HotpotQA, suggesting that the model learns the principle of consistency rather than just memorizing specific facts. Furthermore, human evaluation confirmed that CoG + LoRA fine-tuning increased the proportion of "consistently accurate" answer pairs from 32.6% to 34.7%, proving that consistency does not come at the cost of correctness.
The LoRA Advantage
While full SFT yielded the highest raw consistency scores, it often resulted in "catastrophic forgetting," where the model lost its ability to perform general tasks like mathematical reasoning (measured via GSM8K). LoRA emerged as the "Goldilocks" solution, providing a substantial boost to consistency while maintaining the model's general-purpose utility.
Metrics Matter
The authors found that traditional lexical metrics like ROUGE-L (0.26 correlation with human judgment) are poor indicators of semantic consistency. Instead, metrics based on semantic entailment (0.73 correlation) provide a much more accurate reflection of whether a model is actually being consistent in meaning.
Limitations and Future Work
The primary limitation of the CoG framework is its reliance on answer summarization. This makes it less effective for long-form answers (e.g., ELI5), where nuance cannot be easily condensed into a few words. Additionally, automated semantic metrics still struggle with very verbose outputs, occasionally producing false negatives.
Future research directions include exploring Reinforcement Learning from AI Feedback (RLAIF) or Direct Policy Optimization (DPO) to further refine consistency. The authors also suggest adapting the modular CoG framework to other dimensions of trustworthiness, such as ensuring fairness in screening processes or maintaining stylistic diversity in creative writing.
Summary updated