Order Independence With Finetuning

Katrina Brown, Reid McIlroy-Young · DOI

Abstract

Large Language Models (LLMs) often exhibit "order dependence," where the sequence of options in a multiple-choice question (MCQ) dictates the model's prediction regardless of semantic content. This paper introduces a fine-tuning strategy combining Set-Based Prompting (SBP) with a margin-based contrastive loss to mitigate this sensitivity. By training models to treat answer choices as unordered sets and enforcing a clear decision margin between correct and incorrect options, the authors achieve significant improvements in both accuracy and permutation robustness across benchmarks like MMLU and CSQA, while maintaining general language modeling performance.

The Challenge of Order Dependence

Despite their sophisticated reasoning capabilities, LLMs are notoriously sensitive to the arbitrary ordering of choices in multiple-choice tasks. Simply swapping the positions of "Option A" and "Option B" can cause a model to flip its prediction from correct to incorrect. This phenomenon, known as order dependence, reveals a lack of true semantic understanding and robustness in current models.

Figure 3: Comparison of standard prompting (a, b) showing order dependence versus Set-Based Prompting (c) which maintains correctness.

A previous architectural solution, Set-Based Prompting (SBP), attempted to address this by modifying attention masks and positional embeddings to treat answer choices as an unordered set. However, applying SBP to base models at inference time often results in a performance dip due to a "distribution shift"—the model encounters a data format it never saw during its original pre-training.

Methodology: Bridging the Gap with Fine-Tuning

The authors propose a fine-tuning strategy to integrate SBP into the model's learned manifold. Their approach relies on three pillars:

  1. SBP Integration: Modified attention masks prevent tokens within the answer set from perceiving relative order, while parallel positional embeddings ensure they are treated identically.
  2. Margin-Based Contrastive Loss: Moving beyond standard cross-entropy, the authors employ a loss function designed to force a specific margin ($m$) between the log-probability of the correct answer and the most likely distractor. This creates a sharper, more robust decision boundary.
  3. Parameter-Efficient Fine-Tuning (PEFT): Using LoRA, the researchers fine-tuned Llama-2-7b models, making the optimization process computationally accessible.

Experimental Results

The methodology was evaluated on standard MCQ benchmarks, including MMLU (in-distribution) and CommonsenseQA (CSQA) and ARC Challenge (out-of-distribution).

Accuracy and Robustness

The results demonstrate that fine-tuning is the essential "bridge" for SBP. On the CSQA benchmark, the SBP fine-tuned model using contrastive loss significantly outperformed the base model's best possible performance across multiple orderings. While base models showed high variance across the 24 possible permutations of four choices, the fine-tuned SBP models remained remarkably stable.

Figure 6: Performance on CSQA showing the proposed fine-tuning method (orange circle) significantly outperforming the baseline distribution.

Generalization and Integrity

Crucially, the benefits of fine-tuning on MMLU generalized to out-of-distribution tasks like CSQA and ARC, suggesting the model learned a general strategy for order-invariant reasoning. Furthermore, general language modeling capabilities remained intact; perplexity on WikiText-103 was stable for the base model and actually improved for the Llama-2-7b-chat variant, suggesting that SBP training might mitigate some restrictive behaviors introduced during standard instruction tuning.

Limitations and Future Directions

While highly effective for multiple-choice tasks, the method showed limitations in generative tasks like summarization. When excerpts were provided in a set-based format, the quality of summaries declined, likely because the MCQ-focused fine-tuning objective was misaligned with generative requirements. Future work may involve training on a more diverse corpus of set-formatted data to improve multi-task robustness and exploring the impact of varying the contrastive margin across different model scales.

Summary updated

BibTeX
@inproceedings{brown2025order,
  author = {Katrina Brown and Reid McIlroy-Young},
  title = {{Order Independence With Finetuning}},
  booktitle = {Bi-Align @ ICLR},
  year = {2025},
  url = {https://openreview.net/forum?id=08E6XX0Yen},
}
Figure