English

ContraCLM: Contrastive Learning For Causal Language Model

Computation and Language 2023-05-04 v2

Abstract

Despite exciting progress in causal language models, the expressiveness of the representations is largely limited due to poor discrimination ability. To remedy this issue, we present ContraCLM, a novel contrastive learning framework at both token-level and sequence-level. We assess ContraCLM on a variety of downstream tasks. We show that ContraCLM enhances discrimination of the representations and bridges the gap with the encoder-only models, which makes causal language models better suited for tasks beyond language generation. Specifically, we attain 44%44\% relative improvement on the Semantic Textual Similarity tasks and 34%34\% on Code-to-Code Search tasks. Furthermore, by improving the expressiveness of the representations, ContraCLM also boosts the source code generation capability with 9%9\% relative improvement on execution accuracy on the HumanEval benchmark.

Keywords

Cite

@article{arxiv.2210.01185,
  title  = {ContraCLM: Contrastive Learning For Causal Language Model},
  author = {Nihal Jain and Dejiao Zhang and Wasi Uddin Ahmad and Zijian Wang and Feng Nan and Xiaopeng Li and Ming Tan and Ramesh Nallapati and Baishakhi Ray and Parminder Bhatia and Xiaofei Ma and Bing Xiang},
  journal= {arXiv preprint arXiv:2210.01185},
  year   = {2023}
}

Comments

10 pages

R2 v1 2026-06-28T02:43:18.228Z