cs.CLApr 15, 2026

Training-Free Test-Time Contrastive Learning for Large Language Models

Authors: Kaiwen Zheng, Kai Zhou, Jinwu Hu, Te Gu, Mingkai Peng, Fei Liu

Organizations: South China University of Technology · Pazhou Laboratory

Abstract

Large language models (LLMs) demonstrate strong reasoning capabilities, but their performance often degrades under distribution shift. Existing test-time adaptation (TTA) methods rely on gradient-based updates that require white-box access and need substantial overhead, while training-free alternatives are either static or depend on external guidance. In this paper, we propose Training-Free Test-Time Contrastive Learning TF-TTCL, a training-free adaptation framework that enables a frozen LLM to improve online by distilling supervision from its own inference experiences. Specifically, TF-TTCL implements a dynamic "Explore-Reflect-Steer" loop through three core modules: 1) Semantic Query Augmentation first diversifies problem views via multi-agent role-playing to generate different reasoning trajectories; 2) Contrastive Experience Distillation then captures the semantic gap between superior and inferior trajectories, distilling them into explicit textual rules; and 3) Contextual Rule Retrieval finally activates these stored rules during inference to dynamically steer the frozen LLM toward robust reasoning patterns while avoiding observed errors. Extensive experiments on closed-ended reasoning tasks and open-ended evaluation tasks demonstrate that TF-TTCL consistently outperforms strong zero-shot baselines and representative TTA methods under online evaluation. Code is available at https://github.com/KevinSCUTer/TF-TTCL.

Figures & tables

Appendix figures & tables36 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Beyond Confidence: Stability-Aware Test-Time Adaptation for LLM Reasoning

    Sep 10, 2026Bincheng Gu, Min Gao, Zongwei Wang +3Test-Time AdaptationLLM Reliability

  2. TARo: Token-level Adaptive Routing for LLM Test-time Alignment

    Mar 19, 2026Arushi Rai, Qiang Zhang, Hanqing Zeng +5Inference-Time Language Model AlignmentLLM Reasoning

  3. Query-Conditioned Test-Time Self-Training for Large Language Models

    May 13, 2026Chaehee Song, Minseok Seo, Yeeun Seong +2Test-Time AdaptationTest-Time Optimization