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

Kaiwen Zheng, Kai Zhou, Jinwu Hu, Te Gu, Mingkai Peng +1 more
4/15/2026
cs.CLcs.AI

Official code: KevinSCUTer/TF-TTCL (11 stars, MIT, last commit 2026-05-11).

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.

View on arXivView PDF

Code Implementations(1)

MIT

[ACL 2026 Findings] Training-Free Test Time Contrastive Learning for Large Language Models

111Shell, PythonApr 13, 20265 months agoMIT

Similar Papers

Cite this paper

@article{zheng2026trainingfree,
  title  = {Training-Free Test-Time Contrastive Learning for Large Language Models},
  author = {Kaiwen Zheng and Kai Zhou and Jinwu Hu and Te Gu and Mingkai Peng and Fei Liu},
  year   = {2026},
  eprint = {2604.13552},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.13552v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2604.13552.svg)](https://codeofpaper.com/paper/2604.13552)

Discussion